Ver Fonte

1修改开户阀控规则关联

Xiaojh há 4 anos atrás
pai
commit
4857e00787

+ 3 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/archives/PayBaseCustomerandmeterrelaMapper.java

@@ -4,6 +4,7 @@ import com.bz.smart_city.dto.pay.PayBaseCustomerandmeterrelaDto;
 import com.bz.smart_city.dto.pay.PayCustomerDto;
 import com.bz.smart_city.entity.Organization;
 import com.bz.smart_city.entity.pay.PayBaseAccount;
+import com.bz.smart_city.entity.pay.PayControlRule;
 import com.bz.smart_city.entity.pay.PayPayRechargeaccount;
 import com.bz.smart_city.entity.pay.archives.*;
 import org.apache.ibatis.annotations.Mapper;
@@ -98,4 +99,6 @@ public interface PayBaseCustomerandmeterrelaMapper {
     public PayBaseCustomerandmeterrela findAccountByAccountNumber(@Param("siteId") Integer siteId, @Param("customerId")Integer customerId,@Param("accountnumber")String accountnumber);
 
     void updateMeterInstallOpen(@Param("isAccepted")Integer isAccepted, @Param("updateBy")String updateBy,@Param("date") LocalDateTime date, @Param("id") BigInteger id);
+
+    public List<PayControlRule> getRuleNames(@Param("siteId")Integer siteId,@Param("customerId")Integer customerId,@Param("list")List<String> list);
 }

+ 4 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/PaySaveCustomerDto.java

@@ -47,4 +47,8 @@ public class PaySaveCustomerDto extends PayBaseCustomerandmeterrela {
     private String vatno;
     @ApiModelProperty(value = "设备安装地址", position = 14)
     private String installAddress;
+    @ApiModelProperty(value = "阀控规则ID数组", position = 15)
+    private String[] valveRuleIds;
+    @ApiModelProperty(value = "阀控规则名称数组", position = 15)
+    private String[] valveRuleNames;
 }

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/quartz/service/impl/EstimateMsgSendServiceImpl.java

@@ -77,8 +77,8 @@ public class EstimateMsgSendServiceImpl implements EstimateMsgSendService, Initi
                 minute = sp[1];
                 //String cron = "0 */3 * * * ?";
                 //String cron ="0 40 14 * * ?";
-                //String cron = "0 "+Integer.valueOf(minute)+" "+Integer.valueOf(time)+" * * ? ";
-                String cron = "0 0 19 * * ? ";
+                String cron = "0 "+Integer.valueOf(minute)+" "+Integer.valueOf(time)+" * * ?";
+                //String cron = "0 20 11 * * ?";
                 log.info("预计费每天推送:" + cron);
                 log.info("预计费每天推送:" + "站点ID:"+siteId+"水司ID:"+customerId);
                 entity.setCronExpression(cron);

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/quartz/service/impl/EstimatedDayServiceImpl.java

@@ -59,7 +59,7 @@ public class EstimatedDayServiceImpl implements EstimatedDayService, Initializin
         boolean exists = jobAndTriggerService.isExists(entity);
         if(!exists) {
             //String cron = "0 */2 * * * ?";
-            String cron = "0 0 19 * * ? ";
+            String cron = "0 0 0 * * ?";
             log.info("预计费每天统计:" + cron);
             log.info("预计费每天统计:" + "站点ID:"+siteId+"水司ID:"+customerId);
             entity.setCronExpression(cron);

+ 43 - 4
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/archives/impl/PayBaseCustomerandmeterrelaServiceImpl.java

@@ -16,10 +16,7 @@ import com.bz.smart_city.dto.OrganizationDto;
 import com.bz.smart_city.dto.pay.*;
 import com.bz.smart_city.entity.Organization;
 import com.bz.smart_city.entity.ProgramItem;
-import com.bz.smart_city.entity.pay.PayBaseAccount;
-import com.bz.smart_city.entity.pay.PayBaseWaterprice;
-import com.bz.smart_city.entity.pay.PayMeter;
-import com.bz.smart_city.entity.pay.PayPayRechargeaccount;
+import com.bz.smart_city.entity.pay.*;
 import com.bz.smart_city.entity.pay.archives.*;
 import com.bz.smart_city.service.pay.PayBaseAccountService;
 import com.bz.smart_city.service.pay.PaySysDictService;
@@ -393,6 +390,20 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             customer.setOpendate(LocalDateTime.now());
             customer.setWaterPropertyId(paySaveCustomerDto.waterPropertyId);
             customer.setVatno(paySaveCustomerDto.getVatno()); //公司税号
+            customer.setValveRuleId(paySaveCustomerDto != null && paySaveCustomerDto.getValveRuleIds() != null ? StringUtils.join(paySaveCustomerDto.getValveRuleIds(),",") : "");
+            String[] valveIds = paySaveCustomerDto.getValveRuleIds();
+            String RName = "";
+            if(valveIds != null && valveIds.length >0){
+                List<String> list = Arrays.asList(valveIds);
+                List<PayControlRule> RList = payBaseCustomerandmeterrelaMapper.getRuleNames(loginUser.getSiteId(),loginUser.getCustomerId(),list);
+                if (RList != null && RList.size() >0){
+                    for(PayControlRule dao:RList){
+                        String name = dao.getName();
+                        RName = RName + name +",";
+                    }
+                }
+            }
+            customer.setValveRuleName(RName);
             payBaseCustomerandmeterrelaMapper.update(customer);
 
             //重修开户修改其它地方客户名称
@@ -421,6 +432,20 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             customer.setOpendate(LocalDateTime.now());
             customer.setWaterPropertyId(paySaveCustomerDto.waterPropertyId);
             customer.setVatno(paySaveCustomerDto.getVatno()); //公司税号
+            customer.setValveRuleId(paySaveCustomerDto != null && paySaveCustomerDto.getValveRuleIds() != null ? StringUtils.join(paySaveCustomerDto.getValveRuleIds(),",") : "");
+            String[] valveIds = paySaveCustomerDto.getValveRuleIds();
+            String RName = "";
+            if(valveIds != null && valveIds.length >0){
+                List<String> list = Arrays.asList(valveIds);
+                List<PayControlRule> RList = payBaseCustomerandmeterrelaMapper.getRuleNames(loginUser.getSiteId(),loginUser.getCustomerId(),list);
+                if (RList != null && RList.size() >0){
+                    for(PayControlRule dao:RList){
+                        String name = dao.getName();
+                        RName = RName + name +",";
+                    }
+                }
+            }
+            customer.setValveRuleName(RName);
             customerList.add(customer);
         }
 
@@ -759,6 +784,20 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             customer.setId(payBaseCustomerandmeterrela.getId());
             customer.setVatno(payBaseCustomerandmeterrela.getVatno());
             customer.setWaterPropertyId(newWaterPropertyId);
+            customer.setValveRuleId(payBaseCustomerandmeterrela != null && payBaseCustomerandmeterrela.getValveRuleIds() != null ? StringUtils.join(payBaseCustomerandmeterrela.getValveRuleIds(),",") : "");
+            String[] valveIds = payBaseCustomerandmeterrela.getValveRuleIds();
+            String RName = "";
+            if(valveIds != null && valveIds.length >0){
+                List<String> list = Arrays.asList(valveIds);
+                List<PayControlRule> RList = payBaseCustomerandmeterrelaMapper.getRuleNames(loginUser.getSiteId(),loginUser.getCustomerId(),list);
+                if (RList != null && RList.size() >0){
+                    for(PayControlRule dao:RList){
+                        String name = dao.getName();
+                        RName = RName + name +",";
+                    }
+                }
+            }
+            customer.setValveRuleName(RName);
             payBaseCustomerandmeterrelaMapper.update(customer);
 
             //编辑开户修改其它地方客户名称

+ 18 - 0
smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml

@@ -674,4 +674,22 @@
         </where>
         limit 1
     </select>
+
+    <select id="getRuleNames" resultType="com.bz.smart_city.entity.pay.PayControlRule">
+        select c.name from pay_control_rule c
+        <where>
+            <if test="siteId != null">
+                and c.site_id =#{siteId}
+            </if>
+            <if test="customerId != null">
+                and c.customer_id =#{customerId}
+            </if>
+            <if test="list != null">
+                and c.id in
+                <foreach collection="list" item="item" separator="," open="(" close=")" index="index" >
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+    </select>
 </mapper>