From 759d852f879fa4534aac36036fd6a7e50829bec5 Mon Sep 17 00:00:00 2001 From: zhouhaibin Date: Fri, 26 Apr 2024 14:50:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=9A=E8=AE=AF=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HuzhouUserController.java | 4 +- .../huzhou/controller/WorkflowController.java | 2 +- .../huzhou/dao/HuzhouUserprojectMapper.java | 2 +- .../dao/mapping/HuzhouUserprojectMapper.xml | 27 +++++++++ .../service/IHuzhouUserprojectService.java | 3 +- .../impl/HuzhouUserprojectServiceImpl.java | 56 +++++++++++++++++-- 6 files changed, 83 insertions(+), 11 deletions(-) diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouUserController.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouUserController.java index 8870f37..e461050 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouUserController.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouUserController.java @@ -34,10 +34,10 @@ public class HuzhouUserController { private IHuzhouUserprojectService userprojectService; @GetMapping("/getMyAddressBook") - public Result> getMyAddressBook(@RequestParam(name="current", defaultValue="1") Integer pageNo, + public Result> getMyAddressBook(@RequestParam HashMap map,@RequestParam(name="current", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ //先查询当前参与的项目 - Page myAddressBook = userprojectService.getMyAddressBook(pageNo, pageSize); + Page myAddressBook = userprojectService.getMyAddressBook(pageNo, pageSize,map); return Result.OK(myAddressBook); } @ResponseResult diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/WorkflowController.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/WorkflowController.java index 6c3a502..32c52b3 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/WorkflowController.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/WorkflowController.java @@ -341,7 +341,7 @@ public class WorkflowController { ProcessInstance processInstance = runtimeService.createProcessInstanceQuery() .processInstanceId(processInstanceId) .singleResult(); - //说明流程已经结束 + //说明流程未结束 if(processInstance!=null){ BpmnModel bpmnModel = repositoryService.getBpmnModel(processInstance.getProcessDefinitionId()); Collection flowElements = bpmnModel.getProcesses().get(0).getFlowElements(); diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouUserprojectMapper.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouUserprojectMapper.java index 6434c85..d8cc168 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouUserprojectMapper.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouUserprojectMapper.java @@ -12,6 +12,6 @@ import java.util.Map; public interface HuzhouUserprojectMapper extends BaseMapper { - Page getMyAddressBook(Page page, HuzhouProjectinfo info); + Page getMyAddressBook(Page page, HuzhouProjectinfo info,HashMap map); } diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouUserprojectMapper.xml b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouUserprojectMapper.xml index 7246834..c3df279 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouUserprojectMapper.xml +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouUserprojectMapper.xml @@ -9,7 +9,20 @@ inner join huzhou_projectinfo u on up.project_id =u.id where + + + and s.nickname like #{tempStr1} + + + + and s.username like #{tempStr2} + + + + and u.project_name like #{tempStr3} + + and up.user_id!=#{map.currentUserId} ) UNION @@ -19,6 +32,20 @@ inner join huzhou_sub_projectinfo u on up.project_id =u.id where + + + and s.nickname like #{tempStr1} + + + + + and s.username like #{tempStr2} + + + + and u.project_name like #{tempStr3} + + and up.user_id!=#{map.currentUserId} ) order by username,adminDivision diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouUserprojectService.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouUserprojectService.java index b7c9888..3543cd0 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouUserprojectService.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouUserprojectService.java @@ -10,6 +10,7 @@ import org.springframework.data.domain.PageRequest; import org.springframework.web.bind.annotation.RequestParam; +import java.util.HashMap; import java.util.Map; @@ -25,7 +26,7 @@ public interface IHuzhouUserprojectService extends IService { void removeByProjectId(String projectId,String issubproject); SysUser getUserByrealNameOrName(String id); - Page getMyAddressBook(Integer pageNo, Integer pageSize); + Page getMyAddressBook(Integer pageNo, Integer pageSize, HashMap map); SysUser saveData(SysUser object); diff --git a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUserprojectServiceImpl.java b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUserprojectServiceImpl.java index e557dd1..d5627af 100644 --- a/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUserprojectServiceImpl.java +++ b/huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUserprojectServiceImpl.java @@ -78,24 +78,65 @@ public class HuzhouUserprojectServiceImpl extends ServiceImpl> userDictByRoles = sysUserService.getUserDictByRoles(dictName); - ArrayList strings = new ArrayList<>(); if(userDictByRoles==null||userDictByRoles.size()==0){ String error = "任务牵头处室"+dictName+"负责人未找到"; throw new EasyException(error); } - userDictByRoles.forEach(item->{ - String value = item.get("value"); + for (HashMap map:userDictByRoles + ) { + String value = map.get("value"); HuzhouUserproject huzhouUserproject = new HuzhouUserproject(); huzhouUserproject.setProjectId(projectinfo.getId()); huzhouUserproject.setUserId(value); huzhouUserproject.setIssubproject(issubproject); this.save(huzhouUserproject); - }); + } + //添加信息化保障团队负责人 + String adminDivision = projectinfo.getAdminDivision(); + if(null!=adminDivision){ + if("市本级".equals(adminDivision)){ + //是市本级,判读责任单位 + String dutyWorkplace = projectinfo.getDutyWorkplace(); + if(null!=dutyWorkplace){ + if(dutyWorkplace.contains("湖州市中心医院")){ + //是湖州市中心医院 则由吴兴区负责人审批 + adminDivision="吴兴区"; + }else if(dutyWorkplace.contains("湖州市第一人民医院")){ + //是湖州市第一人民医院,则有南浔区负责人审批 + adminDivision="南浔区"; + }else if(dutyWorkplace.contains("湖州市第三人民医院")){ + //是湖州市第三人民医院,则有德清县负责人审批 + adminDivision="德清县"; + }else if(dutyWorkplace.contains("湖州市妇幼保健院")){ + adminDivision="安吉县"; + }else if(dutyWorkplace.contains("湖州市中医院")){ + adminDivision="长兴县"; + } + } + } + //行政区县名称查询角色有哪些人 + userDictByRoles = userService.getUserDictByRoles(adminDivision); + if(userDictByRoles==null||userDictByRoles.size()==0){ + String error = "信息化保障团队"+adminDivision+"负责人未找到"; + throw new EasyException(error); + } + for (HashMap map:userDictByRoles + ) { + String value = map.get("value"); + HuzhouUserproject huzhouUserproject = new HuzhouUserproject(); + huzhouUserproject.setProjectId(projectinfo.getId()); + huzhouUserproject.setUserId(value); + huzhouUserproject.setIssubproject(issubproject); + this.save(huzhouUserproject); + } + } + } @Override @@ -120,13 +161,16 @@ public class HuzhouUserprojectServiceImpl extends ServiceImpl getMyAddressBook(Integer pageNo, Integer pageSize) { + public Page getMyAddressBook(Integer pageNo, Integer pageSize,HashMap map) { Page sysUserPage = new Page(pageNo,pageSize); HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo(); ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(huzhouProjectinfo); + SysUser currentUser = ShiroUtil.getCurrentUser(); + String id = currentUser.getId(); + map.put("currentUserId",id);//排除当前人员信息 + Page myAddressBook = userprojectMapper.getMyAddressBook(sysUserPage, projectInfoAuthSelect,map); - Page myAddressBook = userprojectMapper.getMyAddressBook(sysUserPage, projectInfoAuthSelect); return myAddressBook; }