Browse Source

更改结算计划

hym 3 years ago
parent
commit
aea2151de0

+ 1 - 1
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/MeasurementInstanceMapper.xml

@@ -44,7 +44,7 @@
         mi.id,mi.total_water_meters,mi.number_of_water_meters_reviewed,mi.billing_period
         mi.id,mi.total_water_meters,mi.number_of_water_meters_reviewed,mi.billing_period
         ,ms.plan_name,mi.clearing_end_date,mi.clearing_start_date,
         ,ms.plan_name,mi.clearing_end_date,mi.clearing_start_date,
                company.ORG_NAME companyOrgName,depart.ORG_NAME deptOrgName,
                company.ORG_NAME companyOrgName,depart.ORG_NAME deptOrgName,
-        commuity.name communityName,mi.checkout_id
+        commuity.name communityName,mi.checkout_id,ms.company_org_id,ms.dept_org_id
         from rmcp_measurement_instance mi  join rmcp_measurement_settlement ms on
         from rmcp_measurement_instance mi  join rmcp_measurement_settlement ms on
             mi.plan_id=ms.id
             mi.plan_id=ms.id
         join rmcp_org company on mi.company_org_id=company.ID
         join rmcp_org company on mi.company_org_id=company.ID

+ 2 - 2
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayChargeSurveyMapper.xml

@@ -558,10 +558,10 @@
         a.plan_id=b.id
         a.plan_id=b.id
         <where>
         <where>
             <if test="startDate != null">
             <if test="startDate != null">
-                and current_period_date &gt;=#{startDate}
+                and DATE_FORMAT( b.billing_period,"%Y-%m") &gt;=#{startDate}
             </if>
             </if>
             <if test="endDate != null">
             <if test="endDate != null">
-                and current_period_date &lt;=#{endDate}
+                and DATE_FORMAT( b.billing_period,"%Y-%m") &lt;=#{endDate}
             </if>
             </if>
             <if test=" companyOrgId!= null">
             <if test=" companyOrgId!= null">
                 and b.company_org_id =#{companyOrgId}
                 and b.company_org_id =#{companyOrgId}

+ 8 - 3
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/MeasurementSettlementServiceImpl.java

@@ -776,7 +776,9 @@ public class MeasurementSettlementServiceImpl implements MeasurementSettlementSe
         Integer month  = DateUtil.getMonth(billingPeriod);
         Integer month  = DateUtil.getMonth(billingPeriod);
         Date startTime = measurementSettlementDto.getClearingStartDate();
         Date startTime = measurementSettlementDto.getClearingStartDate();
         Date endTime = measurementSettlementDto.getClearingEndDate();
         Date endTime = measurementSettlementDto.getClearingEndDate();
+
         measurementSettlementDto.setTenantId(UserUtil.getCurrentUser().getTenantId());
         measurementSettlementDto.setTenantId(UserUtil.getCurrentUser().getTenantId());
+
         //存储本期未结账数据
         //存储本期未结账数据
             this.insertAccountNumber(year,month,startTime,endTime,measurementSettlementDto);
             this.insertAccountNumber(year,month,startTime,endTime,measurementSettlementDto);
             //本期交易未结账数据
             //本期交易未结账数据
@@ -1063,8 +1065,9 @@ public class MeasurementSettlementServiceImpl implements MeasurementSettlementSe
             transactionSurver.setCreateDate(LocalDateTime.now());
             transactionSurver.setCreateDate(LocalDateTime.now());
             transactionSurver.setUpdateBy(loginUser.getUsername());
             transactionSurver.setUpdateBy(loginUser.getUsername());
             transactionSurver.setUpdateDate(LocalDateTime.now());
             transactionSurver.setUpdateDate(LocalDateTime.now());
-
-
+            transactionSurver.setTenantId(loginUser.getTenantId());
+            transactionSurver.setCompanyOrgId(measurementSettlementDto.getCompanyOrgId());
+            transactionSurver.setDeptOrgId(measurementSettlementDto.getDeptOrgId());
             payChargeSurveyMapper.insertTransaction(transactionSurver);
             payChargeSurveyMapper.insertTransaction(transactionSurver);
 
 
         }catch (Exception e) {
         }catch (Exception e) {
@@ -1136,7 +1139,9 @@ public class MeasurementSettlementServiceImpl implements MeasurementSettlementSe
             account.setCreateDate(LocalDateTime.now());
             account.setCreateDate(LocalDateTime.now());
             account.setUpdateBy(loginUser.getUsername());
             account.setUpdateBy(loginUser.getUsername());
             account.setUpdateDate(LocalDateTime.now());
             account.setUpdateDate(LocalDateTime.now());
-
+            account.setTenantId(loginUser.getTenantId());
+            account.setCompanyOrgId(measurementSettlementDto.getCompanyOrgId());
+            account.setDeptOrgId(measurementSettlementDto.getDeptOrgId());
             //保存记录
             //保存记录
             payChargeSurveyMapper.insertAccountNumber(account);
             payChargeSurveyMapper.insertAccountNumber(account);
         }catch (Exception e) {
         }catch (Exception e) {