Ver Fonte

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

lin há 3 anos atrás
pai
commit
a208d8fb09

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

@@ -1,5 +1,6 @@
 package com.zcxk.rmcp.pay.dao.pay;
 
+import com.bz.zoneiot.core.common.pojo.UserCondition;
 import com.zcxk.rmcp.pay.dto.pay.BaseWaterPropertyDataDto;
 import com.zcxk.rmcp.pay.dto.pay.BaseWaterPropertyDto;
 import com.zcxk.rmcp.pay.entity.pay.PayBaseWaterprice;
@@ -15,7 +16,7 @@ public interface BaseWaterPropertyMapper {
     public BaseWaterPropertyDto get(@Param("id") BigInteger id, @Param("tenantId") String tenantId);
 
 
-    public List<BaseWaterPropertyDto> getList(@Param("name") String name, @Param("tenantId") String tenantId, @Param("companyId") Integer companyId);
+    public List<BaseWaterPropertyDto> getList(@Param("name") String name, @Param("tenantId") String tenantId, @Param("companyId") Integer companyId, @Param("userCondition") UserCondition userCondition);
 
     public int delete(@Param("id") BigInteger id);
 

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

@@ -1,5 +1,6 @@
 package com.zcxk.rmcp.pay.dao.pay;
 
+import com.bz.zoneiot.core.common.pojo.UserCondition;
 import com.zcxk.rmcp.pay.dto.pay.PayBaseWatercategoryDto;
 import com.zcxk.rmcp.pay.entity.pay.PayBaseWatercategory;
 import org.apache.ibatis.annotations.Mapper;
@@ -27,7 +28,7 @@ public interface PayBaseWatercategoryMapper {
 
 
 
-    List<PayBaseWatercategoryDto> getAll(@Param("name") String name, @Param("tenantId") String tenantId, @Param("companyId") Integer companyId);
+    List<PayBaseWatercategoryDto> getAll(@Param("name") String name, @Param("tenantId") String tenantId, @Param("companyId") Integer companyId, @Param("userCondition") UserCondition userCondition);
     //判断数据是否存在
     List<Long> ExitsData(@Param("id") String id, @Param("name") String name, @Param("tenantId") String tenantId,@Param("companyId") Integer companyId);
 

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

@@ -60,9 +60,39 @@
 
 		<if test="name!=null">and a.name like concat('%',#{name},'%')</if>
 		<if test="companyId!=null">and a.company_org_id=#{companyId}</if>
+		<include refid="permissionCondition"></include>
 		order by a.create_date desc
 	</select>
-
+	<sql id="permissionCondition">
+		<if test="userCondition.tenantId != null">and a.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 ( a.dept_org_id in
+				<foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+					#{item.orgId}
+				</foreach>
+				or
+				a.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 a.dept_org_id in
+				<foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+					#{item.orgId}
+				</foreach>
+			</if>
+			<if test="userCondition.permissionType == 1">
+				and a.company_org_id in
+				<foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+					#{item.orgId}
+				</foreach>
+				and (a.dept_org_id is null or a.dept_org_id =0)
+			</if>
+		</if>
+	</sql>
 
     <select  id="getFeeInfo" resultType="com.zcxk.rmcp.pay.entity.pay.PayBaseWaterprice">
             select p.feename, p.feetype, p.price,p.id,dict.label from pay_base_waterproperty w

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

@@ -77,6 +77,7 @@
             <if test="companyId!=null">
                 and pbw.company_org_id=#{companyId}
             </if>
+        <include refid="permissionCondition"></include>
         </where>
         order by pbw.create_date desc
     </select>

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

@@ -93,6 +93,7 @@
             <if test="feename != null"> and pbw.feename like concat('%',#{feename,jdbcType = VARCHAR} ,'%') </if>
 			<if test="ladderlevel != null and ladderlevel!=''"> and pbw.ladderlevel=#{ladderlevel,jdbcType=INTEGER} </if>
             <if test="companyId!=null">and pbw.company_org_id=#{companyId} </if>
+       <include refid="permissionCondition"></include>
         </where>
         order by pbw.create_date desc
     </select>

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

@@ -129,6 +129,7 @@
 
             <if test="tenantId != null"> and pa1.tenant_id=#{tenantId}</if>
             <if test="companyId!=null">and pa1.company_org_id=#{companyId}</if>
+        <include refid="permissionCondition"></include>
         </where>
         order by pa1.create_date desc
     </select>

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

@@ -46,7 +46,7 @@ public class BaseWaterPropertyServiceImpl implements BaseWaterPropertyService {
         LoginUser loginUser = UserUtil.getCurrentUser();
 
         PageHelper.startPage(pageNum, pageSize);
-        List<BaseWaterPropertyDto> baseWaterProperties =  baseWaterPropertyMapper.getList(name,loginUser.getTenantId(),companyId)
+        List<BaseWaterPropertyDto> baseWaterProperties =  baseWaterPropertyMapper.getList(name,loginUser.getTenantId(),companyId,loginUser.getUserCondition())
                 ;
         return new Pagination<BaseWaterPropertyDto>(baseWaterProperties);
     }

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

@@ -32,7 +32,7 @@ public class PayBaseWatercategoryServiceImpl implements PayBaseWatercategoryServ
         LoginUser loginUser = UserUtil.getCurrentUser();
         PageHelper.startPage(pageNum, pageSize);
         List<PayBaseWatercategoryDto> payBaseWatercategoryDtoList =
-                payBaseWatercategoryMapper.getAll(name,loginUser.getTenantId(),companyId);
+                payBaseWatercategoryMapper.getAll(name,loginUser.getTenantId(),companyId,loginUser.getUserCondition());
 
         return new Pagination<>(payBaseWatercategoryDtoList);
     }
@@ -40,7 +40,7 @@ public class PayBaseWatercategoryServiceImpl implements PayBaseWatercategoryServ
     public List<PayBaseWatercategoryDto> getAll(Integer companyId)
     {
         LoginUser loginUser = UserUtil.getCurrentUser();
-        return payBaseWatercategoryMapper.getAll(null,loginUser.getTenantId(), companyId);
+        return payBaseWatercategoryMapper.getAll(null,loginUser.getTenantId(), companyId, loginUser.getUserCondition());
     }
 
     @Override

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

@@ -849,7 +849,7 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             //查找待开户信息
             List<PayMeter> meterInfoList = payBaseAccountMapper.findMeterInfo(null,null,"1",null,null,loginUser.getTenantId(),null,null,loginUser.getUserCondition());
             //2.查找用水性质集合
-            List<BaseWaterPropertyDto> propertyList = baseWaterPropertyMapper.getList(null,loginUser.getTenantId(), null);
+            List<BaseWaterPropertyDto> propertyList = baseWaterPropertyMapper.getList(null,loginUser.getTenantId(), null, loginUser.getUserCondition());
             //3.查找结算方式集合
             List<PaySysDictSelectDto> settlementList  = paySysDictMapper.getAll(null,null,"结算方式",loginUser.getTenantId());
             //4.查找证件类型集合