Compare commits

...

2 Commits

Author SHA1 Message Date
姜玉琦 98abe2de96 Merge branch 'dev_xd' of http://62.234.3.186:3000/jiangyq/YZProjectCloud into dev_xd 2025-02-22 11:19:53 +08:00
姜玉琦 4cbac781bd 提交代码 2025-02-22 11:19:45 +08:00
4 changed files with 56 additions and 27 deletions

View File

@ -122,6 +122,9 @@ public class FlowTaskEntity extends BaseEntity {
@ApiModelProperty("角色列表")
private List<Long> roleIds;
@ApiModelProperty("班组列表")
private List<Long> groupIds;
public String getTaskId() {
return taskId;
}
@ -417,4 +420,12 @@ public class FlowTaskEntity extends BaseEntity {
public void setStartUserGroupId(Long startUserGroupId) {
this.startUserGroupId = startUserGroupId;
}
public List<Long> getGroupIds() {
return groupIds;
}
public void setGroupIds(List<Long> groupIds) {
this.groupIds = groupIds;
}
}

View File

@ -69,8 +69,12 @@
<if test="startProId != null and startProId != ''"> and fa.startProId = #{startProId}</if>
<if test="startProName != null and startProName != ''"> and fa.startProName like concat('%', #{startProName}, '%')</if>
<if test='activeTags == "depts"'> and fa.category = '1'</if>
<if test='activeTags == "users"'> and fa.category in ('2','3','4')
<if test="startUserGroupId != null"> and bus.sub_dept_group = #{startUserGroupId}</if>
<if test='activeTags == "users"'> and fa.category in ('2','3','4','5','6','8')</if>
<if test="groupIds != null and groupIds.size()>0">
and bus.sub_dept_group in
<foreach collection="groupIds" item="groupId" open="(" separator="," close=")">
#{groupId}
</foreach>
</if>
<if test="assigneeId != null and roleIds != null and roleIds.size()>0">
AND (fa.ASSIGNEE_ = #{assigneeId}
@ -142,16 +146,14 @@
<if test="startProId != null and startProId != ''"> and fa.startProId = #{startProId}</if>
<if test="startProName != null and startProName != ''"> and fa.startProName like concat('%', #{startProName}, '%')</if>
<if test='activeTags == "depts"'> and fa.category = '1'</if>
<if test='activeTags == "users"'> and fa.category in ('2','3','4')</if>
<if test='activeTags == "users"'> and fa.category in ('2','3','4','5','6','8')</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and fa.endTime between #{params.beginTime} and #{params.endTime}</if>
order by fa.endTime desc
</select>
<!--查询我的已办任务-->
<select id="selectMySubdeptsGroups" resultType="Map">
select * from pro_project_info_subdepts_users where project_id = #{proId} and user_id = #{userId} and user_post=3 and is_del=0
select id, sub_dept_group from pro_project_info_subdepts_users where project_id = #{proId} and user_id = #{userId} and user_post = 3 and approve_status <![CDATA[ >= ]]> 100 and is_del=0 and sub_dept_group is not null
</select>
</mapper>

View File

@ -150,24 +150,8 @@ public class FlowBusinessKeyController extends BaseController {
@GetMapping(value = "/myAwaitFlowTaskList")
public TableDataInfo myAwaitFlowTaskList(FlowTaskEntity flowTaskEntity) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if(SecurityUtils.isAdmin(loginUser.getUserid())){
// TODO超管查询所有申请...
if(Objects.nonNull(loginUser.getProjectDeptId())){
flowTaskEntity.setStartComId(Convert.toStr(loginUser.getProjectDeptId()));
}
if(Objects.nonNull(loginUser.getProjectId())){
flowTaskEntity.setStartProId(Convert.toStr(loginUser.getProjectId()));
}
}else if(SecurityUtils.isGSAdmin()){
// 公司管理员查询公司内的所有申请...
flowTaskEntity.setStartComId(Convert.toStr(loginUser.getProjectDeptId()));
if(Objects.nonNull(loginUser.getProjectId())){
flowTaskEntity.setStartProId(Convert.toStr(loginUser.getProjectId()));
}
}else if(SecurityUtils.isXMAdmin()){
// 公司管理员查询公司内的所有申请...
flowTaskEntity.setStartProId(Convert.toStr(loginUser.getProjectId()));
}else{
if(StringUtils.isNotEmpty(flowTaskEntity.getStartProId())){
// 小程序查询会走这里
flowTaskEntity.setAssigneeId(SecurityUtils.getUserId());
if(loginUser.getSysUser().getRoles().size()>0){
flowTaskEntity.setRoleIds(loginUser.getSysUser().getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
@ -176,6 +160,34 @@ public class FlowBusinessKeyController extends BaseController {
roleIds.add(0L);
flowTaskEntity.setRoleIds(roleIds);
}
}else{
if(SecurityUtils.isAdmin(loginUser.getUserid())){
// 超管查询所有申请...
if(Objects.nonNull(loginUser.getProjectDeptId())){
flowTaskEntity.setStartComId(Convert.toStr(loginUser.getProjectDeptId()));
}
if(Objects.nonNull(loginUser.getProjectId())){
flowTaskEntity.setStartProId(Convert.toStr(loginUser.getProjectId()));
}
}else if(SecurityUtils.isGSAdmin()){
// 公司管理员查询公司内的所有申请...
flowTaskEntity.setStartComId(Convert.toStr(loginUser.getProjectDeptId()));
if(Objects.nonNull(loginUser.getProjectId())){
flowTaskEntity.setStartProId(Convert.toStr(loginUser.getProjectId()));
}
}else if(SecurityUtils.isXMAdmin()){
// 公司管理员查询公司内的所有申请...
flowTaskEntity.setStartProId(Convert.toStr(loginUser.getProjectId()));
}else{
flowTaskEntity.setAssigneeId(SecurityUtils.getUserId());
if(loginUser.getSysUser().getRoles().size()>0){
flowTaskEntity.setRoleIds(loginUser.getSysUser().getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
}else{
List<Long> roleIds = new ArrayList<>();
roleIds.add(0L);
flowTaskEntity.setRoleIds(roleIds);
}
}
}
startPage();
return getDataTable(flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity));
@ -226,7 +238,8 @@ public class FlowBusinessKeyController extends BaseController {
data.put("todo",0);
}
data.put("dwsh",Convert.toInt(sumByCategory.get("1"),0));
data.put("rysh",Convert.toInt(sumByCategory.get("2"),0)+Convert.toInt(sumByCategory.get("3"),0)+Convert.toInt(sumByCategory.get("4"),0));
int rysh = Convert.toInt(sumByCategory.get("2"),0)+Convert.toInt(sumByCategory.get("3"),0)+Convert.toInt(sumByCategory.get("4"),0)+Convert.toInt(sumByCategory.get("5"),0)+Convert.toInt(sumByCategory.get("6"),0)+Convert.toInt(sumByCategory.get("8"),0);
data.put("rysh",rysh);
return success(data);
}

View File

@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
*
@ -46,7 +47,8 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
if(Objects.nonNull(flowTaskEntity.getAssigneeId())){
List<Map<String, Object>> groups = flowBusinessKeyMapper.selectMySubdeptsGroups(Convert.toLong(flowTaskEntity.getStartProId()),SecurityUtils.getUserId());
if(StringUtils.isNotEmpty(groups)){
flowTaskEntity.setStartUserGroupId(Convert.toLong(groups.get(0).get("sub_dept_group")));
List<Long> groupIds = groups.stream().map(group -> Convert.toLong(group.get("sub_dept_group"))).collect(Collectors.toList());
flowTaskEntity.setGroupIds(groupIds);
}
}
int awaitSize = flowBusinessKeyMapper.selectMyAwaitFlowTask(flowTaskEntity).size();
@ -99,7 +101,8 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
if(Objects.nonNull(flowTaskEntity.getAssigneeId())){
List<Map<String, Object>> groups = flowBusinessKeyMapper.selectMySubdeptsGroups(Convert.toLong(flowTaskEntity.getStartProId()),SecurityUtils.getUserId());
if(StringUtils.isNotEmpty(groups)){
flowTaskEntity.setStartUserGroupId(Convert.toLong(groups.get(0).get("sub_dept_group")));
List<Long> groupIds = groups.stream().map(group -> Convert.toLong(group.get("sub_dept_group"))).collect(Collectors.toList());
flowTaskEntity.setGroupIds(groupIds);
}
}
return flowBusinessKeyMapper.selectMyAwaitFlowTask(flowTaskEntity);