1. 调整bug
This commit is contained in:
parent
99192f2b5c
commit
6a7663dce6
|
|
@ -24,4 +24,9 @@ public @interface DictFormat {
|
|||
* 是否重写覆盖本身key
|
||||
*/
|
||||
boolean rewrite() default false;
|
||||
|
||||
/**
|
||||
* 根据 label 获取value 值, 默认根据value 获取label 值
|
||||
*/
|
||||
boolean labelGetValue() default false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public class DictJsonSerializer extends JsonSerializer<Object> implements Contex
|
|||
|
||||
private String dictType;
|
||||
private boolean rewrite;
|
||||
private boolean labelGetValue;
|
||||
|
||||
@Override
|
||||
public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property) throws JsonMappingException {
|
||||
|
|
@ -29,6 +30,7 @@ public class DictJsonSerializer extends JsonSerializer<Object> implements Contex
|
|||
if (Objects.nonNull(anno) && StrUtil.isNotBlank(anno.dictType())) {
|
||||
this.dictType = anno.dictType();
|
||||
this.rewrite = anno.rewrite();
|
||||
this.labelGetValue = anno.labelGetValue();
|
||||
return this;
|
||||
}
|
||||
return prov.findValueSerializer(property.getType(), property);
|
||||
|
|
@ -37,15 +39,16 @@ public class DictJsonSerializer extends JsonSerializer<Object> implements Contex
|
|||
public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
|
||||
try {
|
||||
if (null != value){
|
||||
String dictLabel = DictUtils.getDictLabel(dictType, Convert.toStr(value));
|
||||
String dict = labelGetValue ? DictUtils.getDictValue(dictType, Convert.toStr(value)) :
|
||||
DictUtils.getDictLabel(dictType, Convert.toStr(value));
|
||||
if (rewrite) {
|
||||
// 重写了 原先的 code
|
||||
gen.writeString(dictLabel);
|
||||
gen.writeString(dict);
|
||||
}else {
|
||||
// value == code
|
||||
gen.writeObject(value);
|
||||
gen.writeFieldName(gen.getOutputContext().getCurrentName() + "Name");
|
||||
gen.writeString(dictLabel);
|
||||
gen.writeString(dict);
|
||||
}
|
||||
}else {
|
||||
gen.writeObject(value);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
//package com.chushang.common.excel.convert;
|
||||
//
|
||||
//import com.alibaba.excel.converters.Converter;
|
||||
//import com.alibaba.excel.converters.WriteConverterContext;
|
||||
//import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//
|
||||
//@Slf4j
|
||||
//public class DictConvert implements Converter<String> {
|
||||
// /**
|
||||
// * <h2>转换单元格数据</h2>
|
||||
// *
|
||||
// * @param value Java 数据
|
||||
// * @param contentProperty 内容属性
|
||||
// * @param globalConfiguration 全局配置
|
||||
// * @return excel中的数据
|
||||
// * @author 单傲
|
||||
// * @date 2023/4/19 18:11
|
||||
// */
|
||||
// public WriteCellData<?> convertToExcelData(WriteConverterContext<String> context) throws Exception {
|
||||
// return convertToExcelData(context.getValue(), context.getContentProperty(),
|
||||
// context.getWriteContext().currentWriteHolder().globalConfiguration());
|
||||
// }
|
||||
//}
|
||||
|
|
@ -27,6 +27,9 @@ public class DataListener<T> extends AnalysisEventListener<T> {
|
|||
dataList.add(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 可以对每一行数据进行校验
|
||||
*/
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
|
||||
|
|
|
|||
|
|
@ -72,12 +72,7 @@ public class StoreImportDTO implements Serializable {
|
|||
@ExcelProperty(value = "门店名称")
|
||||
@Size(max = 128, message = "门店名称不能大于128个字符")
|
||||
private String shopName;
|
||||
/**
|
||||
* 现有其他收单产品
|
||||
*/
|
||||
@ExcelProperty(value = "现有其他收单产品")
|
||||
@Size(max = 50, message = "现有其他收单产品不能大于50个字符")
|
||||
private String products;
|
||||
|
||||
/**
|
||||
* 商户提示工具
|
||||
*/
|
||||
|
|
@ -87,15 +82,16 @@ public class StoreImportDTO implements Serializable {
|
|||
/**
|
||||
* 商户类型
|
||||
*/
|
||||
@DictFormat(dictType = "store_type", rewrite = true)
|
||||
@DictFormat(dictType = "store_type", labelGetValue = true, rewrite = true)
|
||||
@ExcelProperty(value = "商户类型")
|
||||
private String storeType;
|
||||
/**
|
||||
* 巡检频次
|
||||
*/
|
||||
@DictFormat(dictType = "ins_fre", rewrite = true)
|
||||
@Range(min = 1, max = 5, message = "巡检频次非法")
|
||||
|
||||
// @Range(min = 1, max = 5, message = "巡检频次非法")
|
||||
@ExcelProperty(value = "巡检频次")
|
||||
@DictFormat(dictType = "ins_fre", labelGetValue = true, rewrite = true)
|
||||
private String insFre;
|
||||
/**
|
||||
* 终端sn号
|
||||
|
|
@ -124,14 +120,14 @@ public class StoreImportDTO implements Serializable {
|
|||
/**
|
||||
* 终端来源
|
||||
*/
|
||||
@DictFormat(dictType = "terminal_source", rewrite = true)
|
||||
@DictFormat(dictType = "terminal_source", labelGetValue = true, rewrite = true)
|
||||
@Range(min = 1, max = 3, message = "终端来源非法")
|
||||
@ExcelProperty(value = "终端来源")
|
||||
private String terminalSource;
|
||||
/**
|
||||
* 终端类型
|
||||
*/
|
||||
@DictFormat(dictType = "terminal_type", rewrite = true)
|
||||
@DictFormat(dictType = "terminal_type", labelGetValue = true, rewrite = true)
|
||||
@Range(min = 1, max = 9, message = "终端类型非法")
|
||||
@ExcelProperty(value = "终端类型")
|
||||
private String terminalType;
|
||||
|
|
@ -148,10 +144,18 @@ public class StoreImportDTO implements Serializable {
|
|||
@Past(message = "必须是过去的日期")
|
||||
@DateTimeFormat(DatePattern.CHINESE_DATE_PATTERN)
|
||||
private LocalDate registerTime;
|
||||
|
||||
/**
|
||||
* 现有其他收单产品
|
||||
*/
|
||||
@ExcelProperty(value = "现有其他收单产品")
|
||||
@Size(max = 50, message = "现有其他收单产品不能大于50个字符")
|
||||
private String products;
|
||||
|
||||
/**
|
||||
* 操作员账号
|
||||
*/
|
||||
@ExcelProperty(value = "pos编号")
|
||||
@ExcelProperty(value = "操作员编号")
|
||||
@Size(max = 50, message = "操作员编号不能大于50个字符")
|
||||
private String adminIds;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.chushang.inspection.work.dto;
|
|||
import cn.hutool.core.date.DatePattern;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||
import com.chushang.common.dict.annotation.DictFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -27,6 +28,7 @@ public class WrkInfoPhoneImportDTO {
|
|||
@ExcelProperty("终端编号")
|
||||
private String terminalNo;
|
||||
@ExcelProperty("终端类型")
|
||||
@DictFormat(dictType = "terminal_type", rewrite = true, labelGetValue = true)
|
||||
private String terminalType;
|
||||
@ExcelProperty("建档日期")
|
||||
@DateTimeFormat(DatePattern.CHINESE_DATE_PATTERN)
|
||||
|
|
@ -35,6 +37,7 @@ public class WrkInfoPhoneImportDTO {
|
|||
@DateTimeFormat(DatePattern.CHINESE_DATE_PATTERN)
|
||||
private LocalDateTime disposeTime;
|
||||
@ExcelProperty("商户类型")
|
||||
@DictFormat(dictType = "store_type", rewrite = true, labelGetValue = true)
|
||||
private String storeType;
|
||||
@ExcelProperty("巡检结果")
|
||||
private String wrkResult;
|
||||
|
|
|
|||
|
|
@ -78,4 +78,9 @@ public class WrkInfoQuery extends CommonParam {
|
|||
*/
|
||||
@Condition(name = "lower_task_id", type = Condition.ConditionType.in, tableName = "i")
|
||||
private List<Long> lowerTaskIds;
|
||||
|
||||
/**
|
||||
* 根据id 下载
|
||||
*/
|
||||
private List<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package com.chushang.inspection.work.vo;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.chushang.common.dict.annotation.DictFormat;
|
||||
import com.chushang.inspection.terminal.vo.FiveStoreVO;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
|
|
@ -26,6 +30,7 @@ public class WrkInfoExportVO implements java.io.Serializable{
|
|||
private String workNo;
|
||||
|
||||
@ExcelProperty(value = "创建时间", index = 2)
|
||||
@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty(value = "legalName", index = 3)
|
||||
|
|
@ -41,6 +46,7 @@ public class WrkInfoExportVO implements java.io.Serializable{
|
|||
private String terminalNo;
|
||||
|
||||
@ExcelProperty(value = "终端来源", index = 7)
|
||||
@DictFormat(dictType = "terminal_source")
|
||||
private String terminalSource;
|
||||
|
||||
@ExcelProperty(value = "终端地址", index = 8)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.chushang.inspection.project.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.chushang.inspection.project.dto.TaskDTO;
|
||||
|
|
@ -38,4 +39,9 @@ public interface PollingTaskService extends IService<PollingTask>{
|
|||
|
||||
PollingTask getTopTask(Long taskId);
|
||||
|
||||
default String getTaskNameById(Long taskId){
|
||||
PollingTask task = getById(taskId);
|
||||
return ObjectUtil.isNotEmpty(task) ? task.getName() : "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chushang.common.core.constant.SecurityConstants;
|
||||
import com.chushang.common.core.util.DateUtils;
|
||||
import com.chushang.common.core.util.SpringUtils;
|
||||
import com.chushang.common.core.util.StringUtils;
|
||||
import com.chushang.common.core.util.TreeUtils;
|
||||
|
|
@ -92,26 +93,18 @@ public class PollingTaskServiceImpl extends ServiceImpl<PollingTaskMapper, Polli
|
|||
@DataScope
|
||||
public List<TaskVO> findTopList(CommonParam commonParam) {
|
||||
LambdaQueryWrapper<PollingTask> searchNumSql = WrapperUtils.builder(commonParam, commonParam);
|
||||
searchNumSql.select(PollingTask::getSearchNum)
|
||||
searchNumSql
|
||||
.eq(PollingTask::getParentId, 0)
|
||||
.eq(PollingTask::getEnabled, 1)
|
||||
.and(w -> w.isNull(PollingTask::getEndTime)
|
||||
.or().ge(PollingTask::getEndTime, LocalDateTime.now()));
|
||||
.or().ge(PollingTask::getEndTime, DateUtils.format(LocalDateTime.now())));
|
||||
|
||||
List<PollingTask> list = list(searchNumSql);
|
||||
List<String> searchNums;
|
||||
if (CollectionUtil.isNotEmpty(list)){
|
||||
searchNums = list.stream().map(PollingTask::getSearchNum).toList();
|
||||
return list.stream().map(this::convert).collect(Collectors.toList());
|
||||
}else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Set<String> searchNumSet = searchNums.stream().map(s -> s.split("-")[0] + '-').collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<PollingTask> topSql = WrapperUtils.builder(commonParam, commonParam);
|
||||
topSql.in(CollectionUtil.isNotEmpty(searchNumSet), PollingTask::getSearchNum, searchNumSet);
|
||||
List<PollingTask> topList = list(topSql);
|
||||
if (CollectionUtil.isNotEmpty(topList)){
|
||||
return topList.stream().map(this::convert).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public interface TerminalService extends IService<Terminal>{
|
|||
JSONObject save(Store store, WrkIcbcJsReceive dto);
|
||||
|
||||
|
||||
int updateTerminalAndStore(TerminalQuery query);
|
||||
long updateTerminalAndStore(TerminalQuery query);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.chushang.common.core.constant.SecurityConstants;
|
|||
import com.chushang.common.core.util.StringUtils;
|
||||
import com.chushang.common.core.web.Result;
|
||||
import com.chushang.common.dict.feign.RemoteDictDataService;
|
||||
import com.chushang.common.dict.utils.DictUtils;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||
|
|
@ -52,10 +53,7 @@ import java.time.LocalDate;
|
|||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
|
|
@ -95,49 +93,36 @@ public class StoreImportServiceImpl extends ServiceImpl<StoreImportMapper, Store
|
|||
}
|
||||
|
||||
|
||||
Store genStoreEntity(StoreImportDTO storeImportDTO,Map<String, String> data){
|
||||
public Store genStoreEntity(StoreImportDTO storeImportDTO) {
|
||||
// 通过任务名称查询任务
|
||||
List<PollingTask> list = pollingTaskService.list(new LambdaQueryWrapper<PollingTask>().eq(PollingTask::getName, storeImportDTO.getTaskName()));
|
||||
if (CollectionUtil.isEmpty(list)){
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
throw new RuntimeException("任务名称不存在");
|
||||
}
|
||||
PollingTask topTask = pollingTaskService.getTopTask(list.get(0).getId());
|
||||
Store store = new Store();
|
||||
store.setAccountManager(storeImportDTO.getAccountManager());
|
||||
store.setDelState(true);
|
||||
store.setAccountPhone(storeImportDTO.getAccountPhone());
|
||||
store.setLegalName(storeImportDTO.getLegalName());
|
||||
store.setSpecialNum(storeImportDTO.getSpecialNum());
|
||||
store.setShopName(storeImportDTO.getShopName());
|
||||
store.setProducts(storeImportDTO.getProducts());
|
||||
store.setTipTool(storeImportDTO.getTipTool());
|
||||
LocalDateTime registerTime = LocalDateTime.now();
|
||||
|
||||
Integer insFre = 0;
|
||||
try{
|
||||
insFre = Integer.valueOf(storeImportDTO.getInsFre());
|
||||
}catch (Exception e){
|
||||
insFre = -1;
|
||||
}
|
||||
|
||||
try{
|
||||
LocalDate registerDate = storeImportDTO.getRegisterTime();
|
||||
registerTime = LocalDateTime.of(registerDate, LocalTime.MIDNIGHT);
|
||||
}catch (Exception e){
|
||||
registerTime = LocalDateTime.now();
|
||||
}
|
||||
store.setInsFre(insFre);
|
||||
LocalDate registerDate = storeImportDTO.getRegisterTime();
|
||||
LocalDateTime registerTime = LocalDateTime.of(registerDate, LocalTime.MIDNIGHT);
|
||||
store.setInsFre(null != storeImportDTO.getInsFre() ? Integer.valueOf(storeImportDTO.getInsFre()) : null);
|
||||
store.setStoreNo(storeImportDTO.getStoreNo());
|
||||
store.setStoreName(storeImportDTO.getStoreName());
|
||||
store.setStoreAddress(storeImportDTO.getStoreAddress());
|
||||
store.setStoreContact(storeImportDTO.getStoreContact());
|
||||
store.setStorePhone(storeImportDTO.getStorePhone());
|
||||
store.setStoreType(1);
|
||||
store.setStoreType(null != storeImportDTO.getStoreType() ? Integer.valueOf(storeImportDTO.getStoreType()) : null);
|
||||
store.setRegisterTime(registerTime); // registertime
|
||||
store.setTaskId(topTask.getId());
|
||||
store.setDeptId(SecurityUtils.getDeptId());
|
||||
store.setLowerTaskId(list.get(0).getId());
|
||||
store.setStoreId(IdUtil.getSnowflake().nextId());
|
||||
store.setDelState(false);
|
||||
return store;
|
||||
}
|
||||
|
||||
|
|
@ -145,12 +130,6 @@ public class StoreImportServiceImpl extends ServiceImpl<StoreImportMapper, Store
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public int confimImport(List<StoreImportDTO> lists) {
|
||||
int i = 0;
|
||||
Result<Map<String, String>> storeType = remoteDictDataService.getInfo("store_type", SecurityConstants.INNER);
|
||||
Map<String, String> data = new HashMap<>();
|
||||
//todo 将返回的map一一对应
|
||||
if(storeType.isSuccess()){
|
||||
data = storeType.getData();
|
||||
}
|
||||
// 商户类型枚举
|
||||
for (StoreImportDTO storeImportDTO : lists) {
|
||||
i++;
|
||||
|
|
@ -158,15 +137,17 @@ public class StoreImportServiceImpl extends ServiceImpl<StoreImportMapper, Store
|
|||
throw new RuntimeException("任务名称不能为空");
|
||||
}
|
||||
|
||||
Store store = genStoreEntity(storeImportDTO,data);
|
||||
Store store = genStoreEntity(storeImportDTO);
|
||||
storeMapper.insert(store);
|
||||
Terminal terminal = new Terminal();
|
||||
terminal.setTerminalNo(storeImportDTO.getTerminalNo());
|
||||
terminal.setTerminalSn(storeImportDTO.getTerminalSn());
|
||||
terminal.setTerminalModel(storeImportDTO.getTerminalModel());
|
||||
terminal.setTerminalType(1);//storeImportDTO.getTerminalType()
|
||||
|
||||
terminal.setTerminalType(null != storeImportDTO.getTerminalType() ? Integer.valueOf(storeImportDTO.getTerminalType()) : null);//storeImportDTO.getTerminalType()
|
||||
|
||||
terminal.setTerminalVersion(storeImportDTO.getTerminalVersion());
|
||||
terminal.setTerminalSource(1);//storeImportDTO.getTerminalSource()
|
||||
terminal.setTerminalSource(null != storeImportDTO.getTerminalSource() ? Integer.valueOf(storeImportDTO.getTerminalSource()) : null);//storeImportDTO.getTerminalSource()
|
||||
terminal.setTerminalAddress(storeImportDTO.getTerminalAddress());
|
||||
terminal.setOccupy(0);
|
||||
terminal.setTerminalStatus(1);
|
||||
|
|
@ -184,5 +165,4 @@ public class StoreImportServiceImpl extends ServiceImpl<StoreImportMapper, Store
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chushang.common.core.constant.SecurityConstants;
|
||||
import com.chushang.common.core.exception.utils.AssertUtil;
|
||||
import com.chushang.common.dict.utils.DictUtils;
|
||||
import com.chushang.common.mybatis.enums.Operator;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
|
|
@ -150,12 +151,18 @@ public class TerminalServiceImpl extends ServiceImpl<TerminalMapper, Terminal> i
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateTerminalAndStore(TerminalQuery query) {
|
||||
public long updateTerminalAndStore(TerminalQuery query) {
|
||||
/**
|
||||
* 当前终端
|
||||
*/
|
||||
Terminal curTerminal = getById(query.getTerminalId());
|
||||
AssertUtil.invalidate(ObjectUtil.isEmpty(curTerminal), "未找寻到对应的终端信息");
|
||||
Terminal terminal = BeanCopyUtils.copy(query, Terminal.class);
|
||||
updateById(terminal);
|
||||
Store store = BeanCopyUtils.copy(query, Store.class);
|
||||
store.setStoreId(curTerminal.getStoreId());
|
||||
storeService.updateById(store);
|
||||
return 1;
|
||||
return query.getTerminalId();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,5 @@ public interface WrkInfoMapper extends BaseMapper<WrkInfo> {
|
|||
WrkInfoDetailsVO getWrkInfoDetails(@Param("wrkId") Long wrkId);
|
||||
|
||||
@DataScope(deptAlias = "i")
|
||||
List<WrkInfoExportVO> exportDispatchPage(@Param("query") WrkInfoQuery query,
|
||||
Page<WrkInfoExportVO> page);
|
||||
List<WrkInfoExportVO> exportDispatchPage(@Param("query") WrkInfoQuery query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,13 +148,20 @@ public class WrkIcbcJsServiceImpl extends ServiceImpl<WrkIcbcJsMapper, WrkIcbcJs
|
|||
dispatchOrder(entity, terJson, store, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 需要创建对应的任务以及 业务员信息
|
||||
* @param entity
|
||||
* @param terJson
|
||||
* @param store
|
||||
* @param userId
|
||||
*/
|
||||
public void dispatchOrder(WrkIcbcJs entity, JSONObject terJson, Store store, Long userId)
|
||||
{
|
||||
Terminal terminal = terJson.getObject("terminal", Terminal.class);
|
||||
TerminalIns terminalIns = terJson.getObject("terminalIns", TerminalIns.class);
|
||||
WrkIcbcJs icbcJs = entity.getArea() != null ? entity : getById(entity.getId());
|
||||
|
||||
AssertUtil.invalidate(icbcJs.getStatus() == 1, "只有下发状态才能派单");
|
||||
AssertUtil.invalidate(icbcJs.getStatus() != 1, "只有下发状态才能派单");
|
||||
DispatchDTO dispatch = new DispatchDTO().dispatch(icbcJs);
|
||||
WrkInfo wrkInfo;
|
||||
if (null == userId){
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ import com.chushang.common.mybatis.utils.WrapperUtils;
|
|||
import com.chushang.inspection.ins.GeneratedInsFactory;
|
||||
import com.chushang.inspection.project.dto.AuditDTO;
|
||||
import com.chushang.inspection.project.po.InspectionData;
|
||||
import com.chushang.inspection.project.po.PollingTask;
|
||||
import com.chushang.inspection.project.service.InspectionDataService;
|
||||
import com.chushang.inspection.project.service.PollingTaskService;
|
||||
import com.chushang.inspection.terminal.po.FiveStore;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.po.Terminal;
|
||||
|
|
@ -108,16 +110,16 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
RemoteUserService userFeignService;
|
||||
@Resource
|
||||
GeneratedInsFactory generatedInsFactory;
|
||||
@Resource
|
||||
PollingTaskService pollingTaskService;
|
||||
|
||||
@Value("${push.icbc-js.enable:false}")
|
||||
private boolean enable;
|
||||
|
||||
@Override
|
||||
public void exportDispatchPage(HttpServletResponse response, WrkInfoQuery query) {
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
WrapperUtils.buildSql(query);
|
||||
Page<WrkInfoExportVO> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||
List<WrkInfoExportVO> records = baseMapper.exportDispatchPage(query, page);
|
||||
List<WrkInfoExportVO> records = baseMapper.exportDispatchPage(query);
|
||||
ExcelUtils.exportList(response, WrkInfoExportVO.class, records, "导出派单");
|
||||
}
|
||||
|
||||
|
|
@ -686,6 +688,9 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
wrkInfo.setWorkSource(query.getWorkSource());
|
||||
wrkInfo.setTaskId(dispatch.getTaskId());
|
||||
wrkInfo.setLowerTaskId(dispatch.getLowerTaskId());
|
||||
wrkInfo.setTaskName(pollingTaskService.getTaskNameById(dispatch.getTaskId()));
|
||||
wrkInfo.setLowerTaskName(pollingTaskService.getTaskNameById(dispatch.getLowerTaskId()));
|
||||
//
|
||||
wrkInfo.setVersion(0L);
|
||||
// 处理时间
|
||||
//wrkInfo.setDisposeTime(query.getEndTime());
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
pt.id AS task_id,
|
||||
pt.`name` AS taskName,
|
||||
s.lower_task_id AS lowerTaskId,
|
||||
lpt.`name` AS lowerTaskName,
|
||||
s.dept_id AS deptId,
|
||||
s.store_id AS storeId,
|
||||
s.store_no AS storeNo,
|
||||
|
|
@ -114,6 +115,7 @@
|
|||
INNER JOIN st_store s ON t.store_id = s.store_id
|
||||
INNER JOIN ta_polling_task pt ON t.task_id = pt.id
|
||||
INNER JOIN wrk_project p ON pt.project_id = p.project_id
|
||||
LEFT JOIN ta_polling_task lpt ON t.lower_task_id = lpt.id
|
||||
where t.del_state = 0
|
||||
</sql>
|
||||
<select id="selectPageApp" resultType="com.chushang.inspection.project.vo.TerminalAppVO">
|
||||
|
|
|
|||
|
|
@ -16,6 +16,17 @@
|
|||
</if>
|
||||
ORDER BY i.create_time desc
|
||||
</select>
|
||||
<resultMap id="resultWrkInfoExportVO" type="com.chushang.inspection.work.vo.WrkInfoExportVO">
|
||||
<id column="terminal_id" property="terminalId" />
|
||||
<result column="user_name" property="userName" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="legal_name" property="legalName" />
|
||||
<result column="terminal_address" property="terminalAddress" />
|
||||
<result column="terminal_no" property="terminalNo" />
|
||||
<result column="terminal_sn" property="terminalSn" />
|
||||
<result column="terminal_source" property="terminalSource" />
|
||||
<result column="work_no" property="workNo" />
|
||||
</resultMap>
|
||||
|
||||
<select id="queryArchivePage" resultMap="wrkInfoDetailsVOResult">
|
||||
<include refid="wrkInfoDetailSql" />
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
i.task_id AS task_id,
|
||||
i.`task_name` AS taskName,
|
||||
i.lower_task_id AS lowerTaskId,
|
||||
lpt.`name` AS lowerTaskName,
|
||||
i.dept_id AS deptId,
|
||||
i.work_no AS workNo,
|
||||
i.wrk_id AS wrkId,
|
||||
|
|
@ -59,6 +60,7 @@
|
|||
INNER JOIN wrk_info_store_record s ON i.wrk_id = s.wrk_id
|
||||
INNER JOIN wrk_info_terminal_record t ON i.wrk_id = t.wrk_id
|
||||
LEFT JOIN wrk_info_terminal_ins_record ti ON i.wrk_id = ti.wrk_id
|
||||
LEFT JOIN ta_polling_task lpt ON i.task_id = lpt.id
|
||||
WHERE i.del_state = 0
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('sqlWhere')}
|
||||
|
|
|
|||
Loading…
Reference in New Issue