Commit c3f8a9a5 by hzc

短板清单允许下发人部门用户查看

parent 7c1363d6
...@@ -14,7 +14,7 @@ public class ShortboardParam { ...@@ -14,7 +14,7 @@ public class ShortboardParam {
private Long offset; private Long offset;
@ApiModelProperty("一页条数") @ApiModelProperty("一页条数")
private Integer size; private Integer size;
@ApiModelProperty("搜索关键词") @ApiModelProperty("搜索关键词---短板名称")
private String keyword; private String keyword;
@ApiModelProperty("机构编码") @ApiModelProperty("机构编码")
private String code; private String code;
...@@ -26,4 +26,10 @@ public class ShortboardParam { ...@@ -26,4 +26,10 @@ public class ShortboardParam {
private String userId; private String userId;
@ApiModelProperty("下发人id") @ApiModelProperty("下发人id")
private String createUserId; private String createUserId;
@ApiModelProperty("单位名称-模糊查询")
private String unitName;
@ApiModelProperty("日期精确查询--维度")
private String dateInt;
} }
...@@ -81,4 +81,14 @@ public interface SystemAuthService { ...@@ -81,4 +81,14 @@ public interface SystemAuthService {
*/ */
@GetMapping("/user/getUserById") @GetMapping("/user/getUserById")
String getUserByIds(@RequestParam List<String> userIds) ; String getUserByIds(@RequestParam List<String> userIds) ;
/**
* 根据用户id获取到,该用户所属的机构下角色为3的用户
* @param: [userId]
* @author: hzc
* @date: 2021/9/24 16:35
*/
@GetMapping("/user/getOrgRoleUser")
List<JSONObject> getOrgRoleUser(@RequestParam("userId") String userId);
} }
package com.keymobile.indicators.service.hytobacco; package com.keymobile.indicators.service.hytobacco;
import com.alibaba.fastjson.JSONObject;
import com.keymobile.indicators.constant.Constants; import com.keymobile.indicators.constant.Constants;
import com.keymobile.indicators.model.entity.indicators.DriveIndCatalog; import com.keymobile.indicators.model.entity.indicators.DriveIndCatalog;
import com.keymobile.indicators.model.entity.shortboard.*; import com.keymobile.indicators.model.entity.shortboard.*;
import com.keymobile.indicators.model.mapper.indmapper.*; import com.keymobile.indicators.model.mapper.indmapper.*;
import com.keymobile.indicators.result.Result; import com.keymobile.indicators.result.Result;
import com.keymobile.indicators.service.SystemAuthService;
import com.keymobile.indicators.utils.LogManager; import com.keymobile.indicators.utils.LogManager;
import com.keymobile.indicators.utils.SystemUserUtil; import com.keymobile.indicators.utils.SystemUserUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -30,7 +32,7 @@ public class ShortboardTaskService { ...@@ -30,7 +32,7 @@ public class ShortboardTaskService {
private ShortboardTaskValMapper shortboardTaskValMapper; private ShortboardTaskValMapper shortboardTaskValMapper;
@Autowired @Autowired
private ShortboardRuleMapper shortboardRuleMapper; private SystemAuthService systemAuthService;
@Autowired @Autowired
private ShortBoardAuditRecordMapper shortBoardAuditRecordMapper; private ShortBoardAuditRecordMapper shortBoardAuditRecordMapper;
...@@ -56,12 +58,21 @@ public class ShortboardTaskService { ...@@ -56,12 +58,21 @@ public class ShortboardTaskService {
//下发人-存的是用户的登录id //下发人-存的是用户的登录id
shortBoardTask.setCreateUserId(SystemUserUtil.getCurrentUserName()); shortBoardTask.setCreateUserId(SystemUserUtil.getCurrentUserName());
//接收人-主键id //接收人-主键id
String userId = SystemUserUtil.getCurrentUserId();
String enterUserId = shortBoardTask.getEnterUserId(); String enterUserId = shortBoardTask.getEnterUserId();
enterUserId =enterUserId+userId+","; //填报接收人id 多个用逗号分开..|能看的用户如 ,1,2,|,3,4 1和2可以修改查看,3和4只能查看
StringBuilder onlyReadUsers = new StringBuilder("|,");//|后面的用户是只读
//只能查看的用户---|后面
List<JSONObject> orgRoleUsers = systemAuthService.getOrgRoleUser(SystemUserUtil.getCurrentUserName());
for (JSONObject orgRoleUser : orgRoleUsers) {
Integer id = orgRoleUser.getInteger("id");
onlyReadUsers.append(id);
onlyReadUsers.append(",");
}
enterUserId= enterUserId+onlyReadUsers.toString();
shortBoardTask.setEnterUserId(enterUserId); shortBoardTask.setEnterUserId(enterUserId);
String currentUser = SystemUserUtil.getCurrentUser(); String currentUser = SystemUserUtil.getCurrentUser();
String[] split = currentUser.split(Constants.SEP_COLON); String[] split = currentUser.split(Constants.SEP_COLON);
if(split.length>2){ if(split.length>2){
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<sql id="findWhereSql"> <sql id="findWhereSql">
where 1 = 1 where 1 = 1
<if test="keyword != null and keyword != ''"> <if test="keyword != null and keyword != ''">
and sbt.shortboard_name like concat('%', #{keyword}, '%') and sbt.drive_name like concat('%', #{keyword}, '%')
</if> </if>
<if test="statusArr != null"> <if test="statusArr != null">
and sbt.status in and sbt.status in
...@@ -73,6 +73,13 @@ ...@@ -73,6 +73,13 @@
<if test="createUserId !=null and createUserId!=''"> <if test="createUserId !=null and createUserId!=''">
and sbt.create_user_id = #{createUserId} and sbt.create_user_id = #{createUserId}
</if> </if>
<if test="dateInt !=null and dateInt!=0">
and sbt.date_int = #{dateInt}
</if>
<if test="unitName !=null and unitName!=''">
and sbt.unit_name like concat('%',#{unitName},'%')
</if>
</sql> </sql>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment