Przeglądaj źródła

Merge remote-tracking branch 'origin/20210716' into 20210716

lihui001 3 lat temu
rodzic
commit
ccdf84841b
51 zmienionych plików z 277 dodań i 298 usunięć
  1. 1 1
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayBaseConfigMapper.java
  2. 1 1
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayInvoiceParamMapper.java
  3. 4 3
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayMessagesendrecordMapper.java
  4. 1 1
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayMessagetemplateMapper.java
  5. 1 1
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayRechargeaccountMapper.java
  6. 3 2
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayReportMapper.java
  7. 1 1
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/archives/PayBaseCustomerandmeterrelaMapper.java
  8. 1 1
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dto/pay/PayMessageTemplateDto.java
  9. 1 0
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dto/pay/PayMessagesendrecordDto.java
  10. 1 0
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/entity/pay/PayInvoiceParam.java
  11. 3 0
      zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/entity/pay/PayInvoiceprinted.java
  12. 6 6
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml
  13. 1 1
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/MeasurementInstanceMapper.xml
  14. 1 1
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayBaseAccountMapper.xml
  15. 2 2
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayBaseConfigMapper.xml
  16. 1 1
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayBaseWatercategoryMapper.xml
  17. 5 4
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayInvoiceParamMapper.xml
  18. 6 2
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayInvoicePrintMapper.xml
  19. 44 34
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayMessagesendrecordMapper.xml
  20. 3 5
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayMessagetemplateMapper.xml
  21. 5 3
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayPayReceivableMapper.xml
  22. 3 5
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayPayReceivedMapper.xml
  23. 1 1
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayPenaltyrecordMapper.xml
  24. 3 5
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayRechargeaccountMapper.xml
  25. 10 17
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayReportMapper.xml
  26. 5 4
      zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/payFeeMapper.xml
  27. 2 1
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/job/EstimateMsgSendJob.java
  28. 4 5
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/job/EstimatedValveJob.java
  29. 2 3
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/job/MessageSendJob.java
  30. 2 2
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/service/EstimateMsgSendService.java
  31. 2 2
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/service/EstimatedValveService.java
  32. 18 15
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/service/impl/EstimateMsgSendServiceImpl.java
  33. 19 15
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/service/impl/EstimatedValveServiceImpl.java
  34. 12 18
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/AmountWaterUsedAmountServiceImpl.java
  35. 20 21
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/IssueElectronicInvoiceServiceImpl.java
  36. 3 3
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayBaseConfigServiceImpl.java
  37. 2 2
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayChargeSurveyServiceImpl.java
  38. 12 15
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayInvoiceParamServiceImpl.java
  39. 1 8
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayInvoicePrintServiceImpl.java
  40. 41 49
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayMessagesendrecordServiceImp.java
  41. 8 18
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayMessagetemplateServiceImp.java
  42. 1 2
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayPayAgentbranchServiceImpl.java
  43. 1 2
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayPayReceivedServiceImpl.java
  44. 3 5
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayReceivableServiceImpl.java
  45. 3 3
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayReportServiceImpl.java
  46. 1 1
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PrintInvoiceQueryResultServiceImpl.java
  47. 2 2
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/AmountWaterUsedAmountService.java
  48. 1 1
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/PayBaseConfigService.java
  49. 1 1
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/PayInvoiceParamService.java
  50. 1 1
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/PayMessagesendrecordService.java
  51. 1 1
      zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/archives/impl/PayBaseCustomerandmeterrelaServiceImpl.java

+ 1 - 1
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayBaseConfigMapper.java

@@ -15,7 +15,7 @@ public interface PayBaseConfigMapper {
 
     List<PayBaseConfigDto> getAllList(@Param("name") String name, @Param("cnname") String cnname, @Param("tenantId") String tenantId);
 
-    List<PayBaseConfigDto> getNameCnname(@Param("queryInfo") String queryInfo, @Param("sitId") Integer sitId, @Param("customerId") Integer customerId);
+    List<PayBaseConfigDto> getNameCnname(@Param("queryInfo") String queryInfo,  @Param("tenantId") String tenantId);
 
     @Insert("insert into pay_base_config(value,name,cnname,type,create_by,create_date,update_by,update_date,remarks,del_flag,site_id,customer_id) values(#{value},#{name},#{cnname},#{type},#{create_by},#{create_date},#{update_by},#{update_date},#{remarks},#{del_flag},#{site_id},#{customer_id}) ")
     int insertList(PayBaseConfig payBaseConfig);

+ 1 - 1
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayInvoiceParamMapper.java

@@ -22,5 +22,5 @@ public interface PayInvoiceParamMapper {
 
     int update(@Param("payInvoiceParam") PayInvoiceParam payInvoiceParam);
 
-    List<PayInvoiceParam> findList(@Param("queryparam") String queryparam, @Param("siteId") BigInteger siteId, @Param("customerId") BigInteger customerId);
+    List<PayInvoiceParam> findList(@Param("queryparam") String queryparam, @Param("tenantId") String tenantId);
 }

+ 4 - 3
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayMessagesendrecordMapper.java

@@ -1,5 +1,6 @@
 package com.zcxk.rmcp.pay.dao.pay;
 
+import com.zcxk.core.common.pojo.UserCondition;
 import com.zcxk.rmcp.pay.dto.pay.PayDebtMessageDto;
 import com.zcxk.rmcp.pay.dto.pay.PayMessagesendrecordDto;
 import com.zcxk.rmcp.pay.entity.ProgramItem;
@@ -33,7 +34,7 @@ public interface PayMessagesendrecordMapper {
             @Param("beginDebtFee") BigDecimal beginDebtFee,
             @Param("endDebtFee") BigDecimal endDebtFee,
             @Param("accountIds") List<BigInteger> accountIds,
-            @Param("siteId") Integer siteId,
-            @Param("customerId") Integer customerId,
-            @Param("programItems") List<ProgramItem> programItems);
+            @Param("tenantId") String tenantId,
+            @Param("userCondition") UserCondition userCondition
+         );
 }

+ 1 - 1
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayMessagetemplateMapper.java

@@ -18,6 +18,6 @@ public interface PayMessagetemplateMapper {
     void insert(PayMessageTemplateDto payMessageTemplateDto);
     void update(PayMessageTemplateDto payMessageTemplateDto);
     void delete(@Param("id") BigInteger id);
-    PayMessageTemplateDto get(@Param("siteId") BigInteger siteId, @Param("customerId") BigInteger customerId, @Param("sendType") Integer sendType, @Param("operationType") Integer operationType);
+    PayMessageTemplateDto get(@Param("tenantId") String tenantId, @Param("sendType") Integer sendType, @Param("operationType") Integer operationType);
     List<PayMessageTemplateDto> getAllMessageTemplate(PayMessageTemplateDto payMessageTemplateDto);
 }

+ 1 - 1
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayRechargeaccountMapper.java

@@ -37,5 +37,5 @@ public interface PayRechargeaccountMapper {
 
     void updateBalance(@Param("balance") BigDecimal balance, @Param("readdate") String readdate, @Param("id") BigInteger id);
 
-    public List<PayRechargeaccountDto> getEstimateBalance(@Param("siteId") Integer siteId, @Param("customerId") Integer customerId);
+    public List<PayRechargeaccountDto> getEstimateBalance(@Param("tenantId") String tenantId);
 }

+ 3 - 2
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/PayReportMapper.java

@@ -1,5 +1,6 @@
 package com.zcxk.rmcp.pay.dao.pay;
 
+import com.zcxk.core.common.pojo.UserCondition;
 import com.zcxk.rmcp.pay.dto.pay.PayArrearagedetailsReportDto;
 import com.zcxk.rmcp.pay.dto.pay.PayOperatordetailsReportDto;
 import com.zcxk.rmcp.pay.dto.pay.PayTransactiondetailsReportDto;
@@ -25,8 +26,8 @@ public interface PayReportMapper {
 
     List<PayWaterPropertyReportDto> getWaterPropertySaleReport(PayWaterPropertyReportDto inParams);
 
-    List<PayWaterPropertyReportDto> getTranInfoReport(@Param("inParams") PayWaterPropertyReport inParams);
-    List<PayWaterPropertyReportDto> getReceviceInfoReport(@Param("inParams") PayWaterPropertyReport inParams);
+    List<PayWaterPropertyReportDto> getTranInfoReport(@Param("inParams") PayWaterPropertyReport inParams, UserCondition userCondition);
+    List<PayWaterPropertyReportDto> getReceviceInfoReport(@Param("inParams") PayWaterPropertyReport inParams, UserCondition userCondition);
 
 
 }

+ 1 - 1
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dao/pay/archives/PayBaseCustomerandmeterrelaMapper.java

@@ -66,7 +66,7 @@ public interface PayBaseCustomerandmeterrelaMapper {
 
     public List<MeterListInfo> queryMetercode(@Param("siteId") Integer siteId, @Param("customerId") Integer customerId);
     public List<PayAccountInfo> selectAccountMeterInfo(@Param("tenantId") String tenantId, @Param("metercode") String metercode);
-    public List<PayAccountInfo> selectMeterElenoMeterInfo(@Param("siteId") Integer siteId, @Param("customerId") Integer customerId, @Param("metereleno") String metereleno);
+    public List<PayAccountInfo> selectMeterElenoMeterInfo(@Param("tenantId") String tenantId, @Param("metereleno") String metereleno);
 
     public int updateAccountInfo(@Param("accountname") String accountname, @Param("accountnumber") String accountnumber, @Param("metercode") String metercode, @Param("idtype") Integer idtype,
                                  @Param("idcardno") String idcardno, @Param("telephone") String telephone, @Param("officeId") BigInteger officeId,

+ 1 - 1
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dto/pay/PayMessageTemplateDto.java

@@ -59,7 +59,7 @@ public class PayMessageTemplateDto extends BaseDto {
 
     @ApiModelProperty(value = "时间格式:HH:mm:ss或者HH:mm")
     private String sendTime;
-
+    private String tenantId;
 
     //发送短信钱校验短信配置是否有空值
     public Boolean checkMessage(){

+ 1 - 0
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/dto/pay/PayMessagesendrecordDto.java

@@ -47,6 +47,7 @@ public class PayMessagesendrecordDto extends BaseDto {
     private LocalDate beginDate;//开始时间
     @ApiModelProperty(value = "结束时间" ,  hidden = true)
     private LocalDate endDate;//结束时间
+    private String tenantId;
 
 
 }

+ 1 - 0
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/entity/pay/PayInvoiceParam.java

@@ -48,4 +48,5 @@ public class PayInvoiceParam extends  PayBaseInfo {
     @JsonIgnore
     @ApiModelProperty(value = "查询字段(收费项目或税收分类编码)")
     private String queryparam;
+    private String tenantId;
 }

+ 3 - 0
zoniot-pay/zoniot-pay-core/src/main/java/com/zcxk/rmcp/pay/entity/pay/PayInvoiceprinted.java

@@ -88,6 +88,9 @@ public class PayInvoiceprinted extends PayBaseInfo {
 	private  Integer month;
 	@ApiModelProperty(value = "邮箱")
 	private  String email;
+	private String tenantId;
+	private Integer companyId;
+	private Integer departmentId;
 }
 
 

+ 6 - 6
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml

@@ -470,8 +470,8 @@
             <!--<if test="siteId != null">
                 and  account.site_id = #{siteId}
             </if>-->
-            <if test="customerId != null">
-                and account.customer_id = #{customerId}
+            <if test="tenantId != null">
+                and account.tenant_id = #{tenantId}
             </if>
             order by account.create_date desc
         </where>
@@ -490,8 +490,8 @@
             device.water_meter_no as "metereleno",
             c.valve_rule_id as "valveRuleId"
         from pay_base_account account
-        left join pay_base_customerandmeterrela c on account.id = c.account_id and c.customer_id =#{customerId}
-        inner join sc_device device on account.id = device.account_id and device.customer_id =#{customerId}
+        left join pay_base_customerandmeterrela c on account.id = c.account_id
+        inner join sc_device device on account.id = device.account_id
         <where>
             device.id not in(select watermeter_id from pay_base_customerandmeterrela where businessstate = '1')
             and device.water_meter_no is not null
@@ -501,8 +501,8 @@
             <!--<if test="siteId != null">
                 and  account.site_id = #{siteId}
             </if>-->
-            <if test="customerId != null">
-                and account.customer_id = #{customerId}
+            <if test="tenantId != null">
+                and account.tenant_id = #{tenantId}
             </if>
             order by account.create_date desc
         </where>

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

@@ -195,7 +195,7 @@
     <select id="findHistory" resultType="com.zcxk.rmcp.pay.entity.pay.MeasurementInstance">
         select * from rmcp_measurement_instance
         <where>
-             status=1
+             status=1 and billing_period is not null
             <if test="id !=null">
                 and plan_id=#{id}
             </if>

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

@@ -410,7 +410,7 @@
 			ptrans.paywayLabel as paywayName,
             pagent.order_no orderNo
         from pay_pay_transactiondetails ptrans
-        left join pay_pay_agenttransaction pagent on pagent.payseriesno = ptrans.payseriesno and pagent.site_id=#{siteId} and pagent.customer_id=#{customerId}
+        left join pay_pay_agenttransaction pagent on pagent.payseriesno = ptrans.payseriesno and pagent.tenant_id=#{tenantId}
         where
             ptrans.accountnumber=#{accountnumber}
             and ptrans.`year`=#{year}

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

@@ -44,9 +44,9 @@
         from pay_base_config config
         left join sc_user su on config.create_by=su.id
         left join sc_user su2 on config.update_by = su2.id
-        left join pay_sys_dict psd on psd.value = config.type and psd.type='系统参数类型' and psd.site_id=#{sitId} and psd.customer_id=#{customerId}
+        left join pay_sys_dict psd on psd.value = config.type and psd.type='系统参数类型' and psd.tenant_id=#{tenantId}
         where config.del_flag='0'
-        and config.site_id = #{sitId} and config.customer_id = #{customerId}
+        and config.tenant_id=#{tenantId}
         <if test ="queryInfo != null and queryInfo != '' "> and (config.name  LIKE concat('%',#{queryInfo},'%') or config.cnname  LIKE concat('%',#{queryInfo},'%') )</if>
         order by config.create_date desc
     </select>

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

@@ -73,7 +73,7 @@
             <if test="1 == 1 "> pbw.del_flag='0' </if>
             <if test="tenantId != null"> and pbw.tenant_id=#{tenantId}</if>
             <if test="name != null"> and pbw.`name` like concat('%',#{name,jdbcType = VARCHAR} ,'%') </if>
-            <include refid="permissionCondition"/>
+
         </where>
         order by pbw.create_date desc
     </select>

+ 5 - 4
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayInvoiceParamMapper.xml

@@ -39,8 +39,8 @@
         param.othermanger,
         dict.label as feetypename
         from pay_invoice_param param
-        inner join pay_sys_dict dict on dict.type='收费类型' and dict.site_id=#{siteId} and dict.customer_id=#{customerId} and dict.value=param.feetype
-        where param.del_flag='0' and param.site_id=#{siteId} and param.customer_id=#{customerId}
+        inner join pay_sys_dict dict on dict.type='收费类型' and dict.tenant_id=#{tenantId} and dict.value=param.feetype
+        where param.del_flag='0' and param.tenant_id=#{tenantId}
         <if test="queryparam != null">
            and  (dict.label like concat('%',#{queryparam},'%') or param.goodstaxno like concat('%',#{queryparam},'%'))
         </if>
@@ -115,7 +115,7 @@
         remarks,
         del_flag,
         site_id,
-        customer_id)
+        customer_id,tenant_id)
         values
         <foreach collection="list" item="payInvoiceParam" separator=",">
             (
@@ -138,7 +138,8 @@
         #{payInvoiceParam.remarks},
         #{payInvoiceParam.delFlag},
         #{payInvoiceParam.siteId},
-        #{payInvoiceParam.customerId})
+        #{payInvoiceParam.customerId},
+        #{payInvoiceParam.tenantId})
         </foreach>
     </insert>
 </mapper>

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

@@ -43,6 +43,7 @@
             year,
             month,
             email
+			,tenant_id,company_org_id,dept_org_id
 		) VALUES (
 			#{printNo},
 			#{oldInvoiceCode},
@@ -83,7 +84,10 @@
             #{saleIdentity},
             #{year},
             #{month},
-            #{email}
+            #{email},
+			#{tenantId},
+			#{companyOrgId},
+			#{deptOrgId}
 		)
     </insert>
     <select id="findInvoiceByPayseriesno" resultType="com.zcxk.rmcp.pay.entity.pay.PayInvoiceprinted">
@@ -118,7 +122,7 @@
 	<select id="findListByState" resultType="com.zcxk.rmcp.pay.entity.pay.PayInvoiceprinted">
 	SELECT a.invoice_code as invoiceCode,a.invoice_no as invoiceNo,a.id as id,a.usercode as userCode,
 		   a.cancelinvoice_id as cancelInvoiceId,a.fpqqlsh as fpqqlsh,a.saleidentity as saleIdentity,
-		   a.invoice_type as invoiceType,a.customer_id as customerId,a.site_id as siteId
+		   a.invoice_type as invoiceType,a.customer_id as customerId,a.site_id as siteId,tenant_id
 	from pay_invoice_printed a
 	where a.state=0 or a.state=2
 	</select>

+ 44 - 34
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayMessagesendrecordMapper.xml

@@ -21,7 +21,7 @@
             content,
             type,
             mobilephone,
-            state
+            state,tenant_id
         )
         values(
             #{siteId},
@@ -41,7 +41,8 @@
             #{content},
             #{type},
             #{mobilephone},
-            #{state}
+            #{state},
+            #{tenantId}
         )
     </insert>
 
@@ -78,12 +79,7 @@
                 or a.content like concat('%',#{condition},'%')
                 )
             </if>
-            <if test="siteId != null">
-                and a.site_id=#{siteId}
-            </if>
-            <if test="customerId != null">
-                and a.customer_id=#{customerId}
-            </if>
+
             <if test="year != null">
                 and a.year=#{year}
             </if>
@@ -93,13 +89,7 @@
             <if test="type != null">
                 and a.type=#{type}
             </if>
-            <if test="programItems != null and programItems.size() != 0">
-                and   <foreach collection="programItems" item="item" open="(" separator=" or " close=")">
-                <if test="item.dimensionId == 10">
-                    cust.${item.dimensionCode} = #{item.dimensionValue}
-                </if>
-            </foreach>
-            </if>
+
         </where>
         order by a.create_date desc
     </select>
@@ -136,12 +126,10 @@
             sum(debt) countfee
             from pay_pay_receivable re
             <where>
-                <if test="siteId != null">
-                    and site_id=#{siteId}
-                </if>
-                <if test="customerId != null">
-                    and customer_id=#{customerId}
+                <if test="tenantId != null">
+                    and tenant_id=#{tenantId}
                 </if>
+
             </where>
             group by account_id
         ) a on account.id=a.account_id
@@ -150,11 +138,8 @@
             select account_id,count(1) sendNum,max(create_date) create_date from pay_pay_messagesendrecord
             <where>
                 year= #{year} and month = #{month}
-                <if test="siteId != null">
-                    and site_id=#{siteId}
-                </if>
-                <if test="customerId != null">
-                    and customer_id=#{customerId}
+                <if test="tenantId != null">
+                    and tenant_id=#{tenantId}
                 </if>
             </where>
             group by account_id
@@ -180,21 +165,46 @@
             <if test="endDebtFee != null">
                 and a.countfee &lt;= #{endDebtFee}
             </if>
-            <if test="siteId != null">
-                and account.site_id=#{siteId}
-            </if>
-            <if test="customerId != null">
-                and account.customer_id=#{customerId}
-            </if>
-            <if test="programItems != null and programItems.size() != 0">
+
+           <!-- <if test="programItems != null and programItems.size() != 0">
                 and   <foreach collection="programItems" item="item" open="(" separator=" or " close=")">
                 <if test="item.dimensionId == 10">
                     cust.${item.dimensionCode} = #{item.dimensionValue}
                 </if>
             </foreach>
-            </if>
+            </if>-->
+        <include refid="permissionCondition"></include>
         </where>
         order by msg.create_date desc
     </select>
-
+    <sql id="permissionCondition">
+        <if test="userCondition.tenantId != null">and account.tenant_id = #{userCondition.tenantId}</if>
+        <if test="userCondition.userType!=null and userCondition.userType!=-999 and userCondition.userType!=-9999 and  userCondition.programItems != null and userCondition.programItems.size() > 0">
+            <if test="userCondition.permissionType == 5 or userCondition.permissionType == 2">
+                and ( account.dept_org_id in
+                <foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+                    #{item.orgId}
+                </foreach>
+                or
+                account.company_org_id in
+                <foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+                    #{item.orgId}
+                </foreach>
+                )
+            </if>
+            <if test="userCondition.permissionType == 4 or userCondition.permissionType == 3">
+                and account.dept_org_id in
+                <foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+                    #{item.orgId}
+                </foreach>
+            </if>
+            <if test="userCondition.permissionType == 1">
+                and account.company_org_id in
+                <foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+                    #{item.orgId}
+                </foreach>
+                and (account.dept_org_id is null or account.dept_org_id =0)
+            </if>
+        </if>
+    </sql>
 </mapper>

+ 3 - 5
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayMessagetemplateMapper.xml

@@ -145,12 +145,10 @@
             a.operation_type as "operationType"
         from pay_pay_messagetemplate a
         <where>
-            <if test="siteId != null">
-                and a.site_id=#{siteId}
-            </if>
-            <if test="customerId != null">
-                and a.customer_id=#{customerId}
+            <if test="tenantId != null">
+                and a.tenant_id=#{tenantId}
             </if>
+
             <if test="sendType != null">
                 and a.send_type=#{sendType}
             </if>

+ 5 - 3
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayPayReceivableMapper.xml

@@ -160,7 +160,9 @@
     <select id="findListInfo" resultType="com.zcxk.rmcp.pay.dto.pay.PayPayReceivableDto">
         SELECT
             id as "id",
-            CONCAT(rece.year,'年',LPAD(rece.month, 2, 0),'月',(select label from pay_sys_dict where type = '收费类型' and value = rece.feetype and site_id =#{siteId} and customer_id =#{customerId})) AS "payitemname",
+            CONCAT(rece.year,'年',LPAD(rece.month, 2, 0),'月',(select label from pay_sys_dict where type = '收费类型'
+                        and value = rece.feetype and tenant_id =#{tenantId} ))
+                AS "payitemname",
             accountnumber AS "accountnumber",
             accountname AS "accountname",
             CASE
@@ -194,8 +196,8 @@
         FROM
         pay_pay_receivable rece
         <where>
-            <if test="siteId != null">
-                and site_id=#{siteId}
+            <if test="tenantId != null">
+                and tenant_id=#{tenantId}
             </if>
             <if test="beginDate != null">
                 and rece.create_date &gt;=#{beginDate}

+ 3 - 5
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayPayReceivedMapper.xml

@@ -34,12 +34,10 @@
         left join pay_base_watercategory groy on groy.id = pro.category_id
         left join sc_user users on users.id = rece.create_by
         <where>
-            <if test="siteId != null">
-                and rece.site_id=#{siteId}
-            </if>
-            <if test="customerId != null">
-                and rece.customer_id=#{customerId}
+            <if test="tenantId != null">
+                and rece.tenant_id=#{tenantId}
             </if>
+
             <if test="payseriesno != null">
                 and rece.payseriesno =#{payseriesno}
             </if>

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

@@ -15,7 +15,7 @@
             feetype = 6
 
             <if test="payPenaltyrecordDto.tenantId != null">
-                and rece.tenant_id=#{tenantId}
+                and rece.tenant_id=#{payPenaltyrecordDto.tenantId}
             </if>
             <if test="payPenaltyrecordDto.condition != null">
                 and

+ 3 - 5
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayRechargeaccountMapper.xml

@@ -265,12 +265,10 @@
         from pay_pay_rechargeaccount a
         <where>
             balance &lt; 0
-            <if test="siteId != null">
-                and a.site_id =#{siteId}
-            </if>
-            <if test="customerId != null">
-                and a.customer_id =#{customerId}
+            <if test="tenantId != null">
+                and a.balance =#{tenantId}
             </if>
+
         </where>
     </select>
 

+ 10 - 17
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/PayReportMapper.xml

@@ -129,11 +129,11 @@
         pba.address as accountAddr,
         scc.`name` communityName,
         SUM(ppt.receivedamount) receivedCount,
-        max(ifnull(ppt.transamount,0)) transamount,
+        max(ifnull(ppr.transamount,0)) transamount,
         sum(ppt.receivedamount)  + max(ifnull(ppr.transamount,0))  subtotal,
         min(ppt.create_date) transTime,
         min(scu.`name`) createByName,
-        ppt.payseriesno
+        ppr.payseriesno
         FROM pay_pay_received ppt
         LEFT JOIN pay_base_account pba on ppt.account_id = pba.id
         LEFT JOIN sc_community scc on scc.`code` = substring(pba.accountnumber,1,3) and scc.`status`=1
@@ -165,8 +165,8 @@
             min(scu.`name`) createByName,
             ppt.payseriesno
         FROM pay_pay_transactiondetails ppt
-        LEFT JOIN pay_base_account pba on ppr.account_id = pba.id
-        LEFT JOIN sc_community scc on scc.`code` = substring(ppr.accountnumber,1,3)
+        LEFT JOIN pay_base_account pba on ppt.account_id = pba.id
+        LEFT JOIN sc_community scc on scc.`code` = substring(ppt.accountnumber,1,3)
             and scc.`status`=1 and scc.tenant_id = #{tenantId}
         LEFT JOIN sc_user scu on scu.id = ppt.create_by
         WHERE ppt.canceledrecord_id is null and ppt.iscanceled =0 and ppt.transtype != 4 AND ppt.transtype != 2 and ppt.transamount>0
@@ -226,7 +226,7 @@
             pba.address,
             pba.mobilephone
         HAVING
-            sum( CASE WHEN pprb.debt IS NULL THEN 0 ELSE pprb.debt END )> 0
+            sum( CASE WHEN ppt.debt IS NULL THEN 0 ELSE ppt.debt END )> 0
         ORDER BY accountnumber asc
     </select>
     <select id="getTranInfoReport" resultType="com.zcxk.rmcp.pay.dto.pay.PayWaterPropertyReportDto">
@@ -258,8 +258,8 @@
             where e.ladderlevel = '1'
             GROUP BY w.id
         )tab on tab.id = p.id
-        left join sc_organization o on o.id = c.office_id
-        left join sc_user u on u.id = a.create_by
+
+        left join sc_user u on u.id = ppt.create_by
         <where>
             ppt.payway != 5
             AND ppt.state = 1
@@ -270,13 +270,10 @@
             </if>
 
             <if test="inParams.startDate != null and inParams.startDate != null">
-                AND DATE_FORMAT(a.transtime,'%Y-%m-%d') &gt;=#{inParams.startDate}
+                AND DATE_FORMAT(ppt.transtime,'%Y-%m-%d') &gt;=#{inParams.startDate}
             </if>
             <if test="inParams.endDate != null and inParams.endDate != null">
-                AND DATE_FORMAT(a.transtime,'%Y-%m-%d') &lt;=#{inParams.endDate}
-            </if>
-            <if test="inParams.officeId != null and inParams.officeId != ''">
-                and o.id =#{inParams.officeId}
+                AND DATE_FORMAT(ppt.transtime,'%Y-%m-%d') &lt;=#{inParams.endDate}
             </if>
             <if test="inParams.userId != null and inParams.userId != ''">
                 and u.id =#{inParams.userId}
@@ -316,8 +313,7 @@
             where e.ladderlevel = '1'
             GROUP BY w.id
         )tab on tab.id = p.id
-        left join sc_organization o on o.id = c.office_id
-        left join sc_user u on u.id = a.create_by
+        left join sc_user u on u.id = ppt.create_by
         <where>
             ppt.payway != 5 and ppt.state =  1 and canceledrecord_id is null and iscanceled = 0
             <if test="inParams.tenantId != null and inParams.tenantId != ''">
@@ -329,9 +325,6 @@
             <if test="inParams.endDate != null and inParams.endDate != null">
                 AND DATE_FORMAT(ppt.create_date,'%Y-%m-%d') &lt;=#{inParams.endDate}
             </if>
-            <if test="inParams.officeId != null and inParams.officeId != ''">
-                and o.id =#{inParams.officeId}
-            </if>
             <if test="inParams.userId != null and inParams.userId != ''">
                 and u.id =#{inParams.userId}
             </if>

+ 5 - 4
zoniot-pay/zoniot-pay-core/src/main/resources/mapper/pay/payFeeMapper.xml

@@ -112,8 +112,9 @@
             c.opendate,
             c.metercode,
             c.watermeter_id as "watermeterId",
-            (select label from pay_sys_dict where type='住房类型' and `value`=c.housetype and pay_sys_dict.tenant_id=#{tenantId}
-            and customer_id=#{customerId}) as "housetype",
+            (select label from pay_sys_dict where type='住房类型' and `value`=c.housetype
+                                              and pay_sys_dict.tenant_id=#{tenantId}
+           ) as "housetype",
             (select label from pay_sys_dict where type='结算方式' and `value`=c.calculateway and pay_sys_dict.tenant_id=#{tenantId}
             ) as "calculateway",
 
@@ -126,7 +127,7 @@
         left join pay_base_waterproperty p on c.waterProperty_id=p.id
         inner join sc_device device on c.watermeter_id=device.id  and device.tenant_id=#{tenantId}
         <where>
-            c.businessstate=1 and c.customer_id=#{customerId} and c.site_id=#{siteId}
+            c.businessstate=1 and c.tenant_id=#{tenantId}
             <if test="id != null and id != ''">
                and  c.id= #{id}
             </if>
@@ -570,7 +571,7 @@
                 group by account_id
         ) msg on msg.account_id = c.account_id
 
-        where c.businessstate =1 and c.site_id= #{siteId} and c.customer_id = #{customerId}
+        where c.businessstate =1 and c.tenant_id=#{tenantId}
          and a.mobilephone is not null
         <if test="accountIds != null and accountIds.size() != 0">
             and a.id in

+ 2 - 1
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/job/EstimateMsgSendJob.java

@@ -27,10 +27,11 @@ public class EstimateMsgSendJob implements Job, Serializable {
         JobDataMap jobDataMap = jobDetail.getJobDataMap();
         Integer siteId = Integer.valueOf(jobDataMap.get("siteId").toString());
         Integer customerId = Integer.valueOf(jobDataMap.get("customerId").toString());
+        String tenantId=jobDataMap.get("tenantId").toString();
 
         // 2,调用推送方法
         log.info("invoke EstimateMsgSendJob , customerId = {}",customerId);
-        estimateMsgSendService.send(siteId,customerId);
+        estimateMsgSendService.send(tenantId);
         log.info("invoked EstimateMsgSendJob , customerId = {}",customerId);
     }
 }

+ 4 - 5
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/job/EstimatedValveJob.java

@@ -25,12 +25,11 @@ public class EstimatedValveJob implements Job, Serializable {
         // 1,获取推送配置信息
         JobDetail jobDetail = context.getJobDetail();
         JobDataMap jobDataMap = jobDetail.getJobDataMap();
-        Integer siteId = Integer.valueOf(jobDataMap.get("siteId").toString());
-        Integer customerId = Integer.valueOf(jobDataMap.get("customerId").toString());
 
+        String tenantId= jobDataMap.get("tenantId").toString();
         // 2,调用推送方法
-        log.info("invoke EstimatedValveJob , customerId = {}",customerId);
-        estimatedValveService.startValve(siteId,customerId);
-        log.info("invoked EstimatedValveJob , customerId = {}",customerId);
+        log.info("invoke EstimatedValveJob , customerId = {}",tenantId);
+        estimatedValveService.startValve(tenantId);
+        log.info("invoked EstimatedValveJob , customerId = {}",tenantId);
     }
 }

+ 2 - 3
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/job/MessageSendJob.java

@@ -30,10 +30,9 @@ public class MessageSendJob implements Job, Serializable {
     public void execute(JobExecutionContext context) {
         JobDetail jobDetail = context.getJobDetail();
         JobDataMap jobDataMap = jobDetail.getJobDataMap();
-        Integer siteId = Integer.valueOf(jobDataMap.get("siteId").toString());
-        Integer customerId = Integer.valueOf(jobDataMap.get("customerId").toString());
+         String tenantId=jobDataMap.get("tenantId").toString();
 //        Integer sendType = Integer.valueOf(jobDataMap.get("sendType").toString());//1指定日期推送 2单日推送
-        payMessagesendrecordService.sendPayDebtPushMessagesByAuto(siteId,customerId);
+        payMessagesendrecordService.sendPayDebtPushMessagesByAuto(tenantId);
         //自动推送短信
 //        if(sendType == 1){
 //            payMessagesendrecordService.sendMessageAuto(siteId,customerId);

+ 2 - 2
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/service/EstimateMsgSendService.java

@@ -9,6 +9,6 @@ import java.math.BigInteger;
  */
 public interface EstimateMsgSendService {
     void afterPropertiesSet();
-    void send(Integer siteId, Integer customerId);
-    void saveQrtzTask(BigInteger siteId, BigInteger customerId, String sendTime);
+    void send(String tenantId);
+    void saveQrtzTask(String tenantId, String sendTime);
 }

+ 2 - 2
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/service/EstimatedValveService.java

@@ -9,6 +9,6 @@ import java.math.BigInteger;
  */
 public interface EstimatedValveService {
     void afterPropertiesSet();
-    void startValve(Integer siteId, Integer customerId);
-    void saveQrtzTask(BigInteger siteId, BigInteger customerId, String sendTime);
+    void startValve(String tenantId);
+    void saveQrtzTask(String tenantId, String sendTime);
 }

+ 18 - 15
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/service/impl/EstimateMsgSendServiceImpl.java

@@ -1,9 +1,11 @@
 package com.zcxk.rmcp.pay.quartz.service.impl;
 
 import com.zcxk.rmcp.pay.dao.pay.BaseClosingAccountInfoMapper;
+import com.zcxk.rmcp.pay.dao.pay.PayBaseAccountMapper;
 import com.zcxk.rmcp.pay.dao.pay.PayMessagetemplateMapper;
 import com.zcxk.rmcp.pay.dto.pay.BaseClosingAccountInfoDto;
 import com.zcxk.rmcp.pay.dto.pay.PayMessageTemplateDto;
+import com.zcxk.rmcp.pay.entity.pay.PayBaseAccount;
 import com.zcxk.rmcp.pay.quartz.entity.QuartzEntity;
 import com.zcxk.rmcp.pay.quartz.job.EstimateMsgSendJob;
 import com.zcxk.rmcp.pay.quartz.service.EstimateMsgSendService;
@@ -42,25 +44,27 @@ public class EstimateMsgSendServiceImpl implements EstimateMsgSendService, Initi
 
     @Resource
     private PayMessagetemplateMapper payMessagetemplateMapper;
+    @Resource
+    private PayBaseAccountMapper payBaseAccountMapper;
 
     @Override
     public void afterPropertiesSet() {
-        List<BaseClosingAccountInfoDto> closingList = baseClosingAccountInfoMapper.getClosingSC();
-        if(closingList != null && closingList.size() >0){
-            for(BaseClosingAccountInfoDto list:closingList ){
-                PayMessageTemplateDto dto = payMessagetemplateMapper.get(list.getSiteId(),list.getCustomerId(),null,null);
-                saveQrtzTask(list.getSiteId(),list.getCustomerId(),dto != null && StringUtils.isNotBlank(dto.getSendTime()) ? dto.getSendTime() : "");
-            }
+        List<PayBaseAccount> payBaseAccounts = payBaseAccountMapper.getCustIdAndSiteId();
+        for (PayBaseAccount payBaseAccount: payBaseAccounts){
+            PayMessageTemplateDto dto = payMessagetemplateMapper.get(payBaseAccount.getTenantId(),null,null);
+            saveQrtzTask(payBaseAccount.getTenantId(),dto != null && StringUtils.isNotBlank(dto.getSendTime()) ? dto.getSendTime() : "");
+
         }
+
     }
 
-    public void saveQrtzTask(BigInteger siteId, BigInteger customerId,String sendTime) {
+    public void saveQrtzTask(String tenantId,String sendTime) {
         // 1,查询需要批量推送的配置项目并构建定时任务
         // 2,若对应定时任务不存在则创建
         QuartzEntity entity = new QuartzEntity();
         entity.setJobGroup("预计费每天推送");
-        entity.setJobName("EstimateMsgSendJob"+siteId );
-        entity.setDescription("EstimateMsgSendJob"+customerId );
+        entity.setJobName("EstimateMsgSendJob"+tenantId );
+
         // modify by pengdi ,判断定时任务是否存在,不存在才进行新增
 
         boolean exists = jobAndTriggerService.isExists(entity);
@@ -82,16 +86,15 @@ public class EstimateMsgSendServiceImpl implements EstimateMsgSendService, Initi
                 String cron = String.format("%s %s %s * * ?",0,Integer.valueOf(minute),Integer.valueOf(time));
                 //String cron = "0 2 15 * * ?";
                 log.info("预计费每天推送:" + cron);
-                log.info("预计费每天推送:" + "站点ID:"+siteId+"水司ID:"+customerId);
+                log.info("预计费每天推送:" + "站点ID:"+tenantId);
                 entity.setCronExpression(cron);
                 entity.setJobClassName(EstimateMsgSendJob.class.getName());
                 HashMap<String, Object> jobData = new HashMap<String, Object>();
-                jobData.put("siteId", siteId);
-                jobData.put("customerId", customerId);
+                jobData.put("tenantId", tenantId);
                 entity.setJobData(jobData);
                 jobAndTriggerService.save(entity);
             }else{
-                log.info("预计费每天推送失败,失败:" + "站点ID:"+siteId+"水司ID:"+customerId+",失败原因:没有推送时间");
+                log.info("预计费每天推送失败,失败:" + "站点ID:"+tenantId+",失败原因:没有推送时间");
                 //throw new ServiceException(-999,"预计费每天推送失败,失败:"+"站点ID:"+siteId+"水司ID:"+customerId+",失败原因:没有推送时间");
             }
         }
@@ -107,9 +110,9 @@ public class EstimateMsgSendServiceImpl implements EstimateMsgSendService, Initi
         }
     }
 
-    public void send(Integer siteId,Integer customerId){
+    public void send(String tenantId){
         log.info("================================================>预计费每天统推送始<=====================================");
-        amountWaterUsedAmountService.estimateMsgSend(siteId,customerId);
+        amountWaterUsedAmountService.estimateMsgSend(tenantId);
         log.info("================================================>预计费每天推送完成<=====================================");
     }
 }

+ 19 - 15
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/quartz/service/impl/EstimatedValveServiceImpl.java

@@ -1,9 +1,11 @@
 package com.zcxk.rmcp.pay.quartz.service.impl;
 
 import com.zcxk.rmcp.pay.dao.pay.BaseClosingAccountInfoMapper;
+import com.zcxk.rmcp.pay.dao.pay.PayBaseAccountMapper;
 import com.zcxk.rmcp.pay.dao.pay.PayMessagetemplateMapper;
 import com.zcxk.rmcp.pay.dto.pay.BaseClosingAccountInfoDto;
 import com.zcxk.rmcp.pay.dto.pay.PayMessageTemplateDto;
+import com.zcxk.rmcp.pay.entity.pay.PayBaseAccount;
 import com.zcxk.rmcp.pay.quartz.entity.QuartzEntity;
 import com.zcxk.rmcp.pay.quartz.job.EstimatedValveJob;
 import com.zcxk.rmcp.pay.quartz.service.EstimatedValveService;
@@ -42,24 +44,26 @@ public class EstimatedValveServiceImpl implements EstimatedValveService, Initial
 
     @Resource
     private PayMessagetemplateMapper payMessagetemplateMapper;
+    @Resource
+    private PayBaseAccountMapper payBaseAccountMapper;
     @Override
     public void afterPropertiesSet() {
-        List<BaseClosingAccountInfoDto> closingList = baseClosingAccountInfoMapper.getClosingSC();
-        if(closingList != null && closingList.size() >0){
-            for(BaseClosingAccountInfoDto list:closingList ){
-                PayMessageTemplateDto dto = payMessagetemplateMapper.get(list.getSiteId(),list.getCustomerId(),null,null);
-                saveQrtzTask(list.getSiteId(),list.getCustomerId(),dto != null && StringUtils.isNotBlank(dto.getSendTime()) ? dto.getSendTime() : "");
-            }
+        List<PayBaseAccount> payBaseAccounts = payBaseAccountMapper.getCustIdAndSiteId();
+        for (PayBaseAccount payBaseAccount: payBaseAccounts){
+            PayMessageTemplateDto dto = payMessagetemplateMapper.get(payBaseAccount.getTenantId(),null,null);
+            saveQrtzTask(payBaseAccount.getTenantId(),dto != null && StringUtils.isNotBlank(dto.getSendTime()) ? dto.getSendTime() : "");
+
         }
+
     }
 
-    public void saveQrtzTask(BigInteger siteId, BigInteger customerId, String sendTime) {
+    public void saveQrtzTask(String tenantId, String sendTime) {
         // 1,查询需要批量推送的配置项目并构建定时任务
         // 2,若对应定时任务不存在则创建
         QuartzEntity entity = new QuartzEntity();
         entity.setJobGroup("预计费推送阀控");
-        entity.setJobName("EstimatedValveJob"+siteId );
-        entity.setDescription("EstimatedValveJob"+customerId );
+        entity.setJobName("EstimatedValveJob"+tenantId );
+        entity.setDescription("EstimatedValveJob"+tenantId );
 
         boolean exists = jobAndTriggerService.isExists(entity);
         if(exists)
@@ -81,23 +85,23 @@ public class EstimatedValveServiceImpl implements EstimatedValveService, Initial
                 String cron = String.format("%s %s %s * * ?",localDateTime.getSecond(),localDateTime.getMinute(),localDateTime.getHour());
                 //String cron ="0 40 14 * * ?";
                 log.info("预计费推送阀控:" + cron);
-                log.info("预计费推送阀控:" + "站点ID:"+siteId+"水司ID:"+customerId);
+                log.info("预计费推送阀控:" + "站点ID:"+tenantId);
                 entity.setCronExpression(cron);
                 entity.setJobClassName(EstimatedValveJob.class.getName());
                 HashMap<String, Object> jobData = new HashMap<String, Object>();
-                jobData.put("siteId", siteId);
-                jobData.put("customerId", customerId);
+                jobData.put("tenantId", tenantId);
+
                 entity.setJobData(jobData);
                 jobAndTriggerService.save(entity);
             }else{
-                log.info("预计费推送阀控失败,失败:" + "站点ID:"+siteId+"水司ID:"+customerId+",失败原因:没有推送时间");
+                log.info("预计费推送阀控失败,失败:" + "站点ID:"+tenantId+",失败原因:没有推送时间");
                 //throw new ServiceException(-999,"预计费每天推送失败,失败:"+"站点ID:"+siteId+"水司ID:"+customerId+",失败原因:没有推送时间");
             }
         }
     }
-    public void startValve(Integer siteId,Integer customerId){
+    public void startValve(String tenantId){
         log.info("================================================>预计费阀控推送开始<=====================================");
-        amountWaterUsedAmountService.estimatedValveStart(siteId,customerId);
+        amountWaterUsedAmountService.estimatedValveStart(tenantId);
         log.info("================================================>预计费阀控推送完成<=====================================");
     }
 }

+ 12 - 18
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/AmountWaterUsedAmountServiceImpl.java

@@ -785,52 +785,46 @@ public class AmountWaterUsedAmountServiceImpl implements AmountWaterUsedAmountSe
         }
     }
 
-    public void estimateMsgSend(Integer siteId,Integer customerId){
+    public void estimateMsgSend(String tenantId){
 
         PayMessageTemplateDto payMessageTemplateDto = new PayMessageTemplateDto();
-        payMessageTemplateDto.setSiteId(BigInteger.valueOf(siteId));
-        payMessageTemplateDto.setCustomerId(BigInteger.valueOf(customerId));
+
         payMessageTemplateDto.setSendType(0);
 
         //获取短信模板
-        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(BigInteger.valueOf(siteId),BigInteger.valueOf(customerId),null,null);
+        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(tenantId,null,null);
         if(templateList == null){
             //获取短信模板失败,没查询到有效模板
             throw new ServiceException(ResultStatus.MESSAGE_TEMPLATE_FAILED);
         }
         //获取最新账期
-        BaseClosingAccountInfoDto baseClosingAccountInfoDto=baseClosingAccountInfoMapper.getLastClosingAccount(siteId,customerId);
-        if(baseClosingAccountInfoDto == null){
-            throw new ServiceException(ResultStatus.ClOSING_ACCCOUNT_NOT_EXIT);
-        }
+        BaseClosingAccountInfoDto baseClosingAccountInfoDto=new BaseClosingAccountInfoDto();
+
         //根据站点跟客户ID查找出用水余额小于0用户
-        List<PayRechargeaccountDto> rechList = payRechargeaccountMapper.getEstimateBalance(siteId,customerId);
+        List<PayRechargeaccountDto> rechList = payRechargeaccountMapper.getEstimateBalance(tenantId);
         if(rechList != null && rechList.size() >0){
             for(PayRechargeaccountDto dto: rechList){
                 PayBaseAccount account = payBaseAccountMapper.get(dto.getAccountId());
-                payMessagesendrecordServiceImp.sendEstimateMessage(BigInteger.valueOf(siteId),BigInteger.valueOf(customerId),templateList,baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),account);
+                payMessagesendrecordServiceImp.sendEstimateMessage(tenantId,templateList,baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),account);
             }
         }
 
         System.out.println("==============================>预计费短信推送成功<============================");
     }
 
-    public void estimatedValveStart(Integer siteId,Integer customerId){
+    public void estimatedValveStart(String tenantId){
         //查找欠费用户
         //获取最新账期
-        BaseClosingAccountInfoDto baseClosingAccountInfoDto=baseClosingAccountInfoMapper.getLastClosingAccount(siteId,customerId);
-        if(baseClosingAccountInfoDto == null){
-            throw new ServiceException(ResultStatus.ClOSING_ACCCOUNT_NOT_EXIT);
-        }
+        BaseClosingAccountInfoDto baseClosingAccountInfoDto=new BaseClosingAccountInfoDto();
         //根据站点跟客户ID查找出用水余额小于0用户
-        List<PayRechargeaccountDto> rechList = payRechargeaccountMapper.getEstimateBalance(siteId,customerId);
-        Customer customerNo = customerMapper.findById(customerId);
+        List<PayRechargeaccountDto> rechList = payRechargeaccountMapper.getEstimateBalance(tenantId);
+
         List<Integer> filterId = new ArrayList<>();
         filterId.add(4);
         for(PayRechargeaccountDto dto:rechList){
             PayBaseCustomerandmeterrela customer = payBaseCustomerandmeterrelaMapper.getAccountCustomer(dto.getAccountId());
             //flag  1 只执行开阀  0 只执行关阀  2开关阀执行
-            controlDayServiceImpl.sendValve(customerNo.getCustomerNo(),0,filterId,customer);
+            controlDayServiceImpl.sendValve("",0,filterId,customer);
         }
     }
 

+ 20 - 21
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/IssueElectronicInvoiceServiceImpl.java

@@ -57,10 +57,10 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
     @Autowired
     private BaseClosingAccountInfoService baseClosingAccountInfoService;
 
-    private Map<String, String> getPrintParam(Integer siteId, Integer customerId) {
+    private Map<String, String> getPrintParam(String tenantId) {
         Map<String, String> map = new HashMap<>();
         //查询销方参数
-        List<PayBaseConfigDto> payBaseConfigDtos = payBaseConfigService.getPrintInfo("PRINT_", siteId, customerId);
+        List<PayBaseConfigDto> payBaseConfigDtos = payBaseConfigService.getPrintInfo("PRINT_", tenantId);
         for (PayBaseConfigDto item : payBaseConfigDtos) {
             switch (item.getName().trim()) {
                 case "PRINT_INVOICE_ADDRESS":
@@ -89,9 +89,9 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
         return map;
     }
 
-    private Map<Integer, PayInvoiceParam> getInvoiceParam(Integer siteId, Integer customerId) {
+    private Map<Integer, PayInvoiceParam> getInvoiceParam(String tenantId) {
         Map<Integer, PayInvoiceParam> map = new HashMap<>();
-        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamService.findList(null, siteId, customerId);
+        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamService.findList(null, tenantId);
         for (PayInvoiceParam item : payInvoiceParams) {
             if (item.getTaxrate() != null) {
                 BigDecimal taxRate = new BigDecimal(item.getTaxrate()).setScale(2, BigDecimal.ROUND_HALF_UP);
@@ -118,21 +118,16 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
      * @Author:
      * @Date: 2020/7/28
      */
+    @Override
     public ReturnPrintResultDto requestPrint(String siteId, String customerId, String kpType, String userCode, String payseriesno, String invoicePrintId, String email) {
         LoginUser loginUser = UserUtil.getCurrentUser();
         ReturnPrintResultDto returnPrintResultDto = new ReturnPrintResultDto();//开票返回结果信息
 
         if (loginUser == null) {
-            User user = userService.findUserByName("系统操作", BigInteger.valueOf(Long.parseLong(siteId)));
-            loginUser = new LoginUser();
-            if (user != null) {
-                loginUser.setName("系统操作");
-                loginUser.setId(user.getId());
-            } else {
-                returnPrintResultDto.setResult("1");//开票失败
-                returnPrintResultDto.setMsg("开票失败,失败原因:系统未配置操作员");
-                return returnPrintResultDto;
-            }
+           loginUser = new LoginUser();
+
+            loginUser.setName("系统操作");
+            loginUser.setId(3);
             loginUser.setCustomerId(Integer.valueOf(customerId));
             loginUser.setSiteId(Integer.valueOf(siteId));
         }
@@ -148,8 +143,8 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
         PayEleInvoiceDto payEleInvoiceDto = new PayEleInvoiceDto();//电子发票请求主体信息
         PayInvoiceprinted oldInvoiceprinted = new PayInvoiceprinted();//原始蓝票信息(红票时处理)
         List<PayInvoiceOrderDetailDto> orderDetailDtos = new ArrayList<>();//蓝票详细信息
-        Map<String, String> invoiceParam = getPrintParam(loginUser.getSiteId(), loginUser.getCustomerId());//销方开票信息
-        Map<Integer, PayInvoiceParam> invoiceMap = getInvoiceParam(loginUser.getSiteId(), loginUser.getCustomerId());//税率相关参数
+        Map<String, String> invoiceParam = getPrintParam(loginUser.getTenantId());//销方开票信息
+        Map<Integer, PayInvoiceParam> invoiceMap = getInvoiceParam(loginUser.getTenantId());//税率相关参数
         payEleInvoiceDto.setIdentity(invoiceParam.get("saleIdentity"));//认证信息
         if (invoiceParam.get("saleIdentity") == null) {
             returnPrintResultDto.setResult("1");//开票失败
@@ -266,13 +261,15 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
             return returnPrintResultDto;
         }
         payInvoiceOrderDto.setDetail(orderDetailDtos);
-        if (email != null && email.length() > 0)
+        if (email != null && email.length() > 0){
             payInvoiceOrderDto.setEmail(email);
-        else {
-            if (payBaseAccount.getEmail() != null)
+        }else {
+            if (payBaseAccount.getEmail() != null){
                 payInvoiceOrderDto.setEmail(payBaseAccount.getEmail());
-            else
+            }else{
                 payInvoiceOrderDto.setEmail(invoiceParam.get("saleEmail"));
+            }
+
         }
         payEleInvoiceDto.setOrder(payInvoiceOrderDto);
         //发送开票请求
@@ -280,7 +277,7 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
         Map<String, String> map = new HashMap<String, String>();
         map.put("order", jsonsString);
         //查询开票地址
-        List<PayBaseConfigDto> payBaseConfigDtos = payBaseConfigService.getPrintInfo("PRINT_INVOICE_URL", loginUser.getSiteId(), loginUser.getCustomerId());
+        List<PayBaseConfigDto> payBaseConfigDtos = payBaseConfigService.getPrintInfo("PRINT_INVOICE_URL", loginUser.getTenantId());
         String invoiceUrl = "";
         if (payBaseConfigDtos.size() == 0) {
             returnPrintResultDto.setResult("1");//开票失败
@@ -316,6 +313,7 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
             payInvoiceprinted.setUserCode(userCode);
             payInvoiceprinted.setEmail(payInvoiceOrderDto.getEmail());
             payInvoiceprinted.setSaleIdentity(invoiceParam.get("saleIdentity"));
+            payInvoiceprinted.setTenantId(loginUser.getTenantId());
             if (kpType.equals("2")) {
                 payInvoiceprinted.setInvoiceType(2);//红票
                 payInvoiceprinted.setCancelInvoiceId(BigInteger.valueOf(Long.parseLong(invoicePrintId)));
@@ -331,6 +329,7 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
                 returnPrintResultDto.setResult("0");//开票成功
                 returnPrintResultDto.setMsg("开票成功,请等待系统票据查询结果");
                 //开票成功的情况,新保存开票的相关信息,查询时再进行更新
+
                 int num = printInvoicePrintService.insert(payInvoiceprinted);
                 //请求成功时就把实收或者蓝票则需根据开票查询结果进行标记
                 if (payInvoiceprinted.getInvoiceType() == 1) {//开具蓝票

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

@@ -63,12 +63,12 @@ public class PayBaseConfigServiceImpl implements PayBaseConfigService {
         LoginUser loginUser = UserUtil.getCurrentUser();
 
         PageHelper.startPage(pageNum, pageSize);
-        List<PayBaseConfigDto> payBaseConfigList = payBaseConfigMapper.getNameCnname(queryInfo,loginUser.getSiteId(),loginUser.getCustomerId());
+        List<PayBaseConfigDto> payBaseConfigList = payBaseConfigMapper.getNameCnname(queryInfo,loginUser.getTenantId());
         return new Pagination<>(payBaseConfigList);
     }
     @Override
-    public List<PayBaseConfigDto> getPrintInfo(String queryInfo, Integer siteId, Integer customerId) {
-        List<PayBaseConfigDto> payBaseConfigList = payBaseConfigMapper.getNameCnname(queryInfo, siteId, customerId);
+    public List<PayBaseConfigDto> getPrintInfo(String queryInfo,String tenantId) {
+        List<PayBaseConfigDto> payBaseConfigList = payBaseConfigMapper.getNameCnname(queryInfo, tenantId);
         return payBaseConfigList;
     }
 

+ 2 - 2
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayChargeSurveyServiceImpl.java

@@ -230,10 +230,10 @@ public class PayChargeSurveyServiceImpl implements PayChargeSurveyService {
     List<MeasurementInstance> findBillingPeriod(Integer companyId,Integer departmentId){
         List<MeasurementInstance> history = measurementInstanceMapper.findHistory(null, companyId, departmentId);
 
-        if(!CollectionUtils.isEmpty(history)){
+        if(CollectionUtils.isEmpty(history)){
             MeasurementInstance a = new MeasurementInstance();
             for(int i=0; i<=1; i++){
-                Calendar cal = Calendar.getInstance();
+
                 a.setBillingPeriod(new Date());
 
                 a.setClearingStartDate(new Date());

+ 12 - 15
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayInvoiceParamServiceImpl.java

@@ -40,23 +40,22 @@ public class PayInvoiceParamServiceImpl implements PayInvoiceParamService {
     public int batchInsert() {
         //1、从登陆信息中获取站点Id 水司ID
         LoginUser loginUser = UserUtil.getCurrentUser();
-        BigInteger siteId = BigInteger.valueOf(loginUser.getSiteId());
-        BigInteger customerId = BigInteger.valueOf(loginUser.getCustomerId());
+
         List<PaySysDictSelectDto> paySysDictSelectDtos = paySysDictMapper.getDicts("收费类型",loginUser.getTenantId());
         List<PayInvoiceParam> list = new ArrayList<PayInvoiceParam>();
         for (PaySysDictSelectDto item : paySysDictSelectDtos) {
             PayInvoiceParam payInvoiceParam = new PayInvoiceParam();
             payInvoiceParam.setFeetype(Integer.valueOf(item.getValue()));
             payInvoiceParam.setDelFlag("0");
-            payInvoiceParam.setSiteId(siteId);
-            payInvoiceParam.setCustomerId(customerId);
+
             payInvoiceParam.setCreateBy(BigInteger.valueOf(loginUser.getId()));
             payInvoiceParam.setCreateDate(LocalDateTime.now());
             payInvoiceParam.setUpdateBy(BigInteger.valueOf(loginUser.getId()));
             payInvoiceParam.setUpdateDate(LocalDateTime.now());
+            payInvoiceParam.setTenantId(loginUser.getTenantId());
             list.add(payInvoiceParam);
         }
-        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamMapper.findList(null, siteId, customerId);
+        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamMapper.findList(null, loginUser.getTenantId());
         if (payInvoiceParams.size() == 0) {
             return payInvoiceParamMapper.batchInsert(list);
         } else {
@@ -73,8 +72,7 @@ public class PayInvoiceParamServiceImpl implements PayInvoiceParamService {
     @Override
     public List<PayInvoiceParam> findList(String queryparam) {
         LoginUser loginUser = UserUtil.getCurrentUser();
-        BigInteger siteId = BigInteger.valueOf(loginUser.getSiteId());
-        BigInteger customerId = BigInteger.valueOf(loginUser.getCustomerId());
+
         //发票销售方设置参数
         try {
             PayBaseConfigDto payBaseConfig = new PayBaseConfigDto();
@@ -133,10 +131,10 @@ public class PayInvoiceParamServiceImpl implements PayInvoiceParamService {
         }
 
         //发票参数
-        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamMapper.findList(queryparam, siteId, customerId);
+        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamMapper.findList(queryparam, loginUser.getTenantId());
         if (payInvoiceParams.size() == 0) {
             batchInsert();
-            payInvoiceParams = payInvoiceParamMapper.findList(queryparam, siteId, customerId);
+            payInvoiceParams = payInvoiceParamMapper.findList(queryparam, loginUser.getTenantId());
         }
         return payInvoiceParams;
     }
@@ -145,8 +143,7 @@ public class PayInvoiceParamServiceImpl implements PayInvoiceParamService {
         LoginUser loginUser = UserUtil.getCurrentUser();
 
 
-        BigInteger siteId = BigInteger.valueOf(loginUser.getSiteId());
-        BigInteger customerId = BigInteger.valueOf(loginUser.getCustomerId());
+
         //发票销售方设置参数
         try {
             PayBaseConfigDto payBaseConfig = new PayBaseConfigDto();
@@ -206,21 +203,21 @@ public class PayInvoiceParamServiceImpl implements PayInvoiceParamService {
         //发票参数
         //分页
         PageHelper.startPage(pageNum,pageSize);
-        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamMapper.findList(queryparam, siteId, customerId);
+        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamMapper.findList(queryparam, loginUser.getTenantId());
         if (payInvoiceParams.size() == 0) {
             batchInsert();
             //分页
             PageHelper.startPage(pageNum,pageSize);
-            payInvoiceParams = payInvoiceParamMapper.findList(queryparam, siteId, customerId);
+            payInvoiceParams = payInvoiceParamMapper.findList(queryparam, loginUser.getTenantId());
         }
         return new Pagination<>(payInvoiceParams);
     }
 
 
     @Override
-    public List<PayInvoiceParam> findList(String queryparam, Integer siteId, Integer customerId) {
+    public List<PayInvoiceParam> findList(String queryparam, String tenantId) {
         //发票参数
-        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamMapper.findList(queryparam, BigInteger.valueOf(siteId), BigInteger.valueOf(customerId));
+        List<PayInvoiceParam> payInvoiceParams = payInvoiceParamMapper.findList(queryparam, tenantId);
         return payInvoiceParams;
     }
 }

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

@@ -69,14 +69,7 @@ public class PayInvoicePrintServiceImpl implements PrintInvoicePrintService {
         //分页
         PageHelper.startPage(pageNum,pageSize);
         //站点为空则加入用户站点查询
-        if( loginUser !=null){
-            //站点权限
-            payInvoiceSearchDto.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
-            //客户权限
-            payInvoiceSearchDto.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
-            //数据权限
-            payInvoiceSearchDto.setProgramItems(loginUser.getDataPermissionMap().get(loginUser.getSiteId()));
-        }
+        payInvoiceSearchDto.setTenantId(loginUser.getTenantId());
 
         return new Pagination<>(payInvoicePrintMapper.findList(payInvoiceSearchDto, loginUser.getUserCondition()));
     }

+ 41 - 49
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayMessagesendrecordServiceImp.java

@@ -1,5 +1,6 @@
 package com.zcxk.rmcp.pay.service.impl.pay;
 
+import com.zcxk.core.utils.DateUtil;
 import com.zcxk.rmcp.pay.commom.exception.ServiceException;
 import com.zcxk.rmcp.pay.commom.model.AjaxMessage;
 import com.zcxk.rmcp.pay.commom.model.Pagination;
@@ -8,14 +9,12 @@ import com.zcxk.rmcp.pay.commom.util.ExcelUtil;
 import com.zcxk.rmcp.pay.commom.util.MessageSend.SMSClient;
 import com.zcxk.rmcp.pay.commom.util.MessageSend.SendReq;
 import com.zcxk.rmcp.pay.commom.util.UserUtil;
-import com.zcxk.rmcp.pay.dao.pay.BaseClosingAccountInfoMapper;
-import com.zcxk.rmcp.pay.dao.pay.PayFeeMapper;
-import com.zcxk.rmcp.pay.dao.pay.PayMessagesendrecordMapper;
-import com.zcxk.rmcp.pay.dao.pay.PayMessagetemplateMapper;
+import com.zcxk.rmcp.pay.dao.pay.*;
 import com.zcxk.rmcp.pay.dto.LoginUser;
 import com.zcxk.rmcp.pay.dto.pay.*;
 import com.zcxk.rmcp.pay.dto.pay.payfee.PayValveStateInfoDto;
 import com.zcxk.rmcp.pay.entity.ProgramItem;
+import com.zcxk.rmcp.pay.entity.pay.MeasurementInstance;
 import com.zcxk.rmcp.pay.entity.pay.PayBaseAccount;
 import com.zcxk.rmcp.pay.entity.pay.PayControlRule;
 import com.zcxk.rmcp.pay.quartz.entity.QuartzEntity;
@@ -34,6 +33,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
@@ -42,6 +42,7 @@ import java.math.BigInteger;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -78,6 +79,9 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
 
     @Autowired
     PayFeeService  payFeeService;
+    @Autowired
+    private MeasurementInstanceMapper measurementInstanceMapper;
+
 
 
     public void insert(PayMessagesendrecordDto payMessagesendrecordDto) {
@@ -101,11 +105,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
         //站点为空则加入用户站点查询
         if( loginUser !=null){
             //站点权限
-            payMessagesendrecordDto.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
-            //客户权限
-            payMessagesendrecordDto.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
-            //数据权限
-            payMessagesendrecordDto.setProgramItems(UserUtil.getCurrentSiteProgramItems(loginUser));
+
         }
 
         List<PayMessagesendrecordDto> list = payMessagesendrecordMapper.findList(payMessagesendrecordDto);
@@ -133,29 +133,24 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
     public Pagination<PayDebtMessageDto> findDebtList(String condition, BigDecimal beginDebtFee, BigDecimal endDebtFee, List<BigInteger> accountIds, int pageNum, int pageSize) {
         LoginUser loginUser = UserUtil.getCurrentUser();
 
-        Integer siteId=null;
-        Integer customerId=null;
-        List<ProgramItem> programItems=null;
-        if( loginUser !=null){
-            //站点权限
-            siteId=loginUser.getSiteId();
-            //客户权限
-            customerId=loginUser.getCustomerId();
-            //数据权限
-            programItems=UserUtil.getCurrentSiteProgramItems(loginUser);
-        }
-        //获取最新账期
-
-        BaseClosingAccountInfoDto baseClosingAccountInfoDto=baseClosingAccountInfoMapper.getLastClosingAccount(loginUser.getSiteId(),loginUser.getCustomerId());
 
-        if(baseClosingAccountInfoDto == null){
-//            throw new ServiceException(ResultStatus.ClOSING_ACCCOUNT_NOT_EXIT);
-            return new Pagination<>(new Page(pageNum,pageSize));
+        //获取最新账期
+        List<MeasurementInstance> history = measurementInstanceMapper.findHistory(null, loginUser.getCompanyId(), loginUser.getDepartmentId());
+        MeasurementInstance measurementInstance=new MeasurementInstance();
+        if(!CollectionUtils.isEmpty(history)){
+            measurementInstance=history.get(0);
+        }
+        Date billingPeriod = measurementInstance.getBillingPeriod();
+        Integer year=null;
+        Integer month=null;
+        if(billingPeriod!=null){
+            year=DateUtil.getYear(billingPeriod);
+            month=DateUtil.getMonth(billingPeriod);
         }
         //分页
         PageHelper.startPage(pageNum,pageSize);
         //获取数据
-        List<PayDebtMessageDto> list = payMessagesendrecordMapper.findDebtList( baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),  condition,  beginDebtFee,  endDebtFee, accountIds,siteId,customerId,programItems);
+        List<PayDebtMessageDto> list = payMessagesendrecordMapper.findDebtList( year,month,  condition,  beginDebtFee,  endDebtFee, accountIds,loginUser.getTenantId(),loginUser.getUserCondition());
 
         return new Pagination<>(list);
     }
@@ -179,7 +174,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
         //获取数据
         List<PayDebtMessageDto> list =new ArrayList();
         if(baseClosingAccountInfoDto != null){
-            list = payMessagesendrecordMapper.findDebtList( baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),  condition,  beginDebtFee,  endDebtFee, null,siteId,customerId,programItems);
+            list = payMessagesendrecordMapper.findDebtList( baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),  condition,  beginDebtFee,  endDebtFee, null,loginUser.getTenantId(),loginUser.getUserCondition());
         }
         String title = "客户欠费记录";
 
@@ -241,7 +236,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
         }
 
         //获取短信模板
-        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(BigInteger.valueOf(loginUser.getSiteId()),BigInteger.valueOf(loginUser.getCustomerId()),0,null);
+        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(loginUser.getTenantId(),0,null);
         if(templateList == null){
             //获取短信模板失败,没查询到有效模板
             throw new ServiceException(ResultStatus.MESSAGE_TEMPLATE_FAILED);
@@ -258,7 +253,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
             throw new ServiceException(ResultStatus.ClOSING_ACCCOUNT_NOT_EXIT);
         }
         //获取数据
-        List<PayDebtMessageDto> debtList = payMessagesendrecordMapper.findDebtList( baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),  condition,  beginDebtFee,  endDebtFee, accountIds,siteId,customerId,programItems);
+        List<PayDebtMessageDto> debtList = payMessagesendrecordMapper.findDebtList( baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),  condition,  beginDebtFee,  endDebtFee, accountIds,loginUser.getTenantId(),loginUser.getUserCondition());
         if(debtList.size()==0){
             //获取欠费信息失败
             throw new ServiceException(ResultStatus.MESSAGE_DEBTFEE_FAILED);
@@ -286,7 +281,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
         payMessageTemplateDto.setSendType(0);
 
         //获取短信模板
-        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(BigInteger.valueOf(siteId),BigInteger.valueOf(customerId),0,1);
+        PayMessageTemplateDto templateList= payMessagetemplateMapper.get("",0,1);
         if(templateList == null){
             //获取短信模板失败,没查询到有效模板
             throw new ServiceException(ResultStatus.MESSAGE_TEMPLATE_FAILED);
@@ -305,7 +300,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
             throw new ServiceException(ResultStatus.ClOSING_ACCCOUNT_NOT_EXIT);
         }
         //获取数据
-        List<PayDebtMessageDto> debtList = payMessagesendrecordMapper.findDebtList( baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),  null,  null,  null, null,siteId,customerId,null);
+        List<PayDebtMessageDto> debtList = payMessagesendrecordMapper.findDebtList( baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),  null,  null,  null, null,null,null);
         if(debtList.size()==0){
             //获取欠费信息失败
             throw new ServiceException(ResultStatus.MESSAGE_DEBTFEE_FAILED);
@@ -523,7 +518,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
         }
     }
 
-    public Integer sendEstimateMessage(BigInteger siteId, BigInteger customerId, PayMessageTemplateDto templates, Integer year,Integer month, PayBaseAccount payDebtMessageDto) {
+    public Integer sendEstimateMessage(String tenantId, PayMessageTemplateDto templates, Integer year,Integer month, PayBaseAccount payDebtMessageDto) {
         String template = "";
         template=templates.getTemplate4();
         //拼接短信内容
@@ -570,8 +565,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
         payMessagesendrecordDto.setUpdateBy(templates.getUpdateBy());
         payMessagesendrecordDto.setUpdateDate(LocalDateTime.now());
         payMessagesendrecordDto.setDelFlag("0");
-        payMessagesendrecordDto.setSiteId(siteId);
-        payMessagesendrecordDto.setCustomerId(customerId);
+        payMessagesendrecordDto.setTenantId(tenantId);
         payMessagesendrecordMapper.insert(payMessagesendrecordDto);
         return result;
     }
@@ -680,7 +674,7 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
             programItems=UserUtil.getCurrentSiteProgramItems(loginUser);
         }
         //获取短信模板
-        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(BigInteger.valueOf(loginUser.getSiteId()),BigInteger.valueOf(loginUser.getCustomerId()),0,null);
+        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(loginUser.getTenantId(),0,null);
         if(templateList == null){
             //获取短信模板失败,没查询到有效模板
             throw new ServiceException(ResultStatus.MESSAGE_TEMPLATE_FAILED);
@@ -743,19 +737,18 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
 
         Integer successNmu=0;
         for(PayDebtPushMessageDto payDebtPushMessageDto: payDebtPushMessageDtos){
-            successNmu = successNmu+ sendPayDebtPushMessages(siteId, customerId, templateList, baseClosingAccountInfoDto, payDebtPushMessageDto,0);
+            successNmu = successNmu+ sendPayDebtPushMessages(loginUser.getTenantId(), templateList, baseClosingAccountInfoDto, payDebtPushMessageDto,0);
         }
         return new AjaxMessage<>(ResultStatus.OK,"推送成功"+successNmu+"条");
     }
 
-    public  AjaxMessage<String> sendPayDebtPushMessagesByAuto(Integer siteId, Integer customerId){
+    public  AjaxMessage<String> sendPayDebtPushMessagesByAuto(String tenantId){
         PayMessageTemplateDto payMessageTemplateDto = new PayMessageTemplateDto();
-        payMessageTemplateDto.setSiteId(BigInteger.valueOf(siteId));
-        payMessageTemplateDto.setCustomerId(BigInteger.valueOf(customerId));
+
         payMessageTemplateDto.setSendType(0);
 
         //获取短信模板
-        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(BigInteger.valueOf(siteId),BigInteger.valueOf(customerId),0,1);
+        PayMessageTemplateDto templateList= payMessagetemplateMapper.get(tenantId,0,1);
         if(templateList == null){
             //获取短信模板失败,没查询到有效模板
             throw new ServiceException(ResultStatus.MESSAGE_TEMPLATE_FAILED);
@@ -769,10 +762,9 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
             throw new ServiceException(ResultStatus.MESSAGE_CONFIGURATION_ISEMPTY);
         }
         //获取最新账期
-        BaseClosingAccountInfoDto baseClosingAccountInfoDto=baseClosingAccountInfoMapper.getLastClosingAccount(siteId,customerId);
-        if(baseClosingAccountInfoDto == null){
-            throw new ServiceException(ResultStatus.ClOSING_ACCCOUNT_NOT_EXIT);
-        }
+
+        BaseClosingAccountInfoDto baseClosingAccountInfoDto=new BaseClosingAccountInfoDto();
+
 
         List<Integer> types =new ArrayList<>();
         types.add(1);   //欠费天数
@@ -819,12 +811,12 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
 
         Integer successNmu=0;
         for(PayDebtPushMessageDto payDebtPushMessageDto: payDebtPushMessageDtos){
-            successNmu = successNmu+ sendPayDebtPushMessages(siteId, customerId, templateList, baseClosingAccountInfoDto, payDebtPushMessageDto,0);
+            successNmu = successNmu+ sendPayDebtPushMessages(tenantId, templateList, baseClosingAccountInfoDto, payDebtPushMessageDto,0);
         }
         return new AjaxMessage<>(ResultStatus.OK,"推送成功"+successNmu+"条");
     }
 
-    private Integer sendPayDebtPushMessages(Integer siteId, Integer customerId, PayMessageTemplateDto templateList, BaseClosingAccountInfoDto baseClosingAccountInfoDto, PayDebtPushMessageDto payDebtPushMessageDto,Integer type) {
+    private Integer sendPayDebtPushMessages(String tenantId, PayMessageTemplateDto templateList, BaseClosingAccountInfoDto baseClosingAccountInfoDto, PayDebtPushMessageDto payDebtPushMessageDto,Integer type) {
         String template;
 
         if(payDebtPushMessageDto.getIsDays() != null &&payDebtPushMessageDto.getIsDays() == 1){
@@ -894,8 +886,8 @@ public class PayMessagesendrecordServiceImp implements PayMessagesendrecordServi
             payMessagesendrecordDto.setUpdateBy(templateList.getUpdateBy());
             payMessagesendrecordDto.setUpdateDate(LocalDateTime.now());
             payMessagesendrecordDto.setDelFlag("0");
-            payMessagesendrecordDto.setSiteId(BigInteger.valueOf(siteId));
-            payMessagesendrecordDto.setCustomerId(BigInteger.valueOf(customerId));
+            payMessagesendrecordDto.setTenantId(tenantId);
+
             payMessagesendrecordMapper.insert(payMessagesendrecordDto);
         }
         return result;

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

@@ -43,8 +43,7 @@ public class PayMessagetemplateServiceImp implements PayMessagetemplateService {
 
     public void save(PayMessageTemplateDto payMessageTemplateDto) {
         LoginUser loginUser=UserUtil.getCurrentUser();
-        payMessageTemplateDto.setCreateBy(BigInteger.valueOf(loginUser.getId()));
-        payMessageTemplateDto.setUpdateBy(BigInteger.valueOf(loginUser.getId()));
+        payMessageTemplateDto.setTenantId(loginUser.getTenantId());
         payMessageTemplateDto.setCreateDate(LocalDateTime.now());
         payMessageTemplateDto.setUpdateDate(LocalDateTime.now());
         payMessageTemplateDto.setDelFlag("0");
@@ -57,7 +56,7 @@ public class PayMessagetemplateServiceImp implements PayMessagetemplateService {
             payMessagesendrecordService.deleteQrtzTask(payMessageTemplateDto.getId());
             payMessagetemplateMapper.update(payMessageTemplateDto);
         }else{
-            PayMessageTemplateDto payMessageTemplateDto1  = payMessagetemplateMapper.get(BigInteger.valueOf(loginUser.getSiteId()),BigInteger.valueOf(loginUser.getCustomerId()),payMessageTemplateDto.getSendType(),null);
+            PayMessageTemplateDto payMessageTemplateDto1  = payMessagetemplateMapper.get(loginUser.getTenantId(),payMessageTemplateDto.getSendType(),null);
             if(payMessageTemplateDto1 != null && payMessageTemplateDto1.getId() != null){
                 //已存在模板则更新
                 payMessagesendrecordService.deleteQrtzTask(payMessageTemplateDto1.getId());
@@ -69,9 +68,9 @@ public class PayMessagetemplateServiceImp implements PayMessagetemplateService {
             }
         }
         //修改预计费短信
-        estimateMsgSendService.saveQrtzTask(BigInteger.valueOf(loginUser.getSiteId()),BigInteger.valueOf(loginUser.getCustomerId()),payMessageTemplateDto.getSendTime());
+        estimateMsgSendService.saveQrtzTask(loginUser.getTenantId(),payMessageTemplateDto.getSendTime());
         //修改预计费短信开关阀
-        estimatedValveService.saveQrtzTask(BigInteger.valueOf(loginUser.getSiteId()),BigInteger.valueOf(loginUser.getCustomerId()),payMessageTemplateDto.getSendTime());
+        estimatedValveService.saveQrtzTask(loginUser.getTenantId(),payMessageTemplateDto.getSendTime());
         payMessagesendrecordService.saveQrtzTask(payMessageTemplateDto);
         //保存模板后判断是不是自动发送短信
 //        if(payMessageTemplateDto.getSendType() == 0     //短信
@@ -92,18 +91,8 @@ public class PayMessagetemplateServiceImp implements PayMessagetemplateService {
     public PayMessageTemplateDto get(Integer sendType) {
         LoginUser loginUser = UserUtil.getCurrentUser();
 
-        PayMessageTemplateDto payMessageTemplateDto = payMessagetemplateMapper.get(BigInteger.valueOf(loginUser.getSiteId()),BigInteger.valueOf(loginUser.getCustomerId()),sendType,null);
-       /* if(payMessageTemplateDto != null){
-            if(payMessageTemplateDto.getTemplate1() != null){
-                payMessageTemplateDto.setTemplate1(payMessageTemplateDto.getTemplate1().replace("{", "<font contentEditable=\"false\" color=\"red\">{").replace("}", "}</font>"));
-            }
-            if(payMessageTemplateDto.getTemplate2() != null){
-                payMessageTemplateDto.setTemplate2(payMessageTemplateDto.getTemplate2().replace("{", "<font contentEditable=\"false\" color=\"red\">{").replace("}", "}</font>"));
-            }
-            if(payMessageTemplateDto.getTemplate3() != null){
-                payMessageTemplateDto.setTemplate3(payMessageTemplateDto.getTemplate3().replace("{", "<font contentEditable=\"false\" color=\"red\">{").replace("}", "}</font>"));
-            }
-        }*/
+        PayMessageTemplateDto payMessageTemplateDto = payMessagetemplateMapper.get(loginUser.getTenantId(),sendType,null);
+
         return payMessageTemplateDto;
     }
 
@@ -157,7 +146,8 @@ public class PayMessagetemplateServiceImp implements PayMessagetemplateService {
      *
      */
     public void delete( Integer siteId, Integer customerId){
-        PayMessageTemplateDto payMessageTemplateDto = payMessagetemplateMapper.get(BigInteger.valueOf(siteId),BigInteger.valueOf(customerId),null,null);
+
+        PayMessageTemplateDto payMessageTemplateDto = payMessagetemplateMapper.get("",null,null);
         if(payMessageTemplateDto != null && payMessageTemplateDto.getId() != null){
             //删除定时任务
             payMessagesendrecordService.deleteQrtzTask(payMessageTemplateDto.getId());

+ 1 - 2
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayPayAgentbranchServiceImpl.java

@@ -113,8 +113,7 @@ public class PayPayAgentbranchServiceImpl implements PayPayAgentbranchService {
     public List<PaySysDictSelectDto>getAgentType()
     {
         LoginUser loginUser = UserUtil.getCurrentUser();
-        BigInteger siteId = new BigInteger(String.valueOf(loginUser.getSiteId()));
-        BigInteger customerId = new BigInteger(String.valueOf(loginUser.getCustomerId()));
+
 
         List<PaySysDictSelectDto> paySysDictSelectDtoList = paySysDictMapper.getDicts("机构类型",loginUser.getTenantId());
         return paySysDictSelectDtoList;

+ 1 - 2
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayPayReceivedServiceImpl.java

@@ -73,9 +73,8 @@ public class PayPayReceivedServiceImpl implements PayPayReceivedService {
 
 
         received.setPayseriesno(payseriesno);
+        received.setTenantId(loginUser.getTenantId());
 
-        received.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
-        received.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
         List<PayPayReceivedListDto> receivedList = payPayReceivedMapper.findListByPayseriesno(received);
         return receivedList;
     }

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

@@ -87,9 +87,8 @@ public class PayReceivableServiceImpl implements PayReceivableService {
         PayPayReceivableDto dto = new PayPayReceivableDto();
         dto.setCondition(condition);
         dto.setTenantId(dto.getTenantId());
-        dto.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
-        dto.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
-        dto.setProgramItems(loginUser.getDataPermissionMap().get(loginUser.getSiteId()));
+
+       // dto.setProgramItems(loginUser.getDataPermissionMap().get(loginUser.getSiteId()));
         dto.setBeginDate(beginDate);
         dto.setEndDate(endDate);
         dto.setState(state);
@@ -102,8 +101,7 @@ public class PayReceivableServiceImpl implements PayReceivableService {
         LoginUser loginUser = UserUtil.getCurrentUser();
         PayPayReceivableDto dto = new PayPayReceivableDto();
         dto.setAccountnumber(accountnumber);
-        dto.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
-        dto.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
+        dto.setTenantId(loginUser.getTenantId());
         dto.setBeginDate(beginDate);
         dto.setEndDate(endDate);
         dto.setYear(year);

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

@@ -223,14 +223,14 @@ public class PayReportServiceImpl implements PayReportService {
     private List<PayWaterPropertyReportDto> getWaterProperSale(PayWaterPropertyReport payWaterPropertyReport){
         LoginUser loginUser = UserUtil.getCurrentUser();
         payWaterPropertyReport.setTenantId(loginUser.getTenantId());
-        payWaterPropertyReport.setUserCondition(loginUser.getUserCondition());
+
 
         //组装账户交易明细+实收记录
         List<PayWaterPropertyReportDto> list = new ArrayList<PayWaterPropertyReportDto>();
         //获取账户交易明细记录
-        List<PayWaterPropertyReportDto> tList = payReportMapper.getTranInfoReport(payWaterPropertyReport);
+        List<PayWaterPropertyReportDto> tList = payReportMapper.getTranInfoReport(payWaterPropertyReport,loginUser.getUserCondition());
         //获取实收记录
-        List<PayWaterPropertyReportDto> rList = payReportMapper.getReceviceInfoReport(payWaterPropertyReport);
+        List<PayWaterPropertyReportDto> rList = payReportMapper.getReceviceInfoReport(payWaterPropertyReport,loginUser.getUserCondition());
         if(tList != null && tList.size() > 0){
             //遍历交易明细
             for(int i=0; i < tList.size(); i++){

+ 1 - 1
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PrintInvoiceQueryResultServiceImpl.java

@@ -50,7 +50,7 @@ public class PrintInvoiceQueryResultServiceImpl {
             invoiceResult.put("order", resultString);
             //查询开票地址
 
-            List<PayBaseConfigDto> payBaseConfigDtos = payBaseConfigService.getPrintInfo("PRINT_INVOICE_QUERYURL",Integer.valueOf(payInvoiceprinted.getSiteId().toString()),Integer.valueOf(payInvoiceprinted.getCustomerId().toString()));
+            List<PayBaseConfigDto> payBaseConfigDtos = payBaseConfigService.getPrintInfo("PRINT_INVOICE_QUERYURL",payInvoiceprinted.getTenantId());
             String invoiceUrl = "";
             if (payBaseConfigDtos.size() == 0) {
                return;

+ 2 - 2
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/AmountWaterUsedAmountService.java

@@ -35,7 +35,7 @@ public interface AmountWaterUsedAmountService {
 
     void estimatedDay(Integer siteId, Integer customerId);
 
-    void estimateMsgSend(Integer siteId, Integer customerId);
+    void estimateMsgSend(String tenantId);
 
-    void estimatedValveStart(Integer siteId, Integer customerId);
+    void estimatedValveStart(String tenantId);
 }

+ 1 - 1
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/PayBaseConfigService.java

@@ -33,5 +33,5 @@ public interface PayBaseConfigService {
      */
     int edit(PayBaseConfigDto payBaseConfigDto);
 
-    List<PayBaseConfigDto> getPrintInfo(String queryInfo, Integer siteId, Integer customerId);
+    List<PayBaseConfigDto> getPrintInfo(String queryInfo, String tenantId);
 }

+ 1 - 1
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/PayInvoiceParamService.java

@@ -22,5 +22,5 @@ public interface PayInvoiceParamService {
     Pagination<PayInvoiceParam> findPage(String queryparam, int pageNum, int pageSize);
 
 
-    List<PayInvoiceParam> findList(String queryparam, Integer siteId, Integer customerId);
+    List<PayInvoiceParam> findList(String queryparam,String tenantId);
 }

+ 1 - 1
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/PayMessagesendrecordService.java

@@ -73,7 +73,7 @@ public interface PayMessagesendrecordService {
     AjaxMessage<String> sendPayDebtPushMessagesByUser(String condition, Integer searchType,
                                                       BigDecimal beginDebtFee, BigDecimal endDebtFee, List<BigInteger> accountIds);
 
-    AjaxMessage<String> sendPayDebtPushMessagesByAuto(Integer siteId, Integer customerId);
+    AjaxMessage<String> sendPayDebtPushMessagesByAuto(String tenantId);
 
 
      void sendValveCommond(Integer siteId, Integer customerId);

+ 1 - 1
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/pay/archives/impl/PayBaseCustomerandmeterrelaServiceImpl.java

@@ -207,7 +207,7 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
     public Pagination<PayAccountInfo> selectMeterElenoMeterInfo(String metereleno,int pageNum, int pageSize){
         LoginUser loginUser = UserUtil.getCurrentUser();
         PageHelper.startPage(pageNum, pageSize);
-        List<PayAccountInfo> list = payBaseCustomerandmeterrelaMapper.selectMeterElenoMeterInfo(loginUser.getSiteId(),loginUser.getCustomerId(),metereleno);
+        List<PayAccountInfo> list = payBaseCustomerandmeterrelaMapper.selectMeterElenoMeterInfo(loginUser.getTenantId(),metereleno);
         return new Pagination<>(list);
     }