模块:api接口
新增:根据7位货柜条码获取所属课题下的所有人员否则部门寻找
提出:秦老师
| | |
| | | System.out.println(5); |
| | | return retJSON;*/ |
| | | } |
| | | |
| | | //从柜子的设备码根据设备的所在实验室的课题组的课题组下的所有用户,没有课题组则返回用部门搜索 |
| | | @ResponseBody |
| | | @RequestMapping(value = "/userListByContainerCodeNew") |
| | | public Object userListByContainerCodeNew(@RequestParam String containerCode,@RequestParam String startTime, @RequestParam String endTime) throws ApiException { |
| | | logger.info("userListByContainerCodeNew start...containerCode= " + containerCode |
| | | + ",startTime=" + startTime |
| | | + ",endTime=" + endTime); |
| | | |
| | | |
| | | //1.课题组下的用户 |
| | | List<SysUser> userList= interfaceService.getUserListByContainerCodeNew(containerCode, startTime, endTime); |
| | | if (userList == null) { |
| | | //2.否则部门下用户 |
| | | userList = interfaceService.getUserListByContainerCode(containerCode, startTime, endTime); |
| | | } |
| | | |
| | | List<Map> datalist = Lists.newArrayListWithCapacity(userList.size()); |
| | | for (SysUser user : userList) { |
| | | Map<String, Object> map = Maps.newHashMapWithExpectedSize(5); |
| | | datalist.add(map); |
| | | map.put("name", user.getName()); |
| | | map.put("role", user.getSeeFlag().getKey()); |
| | | map.put("validFlag", user.getValidFlag().getKey()); |
| | | map.put("idcard", user.getIdCard()); |
| | | map.put("point", user.getPoint()); |
| | | map.put("unit", user.getCompany()); |
| | | map.put("Arp", user.getArp()); |
| | | map.put("departmentName", user.getDepartment()); |
| | | |
| | | } |
| | | logger.info("getUserInfo end..."); |
| | | return ResponseModel.getOkInstence(datalist); |
| | | } |
| | | } |
| | |
| | | int selectUserFavor(Map params); |
| | | |
| | | |
| | | List<SysUser> getUserListByContainerCodeNew(String containerCode, String startTime, String endTime); |
| | | } |
| | |
| | | and u.update_time >= #{1} and #{2} > u.update_time |
| | | </select> |
| | | |
| | | |
| | | <select id="getUserListByContainerCodeNew" parameterType="java.util.Map" resultMap="SysUser"> |
| | | SELECT u.name,u.see_flag,u.role_id,u.valid_flag,u.id_card,bm2.meta_value department,bm1.meta_value company,u.arp,u.point |
| | | from sys_user u |
| | | left join base_meta bm1 on bm1.id = u.company |
| | | left join base_meta bm2 on bm2.id = u.department |
| | | where project_id = ( |
| | | SELECT project_id from sys_laboratory_container |
| | | WHERE container_code = #{0} |
| | | and valid_flag = 1) |
| | | AND u.valid_flag = 1 |
| | | and u.update_time >= #{1} and #{2} > u.update_time |
| | | </select> |
| | | |
| | | <select id="selectByAccount" parameterType="com.nanometer.smartlab.entity.SysUser" resultMap="SysUser"> |
| | | select * from sys_user where valid_flag=1 and account=#{account} |
| | | </select> |
| | |
| | | |
| | | public List<SysUser> getUserListByContainerCode(String containerCode, String startTime,String endTime) throws ApiException; |
| | | |
| | | List<SysUser> getUserListByContainerCodeNew(String containerCode, String startTime, String endTime) throws ApiException; |
| | | } |
| | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> getUserListByContainerCodeNew(String containerCode, String startTime, String endTime) throws ApiException{ |
| | | if (containerCode==null||containerCode.isEmpty()) { |
| | | throw new ApiException(ApiStatus.PARAM_NO_EXIST, ApiStatus.PARAM_NO_EXIST.getRetMsg() + "[containerCode]"); |
| | | } |
| | | |
| | | return sysUserDao.getUserListByContainerCodeNew(containerCode, startTime, endTime); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRED) |