Sfoglia il codice sorgente

权限功能修改

liujh 3 anni fa
parent
commit
f0a6b6027c

+ 3 - 2
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpSupplierController.java

@@ -45,7 +45,8 @@ public class QpSupplierController extends BaseController<QpSupplier> {
     /**
      * 查询供应商列表
      */
-    @PreAuthorize(hasPermi = "airbottle:supplier:list")
+    //@PreAuthorize(hasPermi = "airbottle:supplier:list")
+    @PreAuthorize(hasPermi = PerPrefix.MODULE_AIRBOTTLE+PerPrefix.BUSINESS_SUPPLIER+ PerFun.LIST)
     @GetMapping("/list")
     @ApiOperation(value = "查询供应商列表", notes = "此接口默认查询审核通过的供应商,若需查询待审核供应商,请传参数 state=1,, 权限字符:" + PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER + PerFun.LIST)
     public TableDataInfo<QpSupplierVo> list(QpSupplier qpSupplier) {
@@ -70,7 +71,7 @@ public class QpSupplierController extends BaseController<QpSupplier> {
     /**
      * 查询供应商待审核列表
      */
-    @PreAuthorize(hasPermi = "airbottle:supplier:list")
+    @PreAuthorize(hasPermi = PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER + PerFun.LIST)
     @GetMapping("/checkList")
     @ApiOperation(value = "查询供应商待审核列表", notes = "权限字符:" + PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER + PerFun.LIST)
     public TableDataInfo<QpSupplier> checkList(QpSupplier qpSupplier) {

+ 25 - 0
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/domain/QpSupplier.java

@@ -72,4 +72,29 @@ public class QpSupplier extends BaseEntity {
     @ApiModelProperty(value = "经营地址")
     private String businessAddress;
 
+    /**
+     * 部门id
+     */
+    private Long deptId;
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+    @Override
+    public Long getDeptId() {
+        return deptId;
+    }
+    @Override
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+    @Override
+    public String getDeptName() {
+        return deptName;
+    }
+    @Override
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
 }

+ 4 - 0
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpSupplierServiceImpl.java

@@ -14,10 +14,12 @@ import com.zd.common.core.constant.Constants;
 import com.zd.common.core.constant.HttpStatus;
 import com.zd.common.core.constant.SecurityConstants;
 import com.zd.common.core.domain.R;
+import com.zd.common.core.domain.per.PerPrefix;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.SecurityUtils;
 import com.zd.common.core.utils.bean.TransferUtils;
+import com.zd.common.datascope.annotation.DataScope;
 import com.zd.common.security.utils.SaveUtil;
 import com.zd.system.api.RemoteUserService;
 import com.zd.system.api.domain.SysUser;
@@ -122,6 +124,7 @@ public class QpSupplierServiceImpl implements IQpSupplierService {
     }
 
     @Override
+    @DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.MODULE_AIRBOTTLE+PerPrefix.BUSINESS_SUPPLIER)
     public List<QpSupplier> getList(QpSupplier qpSupplier) {
         return qpSupplierMapper.selectQpSupplierList(qpSupplier);
     }
@@ -379,6 +382,7 @@ public class QpSupplierServiceImpl implements IQpSupplierService {
     }
 
     @Override
+    @DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.MODULE_AIRBOTTLE + PerPrefix.BUSINESS_SUPPLIER)
     public List<QpSupplier> checkList(QpSupplier qpSupplier) {
         return qpSupplierMapper.selectQpSupplierList(qpSupplier);
     }

+ 33 - 17
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpSupplierMapper.xml

@@ -12,6 +12,8 @@
         <result property="phone" column="phone"/>
         <result property="auditTime" column="audit_time"/>
         <result property="accountId" column="account_id"/>
+        <result property="deptId" column="dept_id"/>
+        <result property="deptName" column="dept_name"/>
         <result property="state" column="state"/>
         <result property="status" column="status"/>
         <result property="businessRecord" column="business_record"/>
@@ -30,6 +32,8 @@
                contacts,
                phone,
                account_id,
+               dept_id,
+               dept_name,
                audit_time,
                state,
                status,
@@ -49,6 +53,8 @@
                t.contacts,
                t.phone,
                t.account_id,
+               t.dept_id,
+               t.dept_name,
                t.audit_time,
                t.state,
                t.status,
@@ -60,37 +66,43 @@
                t.update_by,
                t.create_time
         from qp_supplier as t
+                 LEFT JOIN   sys_dept d on   t.dept_id=d.dept_id
+                 LEFT JOIN sys_user u on  t.user_id=u.user_id
     </sql>
     <select id="selectQpSupplierList" parameterType="com.zd.airbottle.domain.QpSupplier" resultMap="QpSupplierResult">
-        <include refid="selectQpSupplierVo"/>
+        <include refid="selectQpSupplierListVo"/>
         <where>
-            <if test="companyName != null  and companyName != ''">and company_name like concat('%', #{companyName},
+            <if test="companyName != null  and companyName != ''">and t.company_name like concat('%', #{companyName},
                 '%')
             </if>
-            <if test="companyShort != null  and companyShort != ''">and company_short = #{companyShort}</if>
-            <if test="contacts != null  and contacts != ''">and contacts = #{contacts}</if>
-            <if test="state != null ">and state = #{state}</if>
-            <if test="status != null ">and status = #{status}</if>
-            <if test="accountId != null ">and account_id = #{accountId}</if>
-            <if test="auditTime != null ">and audit_time = #{auditTime}</if>
-            <if test="phone != null  and phone != ''">and phone = #{phone}</if>
-            <if test="businessRecord != null  and businessRecord != ''">and business_record = #{businessRecord}</if>
-            <if test="businessAddress != null  and businessAddress != ''">and business_address = #{businessAddress}</if>
-            <if test="userId != null ">and user_id = #{userId}</if>
+            <if test="companyShort != null  and companyShort != ''">and t.company_short = #{companyShort}</if>
+            <if test="contacts != null  and contacts != ''">and t.contacts = #{contacts}</if>
+            <if test="state != null ">and t.state = #{state}</if>
+            <if test="status != null ">and t.status = #{status}</if>
+            <if test="accountId != null ">and t.account_id = #{accountId}</if>
+            <if test="deptId != null ">and t.dept_id = #{deptId}</if>
+            <if test="deptName != null ">and t.dept_name = #{deptName}</if>
+            <if test="auditTime != null ">and t.audit_time = #{auditTime}</if>
+            <if test="phone != null  and phone != ''">and t.phone = #{phone}</if>
+            <if test="businessRecord != null  and businessRecord != ''">and t.business_record = #{businessRecord}</if>
+            <if test="businessAddress != null  and businessAddress != ''">and t.business_address = #{businessAddress}</if>
+            <if test="userId != null ">and t.user_id = #{userId}</if>
             <if test="searchValue !=null and searchValue!=''">
-                and (company_name like concat('%', #{searchValue},
+                and (t.company_name like concat('%', #{searchValue},
                 '%')
-                or contacts like concat('%', #{searchValue},
+                or t.contacts like concat('%', #{searchValue},
                 '%')
-                or phone like concat('%', #{searchValue},
+                or t.phone like concat('%', #{searchValue},
                 '%'))
             </if>
             <if test="ids !=null and ids.size>0">
-                and id in
+                and t.id in
                 <foreach item="id" collection="ids" open="(" separator="," close=")">
                     #{id}
                 </foreach>
             </if>
+            <!-- 数据范围过滤 -->
+            ${params.dataScope}
         </where>
     </select>
 
@@ -141,6 +153,8 @@
             <if test="contacts != null">contacts,</if>
             <if test="phone != null">phone,</if>
             <if test="accountId != null">account_id,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
             <if test="auditTime != null">audit_time,</if>
             <if test="state != null">state,</if>
             <if test="status != null">status,</if>
@@ -158,6 +172,8 @@
             <if test="contacts != null">#{contacts},</if>
             <if test="phone != null">#{phone},</if>
             <if test="accountId != null">#{accountId},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
             <if test="auditTime != null">#{auditTime},</if>
             <if test="state != null">#{state},</if>
             <if test="status != null">#{status},</if>
@@ -205,4 +221,4 @@
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>