|
|
|
@ -1,36 +1,36 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.excel;
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.excel;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.mes.api.iservice.busi.IExcelImportService;
|
|
|
|
|
import cn.estsh.i3plus.mes.apiservice.serviceimpl.busi.CommonService;
|
|
|
|
|
import cn.estsh.i3plus.mes.apiservice.util.DateUtil;
|
|
|
|
|
import cn.estsh.i3plus.mes.apiservice.util.MesCommonUtil;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.ExcelTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.util.BaseRedis;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPtr;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.ExcelImportErrorModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.ExcelImportResultModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesPartPtrRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesPartRepository;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.poi.ss.usermodel.CellType;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
|
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import javax.persistence.EntityManager;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description :
|
|
|
|
|
* @Reference :
|
|
|
|
|
* @Author :
|
|
|
|
|
* @CreateDate : 2024-05-14 11:09
|
|
|
|
|
* @Modify:
|
|
|
|
|
**/
|
|
|
|
|
* @Description:
|
|
|
|
|
* @CreateDate 2022/6/27 17:28
|
|
|
|
|
* @Author 尹肖
|
|
|
|
|
*/
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class MesPartPtrExcelService implements IExcelImportService {
|
|
|
|
@ -286,32 +286,32 @@ public class MesPartPtrExcelService implements IExcelImportService {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//校验产线编号
|
|
|
|
|
if (StringUtils.isEmpty(workCenterCode)) {
|
|
|
|
|
if (org.springframework.util.StringUtils.isEmpty(workCenterCode)) {
|
|
|
|
|
errorNum++;
|
|
|
|
|
cellNum += "A;";
|
|
|
|
|
errorInfo += "第A列数据必填;";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//校验原零件号
|
|
|
|
|
if (StringUtils.isEmpty(sourcePartNo)) {
|
|
|
|
|
if (org.springframework.util.StringUtils.isEmpty(sourcePartNo)) {
|
|
|
|
|
errorNum++;
|
|
|
|
|
cellNum += "F;";
|
|
|
|
|
errorInfo += "第F列数据必填;";
|
|
|
|
|
}
|
|
|
|
|
//校验产线编号
|
|
|
|
|
if (StringUtils.isEmpty(targetPartNo)) {
|
|
|
|
|
if (org.springframework.util.StringUtils.isEmpty(targetPartNo)) {
|
|
|
|
|
errorNum++;
|
|
|
|
|
cellNum += "G;";
|
|
|
|
|
errorInfo += "第G列数据必填;";
|
|
|
|
|
}
|
|
|
|
|
//校验替换零件号
|
|
|
|
|
if (StringUtils.isEmpty(ptrProjectNo)) {
|
|
|
|
|
if (org.springframework.util.StringUtils.isEmpty(ptrProjectNo)) {
|
|
|
|
|
errorNum++;
|
|
|
|
|
cellNum += "J;";
|
|
|
|
|
errorInfo += "第J列数据必填;";
|
|
|
|
|
}
|
|
|
|
|
//校验总成类型
|
|
|
|
|
if (StringUtils.isEmpty(partTypeCode)) {
|
|
|
|
|
if (org.springframework.util.StringUtils.isEmpty(partTypeCode)) {
|
|
|
|
|
errorNum++;
|
|
|
|
|
cellNum += "L;";
|
|
|
|
|
errorInfo += "第L列数据必填;";
|
|
|
|
|