demand: TMS系统 - 客户账单管理 - 销账审核通过后交易时间取申请的交易时间 TMS系统 - 客户账单管理 - 业务销账申请 - 增加校验不同支付类型的运单不能一起提交申请 TMS系统 - 客户账单管理 - 财务销账审核 - 审核通过后销账收款类型、账单类型取值调整
This commit is contained in:
parent
634657dec9
commit
598333207f
@ -186,6 +186,37 @@ public class EmisWriteoffApplyServiceImpl extends EmisBaseService implements IEm
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证明细列表中结算账单的结算类型是否一致
|
||||
*
|
||||
* @param emisWriteoffApply 销账申请
|
||||
* @throws EmisBizError 如果结算类型不一致则抛出异常
|
||||
*/
|
||||
private void validateSettleTypeConsistency(EmisWriteoffApply emisWriteoffApply) throws EmisBizError {
|
||||
if (CollectionUtils.isEmpty(emisWriteoffApply.getDetailList())) {
|
||||
return;
|
||||
}
|
||||
|
||||
String firstSettleType = null;
|
||||
for (EmisWriteoffApplyDetail detail : emisWriteoffApply.getDetailList()) {
|
||||
if (detail.getEmisSettleBill() == null) {
|
||||
throw new EmisBizError("运单号 " + detail.getBillCode() + " 的账单信息为空");
|
||||
}
|
||||
|
||||
String settleType = detail.getEmisSettleBill().getSettleType();
|
||||
if (settleType == null) {
|
||||
throw new EmisBizError("运单号 " + detail.getBillCode() + " 的结算账单类型为空");
|
||||
}
|
||||
|
||||
if (firstSettleType == null) {
|
||||
firstSettleType = settleType;
|
||||
} else if (!firstSettleType.equals(settleType)) {
|
||||
throw new EmisBizError("明细列表中的结算账单类型不一致,运单号 " + detail.getBillCode()
|
||||
+ " 的结算类型为 " + settleType + ",与其他明细的结算类型 " + firstSettleType + " 不一致");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增销账申请
|
||||
*
|
||||
@ -199,6 +230,9 @@ public class EmisWriteoffApplyServiceImpl extends EmisBaseService implements IEm
|
||||
// 先验证销账金额
|
||||
validateWriteoffAmount(emisWriteoffApply);
|
||||
|
||||
// 验证结算账单类型一致性
|
||||
validateSettleTypeConsistency(emisWriteoffApply);
|
||||
|
||||
// 设置申请编号
|
||||
String applyNo = generateApplyNo();
|
||||
emisWriteoffApply.setApplyNo(applyNo);
|
||||
@ -1592,7 +1626,7 @@ public class EmisWriteoffApplyServiceImpl extends EmisBaseService implements IEm
|
||||
EmisSettlePayRecord payRecord = new EmisSettlePayRecord();
|
||||
payRecord.setPayId(payId);
|
||||
payRecord.setWriteoffApplyNo(apply.getApplyNo()); // 设置销账申请编号
|
||||
payRecord.setPayType("7"); // 销账收款类型
|
||||
payRecord.setPayType(apply.getPayType()); // 销账收款类型
|
||||
payRecord.setRecType("1"); // 收款类型
|
||||
payRecord.setPayMan(apply.getApplyManName());
|
||||
payRecord.setPayManCode(apply.getApplyManCode());
|
||||
@ -1611,7 +1645,10 @@ public class EmisWriteoffApplyServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
payRecord.setPayMoney(totalApplyMoney);
|
||||
payRecord.setPayStatus("2"); // 支付成功
|
||||
payRecord.setSettleType("1"); // 现金结算
|
||||
if (!detailList.isEmpty() && detailList.get(0).getEmisSettleBill() != null) {
|
||||
EmisSettleBill emisSettleBill = detailList.get(0).getEmisSettleBill();
|
||||
payRecord.setSettleType(emisSettleBill.getSettleType());
|
||||
}
|
||||
payRecord.setTradeDate(apply.getTradeDate());
|
||||
payRecord.setRecManCode(currentUser.getEmpCode());
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user