fix 标协会员导入bug
This commit is contained in:
@@ -139,4 +139,18 @@ public class ValidUtil {
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查错误信息中是否有指定错误信息
|
||||
*/
|
||||
public static boolean checkErrorList(List<String> errorList, String key){
|
||||
boolean result = true;
|
||||
for (String error : errorList) {
|
||||
if (error.contains(key)){
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+10
-10
@@ -191,7 +191,8 @@ public class ITbMemberProjectSubitemService extends ServiceImpl<TbMemberProjectS
|
||||
errorRowNum += 1;
|
||||
TbMemberProjectSubitemExcelImport subitemExcel = (TbMemberProjectSubitemExcelImport) obj;
|
||||
TbMemberProjectSubitem subitem = new TbMemberProjectSubitem();
|
||||
errorMessage.addAll(ValidUtil.validateReturnListWithNum(subitemExcel,errorRowNum));
|
||||
List<String> errorList = ValidUtil.validateReturnListWithNum(subitemExcel, errorRowNum);
|
||||
errorMessage.addAll(errorList);
|
||||
|
||||
String companyName = subitemExcel.getCompanyId();
|
||||
PayCompanyManagement companyManagement = companyManagementService.getCompanyByName(companyName);
|
||||
@@ -241,17 +242,16 @@ public class ITbMemberProjectSubitemService extends ServiceImpl<TbMemberProjectS
|
||||
}
|
||||
|
||||
//待确收金额
|
||||
String amountReceivable = subitemExcel.getAmountReceivable();
|
||||
subitem.setAmountReceivable(new BigDecimal(amountReceivable));
|
||||
|
||||
//预估到账日期
|
||||
String estimatedArrivalDate = subitemExcel.getEstimatedArrivalDate();
|
||||
try {
|
||||
subitem.setEstimatedArrivalDate(DateUtil.parseDate(estimatedArrivalDate));
|
||||
}catch (Exception e){
|
||||
log.error("error",e);
|
||||
if (ValidUtil.checkErrorList(errorList,"待确收金额")) {
|
||||
String amountReceivable = subitemExcel.getAmountReceivable();
|
||||
subitem.setAmountReceivable(new BigDecimal(amountReceivable));
|
||||
}
|
||||
|
||||
//预估到账日期
|
||||
if (ValidUtil.checkErrorList(errorList,"预估到账日期")) {
|
||||
String estimatedArrivalDate = subitemExcel.getEstimatedArrivalDate();
|
||||
subitem.setEstimatedArrivalDate(DateUtil.parseDate(estimatedArrivalDate));
|
||||
}
|
||||
|
||||
String paymentMethod = subitemExcel.getPaymentMethod();
|
||||
if (!paymentTypeMap.containsKey(paymentMethod)){
|
||||
|
||||
Reference in New Issue
Block a user