Browse Source

添加阀控设置规则

hym 3 years ago
parent
commit
daa9f895a3

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

@@ -18,7 +18,7 @@ public interface PayControlRuleMapper {
 
     Integer add(@Param("payControlRule") PayControlRule payControlRule);
 
-    List<PayControlRule>findList(@Param("id") Integer id, @Param("name") String name, @Param("tenantId") String tenantId, @Param("userCondition") UserCondition userCondition);
+    List<PayControlRule>findList(@Param("id") Integer id, @Param("name") String name, @Param("tenantId") String tenantId, @Param("userCondition") UserCondition userCondition, @Param("companyId") Integer companyId);
 
     Integer edit(@Param("payControlRule") PayControlRule payControlRule);
 

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

@@ -68,6 +68,7 @@
             <if test="tenantId != null"> and tenant_id = #{tenantId} </if>
             <if test="id != null"> and id = #{id}</if>
             <if test="name != null and name != ''"> and name LIKE concat('%',#{name},'%')</if>
+            <if test="companyId!=null"> and company_org_id=#{companyId}</if>
         </where>
         order by update_date desc
     </select>

+ 2 - 1
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/controller/pay/PayControlRuleController.java

@@ -103,9 +103,10 @@ public class PayControlRuleController {
             @ApiParam(value = "阀控规则名称", required = false) @RequestParam(required = false) String name,
             @ApiParam(value = "页数,非必传,默认第一页", required = false, defaultValue = "1") @RequestParam(required = false, defaultValue = "1") int pageNum,
             @ApiParam(value = "条数,非必传,默认15条", required = false, defaultValue = "15") @RequestParam(required = false, defaultValue = "15") int pageSize
+            ,@ApiParam(value = "机构id", required = false) @RequestParam(required = false) Integer companyId
     ){
         try {
-            Pagination<PayControlRule> payControlRules = payControlRuleService.findPage(name,pageNum,pageSize);
+            Pagination<PayControlRule> payControlRules = payControlRuleService.findPage(name,pageNum,pageSize,companyId);
             return new AjaxMessage<>(ResultStatus.OK,payControlRules);
         }
         catch (Exception ex){

+ 4 - 4
zoniot-pay/zoniot-pay-web/src/main/java/com/zcxk/rmcp/pay/service/impl/pay/PayControlRuleServiceImpl.java

@@ -69,16 +69,16 @@ public class PayControlRuleServiceImpl implements PayControlRuleService {
     public List<PayControlRule>findList(String name){
         LoginUser loginUser = UserUtil.getCurrentUser();
 
-        return payControlRuleMapper.findList(null,name,loginUser.getTenantId(), loginUser.getUserCondition());
+        return payControlRuleMapper.findList(null,name,loginUser.getTenantId(), loginUser.getUserCondition(), null);
     }
 
     @Override
-    public Pagination<PayControlRule> findPage(String name, int pageNum, int pageSize){
+    public Pagination<PayControlRule> findPage(String name, int pageNum, int pageSize, Integer companyId){
         LoginUser loginUser = UserUtil.getCurrentUser();
 
 
         PageHelper.startPage(pageNum,pageSize);
-        List<PayControlRule> payControlRules = payControlRuleMapper.findList(null,name,loginUser.getTenantId(),loginUser.getUserCondition());
+        List<PayControlRule> payControlRules = payControlRuleMapper.findList(null,name,loginUser.getTenantId(),loginUser.getUserCondition(),companyId);
         return new  Pagination<>(payControlRules);
     }
 
@@ -477,7 +477,7 @@ public class PayControlRuleServiceImpl implements PayControlRuleService {
     @Override
     public Integer GetConditionReusl(Integer id,String accountId,int flag,List<Integer> ConditionIds){
         //["=", "≠", ">", "<", "≥", "≤"]
-        List<PayControlRule> payControlRules = payControlRuleMapper.findList(id,null,null, null);
+        List<PayControlRule> payControlRules = payControlRuleMapper.findList(id,null,null, null, null);
 
         if(payControlRules != null && payControlRules.size() ==1){
 

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

@@ -15,7 +15,6 @@ import com.zcxk.rmcp.pay.entity.Message;
 import com.zcxk.rmcp.pay.entity.pay.PayBaseAccount;
 import com.zcxk.rmcp.pay.entity.pay.PayControlRule;
 import com.zcxk.rmcp.pay.entity.pay.PayControlValve;
-import com.zcxk.rmcp.pay.entity.pay.PaySysDict;
 import com.zcxk.rmcp.pay.entity.pay.archives.PayBaseCustomerandmeterrela;
 import com.zcxk.rmcp.pay.excel.resolver.InstallPlanResolverExcelTemplate;
 import com.zcxk.rmcp.pay.service.ImportService;
@@ -253,7 +252,7 @@ public class AsyncTaskImportService {
                                List<PayControlRule> contollList = newArrayList();
                                if(StringUtils.isNotBlank(contollName)){
                                    //根据阀控规则查找ID
-                                   contollList =payControlRuleMapper.findList(null,contollName,loginUser.getTenantId(), loginUser.getUserCondition());
+                                   contollList =payControlRuleMapper.findList(null,contollName,loginUser.getTenantId(), loginUser.getUserCondition(), null);
                                    if(contollList != null && contollList.size() > 0){
                                        if(contollList.get(0).getConditionId() == 5){
                                            //插入阀控记录

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

@@ -20,7 +20,7 @@ public interface PayControlRuleService {
     //查询规则
     List<PayControlRule> findList(String name);
 
-    Pagination<PayControlRule> findPage(String name, int pageNum, int pageSize);
+    Pagination<PayControlRule> findPage(String name, int pageNum, int pageSize, Integer companyId);
 
     Integer edit(PayControlRule payControlRule);
 

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

@@ -890,7 +890,7 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             //7.查找开户分组集合
             List<PaySysDictSelectDto> customerList  = paySysDictMapper.getAll(null,null,"开户分组",loginUser.getTenantId());
             //8.阀控规则集合
-            List<PayControlRule> controList = payControlRuleMapper.findList(null,null,loginUser.getTenantId(), loginUser.getUserCondition());
+            List<PayControlRule> controList = payControlRuleMapper.findList(null,null,loginUser.getTenantId(), loginUser.getUserCondition(), null);
             //列表数据将存储到指定的excel文件路径
             FileOutputStream out = new FileOutputStream(filePath);
             //这里的context是jxls框架上的context内容