Browse Source

评估客户信息部门主任可修改判定调整

user5 1 year ago
parent
commit
de9cc13ec4

+ 5 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/factory/UserApiFallbackFactory.java

@@ -200,6 +200,11 @@ public class UserApiFallbackFactory implements FallbackFactory <IUserApi> {
                 return null;
             }
 
+            @Override
+            public Integer getUserPostCountById(String id) {
+                return null;
+            }
+
         };
     }
 }

+ 8 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/feign/IUserApi.java

@@ -294,6 +294,14 @@ public interface IUserApi {
      */
     @GetMapping(value = BASE_URL + "/getUserIdByName")
     String getUserIdByName(@RequestParam(value = "name")String name);
+
+    /**
+     * 根据用户id查询是否存在“部门主任”岗位
+     * @param id
+     * @return
+     */
+    @GetMapping(value = BASE_URL + "/getUserPostCountById")
+    Integer getUserPostCountById(@RequestParam(value = "id")String id);
 }
 
 

+ 7 - 1
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/workClientInfo/controller/WorkClientController.java

@@ -53,8 +53,14 @@ public class WorkClientController {
         }
         IPage<WorkClientInfo> list = workClientService.list(page,workClientInfoQueryWrapper);
         UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        Integer postCount = 0;
+        if(null != userDTO && StringUtils.isNotBlank(userDTO.getId())){
+            //查询当前用户是否存在部门主任岗位信息(部门主任可调整所有客户信息)
+            postCount = SpringUtil.getBean ( IUserApi.class ).getUserPostCountById(userDTO.getId());
+        }
+        //判定当前登录人是否为部门主任
         for (WorkClientInfo info: list.getRecords()) {
-            if(userDTO.getName().equals(info.getCreateById()) || userDTO.isAdmin()){
+            if(userDTO.getName().equals(info.getCreateById()) || userDTO.isAdmin() || postCount > 0){
                 info.setCreateFlag("1");
             }else{
                 info.setCreateFlag("0");

+ 1 - 2
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml

@@ -272,8 +272,7 @@
         DISTINCT
         <include refid="Base_Column_List"></include>,
         su.name as reconciliationPeopleName,
-        rpl.report_no,
-        pr.report_type as reportType
+        rpl.report_no
         from cw_finance_invoice fi
         left join cw_finance_invoice_base fib on fib.invoice_id = fi.id
         left join cw_project_report_new_line rpl on fib.program_id=rpl.report_id

+ 5 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/feign/UserApiImpl.java

@@ -234,4 +234,9 @@ public class UserApiImpl implements IUserApi {
         return userService.getUserIdByName(name) ;
     }
 
+    @Override
+    public Integer getUserPostCountById(String id) {
+        return userService.getUserPostCountById(id) ;
+    }
+
 }

+ 3 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/UserMapper.java

@@ -252,4 +252,7 @@ public interface UserMapper extends BaseMapper <User> {
     @InterceptorIgnore(tenantLine = "true")
     void updateDelFlagById(@Param("id") String id);
 
+    @InterceptorIgnore(tenantLine = "true")
+    Integer getUserPostCountById(@Param("id") String id);
+
 }

+ 12 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml

@@ -570,4 +570,16 @@ select a.id, a.company_id as "companyDTO.id", a.office_id as "officeDTO.id", a.l
         update sys_user set del_flag = '1',login_flag = '0' where id=#{id}
     </update>
 
+    <select id="getUserPostCountById" resultType="java.lang.Integer">
+        SELECT
+            count(a.id)
+        FROM
+            sys_user a
+            LEFT JOIN sys_user_post sup ON sup.user_id = a.id
+            LEFT JOIN sys_post sp ON sp.id = sup.post_id
+        WHERE
+            sp.CODE = 'bmzr'
+            AND a.id = #{id}
+    </select>
+
 </mapper>

+ 9 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/UserService.java

@@ -675,4 +675,13 @@ public class UserService extends ServiceImpl <UserMapper, User> {
     public void updateDelFlagById(String id) {
         userMapper.updateDelFlagById(id);
     }
+
+    /**
+     * 根据用户id查询是否存在“部门主任”岗位
+     * @param id
+     * @return
+     */
+    public Integer getUserPostCountById(String id) {
+        return userMapper.getUserPostCountById (id);
+    }
 }