| | |
| | | List<SysUser> usersTemp = sysUser2Mapper.selectUserList(suTemp); |
| | | |
| | | //新增用户与科室 |
| | | List<SysUserDept> sysUserDept = sysUserDeptAll.stream().filter((SysUserDept b) -> b.getUserCode().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | List<SysUserDept> sysUserDept = sysUserDeptAll.stream().filter((SysUserDept b) -> |
| | | b.getUserCode().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | //新增用户与病区 |
| | | List<SysUserDept> sysUserDeptBf = sysUserDeptBfAll.stream().filter((SysUserDept b) -> b.getUserCode().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | List<SysUserDept> sysUserDeptBf = sysUserDeptBfAll.stream().filter((SysUserDept b) -> |
| | | b.getUserCode().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | //新增用户与院区 |
| | | List<SysUserOrg> sysUserOrg = sysUserOrgAll.stream().filter((SysUserOrg o) -> o.getUserId().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | List<SysUserOrg> sysUserOrg = sysUserOrgAll.stream().filter((SysUserOrg o) -> |
| | | o.getUserId().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | |
| | | List<String> userDepts = sysUserDept.stream().map(SysUserDept::getDeptCode).distinct().collect(Collectors.toList()); |
| | | List<String> userDeptBfs = sysUserDeptBf.stream().map(SysUserDept::getDeptCode).distinct().collect(Collectors.toList()); |
| | | List<String> userDepts = sysUserDept.stream().map(SysUserDept::getDeptCode). |
| | | distinct().collect(Collectors.toList()); |
| | | |
| | | List<String> userDeptBfs = sysUserDeptBf.stream().map(SysUserDept::getDeptCode). |
| | | distinct().collect(Collectors.toList()); |
| | | |
| | | //和queryHospUserInfoList采集的数据格式保持一致 |
| | | List<List<String>> userDeptsList = new ArrayList<>(); |
| | | if(!userDepts.isEmpty()){ |
| | | for(String userDept: userDepts){ |
| | | List<String> uDept = new ArrayList<>(); |
| | | uDept.add(userDept); |
| | | userDeptsList.add(uDept); |
| | | } |
| | | } |
| | | List<List<String>> userDeptBfsList = new ArrayList<>(); |
| | | if(!userDeptBfs.isEmpty()){ |
| | | for(String userBfDept: userDeptBfs){ |
| | | List<String> uBfDept = new ArrayList<>(); |
| | | uBfDept.add(userBfDept); |
| | | userDeptBfsList.add(uBfDept); |
| | | } |
| | | } |
| | | |
| | | if (usersTemp.size() > 0) { |
| | | sysUser1.setUserId(usersTemp.get(0).getUserId()); |
| | |
| | | } |
| | | //将部门我病区放到指定字段中 |
| | | Gson gson = new Gson(); |
| | | if(!userDepts.isEmpty()){ |
| | | sysUser1.setDeptInfo(gson.toJson(userDepts)); |
| | | } |
| | | if(!userDeptBfs.isEmpty()){ |
| | | sysUser1.setHospInfo(gson.toJson(userDeptBfs)); |
| | | } |
| | | sysUser1.setHospInfo(gson.toJson(userDeptsList)); |
| | | sysUser1.setDeptInfo(gson.toJson(userDeptBfsList)); |
| | | |
| | | sysUser2Mapper.updateUser(sysUser1); |
| | | } else { |
| | | sysUser1.setUserName(sysUser1.getHisUserId()); |
| | | //将部门我病区放到指定字段中 |
| | | Gson gson = new Gson(); |
| | | if(!userDepts.isEmpty()){ |
| | | sysUser1.setDeptInfo(gson.toJson(userDepts)); |
| | | } |
| | | if(!userDeptBfs.isEmpty()){ |
| | | sysUser1.setHospInfo(gson.toJson(userDeptBfs)); |
| | | } |
| | | sysUser1.setHospInfo(gson.toJson(userDeptsList)); |
| | | sysUser1.setDeptInfo(gson.toJson(userDeptBfsList)); |
| | | |
| | | sysUser2Mapper.insertUser(sysUser1); |
| | | //对应 SysUserServiceImpl selectUserByUserName2 191行 |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(sysUserOrg)) { |