Ver código fonte

fix: 对接人导入问题修复

chenjianhua 1 mês atrás
pai
commit
06a9f6f4e3

+ 9 - 1
service-manage/src/main/java/com/simuwang/manage/service/impl/CompanyContactServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.read.listener.PageReadListener;
 import com.alibaba.excel.support.ExcelTypeEnum;
+import com.alibaba.excel.util.StringUtils;
 import com.simuwang.base.common.conts.ExcelConst;
 import com.simuwang.base.common.enums.ContactStatusType;
 import com.simuwang.base.common.enums.SignMethodType;
@@ -210,6 +211,13 @@ public class CompanyContactServiceImpl implements CompanyContactService {
                     excelFailDataVOList.add(failDataVO);
                     continue;
                 }
+
+                if(ContactStatusType.getContactStatusTypeByInfo(excelData.getContactStatus()) == null ||
+                        (StringUtil.isNotEmpty(excelData.getSignMethod()) && SignMethodType.getSignMethodTypeByInfo(excelData.getSignMethod()) == null)){
+                    CompanyContactExcelFailDataVO failDataVO = toExcelFailDataVO(excelData, ExcelConst.ERROR_METHOD,dataIdx+startRow);
+                    excelFailDataVOList.add(failDataVO);
+                    continue;
+                }
                 //开始处理成功数据
                 ContactInformationDO contactInformationDO = new ContactInformationDO();
                 contactInformationDO.setContactName(excelData.getContactName());
@@ -231,7 +239,7 @@ public class CompanyContactServiceImpl implements CompanyContactService {
                 companyContactInfDO.setContactRemark(excelData.getContactRemark());
                 companyContactInfDO.setCompanyId(excelData.getCompanyId());
                 companyContactInfDO.setContactStatus(ContactStatusType.getContactStatusTypeByInfo(excelData.getContactStatus()).getCode());
-                companyContactInfDO.setSignMethod(SignMethodType.getSignMethodTypeByInfo(excelData.getSignMethod()).getCode());
+                companyContactInfDO.setSignMethod(StringUtils.isEmpty(excelData.getSignMethod())?null:SignMethodType.getSignMethodTypeByInfo(excelData.getSignMethod()).getCode());
                 companyContactInfDO.setCreatorId(UserUtils.getLoginUser().getUserId());
                 companyContactInfDO.setUpdaterId(UserUtils.getLoginUser().getUserId());
                 companyContactInfDO.setUpdateTime(new Date());