Browse Source

优化通讯录

master
zhouhaibin 7 months ago
parent
commit
759d852f87
  1. 4
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouUserController.java
  2. 2
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/WorkflowController.java
  3. 2
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouUserprojectMapper.java
  4. 27
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouUserprojectMapper.xml
  5. 3
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouUserprojectService.java
  6. 56
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUserprojectServiceImpl.java

4
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<Page<Map>> getMyAddressBook(@RequestParam(name="current", defaultValue="1") Integer pageNo,
public Result<Page<Map>> getMyAddressBook(@RequestParam HashMap<String,Object> map,@RequestParam(name="current", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
//先查询当前参与的项目
Page<Map> myAddressBook = userprojectService.getMyAddressBook(pageNo, pageSize);
Page<Map> myAddressBook = userprojectService.getMyAddressBook(pageNo, pageSize,map);
return Result.OK(myAddressBook);
}
@ResponseResult

2
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<FlowElement> flowElements = bpmnModel.getProcesses().get(0).getFlowElements();

2
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<HuzhouUserproject> {
Page<Map> getMyAddressBook(Page page, HuzhouProjectinfo info);
Page<Map> getMyAddressBook(Page page, HuzhouProjectinfo info,HashMap<String,Object> map);
}

27
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
<include refid="com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoMapper.selectAuthSql"/>
<if test="map.realname!=null and map.realname!=''">
<bind name="tempStr1" value="'%' + map.realname + '%'" />
and s.nickname like #{tempStr1}
</if>
<if test="map.username!=null and map.username!=''">
<bind name="tempStr2" value="'%' + map.username + '%'" />
and s.username like #{tempStr2}
</if>
<if test="map.projectName!=null and map.projectName!=''">
<bind name="tempStr3" value="'%' + map.projectName + '%'" />
and u.project_name like #{tempStr3}
</if>
and up.user_id!=#{map.currentUserId}
)
UNION
@ -19,6 +32,20 @@
inner join huzhou_sub_projectinfo u on up.project_id =u.id
where
<include refid="com.easy.admin.modules.huzhou.dao.HuzhouProjectinfoMapper.selectAuthSql"/>
<if test="map.realname!=null and map.realname!=''">
<bind name="tempStr1" value="'%' + map.realname + '%'" />
and s.nickname like #{tempStr1}
</if>
<if test="map.username!=null and map.username!=''">
<bind name="tempStr2" value="'%' + map.username + '%'" />
and s.username like #{tempStr2}
</if>
<if test="map.projectName!=null and map.projectName!=''">
<bind name="tempStr3" value="'%' + map.projectName + '%'" />
and u.project_name like #{tempStr3}
</if>
and up.user_id!=#{map.currentUserId}
)
order by username,adminDivision
</select>

3
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<HuzhouUserproject> {
void removeByProjectId(String projectId,String issubproject);
SysUser getUserByrealNameOrName(String id);
Page<Map> getMyAddressBook(Integer pageNo, Integer pageSize);
Page<Map> getMyAddressBook(Integer pageNo, Integer pageSize, HashMap<String,Object> map);
SysUser saveData(SysUser object);

56
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUserprojectServiceImpl.java

@ -78,24 +78,65 @@ public class HuzhouUserprojectServiceImpl extends ServiceImpl<HuzhouUserprojectM
this.save(huzhouUserproject);
}
}
//添加上级指导室负责人
String superLeader = projectinfo.getSuperLeader();
SysDict dict = sysDictService.getDictByCode("superLeader", superLeader);
String dictName = dict.getName();
//上级指导室中文名称查询角色有哪些人
List<HashMap<String, String>> userDictByRoles = sysUserService.getUserDictByRoles(dictName);
ArrayList<String> 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<String, String> 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<String, String> 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<HuzhouUserprojectM
@Override
public Page<Map> getMyAddressBook(Integer pageNo, Integer pageSize) {
public Page<Map> getMyAddressBook(Integer pageNo, Integer pageSize,HashMap<String,Object> map) {
Page sysUserPage = new Page<SysUser>(pageNo,pageSize);
HuzhouProjectinfo huzhouProjectinfo = new HuzhouProjectinfo();
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(huzhouProjectinfo);
SysUser currentUser = ShiroUtil.getCurrentUser();
String id = currentUser.getId();
map.put("currentUserId",id);//排除当前人员信息
Page<Map> myAddressBook = userprojectMapper.getMyAddressBook(sysUserPage, projectInfoAuthSelect,map);
Page<Map> myAddressBook = userprojectMapper.getMyAddressBook(sysUserPage, projectInfoAuthSelect);
return myAddressBook;
}

Loading…
Cancel
Save