From e05e9e05ef7edb1cdac6443f82deba3befed5c52 Mon Sep 17 00:00:00 2001 From: zhouxiang <zhouxiang> Date: 星期三, 15 十二月 2021 10:52:24 +0800 Subject: [PATCH] Merge branch 'master' of http://1.15.4.62/r/~chenjiahe/phi_platform into zhouxiangTest --- phi_platform_user/src/main/java/com/hx/phip/controller/employee/RoleController.java | 7 -- phi_platform_user/src/main/java/com/hx/phip/controller/login/EmployeeLoginController.java | 4 phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeList.java | 2 phi_platform_user/src/main/java/com/hx/phip/common/TestController.java | 12 ---- phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeQrLogin.java | 2 phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeRoleLogin.java | 2 phi_platform_user/src/main/java/com/hx/phip/controller/user/UserController.java | 104 +++++++++++++++++++++++++++++++++- phi_platform_common/src/main/java/com/hx/phip/entity/user/UserList.java | 2 phi_platform_common/src/main/java/com/hx/phip/entity/user/UserData.java | 13 ++++ phi_platform_user/src/main/java/com/hx/phip/controller/employee/EmployeeController.java | 12 --- 10 files changed, 122 insertions(+), 38 deletions(-) diff --git a/phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeList.java b/phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeList.java similarity index 97% rename from phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeList.java rename to phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeList.java index f582ac7..fb0da05 100644 --- a/phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeList.java +++ b/phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeList.java @@ -1,4 +1,4 @@ -package com.hx.phip.entity; +package com.hx.phip.entity.employee; public class EmployeeList { diff --git a/phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeQrLogin.java b/phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeQrLogin.java similarity index 93% rename from phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeQrLogin.java rename to phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeQrLogin.java index 872a872..a835a15 100644 --- a/phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeQrLogin.java +++ b/phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeQrLogin.java @@ -1,4 +1,4 @@ -package com.hx.phip.entity; +package com.hx.phip.entity.employee; public class EmployeeQrLogin { diff --git a/phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeRoleLogin.java b/phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeRoleLogin.java similarity index 92% rename from phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeRoleLogin.java rename to phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeRoleLogin.java index c69c087..d1b8ca7 100644 --- a/phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeRoleLogin.java +++ b/phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeRoleLogin.java @@ -1,4 +1,4 @@ -package com.hx.phip.entity; +package com.hx.phip.entity.employee; /**浜哄憳瑙掕壊鐧诲綍*/ public class EmployeeRoleLogin { diff --git a/phi_platform_common/src/main/java/com/hx/phip/entity/user/UserData.java b/phi_platform_common/src/main/java/com/hx/phip/entity/user/UserData.java new file mode 100644 index 0000000..2608e39 --- /dev/null +++ b/phi_platform_common/src/main/java/com/hx/phip/entity/user/UserData.java @@ -0,0 +1,13 @@ +package com.hx.phip.entity.user; + +/**鐢ㄦ埛鏁版嵁锛堟柊澧�/淇敼锛� + * @author CJH + * @Date 2021-12-15 + */ +public class UserData { + + + + + +} diff --git a/phi_platform_common/src/main/java/com/hx/phip/entity/UserList.java b/phi_platform_common/src/main/java/com/hx/phip/entity/user/UserList.java similarity index 98% rename from phi_platform_common/src/main/java/com/hx/phip/entity/UserList.java rename to phi_platform_common/src/main/java/com/hx/phip/entity/user/UserList.java index bf11234..720c716 100644 --- a/phi_platform_common/src/main/java/com/hx/phip/entity/UserList.java +++ b/phi_platform_common/src/main/java/com/hx/phip/entity/user/UserList.java @@ -1,4 +1,4 @@ -package com.hx.phip.entity; +package com.hx.phip.entity.user; public class UserList { diff --git a/phi_platform_user/src/main/java/com/hx/phip/common/TestController.java b/phi_platform_user/src/main/java/com/hx/phip/common/TestController.java index 06d8fba..7506039 100644 --- a/phi_platform_user/src/main/java/com/hx/phip/common/TestController.java +++ b/phi_platform_user/src/main/java/com/hx/phip/common/TestController.java @@ -1,18 +1,7 @@ package com.hx.phip.common; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; import com.hx.common.BaseController; -import com.hx.mybatisTool.SqlSentence; -import com.hx.phiappt.model.BaseEntity; -import com.hx.phip.dao.mapper.EmployeeMapper; -import com.hx.phip.entity.EmployeeList; import com.hx.redis.RedisUtil; -import com.hx.util.HttpServletRequestUtil; -import com.hx.util.StringUtils; -import com.platform.exception.PlatTipsException; -import com.platform.resultTool.PlatformCode; import com.platform.resultTool.PlatformResult; import org.apache.catalina.servlet4preview.http.HttpServletRequest; import org.slf4j.Logger; @@ -23,7 +12,6 @@ import javax.annotation.Resource; import java.util.HashMap; -import java.util.List; import java.util.Map; /** diff --git a/phi_platform_user/src/main/java/com/hx/phip/controller/EmployeeController.java b/phi_platform_user/src/main/java/com/hx/phip/controller/employee/EmployeeController.java similarity index 93% rename from phi_platform_user/src/main/java/com/hx/phip/controller/EmployeeController.java rename to phi_platform_user/src/main/java/com/hx/phip/controller/employee/EmployeeController.java index 834caf3..ef41713 100644 --- a/phi_platform_user/src/main/java/com/hx/phip/controller/EmployeeController.java +++ b/phi_platform_user/src/main/java/com/hx/phip/controller/employee/EmployeeController.java @@ -1,4 +1,4 @@ -package com.hx.phip.controller; +package com.hx.phip.controller.employee; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; @@ -6,26 +6,18 @@ import com.hx.common.BaseController; import com.hx.mybatisTool.SqlSentence; import com.hx.phiappt.model.BaseEntity; -import com.hx.phiappt.model.EmployeeRoleType; import com.hx.phip.dao.mapper.EmployeeMapper; -import com.hx.phip.dao.mapper.EmployeeRoleTypeMapper; -import com.hx.phip.entity.EmployeeList; -import com.hx.phip.entity.EmployeeQrLogin; -import com.hx.redis.RedisUtil; +import com.hx.phip.entity.employee.EmployeeList; import com.hx.util.HttpServletRequestUtil; import com.hx.util.StringUtils; -import com.hx.util.rsa.RSAUtil; import com.platform.exception.PlatTipsException; import com.platform.resultTool.PlatformCode; import com.platform.resultTool.PlatformResult; import org.apache.catalina.servlet4preview.http.HttpServletRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/phi_platform_user/src/main/java/com/hx/phip/controller/RoleController.java b/phi_platform_user/src/main/java/com/hx/phip/controller/employee/RoleController.java similarity index 88% rename from phi_platform_user/src/main/java/com/hx/phip/controller/RoleController.java rename to phi_platform_user/src/main/java/com/hx/phip/controller/employee/RoleController.java index b1bc3e7..ff5ddfb 100644 --- a/phi_platform_user/src/main/java/com/hx/phip/controller/RoleController.java +++ b/phi_platform_user/src/main/java/com/hx/phip/controller/employee/RoleController.java @@ -1,4 +1,4 @@ -package com.hx.phip.controller; +package com.hx.phip.controller.employee; import com.hx.common.BaseController; import com.hx.mybatisTool.SqlSentence; @@ -27,11 +27,6 @@ @RestController @RequestMapping("/role") public class RoleController extends BaseController { - - //log4j鏃ュ織 - private static Logger logger = LoggerFactory.getLogger(RoleController.class.getName()); - @Resource - private RedisUtil redisUtil; /**浼佷笟鍛樺伐-鎵爜鐧诲綍 */ diff --git a/phi_platform_user/src/main/java/com/hx/phip/controller/login/EmployeeLoginController.java b/phi_platform_user/src/main/java/com/hx/phip/controller/login/EmployeeLoginController.java index e4530b0..f8aef5a 100644 --- a/phi_platform_user/src/main/java/com/hx/phip/controller/login/EmployeeLoginController.java +++ b/phi_platform_user/src/main/java/com/hx/phip/controller/login/EmployeeLoginController.java @@ -8,8 +8,8 @@ import com.hx.phiappt.model.*; import com.hx.phip.common.wx.corp.WeiXinCorpMpUtil; import com.hx.phip.dao.mapper.*; -import com.hx.phip.entity.EmployeeQrLogin; -import com.hx.phip.entity.EmployeeRoleLogin; +import com.hx.phip.entity.employee.EmployeeQrLogin; +import com.hx.phip.entity.employee.EmployeeRoleLogin; import com.hx.phip.model.ApplyParameter; import com.hx.phip.model.SysParameter; import com.hx.phip.service.EmployeeBindService; diff --git a/phi_platform_user/src/main/java/com/hx/phip/controller/UserController.java b/phi_platform_user/src/main/java/com/hx/phip/controller/user/UserController.java similarity index 63% rename from phi_platform_user/src/main/java/com/hx/phip/controller/UserController.java rename to phi_platform_user/src/main/java/com/hx/phip/controller/user/UserController.java index 80e9e54..78d3361 100644 --- a/phi_platform_user/src/main/java/com/hx/phip/controller/UserController.java +++ b/phi_platform_user/src/main/java/com/hx/phip/controller/user/UserController.java @@ -1,4 +1,4 @@ -package com.hx.phip.controller; +package com.hx.phip.controller.user; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; @@ -8,7 +8,7 @@ import com.hx.phiappt.model.Appointment; import com.hx.phiappt.model.BaseEntity; import com.hx.phip.dao.mapper.EmployeeMapper; -import com.hx.phip.entity.UserList; +import com.hx.phip.entity.user.UserList; import com.hx.util.HttpServletRequestUtil; import com.hx.util.StringUtils; import com.platform.exception.PlatTipsException; @@ -35,10 +35,10 @@ 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)){ @@ -149,4 +149,100 @@ 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); + } + + /**鏂板鐢ㄦ埛 + */ + @RequestMapping(value = "/add",method = RequestMethod.POST) + public PlatformResult addUser(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); + } + + } -- Gitblit v1.8.0