| | |
| | | public class UserController extends BaseController { |
| | | |
| | | /** |
| | | * 企业员工列表 |
| | | * 获取用户列表 |
| | | */ |
| | | @RequestMapping(value = "/list",method = RequestMethod.POST) |
| | | public PlatformResult typeList(HttpServletRequest request) { |
| | | public PlatformResult userList(HttpServletRequest request) { |
| | | //获取返回参数 |
| | | String bodyData = HttpServletRequestUtil.getBody(request); |
| | | if(StringUtils.isEmpty(bodyData)){ |
| | |
| | | return PlatformResult.success(data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取指定用户 |
| | | */ |
| | | @RequestMapping(value = "/appoint_user",method = RequestMethod.POST) |
| | | public PlatformResult appointUser(HttpServletRequest request) { |
| | | //获取返回参数 |
| | | String bodyData = HttpServletRequestUtil.getBody(request); |
| | | if(StringUtils.isEmpty(bodyData)){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_BODY_DATA,"数据格式错误"); |
| | | } |
| | | |
| | | UserList userList = null; |
| | | |
| | | try{ |
| | | userList = JSONObject.parseObject(bodyData,UserList.class); |
| | | }catch (Exception e){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_BODY_DATA,"数据格式错误"); |
| | | } |
| | | |
| | | if(userList == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_BODY_DATA,"数据格式错误"); |
| | | } |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> values = new HashMap<>(); |
| | | values.put("isDel", BaseEntity.NO); |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append("SELECT u.id,u.name,u.CIQ,u.tel,u.apiId,u.imgUrl,u.gender,DATE_FORMAT(u.createTime,'%Y-%m-%d %H:%i:%S') AS createTime" + |
| | | ",(SELECT un.unionId FROM user_union_his un WHERE un.isDel = #{m.isDel} AND un.userId = u.id LIMIT 1) AS unionId" + |
| | | " FROM user u WHERE u.isDel = #{m.isDel}"); |
| | | |
| | | if (StringUtils.noNull(userList.getCiq())){ |
| | | values.put("ciq",userList.getCiq()); |
| | | sql.append(" AND u.CIQ = #{m.ciq}"); |
| | | } |
| | | if (StringUtils.noNull(userList.getTel())){ |
| | | values.put("tel",userList.getTel()); |
| | | sql.append(" AND u.tel = #{m.tel}"); |
| | | } |
| | | |
| | | sqlSentence.sqlSentence(sql.toString(),values); |
| | | List<Map<String,Object>> employeeList = commonService.selectListMap(EmployeeMapper.class,sqlSentence); |
| | | Map<String,Object> data = new HashMap<>(); |
| | | data.put("userList",employeeList); |
| | | |
| | | return PlatformResult.success(data); |
| | | } |
| | | |
| | | |
| | | } |