修改bug#40461

This commit is contained in:
梁琦涛
2021-10-12 15:36:10 +08:00
parent 515fcef3e9
commit 56724b91b4
8 changed files with 55 additions and 9 deletions
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.util.DateUtils;
import com.jero.common.util.ImportExcelUtil;
import com.jero.common.util.ValidUtil;
import com.jero.contract.common.PayIncomeContractCommon;
import com.jero.contract.entity.PaySpendingContract;
@@ -78,7 +79,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
throw new JeroBootException("支出合同信息不能为空!");
}
if(!Objects.isNull(paySpendingContract.getAccountsReceivableAmount()) && !Objects.isNull(paySpendingContract.getAmountReceived())
&& paySpendingContract.getAccountsReceivableAmount().compareTo(paySpendingContract.getAmountReceived()) == -1){
&& paySpendingContract.getAccountsReceivableAmount().compareTo(paySpendingContract.getAmountReceived()) < 0){
throw new JeroBootException("应收金额大于已收金额!");
}
StringBuilder msgPayIncomeContract = ValidUtil.validateAll(paySpendingContract);
@@ -118,7 +119,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
msgPaySpendingContractInstallment.append("第").append(finalListPaySpendingContractInstallment.indexOf(p) + 1).append("阶段:").append(sb);
}
if(!Objects.isNull(p.getAccountsReceivableAmount()) && !Objects.isNull(p.getPaidAmount())
&& p.getAccountsReceivableAmount().compareTo(p.getPaidAmount()) == -1){
&& p.getAccountsReceivableAmount().compareTo(p.getPaidAmount()) < 0){
msgPaySpendingContractInstallment.append("第").append(finalListPaySpendingContractInstallment.indexOf(p) + 1).append("期应收金额大于已收金额!");
}
});
@@ -141,7 +142,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
throw new JeroBootException("支出合同信息不能为空!");
}
if(!Objects.isNull(paySpendingContract.getAccountsReceivableAmount()) && !Objects.isNull(paySpendingContract.getAmountReceived())
&& paySpendingContract.getAccountsReceivableAmount().compareTo(paySpendingContract.getAmountReceived()) == -1){
&& paySpendingContract.getAccountsReceivableAmount().compareTo(paySpendingContract.getAmountReceived()) < 0){
throw new JeroBootException("应收金额大于已收金额!");
}
StringBuilder msgPayIncomeContract = ValidUtil.validateAll(paySpendingContract);
@@ -245,6 +246,10 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
// 获取上传文件对象
MultipartFile file = entity.getValue();
// 校验文件是否为excel
if(!ImportExcelUtil.checkExcelFile(file)){
throw new JeroBootException("请导入excel文件!");
}
List<Map<Integer, String>> list = read(file);
if(!CollectionUtils.isEmpty(list)){
List<String> listSpendingContract = PayIncomeContractCommon.LIST_SPENDING_CONTRACT;