|
@@ -2,20 +2,18 @@ package com.rongwei.zhsw.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.rongwei.zhsw.dao.SwBillManagementUnpaidDao;
|
|
|
-import com.rongwei.zhsw.service.SwBillManagementUnpaidService;
|
|
|
+import com.rongwe.zhsw.domain.SwBillManagementUnpaidDo;
|
|
|
import com.rongwe.zhsw.domain.SwMeterReadingCorrectionDo;
|
|
|
-import com.rongwe.zhsw.domain.SwUserManagement;
|
|
|
+import com.rongwe.zhsw.domain.SwUserManagementDo;
|
|
|
import com.rongwe.zhsw.domain.SwWaterUsageEntryDo;
|
|
|
import com.rongwe.zhsw.dto.MeterReadingCorrectionDTO;
|
|
|
import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
-import com.rongwei.zhsw.sys.dao.SwBillManagementUnpaidDao;
|
|
|
-import com.rongwei.zhsw.sys.service.SwBillManagementUnpaidService;
|
|
|
-import com.rongwe.zhsw.domain.SwBillManagementUnpaidDo;
|
|
|
+import com.rongwei.zhsw.dao.SwBillManagementUnpaidDao;
|
|
|
+import com.rongwei.zhsw.service.SwBillManagementUnpaidService;
|
|
|
+import com.rongwei.zhsw.service.SwUserManagementService;
|
|
|
import com.rongwei.zhsw.sys.service.SwMeterReadingCorrectionService;
|
|
|
-import com.rongwei.zhsw.sys.service.SwUserManagementService;
|
|
|
import com.rongwei.zhsw.sys.service.SwWaterUsageEntryService;
|
|
|
import com.rongwei.zhsw.utils.ZhswCommonUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -34,27 +32,29 @@ import static com.rongwei.zhsw.utils.SaveConstans.billReccord.HAVEREVISEDSTATUS;
|
|
|
* @since 2025-03-07 16:49:13
|
|
|
*/
|
|
|
@Service
|
|
|
-public class SwBillManagementUnpaidServiceImpl extends ServiceImpl<SwBillManagementUnpaidDao, SwBillManagementUnpaidDo>
|
|
|
- implements SwBillManagementUnpaidService {
|
|
|
+public class SwBillManagementUnpaidServiceImpl extends ServiceImpl<SwBillManagementUnpaidDao, SwBillManagementUnpaidDo>
|
|
|
+ implements SwBillManagementUnpaidService {
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
SwUserManagementService swUserManagementService;
|
|
|
|
|
|
@Autowired
|
|
|
- SwWaterUsageEntryService swWaterUsageEntryService;
|
|
|
+ SwWaterUsageEntryService swWaterUsageEntryService;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
- SwBillManagementUnpaidService swBillManagementUnpaidService;
|
|
|
+ SwBillManagementUnpaidService swBillManagementUnpaidService;
|
|
|
|
|
|
@Autowired
|
|
|
SwMeterReadingCorrectionService swMeterReadingCorrectionService;
|
|
|
+
|
|
|
/**
|
|
|
* 抄表修正
|
|
|
- * 1、将 对应抄表记录更新,本次抄表数 更新
|
|
|
- * 2、将 对应用户表中 对应的【最近抄表读数】进行更新
|
|
|
- * 3、将 对应的这笔账单的 相关计费信息更新
|
|
|
+ * 1、将 对应抄表记录更新,本次抄表数 更新
|
|
|
+ * 2、将 对应用户表中 对应的【最近抄表读数】进行更新
|
|
|
+ * 3、将 对应的这笔账单的 相关计费信息更新
|
|
|
+ *
|
|
|
* @param meterReadId
|
|
|
* @param billId
|
|
|
* @param thisMeterReading
|
|
@@ -76,12 +76,14 @@ public class SwBillManagementUnpaidServiceImpl extends ServiceImpl<SwBillManage
|
|
|
|
|
|
BigDecimal oldreading = swWaterUsageEntryDo.getThisreading();
|
|
|
swWaterUsageEntryDo.setThisreading(thisMeterReading)
|
|
|
- .setModifyuserid(currentUser.getId()).setModifyusername(currentUser.getName()).setModifydate(new Date());
|
|
|
+ .setModifyuserid(currentUser.getId()).setModifyusername(currentUser.getName()).setModifydate(new Date());
|
|
|
|
|
|
swWaterUsageEntryService.updateById(swWaterUsageEntryDo);
|
|
|
|
|
|
//2. 根据抄表户号查询用户修改最近读表数
|
|
|
- SwUserManagement swUserManagement = swUserManagementService.getBaseMapper().selectOne(new LambdaQueryWrapper<SwUserManagement>().eq(SwUserManagement::getUsernumber, swWaterUsageEntryDo.getUsernumber()));
|
|
|
+ SwUserManagementDo swUserManagement = swUserManagementService.getBaseMapper()
|
|
|
+ .selectOne(new LambdaQueryWrapper<SwUserManagementDo>()
|
|
|
+ .eq(SwUserManagementDo::getUsernumber, swWaterUsageEntryDo.getUsernumber()));
|
|
|
swUserManagement.setLastmeterreading(thisMeterReading);
|
|
|
swUserManagement.setModifyuserid(currentUser.getId());
|
|
|
swUserManagement.setModifyusername(currentUser.getName());
|
|
@@ -93,7 +95,7 @@ public class SwBillManagementUnpaidServiceImpl extends ServiceImpl<SwBillManage
|
|
|
//【本次抄表数】对应更新
|
|
|
unpaidDo.setThismeterreading(thisMeterReading);
|
|
|
//【当期用水量】=【更新后本次抄表数】-【上次抄表数】
|
|
|
- unpaidDo.setCurrentwateruse(thisMeterReading.subtract(unpaidDo.getLastmeterreading()==null?BigDecimal.ZERO:unpaidDo.getLastmeterreading()));
|
|
|
+ unpaidDo.setCurrentwateruse(thisMeterReading.subtract(unpaidDo.getLastmeterreading() == null ? BigDecimal.ZERO : unpaidDo.getLastmeterreading()));
|
|
|
//【原应缴】=【单价】*【当期用水量】
|
|
|
unpaidDo.setOughttohavepaid(unpaidDo.getUnitprice().multiply(unpaidDo.getCurrentwateruse()));
|
|
|
//更新未已修正状态
|
|
@@ -118,5 +120,4 @@ public class SwBillManagementUnpaidServiceImpl extends ServiceImpl<SwBillManage
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|