|
...
|
...
|
@@ -28,6 +28,7 @@ import com.lframework.starter.web.core.components.resp.PageResult; |
|
28
|
28
|
import com.lframework.starter.common.utils.Assert;
|
|
29
|
29
|
import com.lframework.xingyun.sc.service.contract.ContractDistributorStandardService;
|
|
30
|
30
|
import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
|
|
|
31
|
+import com.lframework.xingyun.sc.service.ledger.FundOrderingUnitDetailService;
|
|
31
|
32
|
import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
|
|
32
|
33
|
import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
|
|
33
|
34
|
import com.lframework.xingyun.sc.service.shipments.ShipmentsOrderInfoService;
|
|
...
|
...
|
@@ -50,6 +51,7 @@ import java.math.RoundingMode; |
|
50
|
51
|
import java.time.LocalDate;
|
|
51
|
52
|
import java.time.LocalDateTime;
|
|
52
|
53
|
import java.time.YearMonth;
|
|
|
54
|
+import java.time.format.DateTimeFormatter;
|
|
53
|
55
|
import java.time.temporal.ChronoUnit;
|
|
54
|
56
|
import java.time.temporal.TemporalAdjusters;
|
|
55
|
57
|
import java.util.*;
|
|
...
|
...
|
@@ -84,6 +86,8 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
84
|
86
|
private ContractDistributorStandardService contractDistributorStandardService;
|
|
85
|
87
|
@Resource
|
|
86
|
88
|
private DraftRequestCarTicketService draftRequestCarTicketService;
|
|
|
89
|
+ @Resource
|
|
|
90
|
+ private FundOrderingUnitDetailService fundOrderingUnitDetailService;
|
|
87
|
91
|
|
|
88
|
92
|
|
|
89
|
93
|
// 定义状态优先级顺序(从高到低)
|
|
...
|
...
|
@@ -121,11 +125,34 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
121
|
125
|
List<SysDataDicItem> debtStatusList = sysDataDicItemService.findByDicCode("DEBT_STATUS");
|
|
122
|
126
|
Map<String, String> debtStatusMap = debtStatusList.stream()
|
|
123
|
127
|
.collect(Collectors.toMap(SysDataDicItem::getCode, SysDataDicItem::getName, (v1, v2) -> v1));
|
|
|
128
|
+ // 获取资金协调状态
|
|
|
129
|
+ Map<String, String> fundCoordinateStatusMap = new HashMap<>();
|
|
|
130
|
+ List<String> ledgerIds = infoList.stream().map(ReceiptLedgerInfo::getId).collect(Collectors.toList());
|
|
|
131
|
+ List<Map<String, Object>> fundCoordinateStatusList = fundOrderingUnitDetailService.listByLedgerIds(ledgerIds);
|
|
|
132
|
+ if (CollectionUtils.isNotEmpty(fundCoordinateStatusList)) {
|
|
|
133
|
+ for (Map<String, Object> map : fundCoordinateStatusList) {
|
|
|
134
|
+ String ledgerId = (String) map.get("ledger_id");
|
|
|
135
|
+ String debtStatus = (String) map.get("debt_status");
|
|
|
136
|
+ String status = (String) map.get("status");
|
|
|
137
|
+
|
|
|
138
|
+ fundCoordinateStatusMap.put(ledgerId + "_" + debtStatus, status);
|
|
|
139
|
+ }
|
|
|
140
|
+ }
|
|
124
|
141
|
for (ReceiptLedgerInfo info : infoList) {
|
|
125
|
142
|
String customerType = info.getCustomerType();
|
|
126
|
143
|
String enterpriseType = enterpriseTypeMap.get(customerType);
|
|
127
|
144
|
String debtStatus = info.getDebtStatus();
|
|
128
|
145
|
String debtStatusName = debtStatusMap.get(debtStatus);
|
|
|
146
|
+ String applyStatus = fundCoordinateStatusMap.get(info.getId() + "_" + debtStatusName);
|
|
|
147
|
+ if ("FIRST_COORDINATE".equals(debtStatus) || "SECOND_COORDINATE".equals(debtStatus) || "CLEAR_DEBTS".equals(debtStatus)) {
|
|
|
148
|
+ if ("AUDIT".equals(applyStatus)) {
|
|
|
149
|
+ info.setApplyStatus("批复中");
|
|
|
150
|
+ } else if ("PASS".equals(applyStatus) || "REFUSE".equals(applyStatus)) {
|
|
|
151
|
+ info.setApplyStatus("已申请");
|
|
|
152
|
+ } else {
|
|
|
153
|
+ info.setApplyStatus("未申请");
|
|
|
154
|
+ }
|
|
|
155
|
+ }
|
|
129
|
156
|
|
|
130
|
157
|
info.setCustomerType(enterpriseType);
|
|
131
|
158
|
info.setDebtStatus(debtStatusName);
|
|
...
|
...
|
@@ -457,6 +484,16 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
457
|
484
|
public PageResult<ReceiptLedgerReportBo> report(Integer pageIndex, Integer pageSize, ReceiptLedgerReportVo vo) {
|
|
458
|
485
|
Assert.greaterThanZero(pageIndex);
|
|
459
|
486
|
Assert.greaterThanZero(pageSize);
|
|
|
487
|
+ // 获取当月1号和当前时间
|
|
|
488
|
+ LocalDateTime endTime = LocalDateTime.now();
|
|
|
489
|
+ LocalDateTime startTime = LocalDate.now().withDayOfMonth(1).atStartOfDay();
|
|
|
490
|
+ if (vo.getStartTime() == null) {
|
|
|
491
|
+ vo.setStartTime(startTime);
|
|
|
492
|
+ }
|
|
|
493
|
+ if (vo.getEndTime() == null) {
|
|
|
494
|
+ vo.setEndTime(endTime);
|
|
|
495
|
+ }
|
|
|
496
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
460
|
497
|
// 开启分页
|
|
461
|
498
|
PageHelperUtil.startPage(pageIndex, pageSize);
|
|
462
|
499
|
List<ReceiptLedgerReportBo> dataList = getBaseMapper().report(vo);
|
|
...
|
...
|
@@ -465,11 +502,15 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
465
|
502
|
return result;
|
|
466
|
503
|
}
|
|
467
|
504
|
List<String> shortNames = dataList.stream().map(ReceiptLedgerReportBo::getCustomerShortName).distinct().collect(Collectors.toList());
|
|
468
|
|
- // 根据简称获取台账明细数据
|
|
469
|
|
- Map<String, List<ReceiptLedgerInfo>> agreementDataMap = getLedgerInfoByShortName(shortNames, Boolean.FALSE);
|
|
470
|
|
- Map<String, List<ReceiptLedgerInfo>> overdueDataMap = getLedgerInfoByShortName(shortNames, Boolean.TRUE);
|
|
|
505
|
+ // 获取当月所有台账明细数据(内贸)
|
|
|
506
|
+ QueryReceiptLedgerInfoVo ledgerInfoVo = new QueryReceiptLedgerInfoVo();
|
|
|
507
|
+ ledgerInfoVo.setType("INSIDE");
|
|
|
508
|
+ ledgerInfoVo.setCreateTimeStart(startTime.format(formatter));
|
|
|
509
|
+ ledgerInfoVo.setCreateTimeEnd(endTime.format(formatter));
|
|
|
510
|
+ List<ReceiptLedgerInfo> ledgerInfoList = getBaseMapper().query(ledgerInfoVo);
|
|
471
|
511
|
// 统计各个阶段欠款金额数据
|
|
472
|
|
- List<Map<String, Object>> debtAmountList = getBaseMapper().statisticsDebtByShortName(shortNames, null, "INSIDE");
|
|
|
512
|
+ List<Map<String, Object>> debtAmountList = getBaseMapper().statisticsDebtByShortName(shortNames, null, "INSIDE"
|
|
|
513
|
+ , vo.getStartTime(), vo.getEndTime());
|
|
473
|
514
|
if (CollectionUtils.isEmpty(debtAmountList)) {
|
|
474
|
515
|
return result;
|
|
475
|
516
|
}
|
|
...
|
...
|
@@ -485,6 +526,7 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
485
|
526
|
List<Map<String, Object>> list = debtMap.computeIfAbsent(shortName, k -> new ArrayList<>());
|
|
486
|
527
|
list.add(map);
|
|
487
|
528
|
}
|
|
|
529
|
+ Set<String> customerNames = new HashSet<>();
|
|
488
|
530
|
// 获取待交付订货单数
|
|
489
|
531
|
Map<String, Long> orderCountMap = shipmentsOrderInfoService.countWaitDeliveredOrder(customerNameList);
|
|
490
|
532
|
for (ReceiptLedgerReportBo report : dataList) {
|
|
...
|
...
|
@@ -494,28 +536,19 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
494
|
536
|
continue;
|
|
495
|
537
|
}
|
|
496
|
538
|
long waitDeliveredOrderTotal = 0;
|
|
497
|
|
- List<String> creditStatusList = new ArrayList<>();
|
|
498
|
|
- List<String> debtStates = new ArrayList<>();
|
|
499
|
539
|
Map<String, ReceiptLedgerReportDetail> reportDetailMap = new LinkedHashMap<>();
|
|
500
|
540
|
for (Map<String, Object> map : list) {
|
|
501
|
541
|
String customerName = (String) map.get("name");
|
|
502
|
542
|
String debtStatus = (String) map.get("debt_status");
|
|
503
|
|
- debtStates.add(debtStatus);
|
|
504
|
543
|
BigDecimal debtAmount = (BigDecimal) map.get("debt_amount");
|
|
505
|
544
|
|
|
506
|
545
|
ReceiptLedgerReportDetail reportDetail = reportDetailMap.get(customerName);
|
|
507
|
546
|
if (reportDetail == null) {
|
|
508
|
547
|
reportDetail = new ReceiptLedgerReportDetail();
|
|
|
548
|
+ reportDetail.setCustomerName(customerName);
|
|
509
|
549
|
}
|
|
510
|
|
- reportDetail.setCustomerName(customerName);
|
|
511
|
|
- if ("AGREEMENT".equals(debtStatus) || "DEPOSIT".equals(debtStatus)) {
|
|
512
|
|
- BigDecimal agreement = reportDetail.getAgreement();
|
|
513
|
|
- if (agreement == null) {
|
|
514
|
|
- agreement = debtAmount;
|
|
515
|
|
- } else {
|
|
516
|
|
- agreement = agreement.add(debtAmount);
|
|
517
|
|
- }
|
|
518
|
|
- reportDetail.setAgreement(valueConvert(agreement));
|
|
|
550
|
+ if ("AGREEMENT".equals(debtStatus)) {
|
|
|
551
|
+ reportDetail.setAgreement(valueConvert(debtAmount));
|
|
519
|
552
|
reportDetail.setTimingStatus("约定内");
|
|
520
|
553
|
} else if ("FIRST_COORDINATE".equals(debtStatus)) {
|
|
521
|
554
|
reportDetail.setFirstCoordinate(valueConvert(debtAmount));
|
|
...
|
...
|
@@ -527,17 +560,13 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
527
|
560
|
reportDetail.setClearDebt(valueConvert(debtAmount));
|
|
528
|
561
|
reportDetail.setTimingStatus("超期3");
|
|
529
|
562
|
}
|
|
530
|
|
- // 计算超额数据(授信状态)
|
|
531
|
|
- String creditStatus = calculateExcess(debtAmount, report.getQuota());
|
|
532
|
|
- if (StringUtils.isNotBlank(creditStatus)) {
|
|
533
|
|
- report.setCreditStatus(creditStatus);
|
|
534
|
|
- creditStatusList.add(creditStatus);
|
|
535
|
|
- }
|
|
536
|
563
|
// 统计待交付订单数
|
|
537
|
564
|
Long count = orderCountMap.get(customerName);
|
|
538
|
|
- if (count != null) {
|
|
|
565
|
+ if (count != null && !customerNames.contains(customerName)) {
|
|
539
|
566
|
waitDeliveredOrderTotal += count;
|
|
540
|
567
|
reportDetail.setWaitDeliveredOrder(count);
|
|
|
568
|
+ // 防止重复相加
|
|
|
569
|
+ customerNames.add(customerName);
|
|
541
|
570
|
}
|
|
542
|
571
|
// 计算总欠款
|
|
543
|
572
|
BigDecimal debtTotal = reportDetail.getDebtTotal();
|
|
...
|
...
|
@@ -551,22 +580,28 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
551
|
580
|
}
|
|
552
|
581
|
List<ReceiptLedgerReportDetail> details = new ArrayList<>(reportDetailMap.values());
|
|
553
|
582
|
if (CollectionUtils.isNotEmpty(details)) {
|
|
554
|
|
- // 转换成万元
|
|
555
|
583
|
for (ReceiptLedgerReportDetail detail : details) {
|
|
|
584
|
+ // 转换成万元
|
|
556
|
585
|
BigDecimal debtTotal = detail.getDebtTotal();
|
|
557
|
586
|
detail.setDebtTotal(valueConvert(debtTotal));
|
|
|
587
|
+ // 计算超额数据(授信状态)
|
|
|
588
|
+ String creditStatus = calculateExcess(debtTotal, report.getQuota());
|
|
|
589
|
+ if (StringUtils.isNotBlank(creditStatus)) {
|
|
|
590
|
+ detail.setCreditStatus(creditStatus);
|
|
|
591
|
+ }
|
|
558
|
592
|
}
|
|
559
|
593
|
}
|
|
560
|
594
|
report.setDetailList(details);
|
|
561
|
595
|
|
|
562
|
596
|
// 处理约定内、一次协调、二次协调、清欠小计数据
|
|
563
|
|
- handleSubtotal(agreementDataMap, overdueDataMap, report);
|
|
564
|
|
- // 授时状态
|
|
565
|
|
- report.setTimingStatus(getHighestPriorityStatus(debtStates));
|
|
|
597
|
+ handleSubtotal(ledgerInfoList, report);
|
|
566
|
598
|
// 授信状态
|
|
567
|
|
- report.setCreditStatus(findMaxPercentageString(creditStatusList));
|
|
568
|
|
- report.setWaitDeliveredOrderTotal(waitDeliveredOrderTotal);
|
|
569
|
599
|
BigDecimal debtTotal = report.getDebtTotal();
|
|
|
600
|
+ String creditStatus = calculateExcess(debtTotal, report.getQuota());
|
|
|
601
|
+ if (StringUtils.isNotBlank(creditStatus)) {
|
|
|
602
|
+ report.setCreditStatus(creditStatus);
|
|
|
603
|
+ }
|
|
|
604
|
+ report.setWaitDeliveredOrderTotal(waitDeliveredOrderTotal);
|
|
570
|
605
|
report.setDebtTotal(valueConvert(debtTotal));
|
|
571
|
606
|
}
|
|
572
|
607
|
return result;
|
|
...
|
...
|
@@ -1006,13 +1041,111 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
1006
|
1041
|
/**
|
|
1007
|
1042
|
* 处理“小计”数据
|
|
1008
|
1043
|
*
|
|
1009
|
|
- * @param agreementDataMap 约定内数据集合
|
|
1010
|
|
- * @param overdueDataMap 逾期数据集合
|
|
1011
|
|
- * @param report 报表数据
|
|
|
1044
|
+ * @param ledgerInfoList 台账明细数据
|
|
|
1045
|
+ * @param report 报表数据
|
|
1012
|
1046
|
*/
|
|
1013
|
|
- private void handleSubtotal(Map<String, List<ReceiptLedgerInfo>> agreementDataMap, Map<String, List<ReceiptLedgerInfo>> overdueDataMap
|
|
1014
|
|
- , ReceiptLedgerReportBo report) {
|
|
1015
|
|
- String customerShortName = report.getCustomerShortName();
|
|
|
1047
|
+ private void handleSubtotal(List<ReceiptLedgerInfo> ledgerInfoList, ReceiptLedgerReportBo report) {
|
|
|
1048
|
+ if (CollectionUtils.isEmpty(ledgerInfoList) || report == null) {
|
|
|
1049
|
+ return;
|
|
|
1050
|
+ }
|
|
|
1051
|
+ BigDecimal debtTotal = report.getDebtTotal();
|
|
|
1052
|
+ // 约定内欠款
|
|
|
1053
|
+ BigDecimal agreement = getAgreementDebt(ledgerInfoList, report);
|
|
|
1054
|
+ if (agreement.compareTo(debtTotal) >= 0) {
|
|
|
1055
|
+ report.setAgreementTotal(valueConvert(debtTotal));
|
|
|
1056
|
+ report.setTimingStatus("约定内");
|
|
|
1057
|
+ return;
|
|
|
1058
|
+ }
|
|
|
1059
|
+ // 一次协调欠款
|
|
|
1060
|
+ BigDecimal firstCoordinate = BigDecimal.ZERO;
|
|
|
1061
|
+ for (ReceiptLedgerInfo ledgerInfo : ledgerInfoList) {
|
|
|
1062
|
+ String customerShortName = report.getCustomerShortName();
|
|
|
1063
|
+ if (!customerShortName.equals(ledgerInfo.getCustomerShortName())) {
|
|
|
1064
|
+ continue;
|
|
|
1065
|
+ }
|
|
|
1066
|
+ BigDecimal startAccountReceivable = ledgerInfo.getStartAccountReceivable();
|
|
|
1067
|
+ String debtStatus = ledgerInfo.getDebtStatus();
|
|
|
1068
|
+ if ("FIRST_COORDINATE".equals(debtStatus)) {
|
|
|
1069
|
+ firstCoordinate = firstCoordinate.add(startAccountReceivable);
|
|
|
1070
|
+ }
|
|
|
1071
|
+ }
|
|
|
1072
|
+ if (firstCoordinate.add(agreement).compareTo(debtTotal) >= 0) {
|
|
|
1073
|
+ BigDecimal difference = debtTotal.subtract(agreement);
|
|
|
1074
|
+ report.setAgreementTotal(valueConvert(agreement));
|
|
|
1075
|
+ report.setFirstCoordinateTotal(valueConvert(difference));
|
|
|
1076
|
+ report.setTimingStatus("超期1");
|
|
|
1077
|
+ return;
|
|
|
1078
|
+ }
|
|
|
1079
|
+ // 二次协调欠款
|
|
|
1080
|
+ BigDecimal secondCoordinate = BigDecimal.ZERO;
|
|
|
1081
|
+ for (ReceiptLedgerInfo ledgerInfo : ledgerInfoList) {
|
|
|
1082
|
+ String customerShortName = report.getCustomerShortName();
|
|
|
1083
|
+ if (!customerShortName.equals(ledgerInfo.getCustomerShortName())) {
|
|
|
1084
|
+ continue;
|
|
|
1085
|
+ }
|
|
|
1086
|
+ BigDecimal startAccountReceivable = ledgerInfo.getStartAccountReceivable();
|
|
|
1087
|
+ String debtStatus = ledgerInfo.getDebtStatus();
|
|
|
1088
|
+ if ("SECOND_COORDINATE".equals(debtStatus)) {
|
|
|
1089
|
+ secondCoordinate = secondCoordinate.add(startAccountReceivable);
|
|
|
1090
|
+ }
|
|
|
1091
|
+ }
|
|
|
1092
|
+ BigDecimal secondCoordinateDifference = debtTotal.subtract(agreement).subtract(firstCoordinate);
|
|
|
1093
|
+ if (secondCoordinate.add(firstCoordinate).add(agreement).compareTo(debtTotal) >= 0) {
|
|
|
1094
|
+ report.setAgreementTotal(valueConvert(agreement));
|
|
|
1095
|
+ report.setFirstCoordinateTotal(valueConvert(firstCoordinate));
|
|
|
1096
|
+ report.setSecondCoordinateTotal(valueConvert(secondCoordinateDifference));
|
|
|
1097
|
+ report.setTimingStatus("超期2");
|
|
|
1098
|
+ return;
|
|
|
1099
|
+ }
|
|
|
1100
|
+ // 清欠阶段欠款
|
|
|
1101
|
+ BigDecimal clearDebt = BigDecimal.ZERO;
|
|
|
1102
|
+ for (ReceiptLedgerInfo ledgerInfo : ledgerInfoList) {
|
|
|
1103
|
+ String customerShortName = report.getCustomerShortName();
|
|
|
1104
|
+ if (!customerShortName.equals(ledgerInfo.getCustomerShortName())) {
|
|
|
1105
|
+ continue;
|
|
|
1106
|
+ }
|
|
|
1107
|
+ BigDecimal startAccountReceivable = ledgerInfo.getStartAccountReceivable();
|
|
|
1108
|
+ String debtStatus = ledgerInfo.getDebtStatus();
|
|
|
1109
|
+ if ("CLEAR_DEBTS".equals(debtStatus)) {
|
|
|
1110
|
+ clearDebt = clearDebt.add(startAccountReceivable);
|
|
|
1111
|
+ }
|
|
|
1112
|
+ }
|
|
|
1113
|
+ report.setAgreementTotal(valueConvert(agreement));
|
|
|
1114
|
+ report.setFirstCoordinateTotal(valueConvert(firstCoordinate));
|
|
|
1115
|
+ report.setSecondCoordinateTotal(valueConvert(secondCoordinate));
|
|
|
1116
|
+ report.setTimingStatus("超期3");
|
|
|
1117
|
+ if (clearDebt.add(secondCoordinate).add(firstCoordinate).add(agreement).compareTo(debtTotal) >= 0) {
|
|
|
1118
|
+ BigDecimal difference = secondCoordinateDifference.subtract(secondCoordinate);
|
|
|
1119
|
+ report.setClearDebtTotal(valueConvert(difference));
|
|
|
1120
|
+ } else {
|
|
|
1121
|
+ report.setClearDebtTotal(valueConvert(clearDebt));
|
|
|
1122
|
+ }
|
|
|
1123
|
+ }
|
|
|
1124
|
+
|
|
|
1125
|
+ /**
|
|
|
1126
|
+ * 获取约定内欠款小计
|
|
|
1127
|
+ *
|
|
|
1128
|
+ * @param ledgerInfoList 应收款台账明细数据
|
|
|
1129
|
+ * @param report 报表数据
|
|
|
1130
|
+ * @return BigDecimal
|
|
|
1131
|
+ */
|
|
|
1132
|
+ private static BigDecimal getAgreementDebt(List<ReceiptLedgerInfo> ledgerInfoList, ReceiptLedgerReportBo report) {
|
|
|
1133
|
+ BigDecimal agreement = BigDecimal.ZERO;
|
|
|
1134
|
+ for (ReceiptLedgerInfo ledgerInfo : ledgerInfoList) {
|
|
|
1135
|
+ String customerShortName = report.getCustomerShortName();
|
|
|
1136
|
+ if (!customerShortName.equals(ledgerInfo.getCustomerShortName())) {
|
|
|
1137
|
+ continue;
|
|
|
1138
|
+ }
|
|
|
1139
|
+ BigDecimal startAccountReceivable = ledgerInfo.getStartAccountReceivable();
|
|
|
1140
|
+ String debtStatus = ledgerInfo.getDebtStatus();
|
|
|
1141
|
+ if ("AGREEMENT".equals(debtStatus) || "SETTLE_UP".equals(debtStatus)) {
|
|
|
1142
|
+ agreement = agreement.add(startAccountReceivable);
|
|
|
1143
|
+ } else if ("DEPOSIT".equals(debtStatus)) {
|
|
|
1144
|
+ BigDecimal endAccountReceivable = ledgerInfo.getEndAccountReceivable();
|
|
|
1145
|
+ agreement = agreement.add(endAccountReceivable.abs());
|
|
|
1146
|
+ }
|
|
|
1147
|
+ }
|
|
|
1148
|
+ return agreement;
|
|
1016
|
1149
|
}
|
|
1017
|
1150
|
|
|
1018
|
1151
|
|
|
...
|
...
|
@@ -1073,8 +1206,12 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge |
|
1073
|
1206
|
}
|
|
1074
|
1207
|
data.setSettleTerm(credit.getCompanySettlementPeriod());
|
|
1075
|
1208
|
}
|
|
1076
|
|
- data.setDeptId(deptId);
|
|
1077
|
|
- data.setRegion(region);
|
|
|
1209
|
+ if (StringUtils.isNotBlank(deptId) && !deptId.equals("null")) {
|
|
|
1210
|
+ data.setDeptId(deptId);
|
|
|
1211
|
+ }
|
|
|
1212
|
+ if (StringUtils.isNotBlank(region) && !region.equals("null")) {
|
|
|
1213
|
+ data.setRegion(region);
|
|
|
1214
|
+ }
|
|
1078
|
1215
|
data.setCustomerId(shipmentsOrderInfo.getCustomerId());
|
|
1079
|
1216
|
data.setShipmentDate(shipmentsOrderInfo.getShipmentsDate());
|
|
1080
|
1217
|
|
...
|
...
|
|