|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
|
|
|
import com.rongwe.zhsw.system.domain.SwUserManagementDo;
|
|
|
import com.rongwe.zhsw.system.domain.SwWaterUsageEntryDo;
|
|
|
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
import com.rongwei.zhsw.system.utils.ZHSWCommonUtils;
|
|
@@ -51,11 +52,13 @@ public class BillGenerationServiceImpl {
|
|
|
}
|
|
|
|
|
|
public void generateBill(List<SwWaterUsageEntryDo> swWaterUsageEntryDoList) {
|
|
|
- log.info("开始生成账单信息");
|
|
|
+ SysUserVo currentUser = ZHSWCommonUtils.getCurrentUser();
|
|
|
+ log.info("当前生成账单的用户:{},所属的租户库为:{}",currentUser.getAccount(),currentUser.getTenantDo().getDskey());
|
|
|
if (swWaterUsageEntryDoList == null || swWaterUsageEntryDoList.isEmpty()) {
|
|
|
log.error("暂无需要生成账单的信息");
|
|
|
return;
|
|
|
}
|
|
|
+ log.debug("需要生成账单的抄表记录为:{}",swWaterUsageEntryDoList);
|
|
|
// 对数据按照抄表日期排序
|
|
|
List<SwWaterUsageEntryDo> collect = swWaterUsageEntryDoList.stream()
|
|
|
.sorted(Comparator.comparing(SwWaterUsageEntryDo::getCurrentreadingdate))
|
|
@@ -144,26 +147,30 @@ public class BillGenerationServiceImpl {
|
|
|
dataSave(saveList, saveUsageEntryList, userSaveList);
|
|
|
}
|
|
|
|
|
|
- @Async(value = "customThreadPool")
|
|
|
+ @Async(value = "zhswThreadPool")
|
|
|
public void generateBill(String id) {
|
|
|
+ log.info("开始给抄表记录:{},生成账单信息",id);
|
|
|
+
|
|
|
SwWaterUsageEntryDo swWaterUsageEntryDo = swWaterUsageEntryService.getById(id);
|
|
|
this.generateBill(Collections.singletonList(swWaterUsageEntryDo));
|
|
|
}
|
|
|
|
|
|
- @Async(value = "customThreadPool")
|
|
|
+ @Async(value = "zhswThreadPool")
|
|
|
public void generateBill(List<String> ids, boolean a) {
|
|
|
if (ids.isEmpty()) {
|
|
|
log.error("抄表记录ID为空");
|
|
|
return;
|
|
|
}
|
|
|
+ log.info("开始给抄表记录:{},生成账单信息",ids);
|
|
|
this.generateBill(swWaterUsageEntryService.getBaseMapper().selectBatchIds(ids));
|
|
|
}
|
|
|
|
|
|
- @Async(value = "customThreadPool")
|
|
|
+ @Async(value = "zhswThreadPool")
|
|
|
public void generateBill() {
|
|
|
List<SwWaterUsageEntryDo> list = swWaterUsageEntryService.list(new LambdaQueryWrapper<SwWaterUsageEntryDo>()
|
|
|
.eq(SwWaterUsageEntryDo::getDeleted, "0")
|
|
|
.eq(SwWaterUsageEntryDo::getState, 0));
|
|
|
+ log.info("开始给抄表记录:{},生成账单信息",list.stream().map(SwWaterUsageEntryDo::getId).collect(Collectors.toList()));
|
|
|
this.generateBill(list);
|
|
|
}
|
|
|
|