修改bug#41520

This commit is contained in:
梁琦涛
2021-10-28 13:50:29 +08:00
parent 1c79b30be5
commit 0aa1abd5af
6 changed files with 32 additions and 64 deletions
@@ -80,11 +80,11 @@ public class PayIncomeContractCommon {
*/
public final static List<String> LIST_SPENDING_CONTRACT = Arrays.asList("合同编号","合同名称","签订单位","签订联系人","是否开口","负责人",
"部门名称","签订合同总金额","税率","未税金额","合同签订日期","合同终止日期","合同约定主要时点",
"金额","金额","金额","账款状态","合同约定付款次数","是否打包","打包年份");
"金额","金额","金额","账款状态","合同约定付款次数");
/**
* 支出合同分期信息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:打包管理)
@@ -287,7 +287,6 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
map.put("terminationDate",DateUtils.date2Str(p.getTerminationDate(),new SimpleDateFormat("yyyy-MM-dd")));
map.put("opening",sysBaseAPI.translateDict("yn",String.valueOf(p.getOpening())));
map.put("accountStatus",sysBaseAPI.translateDict("revenue_contract_account_status",String.valueOf(p.getAccountStatus())));
map.put("pack",sysBaseAPI.translateDict("yn",String.valueOf(p.getPack())));
List<PaySpendingContractInstallment> listSub = listPaySpendingContractInstallment.stream().filter(item->
Objects.equals(p.getId(),item.getContractId())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listSub)){
@@ -330,8 +329,6 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
filedsList.add(new ExcelExportEntity("未收金额", "outstandingAmount"));
filedsList.add(new ExcelExportEntity("账款状态", "accountStatus"));
filedsList.add(new ExcelExportEntity("合同约定付款次数", "contractPaymentTimes"));
filedsList.add(new ExcelExportEntity("是否打包", "pack"));
filedsList.add(new ExcelExportEntity("打包年份", "packYear"));
int count = mapCount.get("count");
if(count > 0){
for (int i = 1; i <= count; i++){
@@ -134,25 +134,25 @@ public class PaySpendingContract implements Serializable {
@ApiModelProperty(value = "合同约定主要时点")
@Size(max = 200, message = "合同约定主要时点不能大于200个字符")
private String contractTimePoints;
/**应金额*/
@Excel(name = "金额", width = 15)
@ApiModelProperty(value = "金额")
@NotNull(message = "金额不能为空")
/**应金额*/
@Excel(name = "金额", width = 15)
@ApiModelProperty(value = "金额")
@NotNull(message = "金额不能为空")
@JsonFormat(shape = JsonFormat.Shape.STRING)
@DecimalMax(value = "9999999999.99",message = "金额格式错误")
@DecimalMax(value = "9999999999.99",message = "金额格式错误")
private BigDecimal accountsReceivableAmount;
/**已金额*/
@Excel(name = "金额", width = 15)
@ApiModelProperty(value = "金额")
@NotNull(message = "金额不能为空")
/**已金额*/
@Excel(name = "金额", width = 15)
@ApiModelProperty(value = "金额")
@NotNull(message = "金额不能为空")
@JsonFormat(shape = JsonFormat.Shape.STRING)
@DecimalMax(value = "9999999999.99",message = "金额格式错误")
@DecimalMax(value = "9999999999.99",message = "金额格式错误")
private BigDecimal amountReceived;
/**未金额*/
@Excel(name = "金额", width = 15)
@ApiModelProperty(value = "金额")
/**未金额*/
@Excel(name = "金额", width = 15)
@ApiModelProperty(value = "金额")
@JsonFormat(shape = JsonFormat.Shape.STRING)
@DecimalMax(value = "9999999999.99",message = "金额格式错误")
@DecimalMax(value = "9999999999.99",message = "金额格式错误")
private BigDecimal outstandingAmount;
/**账款状态(1:未支付,2:部分支付,3:已付全款)*/
@Excel(name = "账款状态(1:未支付,2:部分支付,3:已付全款)", width = 15)
@@ -47,30 +47,30 @@ public class PaySpendingContractInstallment implements Serializable {
@NotEmpty(message = "阶段不能为空")
@Size(max = 50, message = "阶段长度不能大于50个字符")
private String phaseName;
/**应金额*/
@Excel(name = "阶段应金额", width = 15)
@ApiModelProperty(value = "金额")
@NotNull(message = "阶段应不能为空")
@DecimalMax(value = "9999999999.99",message = "阶段应格式错误")
/**应金额*/
@Excel(name = "阶段应金额", width = 15)
@ApiModelProperty(value = "金额")
@NotNull(message = "阶段应不能为空")
@DecimalMax(value = "9999999999.99",message = "阶段应格式错误")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal accountsReceivableAmount;
/**应时间*/
@Excel(name = "阶段应时间", width = 15, format = "yyyy-MM-dd")
/**应时间*/
@Excel(name = "阶段应时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "时间")
@ApiModelProperty(value = "时间")
private Date accountsReceivableTime;
/**实金额*/
@Excel(name = "阶段实金额", width = 15)
@ApiModelProperty(value = "阶段实金额")
@DecimalMax(value = "9999999999.99",message = "阶段实格式错误")
/**实金额*/
@Excel(name = "阶段实金额", width = 15)
@ApiModelProperty(value = "阶段实金额")
@DecimalMax(value = "9999999999.99",message = "阶段实格式错误")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal paidAmount;
/**实时间*/
@Excel(name = "时间", width = 15, format = "yyyy-MM-dd")
/**实时间*/
@Excel(name = "时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "时间")
@ApiModelProperty(value = "时间")
private Date paidTime;
/**创建人*/
@ApiModelProperty(value = "创建人")
@@ -294,9 +294,7 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
});
int count1 = count - listSpendingContract.size();
if(count1 != 0){
Pattern p = Pattern.compile("[0-9]*");
Matcher m = p.matcher(String.valueOf(count1 / 5));
if (!m.matches()){
if (count1 % 5 != 0){
throw new JeroBootException("文件格式有误,请下载模板后上传!");
}
int count2 = count1 / listSpendingContractInstallment.size();
@@ -610,27 +608,6 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
}
paySpendingContract.setContractPaymentTimes(map.get(17));
if(StringUtils.isEmpty(map.get(18))){
sb.append("").append(n).append("行:是否打包不能为空,请修改。<br/>");
}else{
mapPack.forEach((k,v)->{
if(Objects.equals(map.get(18),k)){
paySpendingContract.setPack(Integer.parseInt(v));
}
});
if(Objects.isNull(paySpendingContract.getPack())){
sb.append("").append(n).append("行:是否打包格式错误,请修改。<br/>");
paySpendingContract.setPack(2);
}
// 打包获取打包年份
if(Objects.equals(paySpendingContract.getPack(),PayIncomeContractCommon.PACK1)){
if(StringUtils.isEmpty(map.get(19))){
sb.append("").append(n).append("行:打包年份不能为空,请修改。<br/>");
}else{
paySpendingContract.setPackYear(map.get(19));
}
}
}
return paySpendingContract;
}
@@ -62,12 +62,6 @@ public class PaySpendingContractExcelModel implements Serializable {
/**合同约定付款次数*/
@Excel(name = "合同约定付款次数", width = 15)
private String contractPaymentTimes;
/**是否打包(1:是,0:否)*/
@Excel(name = "是否打包", width = 15)
private Integer pack;
/**打包年份*/
@Excel(name = "打包年份", width = 15)
private String packYear;
/**阶段名称*/
@Excel(name = "1阶段", width = 15)
private String phaseName1;