fix:设备台账导入数据报错处理
This commit is contained in:
parent
52954eb751
commit
ccdc77f67e
@ -1,5 +1,6 @@
|
|||||||
package com.ktg.mes.dv.service.impl;
|
package com.ktg.mes.dv.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.ktg.common.constant.UserConstants;
|
import com.ktg.common.constant.UserConstants;
|
||||||
import com.ktg.common.core.domain.AjaxResult;
|
import com.ktg.common.core.domain.AjaxResult;
|
||||||
import com.ktg.common.utils.DateUtils;
|
import com.ktg.common.utils.DateUtils;
|
||||||
@ -120,6 +121,27 @@ public class DvMachineryServiceImpl implements IDvMachineryService
|
|||||||
int successCount = 0;
|
int successCount = 0;
|
||||||
int failureCount = 0;
|
int failureCount = 0;
|
||||||
for (DvMachinery machinery : machineryList) {
|
for (DvMachinery machinery : machineryList) {
|
||||||
|
// 判断必填项是否为空
|
||||||
|
if (ObjectUtil.isEmpty(machinery.getMachineryCode())) {
|
||||||
|
failureCount++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(machinery.getMachineryName())) {
|
||||||
|
failureCount++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(machinery.getMachineryTypeId())) {
|
||||||
|
failureCount++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(machinery.getWorkshopId())) {
|
||||||
|
failureCount++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(machinery.getStatus())) {
|
||||||
|
failureCount++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// 去除空格
|
// 去除空格
|
||||||
String machineryCode = machinery.getMachineryCode().trim();
|
String machineryCode = machinery.getMachineryCode().trim();
|
||||||
machinery.setCreateTime(new Date());
|
machinery.setCreateTime(new Date());
|
||||||
|
Loading…
Reference in New Issue
Block a user