|
@@ -17,7 +17,6 @@ import com.qmth.sop.business.util.excel.BasicExcelListener;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.enums.*;
|
|
import com.qmth.sop.common.enums.*;
|
|
import com.qmth.sop.common.util.DateDisposeUtils;
|
|
import com.qmth.sop.common.util.DateDisposeUtils;
|
|
-import com.qmth.sop.common.util.ServletUtil;
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -108,7 +107,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
EasyExcel.read(inputStream, UserArchivesImportDto.class, new BasicExcelListener<UserArchivesImportDto>() {
|
|
EasyExcel.read(inputStream, UserArchivesImportDto.class, new BasicExcelListener<UserArchivesImportDto>() {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void handle(LinkedMultiValueMap<String, UserArchivesImportDto> dataList, StringJoiner errorDataSj) {
|
|
|
|
|
|
+ public void handle(LinkedMultiValueMap<String, UserArchivesImportDto> dataList, StringJoiner errorDataSj, Exception exception) {
|
|
userArchivesImportDtoLinkedMultiValueMap.addAll(dataList);
|
|
userArchivesImportDtoLinkedMultiValueMap.addAll(dataList);
|
|
errorData.add(errorDataSj.toString());
|
|
errorData.add(errorDataSj.toString());
|
|
}
|
|
}
|
|
@@ -232,7 +231,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
EasyExcel.read(inputStream, CustomImportDto.class, new BasicExcelListener<CustomImportDto>() {
|
|
EasyExcel.read(inputStream, CustomImportDto.class, new BasicExcelListener<CustomImportDto>() {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void handle(LinkedMultiValueMap<String, CustomImportDto> dataList, StringJoiner errorDataSj) {
|
|
|
|
|
|
+ public void handle(LinkedMultiValueMap<String, CustomImportDto> dataList, StringJoiner errorDataSj, Exception exception) {
|
|
customImportDtoLinkedMultiValueMap.addAll(dataList);
|
|
customImportDtoLinkedMultiValueMap.addAll(dataList);
|
|
errorData.add(errorDataSj.toString());
|
|
errorData.add(errorDataSj.toString());
|
|
}
|
|
}
|
|
@@ -265,7 +264,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
sysCustom.setLevelId(sysLevel.getId());
|
|
sysCustom.setLevelId(sysLevel.getId());
|
|
sysCustom.setSync(false);
|
|
sysCustom.setSync(false);
|
|
sysCustom.setEnable(true);
|
|
sysCustom.setEnable(true);
|
|
- sysCustom.setCreateId(((SysUser)map.get("account")).getId());
|
|
|
|
|
|
+ sysCustom.setCreateId(((SysUser) map.get("account")).getId());
|
|
sysCustom.setCreateTime(System.currentTimeMillis());
|
|
sysCustom.setCreateTime(System.currentTimeMillis());
|
|
sysCustomService.saveOrUpdate(sysCustom);
|
|
sysCustomService.saveOrUpdate(sysCustom);
|
|
|
|
|
|
@@ -311,10 +310,10 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
dto.setStatus(e.getStatus() ? "已阅" : "未阅");
|
|
dto.setStatus(e.getStatus() ? "已阅" : "未阅");
|
|
dto.setSupplier(e.getSupplier());
|
|
dto.setSupplier(e.getSupplier());
|
|
//时间戳转化为日期字符串
|
|
//时间戳转化为日期字符串
|
|
- if(Objects.nonNull(e.getReceiveTime()))
|
|
|
|
- dto.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getReceiveTime()));
|
|
|
|
- if(Objects.nonNull(e.getType()))
|
|
|
|
- dto.setType(e.getType().getTitle());
|
|
|
|
|
|
+ if (Objects.nonNull(e.getReceiveTime()))
|
|
|
|
+ dto.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getReceiveTime()));
|
|
|
|
+ if (Objects.nonNull(e.getType()))
|
|
|
|
+ dto.setType(e.getType().getTitle());
|
|
return dto;
|
|
return dto;
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
@@ -337,7 +336,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
try {
|
|
try {
|
|
fileTemp = SystemConstant.getFileTempVar(SystemConstant.XLSX_PREFIX);
|
|
fileTemp = SystemConstant.getFileTempVar(SystemConstant.XLSX_PREFIX);
|
|
|
|
|
|
- List<TBDingSubmitQueryResult> tbDingCountQueryResults = tbDingService.query((SysUser)map.get("account"),(Long) map.get("serviceId"), (String) map.get("status"), (Long) map.get("createId"), (String) map.get("userName"), (Long) map.get("supplierId"), (String) map.get("String"), (String) map.get("sopNo"), (Long) map.get("days"));
|
|
|
|
|
|
+ List<TBDingSubmitQueryResult> tbDingCountQueryResults = tbDingService.query((SysUser) map.get("account"), (Long) map.get("serviceId"), (String) map.get("status"), (Long) map.get("createId"), (String) map.get("userName"), (Long) map.get("supplierId"), (String) map.get("String"), (String) map.get("sopNo"), (Long) map.get("days"));
|
|
// tbDingCountQueryResults.forEach(e -> {
|
|
// tbDingCountQueryResults.forEach(e -> {
|
|
// e.setStatus(FlowStatusEnum.convertToEnum(e.getStatus()).getTitle());
|
|
// e.setStatus(FlowStatusEnum.convertToEnum(e.getStatus()).getTitle());
|
|
// });
|
|
// });
|
|
@@ -388,7 +387,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
EasyExcel.read(inputStream, DeviceImportDto.class, new BasicExcelListener<DeviceImportDto>() {
|
|
EasyExcel.read(inputStream, DeviceImportDto.class, new BasicExcelListener<DeviceImportDto>() {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void handle(LinkedMultiValueMap<String, DeviceImportDto> dataList, StringJoiner errorDataSj) {
|
|
|
|
|
|
+ public void handle(LinkedMultiValueMap<String, DeviceImportDto> dataList, StringJoiner errorDataSj, Exception exception) {
|
|
customImportDtoLinkedMultiValueMap.addAll(dataList);
|
|
customImportDtoLinkedMultiValueMap.addAll(dataList);
|
|
errorData.add(errorDataSj.toString());
|
|
errorData.add(errorDataSj.toString());
|
|
}
|
|
}
|
|
@@ -406,24 +405,24 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
List<SysDeviceModel> modelList = sysDeviceModelService.list();
|
|
List<SysDeviceModel> modelList = sysDeviceModelService.list();
|
|
Objects.requireNonNull(customImportDtoLinkedMultiValueMap.get(BasicExcelListener.SUCCESS)).forEach(e -> {
|
|
Objects.requireNonNull(customImportDtoLinkedMultiValueMap.get(BasicExcelListener.SUCCESS)).forEach(e -> {
|
|
SysDevice device = new SysDevice();
|
|
SysDevice device = new SysDevice();
|
|
- if(brandList.stream().noneMatch(r->r.getBrand().equals(e.getBrand()))){
|
|
|
|
- SysDeviceBrand brand=new SysDeviceBrand();
|
|
|
|
|
|
+ if (brandList.stream().noneMatch(r -> r.getBrand().equals(e.getBrand()))) {
|
|
|
|
+ SysDeviceBrand brand = new SysDeviceBrand();
|
|
brand.setBrand(e.getBrand());
|
|
brand.setBrand(e.getBrand());
|
|
- brand.insertInfo(((SysUser)map.get("account")).getId());
|
|
|
|
|
|
+ brand.insertInfo(((SysUser) map.get("account")).getId());
|
|
sysDeviceBrandService.saveOrUpdate(brand);
|
|
sysDeviceBrandService.saveOrUpdate(brand);
|
|
brandList.add(brand);
|
|
brandList.add(brand);
|
|
- SysDeviceModel model=new SysDeviceModel();
|
|
|
|
|
|
+ SysDeviceModel model = new SysDeviceModel();
|
|
model.setBrandId(brand.getId());
|
|
model.setBrandId(brand.getId());
|
|
model.setModel(e.getModel());
|
|
model.setModel(e.getModel());
|
|
- model.insertInfo(((SysUser)map.get("account")).getId());
|
|
|
|
|
|
+ model.insertInfo(((SysUser) map.get("account")).getId());
|
|
sysDeviceModelService.saveOrUpdate(model);
|
|
sysDeviceModelService.saveOrUpdate(model);
|
|
modelList.add(model);
|
|
modelList.add(model);
|
|
- }else{
|
|
|
|
- if(modelList.stream().noneMatch(r->r.getModel().equals(e.getModel()))){
|
|
|
|
- SysDeviceModel model=new SysDeviceModel();
|
|
|
|
- model.setBrandId(brandList.stream().filter(r->r.getBrand().equals(e.getBrand())).findFirst().get().getId());
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (modelList.stream().noneMatch(r -> r.getModel().equals(e.getModel()))) {
|
|
|
|
+ SysDeviceModel model = new SysDeviceModel();
|
|
|
|
+ model.setBrandId(brandList.stream().filter(r -> r.getBrand().equals(e.getBrand())).findFirst().get().getId());
|
|
model.setModel(e.getModel());
|
|
model.setModel(e.getModel());
|
|
- model.insertInfo(((SysUser)map.get("account")).getId());
|
|
|
|
|
|
+ model.insertInfo(((SysUser) map.get("account")).getId());
|
|
sysDeviceModelService.saveOrUpdate(model);
|
|
sysDeviceModelService.saveOrUpdate(model);
|
|
modelList.add(model);
|
|
modelList.add(model);
|
|
}
|
|
}
|
|
@@ -433,8 +432,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
device.setModel(e.getModel());
|
|
device.setModel(e.getModel());
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
device.setDeviceCode(e.getDeviceCode());
|
|
device.setDeviceCode(e.getDeviceCode());
|
|
InOutTypeEnum bound = InOutTypeEnum.IN.getTitle().equals(e.getBound()) ? InOutTypeEnum.IN : InOutTypeEnum.OUT;
|
|
InOutTypeEnum bound = InOutTypeEnum.IN.getTitle().equals(e.getBound()) ? InOutTypeEnum.IN : InOutTypeEnum.OUT;
|
|
device.setBound(bound);
|
|
device.setBound(bound);
|
|
@@ -456,7 +453,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
DeviceStatusEnum status = DeviceStatusEnum.NORMAL.getTitle().equals(e.getStatus()) ? DeviceStatusEnum.NORMAL : DeviceStatusEnum.BREAK_DOWN;
|
|
DeviceStatusEnum status = DeviceStatusEnum.NORMAL.getTitle().equals(e.getStatus()) ? DeviceStatusEnum.NORMAL : DeviceStatusEnum.BREAK_DOWN;
|
|
device.setStatus(status);
|
|
device.setStatus(status);
|
|
device.setSync(false);
|
|
device.setSync(false);
|
|
- device.insertInfo(((SysUser)map.get("account")).getId());
|
|
|
|
|
|
+ device.insertInfo(((SysUser) map.get("account")).getId());
|
|
sysDevices.add(device);
|
|
sysDevices.add(device);
|
|
});
|
|
});
|
|
sysDeviceService.saveSysDevice(sysDevices);
|
|
sysDeviceService.saveSysDevice(sysDevices);
|