|
@@ -1089,8 +1089,7 @@ public class DailyImportSummaryLogic {
|
|
|
public void summaryReduce(List<SettleDailyReduceCost> reduceList, String opName, String importBatchNo, List<String> ids, AdminUserCom adminUser) {
|
|
|
String doBatchNo = commonLogic.generateNo("ZX", "dailyDoBatch", 13);
|
|
|
List<SettleDailyIssueSummaryRecord> records = new ArrayList<>();
|
|
|
-// List<String> serviceNumberList = new ArrayList<>();
|
|
|
-// List<String> websiteNumberList = new ArrayList<>();
|
|
|
+
|
|
|
List<SettleDailyReduceCost> reduceUpdateList = new ArrayList<>();
|
|
|
|
|
|
for (SettleDailyReduceCost bean : reduceList) {
|
|
@@ -1102,9 +1101,9 @@ public class DailyImportSummaryLogic {
|
|
|
.eq(SettleDailyIssueSummaryRecord::getWebsitNumber, bean.getWebsitNumber())
|
|
|
.orderByDesc(SettleDailyIssueSummaryRecord::getIssueCost)
|
|
|
.last("limit 1"));
|
|
|
- if (issueRecord != null) {
|
|
|
+ if (Objects.nonNull(issueRecord)) {
|
|
|
BigDecimal reduceCost = new BigDecimal(0);
|
|
|
- if (issueRecord.getShouldReduceCost() != null) {
|
|
|
+ if (Objects.nonNull(issueRecord.getShouldReduceCost())) {
|
|
|
reduceCost = reduceCost.add(issueRecord.getShouldReduceCost());
|
|
|
}
|
|
|
reduceCost = reduceCost.add(bean.getTotalFee());
|
|
@@ -1136,26 +1135,14 @@ public class DailyImportSummaryLogic {
|
|
|
issueRecord.setIssueCost(subAmount);
|
|
|
}
|
|
|
records.add(issueRecord);
|
|
|
-// serviceNumberList.add(bean.getWorkerNumber());
|
|
|
-// websiteNumberList.add(bean.getWebsitNumber());
|
|
|
}
|
|
|
}
|
|
|
- if (records.size() == 0) {
|
|
|
+ if (CollectionUtil.isEmpty(records)) {
|
|
|
throw new RemoteServiceException("暂无可扣回的数据");
|
|
|
}
|
|
|
settleDailyIssueSummaryRecordService.updateBatchById(records);
|
|
|
settleDailyReduceCostService.updateBatchById(reduceUpdateList);
|
|
|
-// dailyReduceCostService.lambdaUpdate()
|
|
|
-// .set(DailyReduceCost::getDoBatchNo, doBatchNo)
|
|
|
-// .set(DailyReduceCost::getReduceDate, new Date())
|
|
|
-// .set(DailyReduceCost::getDoTime, new Date())
|
|
|
-// .set(DailyReduceCost::getDoBy, opName)
|
|
|
-// .set(DailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
|
|
|
-// .eq(StringUtils.isNotEmpty(importBatchNo), DailyReduceCost::getImportBatchNo, importBatchNo)
|
|
|
-// .in(ids != null, DailyReduceCost::getId, ids)
|
|
|
-// .in(DailyReduceCost::getWebsitNumber, websiteNumberList)
|
|
|
-// .in(DailyReduceCost::getWorkerNumber, serviceNumberList)
|
|
|
-// .eq(DailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_NOT).update();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@@ -1167,10 +1154,12 @@ public class DailyImportSummaryLogic {
|
|
|
}
|
|
|
String opName = adminUser.getNickName();
|
|
|
List<SettleDailyReduceCost> reduceList = settleDailyReduceCostService.lambdaQuery()
|
|
|
+ .eq(SettleDailyReduceCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
.in(SettleDailyReduceCost::getId, ids)
|
|
|
- .eq(SettleDailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_NOT).list();
|
|
|
+ .eq(SettleDailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_NOT)
|
|
|
+ .list();
|
|
|
|
|
|
- if (reduceList.size() == 0) {
|
|
|
+ if (CollectionUtil.isEmpty(reduceList)) {
|
|
|
throw new RemoteServiceException("暂无可扣回的数据");
|
|
|
}
|
|
|
summaryReduce(reduceList, opName, null, ids, adminUser);
|