修改bug#41007
This commit is contained in:
+1
-1
@@ -99,7 +99,7 @@ public class ValidUtil {
|
||||
if(set != null && set.size() > 0 ){
|
||||
for(ConstraintViolation<Object> constraintViolation : set){
|
||||
// 这里循环获取错误信息,可以自定义格式
|
||||
msg.append("第").append(count).append("行:").append(constraintViolation.getMessage()).append("<br/>");
|
||||
msg.append("第").append(count).append("行:").append(constraintViolation.getMessage()).append(",请修改!<br/>");
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ public class PayIncomeContractCommon {
|
||||
/**
|
||||
* 支出合同分期信息excel 表头
|
||||
*/
|
||||
public final static List<String> LIST_SPENDING_CONTRACT_INSTALLMENT = Arrays.asList("阶段","期应收","期应收时间","期实收","期实收时间");
|
||||
public final static List<String> LIST_SPENDING_CONTRACT_INSTALLMENT = Arrays.asList("阶段","阶段应收","阶段应收时间","阶段实收","阶段实收时间");
|
||||
|
||||
/**
|
||||
* 来源(1:收入合同,2:打包管理)
|
||||
|
||||
+4
-4
@@ -617,10 +617,10 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
|
||||
if(count > 0){
|
||||
for (int i = 1; i <= count; i++){
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段", "phaseName" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "期应收", "accountsReceivableAmount" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "期应收时间", "accountsReceivableTime" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "期实收", "paidAmount" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "期实收时间", "paidTime" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段应收", "accountsReceivableAmount" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段应收时间", "accountsReceivableTime" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段实收", "paidAmount" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段实收时间", "paidTime" + i));
|
||||
}
|
||||
}
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
|
||||
+4
-4
@@ -340,10 +340,10 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
|
||||
if(count > 0){
|
||||
for (int i = 1; i <= count; i++){
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段", "phaseName" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "期应收", "accountsReceivableAmount" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "期应收时间", "accountsReceivableTime" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "期实收", "paidAmount" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "期实收时间", "paidTime" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段应收", "accountsReceivableAmount" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段应收时间", "accountsReceivableTime" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段实收", "paidAmount" + i));
|
||||
filedsList.add(new ExcelExportEntity(i + "阶段实收时间", "paidTime" + i));
|
||||
}
|
||||
}
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
|
||||
+17
-18
@@ -307,7 +307,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
|
||||
listSpendingContractInstallment.forEach(item->{
|
||||
int n = listSpendingContractInstallment.indexOf(item) + 1;
|
||||
if(Objects.equals((n + 1) + item,map.get(listSpendingContract.size() + finalI * n))){
|
||||
throw new JeroBootException("导入的!" + n + "期阶段excel表头有误!");
|
||||
throw new JeroBootException("导入的!" + n + "阶段excel表头有误!");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -350,28 +350,28 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
|
||||
paySpendingContractInstallment.setPhaseName(sub.get(mm));
|
||||
if(!StringUtils.isBlank(sub.get(mm + 1))){
|
||||
if(!pattern.matcher(sub.get(mm + 1)).matches()){
|
||||
sb.append("第").append(n + 1).append("行:").append(i+1).append("期应收金额格式错误!<br/>");
|
||||
sb.append("第").append(n + 1).append("行:").append(i+1).append("阶段应收格式错误,请修改!<br/>");
|
||||
}else{
|
||||
paySpendingContractInstallment.setAccountsReceivableAmount(new BigDecimal(sub.get(mm + 1)));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(sub.get(mm + 2))){
|
||||
if(!DateUtils.isValidDate(sub.get(mm + 2))){
|
||||
sb.append("第").append(n + 1).append("行:").append(i+1).append("期应收时间日期格式不正确 <br/>");
|
||||
sb.append("第").append(n + 1).append("行:").append(i+1).append("阶段应收时间日期格式不正确,请修改! <br/>");
|
||||
}else{
|
||||
paySpendingContractInstallment.setAccountsReceivableTime(DateUtils.str2Date(sub.get(mm + 2),new SimpleDateFormat("yyyy-MM-dd")));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(sub.get(mm + 3))){
|
||||
if(!pattern.matcher(sub.get(mm + 3)).matches()){
|
||||
sb.append("第").append(n + 1).append("行:").append(i+1).append("期实收金额格式错误!<br/>");
|
||||
sb.append("第").append(n + 1).append("行:").append(i+1).append("阶段实收格式错误,请修改!<br/>");
|
||||
}else{
|
||||
paySpendingContractInstallment.setPaidAmount(new BigDecimal(sub.get(mm + 3)));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(sub.get(mm + 4))) {
|
||||
if (!DateUtils.isValidDate(sub.get(mm + 4))) {
|
||||
sb.append("第").append(n + 1).append("行:").append(i+1).append("期实收时间日期格式不正确 <br/>");
|
||||
sb.append("第").append(n + 1).append("行:").append(i+1).append("阶段实收时间日期格式不正确,请修改 <br/>");
|
||||
} else {
|
||||
paySpendingContractInstallment.setPaidTime(DateUtils.str2Date(sub.get(mm + 4), new SimpleDateFormat("yyyy-MM-dd")));
|
||||
}
|
||||
@@ -459,8 +459,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
|
||||
if(!Objects.isNull(paySpendingContract.getAccountsReceivableAmount()) && !Objects.isNull(paySpendingContract.getAmountReceived())){
|
||||
if(paySpendingContract.getAccountsReceivableAmount().compareTo(paySpendingContract.getAmountReceived()) < 0){
|
||||
sb.append("第").append(n + 1).append("行:已收金额大于应收金额,请修改!<br/>");
|
||||
}
|
||||
if(!Objects.isNull(paySpendingContract.getOutstandingAmount()) && paySpendingContract.getAccountsReceivableAmount().subtract(paySpendingContract.getAmountReceived()).compareTo(paySpendingContract.getOutstandingAmount()) != 0){
|
||||
}else if(!Objects.isNull(paySpendingContract.getOutstandingAmount()) && paySpendingContract.getAccountsReceivableAmount().subtract(paySpendingContract.getAmountReceived()).compareTo(paySpendingContract.getOutstandingAmount()) != 0){
|
||||
sb.append("第").append(n + 1).append("行:未收金额不正确,请修改!<br/>");
|
||||
}
|
||||
}
|
||||
@@ -474,7 +473,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
|
||||
int c = listPaySpendingContractInstallment.indexOf(item) + 1;
|
||||
if(!Objects.isNull(item.getAccountsReceivableAmount()) && !Objects.isNull(item.getPaidAmount())
|
||||
&& item.getAccountsReceivableAmount().compareTo(item.getPaidAmount()) < 0){
|
||||
sb.append("第").append(n + 1).append("行:").append(c).append("期实收金额大于应收金额,请修改!<br/>");
|
||||
sb.append("第").append(n + 1).append("行:").append(c).append("阶段实收大于应收,请修改!<br/>");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -500,7 +499,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
|
||||
// 负责人名称
|
||||
SysUser principalName = sysUserService.getById(paySpendingContract.getPrincipalId());
|
||||
if(Objects.isNull(principalName)){
|
||||
throw new JeroBootException("负责人名称为空!");
|
||||
throw new JeroBootException("负责人名称为空,请修改!");
|
||||
}
|
||||
paySpendingContract.setPrincipalId(principalName.getId());
|
||||
paySpendingContract.setPrincipalName(principalName.getRealname());
|
||||
@@ -537,7 +536,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
|
||||
paySpendingContract.setSignedCompanyTemporaryName(map.get(2));
|
||||
paySpendingContract.setSignedContactsTemporaryName(map.get(3));
|
||||
if(!Objects.equals(map.get(4),"是") && !Objects.equals(map.get(4),"否")){
|
||||
sb.append("第").append(n).append("行:是否开口格式错误!<br/>");
|
||||
sb.append("第").append(n).append("行:是否开口格式错误,请修改!<br/>");
|
||||
}else{
|
||||
mapOpening.forEach((k,v)->{
|
||||
if(Objects.equals(map.get(4),k)){
|
||||
@@ -550,35 +549,35 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
|
||||
paySpendingContract.setDepartmentName(map.get(6));
|
||||
if(!StringUtils.isBlank(map.get(7))){
|
||||
if(!pattern.matcher(map.get(7)).matches()){
|
||||
sb.append("第").append(n).append("行:签订合同总金额格式错误!<br/>");
|
||||
sb.append("第").append(n).append("行:签订合同总金额格式错误,请修改!<br/>");
|
||||
}else{
|
||||
paySpendingContract.setContractAmount(new BigDecimal(map.get(7)));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(map.get(8))){
|
||||
if(!pattern.matcher(map.get(8)).matches()){
|
||||
sb.append("第").append(n).append("行:税率格式错误!<br/>");
|
||||
sb.append("第").append(n).append("行:税率格式错误,请修改!<br/>");
|
||||
}else{
|
||||
paySpendingContract.setRate(new BigDecimal(map.get(8)));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(map.get(9)) ){
|
||||
if(!pattern.matcher(map.get(9)).matches()){
|
||||
sb.append("第").append(n).append("行:未税金额格式错误!<br/>");
|
||||
sb.append("第").append(n).append("行:未税金额格式错误,请修改!<br/>");
|
||||
}else{
|
||||
paySpendingContract.setNoTaxAmount(new BigDecimal(map.get(9)));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(map.get(10)) ){
|
||||
if(!DateUtils.isValidDate(map.get(10))){
|
||||
sb.append("第").append(n).append("行:合同签订日期格式不正确 <br/>");
|
||||
sb.append("第").append(n).append("行:合同签订日期格式不正确,请修改! <br/>");
|
||||
}else{
|
||||
paySpendingContract.setContractDate(DateUtils.str2Date(map.get(10),new SimpleDateFormat("yyyy-MM-dd")));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(map.get(11))){
|
||||
if(!DateUtils.isValidDate(map.get(11))) {
|
||||
sb.append("第").append(n).append("行:合同终止日期格式不正确 <br/>");
|
||||
sb.append("第").append(n).append("行:合同终止日期格式不正确,请修改! <br/>");
|
||||
}else{
|
||||
paySpendingContract.setTerminationDate(DateUtils.str2Date(map.get(11),new SimpleDateFormat("yyyy-MM-dd")));
|
||||
}
|
||||
@@ -586,21 +585,21 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
|
||||
paySpendingContract.setContractTimePoints(map.get(13));
|
||||
if(!StringUtils.isBlank(map.get(13))){
|
||||
if(!pattern.matcher(map.get(13)).matches()){
|
||||
sb.append("第").append(n).append("行:应收金额格式错误!<br/>");
|
||||
sb.append("第").append(n).append("行:应收金额格式错误,请修改!<br/>");
|
||||
}else{
|
||||
paySpendingContract.setAccountsReceivableAmount(new BigDecimal(map.get(13)));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(map.get(14))){
|
||||
if(!pattern.matcher(map.get(14)).matches()){
|
||||
sb.append("第").append(n).append("行:已收金额格式错误!<br/>");
|
||||
sb.append("第").append(n).append("行:已收金额格式错误,请修改!<br/>");
|
||||
}else{
|
||||
paySpendingContract.setAmountReceived(new BigDecimal(map.get(14)));
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(map.get(15))){
|
||||
if(!pattern.matcher(map.get(15)).matches()){
|
||||
sb.append("第").append(n).append("行:未收金额格式错误!<br/>");
|
||||
sb.append("第").append(n).append("行:未收金额格式错误,请修改!<br/>");
|
||||
}else{
|
||||
paySpendingContract.setOutstandingAmount(new BigDecimal(map.get(15)));
|
||||
}
|
||||
|
||||
+8
-8
@@ -72,30 +72,30 @@ public class PaySpendingContractExcelModel implements Serializable {
|
||||
@Excel(name = "1阶段", width = 15)
|
||||
private String phaseName1;
|
||||
/**应收金额*/
|
||||
@Excel(name = "1期应收", width = 15)
|
||||
@Excel(name = "1阶段应收", width = 15)
|
||||
private Integer accountsReceivableAmount1;
|
||||
/**应收时间*/
|
||||
@Excel(name = "1期应收时间", width = 15, format = "yyyy-MM-dd")
|
||||
@Excel(name = "1阶段应收时间", width = 15, format = "yyyy-MM-dd")
|
||||
private Date accountsReceivableTime1;
|
||||
/**实收金额*/
|
||||
@Excel(name = "1期实收", width = 15)
|
||||
@Excel(name = "1阶段实收", width = 15)
|
||||
private Integer paidAmount1;
|
||||
/**实收时间*/
|
||||
@Excel(name = "1期实收时间", width = 15, format = "yyyy-MM-dd")
|
||||
@Excel(name = "1阶段实收时间", width = 15, format = "yyyy-MM-dd")
|
||||
private Date paidTime1;
|
||||
/**阶段名称*/
|
||||
@Excel(name = "2阶段", width = 15)
|
||||
private String phaseName2;
|
||||
/**应收金额*/
|
||||
@Excel(name = "2期应收", width = 15)
|
||||
@Excel(name = "2阶段应收", width = 15)
|
||||
private Integer accountsReceivableAmount2;
|
||||
/**应收时间*/
|
||||
@Excel(name = "2期应收时间", width = 15, format = "yyyy-MM-dd")
|
||||
@Excel(name = "2阶段应收时间", width = 15, format = "yyyy-MM-dd")
|
||||
private Date accountsReceivableTime2;
|
||||
/**实收金额*/
|
||||
@Excel(name = "2期实收", width = 15)
|
||||
@Excel(name = "2阶段实收", width = 15)
|
||||
private Integer paidAmount2;
|
||||
/**实收时间*/
|
||||
@Excel(name = "2期实收时间", width = 15, format = "yyyy-MM-dd")
|
||||
@Excel(name = "2阶段实收时间", width = 15, format = "yyyy-MM-dd")
|
||||
private Date paidTime2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user