Merge pull request 'demand: TMS系统 - 月结账单销账/现金账单销账 - 逻辑调整' (#316) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/316
This commit is contained in:
commit
3562709ea3
@ -480,11 +480,29 @@ public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements I
|
|||||||
&& !"7".equals(emisSettlePayRecord.getPayType())) {
|
&& !"7".equals(emisSettlePayRecord.getPayType())) {
|
||||||
throw new EmisBizError(EmisBizErrorType.FAIL, "业务账单未确认,不允许收款!");
|
throw new EmisBizError(EmisBizErrorType.FAIL, "业务账单未确认,不允许收款!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 校验账单对应的运单是否在销账申请表中,且中心审核状态为未审核
|
// 校验运单是否已登记业务销账申请且中心审核状态为未审核
|
||||||
|
// 优先按运单维度校验;若未传运单明细,则使用原“账单->子账单->运单”的兜底逻辑,避免误放行
|
||||||
|
List<EmisSettlePayRel> payRelListForCheck = emisSettlePayRecord.getPayRelList();
|
||||||
|
if (!CollectionUtils.isEmpty(payRelListForCheck)) {
|
||||||
|
List<String> waybillNos = payRelListForCheck.stream()
|
||||||
|
.map(EmisSettlePayRel::getBillNo)
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
for (String waybillNo : waybillNos) {
|
||||||
|
checkWriteoffApplyStatusByBillCode(waybillNo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < settleBillNoArr.size(); i++) {
|
||||||
|
String settleBillNo = settleBillNoArr.get(i);
|
||||||
|
if (!StringUtils.isEmpty(settleBillNo)) {
|
||||||
checkWriteoffApplyStatus(settleBillNo);
|
checkWriteoffApplyStatus(settleBillNo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 不重复的 id流水号
|
// 不重复的 id流水号
|
||||||
// 如果支付单是空的则生成新的支付单
|
// 如果支付单是空的则生成新的支付单
|
||||||
@ -640,12 +658,27 @@ public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements I
|
|||||||
|
|
||||||
// 根据运单号查询销账申请明细
|
// 根据运单号查询销账申请明细
|
||||||
for (String billCode : billCodeList) {
|
for (String billCode : billCodeList) {
|
||||||
|
checkWriteoffApplyStatusByBillCode(billCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验运单是否在销账申请表中,且中心审核状态为未审核
|
||||||
|
*
|
||||||
|
* @param billCode 运单号
|
||||||
|
* @throws EmisBizError 如果存在未审核的销账申请,则抛出异常
|
||||||
|
*/
|
||||||
|
private void checkWriteoffApplyStatusByBillCode(String billCode) throws EmisBizError {
|
||||||
|
if (StringUtils.isBlank(billCode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
EmisWriteoffApplyDetail queryDetail = new EmisWriteoffApplyDetail();
|
EmisWriteoffApplyDetail queryDetail = new EmisWriteoffApplyDetail();
|
||||||
queryDetail.setBillCode(billCode);
|
queryDetail.setBillCode(billCode);
|
||||||
List<EmisWriteoffApplyDetail> detailList = emisWriteoffApplyDetailMapper.selectEmisWriteoffApplyDetailList(queryDetail);
|
List<EmisWriteoffApplyDetail> detailList = emisWriteoffApplyDetailMapper.selectEmisWriteoffApplyDetailList(queryDetail);
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(detailList)) {
|
if (CollectionUtils.isEmpty(detailList)) {
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取所有申请ID,去重
|
// 获取所有申请ID,去重
|
||||||
@ -656,7 +689,7 @@ public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements I
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(applyIds)) {
|
if (CollectionUtils.isEmpty(applyIds)) {
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询销账申请,检查中心审核状态
|
// 查询销账申请,检查中心审核状态
|
||||||
@ -669,7 +702,6 @@ public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收款退款
|
* 收款退款
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user