zhouxiang
2021-12-15 e05e9e05ef7edb1cdac6443f82deba3befed5c52
Merge branch 'master' of http://1.15.4.62/r/~chenjiahe/phi_platform into zhouxiangTest
7 文件已重命名
1个文件已添加
2个文件已修改
160 ■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeList.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeQrLogin.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeRoleLogin.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/entity/user/UserData.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/entity/user/UserList.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/common/TestController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/employee/EmployeeController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/employee/RoleController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/login/EmployeeLoginController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/user/UserController.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeList.java
File was renamed from phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeList.java
@@ -1,4 +1,4 @@
package com.hx.phip.entity;
package com.hx.phip.entity.employee;
public class EmployeeList {
phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeQrLogin.java
File was renamed from phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeQrLogin.java
@@ -1,4 +1,4 @@
package com.hx.phip.entity;
package com.hx.phip.entity.employee;
public class EmployeeQrLogin {
phi_platform_common/src/main/java/com/hx/phip/entity/employee/EmployeeRoleLogin.java
File was renamed from phi_platform_common/src/main/java/com/hx/phip/entity/EmployeeRoleLogin.java
@@ -1,4 +1,4 @@
package com.hx.phip.entity;
package com.hx.phip.entity.employee;
/**人员角色登录*/
public class EmployeeRoleLogin {
phi_platform_common/src/main/java/com/hx/phip/entity/user/UserData.java
New file
@@ -0,0 +1,13 @@
package com.hx.phip.entity.user;
/**用户数据(新增/修改)
 * @author CJH
 * @Date 2021-12-15
 */
public class UserData {
}
phi_platform_common/src/main/java/com/hx/phip/entity/user/UserList.java
File was renamed from phi_platform_common/src/main/java/com/hx/phip/entity/UserList.java
@@ -1,4 +1,4 @@
package com.hx.phip.entity;
package com.hx.phip.entity.user;
public class UserList {
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;
/**
phi_platform_user/src/main/java/com/hx/phip/controller/employee/EmployeeController.java
File was renamed from phi_platform_user/src/main/java/com/hx/phip/controller/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;
phi_platform_user/src/main/java/com/hx/phip/controller/employee/RoleController.java
File was renamed from phi_platform_user/src/main/java/com/hx/phip/controller/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;
    /**企业员工-扫码登录
     */
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;
phi_platform_user/src/main/java/com/hx/phip/controller/user/UserController.java
File was renamed from phi_platform_user/src/main/java/com/hx/phip/controller/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);
    }
}