package com.philisense.www.controller.app;

import com.alibaba.fastjson.JSONObject;
import com.philisense.www.annotation.log.OperateLog;
import com.philisense.www.common.config.CommonConst;
import com.philisense.www.constant.RedisConstant;
import com.philisense.www.controller.BaseUtilController;
import com.philisense.www.core.text.Convert;
import com.philisense.www.service.ProUserService;
import com.philisense.www.utils.ChineseCharToEnUtil;
import com.philisense.www.utils.RandUtil;
import com.philisense.www.utils.SmsSenderUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

@RestController
@RequestMapping(CommonConst.APP_REST_SERVICE_PREFICX + "prouser")
@Api(tags = "ProUserControllerForApp |一个用来操作-{用户表}-业务模块的控制器")
public class ProUserControllerForApp extends BaseUtilController {

    @Autowired
    private ProUserService proUserService;

    @Autowired
    private StringRedisTemplate redisTemplate;

    @GetMapping("/delete")
    @ApiOperation(value = "根据-{用户表}-主键删除记录", notes = "成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
    @ApiImplicitParam(paramType = "query", name = "recordid", value = "记录主键", required = true, dataTypeClass = String.class)
    @OperateLog(name = "根据-{用户表}-主键删除记录", value = "delete", type = "APP")
    public Map<String, Object> deleteByPrimaryKeyForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestParam String recordid) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            int flag = proUserService.deleteByPrimaryKey(recordid);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, DELETE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, DELETE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @GetMapping("/get")
    @ApiOperation(value = "根据-{用户表}-主键查询记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"datarecord\":\"{}\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParam(paramType = "body", name = "recordid", value = "记录主键", required = true, dataTypeClass = String.class)
    @OperateLog(name = "根据-{用户表}-主键查询记录", value = "query", type = "APP")
    public Map<String, Object> selectByPrimaryKeyForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestParam String recordid) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATARECORD, proUserService.selectByPrimaryKey(recordid));
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/insert")
    @ApiOperation(value = "根据-{用户表}-对象插入记录", notes = "成功返回:{\"success\":true,\"message\",\"数据插入成功\"},失败返回:{\"success\":false,\"message\",\"数据插入失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象插入记录", value = "insert", type = "APP")
    public Map<String, Object> insertForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            if (map.get("user_name") == null) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, INSERT_FAIL_MSG + "用户名不能为空！");
                return result;
            }
            map.put("user_id", Convert.toStr(map.get("user_name")));
            BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
            map.put("password", bCryptPasswordEncoder.encode(map.get("password") + ""));
            map.put("status", Convert.toStr(map.get("status"), "1"));
            map.put("is_system_user", Convert.toStr(map.get("is_system_user"), "1"));

            Map<String, Object> paramMap = new HashMap<>();
            paramMap.put("user_name", Convert.toStr(map.get("user_name")));
            List<Map<String, Object>> nameAll = proUserService.getAllByUserName(paramMap);
            if (null != nameAll && !nameAll.isEmpty()) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, INSERT_FAIL_MSG + "用户名已存在！");
                return result;
            }

            proUserService.insert(map);
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, INSERT_SUCCESS_MSG);
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, INSERT_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/update")
    @ApiOperation(value = "根据-{用户表}-对象更新记录", notes = "成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象更新记录", value = "update", type = "APP")
    public Map<String, Object> updateForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            String userid = Convert.toStr(map.get("user_id"));
            if (StringUtils.isEmpty(userid)) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG + "记录ID不能为空");
                return result;
            }
            Map<String, Object> temmap = proUserService.selectByPrimaryKey(userid);
            if (null == temmap || temmap.size() == 0) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG + "[" + userid + "] 记录不存在");
                return result;
            }

            Map<String, Object> paramMap = new HashMap<>();
            paramMap.put("id_card", map.get("id_card") + "");
            List<Map<String, Object>> nameAll = proUserService.getAllByUserName(paramMap);
            if (null != nameAll && !nameAll.isEmpty()) {
                if (1 == nameAll.size()) {
                    Map<String, Object> userInfo = nameAll.get(0);
                    if (!userInfo.get("id_card").equals(map.get("id_card"))) {
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, INSERT_FAIL_MSG + "身份证号已存在！");
                        return result;
                    }
                } else {
                    result.put(DATASUCCESS, ERRORFLAG);
                    result.put(DATAMESSAGE, INSERT_FAIL_MSG + "身份证号已存在！");
                    return result;
                }
            }

            if (null != map.get("password") && !temmap.get("password").equals(map.get("password"))) {
                BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
                map.put("password", bCryptPasswordEncoder.encode(map.get("password") + ""));
            }
            temmap.putAll(map);
            int flag = proUserService.update(temmap);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, UPDATE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/deleteByMap")
    @ApiOperation(value = "根据-{用户表}-对象Map删除记录", notes = "成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map删除记录", value = "delete", type = "APP")
    public Map<String, Object> deleteByMapForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            int flag = proUserService.deleteByMap(map);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, DELETE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, DELETE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/updateByMap")
    @ApiOperation(value = "根据-{用户表}-对象Map更新记录", notes = "成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map更新记录", value = "update", type = "APP")
    public Map<String, Object> updateByMapForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {


            int flag = proUserService.updateByMap(map);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, UPDATE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/getOne")
    @ApiOperation(value = "根据-{用户表}-对象Map查询记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"datarecord\":\"{}\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map查询记录", value = "query", type = "APP")
    public Map<String, Object> getOneForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATARECORD, proUserService.getOne(map));
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/getAll")
    @ApiOperation(value = "根据-{用户表}-对象Map查询所有记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map查询所有记录", value = "query", type = "APP")
    public Map<String, Object> getAllForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST_VUE, proUserService.getAll(map));
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/queryPage")
    @ApiOperation(value = "根据-{用户表}-对象Map分页记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map分页记录", value = "query", type = "APP")
    public Map<String, Object> queryPageForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            int currentPage = map.get(DATACURRENT_VUE) != null ? Integer.parseInt(map.get(DATACURRENT_VUE) + "") : 0;
            int pageSize = map.get(PAGESIZE_VUE) != null ? Integer.parseInt(map.get(PAGESIZE_VUE) + "") : 10;
            int pageStart = currentPage * pageSize;

            map.put(PAGESIZE_VUE, pageSize);
            map.put(PAGESTART, pageStart);

            int total = proUserService.count(map);
            List<Map<String, Object>> datalist = new ArrayList<Map<String, Object>>();
            if (total > 0) {
                datalist = proUserService.queryPage(map);
            }
            Map<String, Object> tempresult = new HashMap<String, Object>();
            tempresult.put(DATASUCCESS, SUCCESSFLAG);
            tempresult.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            tempresult.put(DATALIST_VUE,datalist);
            tempresult.put(DATATOTAL_VUE,total);
            tempresult.put(PAGESIZE_VUE,map.get(PAGESIZE_VUE)!=null?map.get(PAGESIZE_VUE):10);
            tempresult.put(DATACURRENT_VUE,map.get(DATACURRENT_VUE)!=null?map.get(DATACURRENT_VUE):0);
            result.put(DATARESULT, tempresult);
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/count")
    @ApiOperation(value = "根据-{用户表}-对象Map统计查询总数记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map统计查询总数记录", value = "query", type = "APP")
    public Map<String, Object> countForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATATOTAL_VUE, proUserService.count(map));
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/insertBatch")
    @ApiOperation(value = "根据-{用户表}-对象Map批量插入记录", notes = "成功返回:{\"success\":true,\"message\",\"数据插入成功\"},失败返回:{\"success\":false,\"message\",\"数据插入失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map批量插入记录", value = "insert", type = "APP")
    public Map<String, Object> insertBatchForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Map<String, Object>> list) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            for (Map<String, Object> map : list) {
                map.put("id", UUID.randomUUID().toString().replaceAll("-", ""));
            }

            proUserService.insertBatch(list);
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, INSERT_SUCCESS_MSG);
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, INSERT_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/deleteBatch")
    @ApiOperation(value = "根据-{用户表}-对象Map批量删除记录", notes = "成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map批量删除记录", value = "delete", type = "APP")
    public Map<String, Object> deleteBatchForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Map<String, Object>> list) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            proUserService.deleteBatch(list);
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, DELETE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/updateBatch")
    @ApiOperation(value = "根据-{用户表}-对象Map批量更新记录", notes = "成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象Map批量更新记录", value = "update", type = "APP")
    public Map<String, Object> updateBatchForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Map<String, Object>> list) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {


            proUserService.updateBatch(list);
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, UPDATE_FAIL_MSG + e.getMessage());
        }
        return result;
    }


    @PostMapping("/getAddressBook")
    @ApiOperation(value = "根据-{用户表}-查询通讯录信息", notes = "成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-查询通讯录信息", value = "query", type = "APP")
    public Map<String, Object> getAddressBookForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            // 查询所有人员数据
            List<Map<String, Object>> addressBookAll = proUserService.getAllAddressBook(map);
            List<Map<String, Object>> codeGroup = getCodeGroupByZindex(addressBookAll);

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATARECORD, codeGroup);

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, UPDATE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    /**
     * 按拼音首字母分组
     *
     * @param list
     * @return
     * @throws BadHanyuPinyinOutputFormatCombination
     */
    public static List<Map<String, Object>> getCodeGroupByZindex(List<Map<String, Object>> list) throws BadHanyuPinyinOutputFormatCombination {
        List<Map<String, Object>> resList = new ArrayList<>();
        //输出26个字母
        for (int i = 1; i <= 26; i++) {
            Map<String, Object> map = new TreeMap<String, Object>();
            String word = String.valueOf((char) (96 + i)).toUpperCase();
            //循环找出首字母一样的数据
            List<Map<String, Object>> letter = new ArrayList<Map<String, Object>>();
            for (Map<String, Object> str : list) {
                String user_name_cn = "" + str.get("user_name_cn");
                String code = "" + str.get("zindex");
                if (word.equals(code)) {
                    str.put("name", user_name_cn.trim());
                    str.put("key", word);
                    letter.add(str);
                }
            }
            if (null != letter && letter.size() != 0) {
                map.put("title", word);
                map.put("key", word);
                map.put("items", letter);
                resList.add(map);

            }

        }
        return resList;
    }


    /**
     * 按拼音首字母分组
     *
     * @param list
     * @return
     * @throws BadHanyuPinyinOutputFormatCombination
     */
    public static List<Map<String, Object>> getCodeGroup(List<Map<String, Object>> list) throws BadHanyuPinyinOutputFormatCombination {
        List<Map<String, Object>> resList = new ArrayList<>();
        //输出26个字母
        for (int i = 1; i <= 26; i++) {
            Map<String, Object> map = new TreeMap<String, Object>();
            String word = String.valueOf((char) (96 + i)).toUpperCase();
            //循环找出首字母一样的数据
            List<Map<String, Object>> letter = new ArrayList<Map<String, Object>>();
            for (Map<String, Object> str : list) {
                String user_name_cn = "" + str.get("user_name_cn");
                String pingyin = ChineseCharToEnUtil.getFullSpell(user_name_cn.trim());
                String code = pingyin.substring(0, 1).toUpperCase();
                if (word.equals(code)) {
                    str.put("name", user_name_cn.trim());
                    str.put("key", word);
                    letter.add(str);
                }
            }
            if (null != letter && letter.size() != 0) {
                map.put("title", word);
                map.put("key", word);
                map.put("items", letter);
                resList.add(map);

            }

        }
        return resList;
    }

    @PostMapping("/register")
    @ApiOperation(value = "根据-{用户表}-对象插入记录", notes = "成功返回:{\"success\":true,\"message\",\"数据插入成功\"},失败返回:{\"success\":false,\"message\",\"数据插入失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象插入记录", value = "insert", type = "PC")
    public Map<String, Object> registerForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            if (map.get("phone") == null || map.get("password") == null || map.get("code") == null) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, INSERT_FAIL_MSG + "参数不能为空");
                return result;
            }

            String redisCode = redisTemplate.opsForValue().get(RedisConstant.CODE + "phone:" + map.get("phone"));
            if (!map.get("code").equals(redisCode)) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, "验证码不匹配");
                return result;
            }

            Map<String, Object> paramMap = new HashMap<>();
            paramMap.put("id_card", map.get("id_card") + "");
            List<Map<String, Object>> nameAll = proUserService.getAll(paramMap);
            if (null != nameAll && !nameAll.isEmpty()) {
                Map<String, Object> idCardMap = nameAll.get(0);
                if ("1".equals(idCardMap.get("enabled"))) {
                    result.put(DATASUCCESS, ERRORFLAG);
                    result.put(DATAMESSAGE, INSERT_FAIL_MSG + "身份证号已存在！");
                    return result;
                } else {
                    Map<String, Object> paramPhoneMap = new HashMap<>();
                    paramPhoneMap.put("phone", map.get("phone") + "");
                    List<Map<String, Object>> namePhoneAll = proUserService.getAll(paramPhoneMap);
                    if (null != namePhoneAll && !namePhoneAll.isEmpty() && !namePhoneAll.get(0).get("phone").equals(idCardMap.get("phone"))) {
                        // 该手机号已经绑定，请跟换手机号
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, "该手机号已经绑定，请跟换手机号");
                        return result;
                    } else {
                        // 修改
                        idCardMap.putAll(map);
                        idCardMap.put("enabled", 1);
                        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
                        idCardMap.put("password", bCryptPasswordEncoder.encode(map.get("password") + ""));
                        proUserService.update(idCardMap);
                    }
                }

            } else {
                paramMap.clear();
                nameAll.clear();
                paramMap.put("phone", map.get("phone") + "");
                nameAll = proUserService.getAll(paramMap);
                if (null != nameAll && !nameAll.isEmpty()) {
                    result.put(DATASUCCESS, ERRORFLAG);
                    result.put(DATAMESSAGE, INSERT_FAIL_MSG + "手机号已存在！");
                    return result;
                }

                map.put("user_id", UUID.randomUUID().toString().replaceAll("-", ""));
                BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
                map.put("password", bCryptPasswordEncoder.encode(map.get("password") + ""));
                map.put("status", Convert.toStr(map.get("status"), "1"));
                map.put("is_system_user", Convert.toStr(map.get("is_system_user"), "1"));

                proUserService.insert(map);
            }

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, INSERT_SUCCESS_MSG);
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, INSERT_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/updateUser")
    @ApiOperation(value = "根据-{用户表}-对象更新记录", notes = "成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-对象更新记录", value = "update", type = "PC")
    public Map<String, Object> updateUserForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            String ID = map.get("user_id") + "";
            if (ID.equals("")) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG + "记录ID不能为空");
                return result;
            }

            if (map.get("phone") == null || map.get("password") == null) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, INSERT_FAIL_MSG + "参数不能为空");
                return result;
            }

            String redisCode = redisTemplate.opsForValue().get(RedisConstant.CODE + "phone:" + map.get("phone"));
            if (!map.get("code").equals(redisCode)) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, "验证码不匹配");
                return result;
            }

            Map<String, Object> temmap = proUserService.selectByPrimaryKey(ID);
            if (null == temmap || temmap.size() == 0) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG + ID + "记录不存在");
                return result;
            }

            Map<String, Object> paramMap = new HashMap<>();
            paramMap.put("id_card", map.get("id_card") + "");
            List<Map<String, Object>> nameAll = proUserService.getAll(paramMap);
            if (null != nameAll && !nameAll.isEmpty()) {
                if (1 == nameAll.size()) {
                    Map<String, Object> userInfo = nameAll.get(0);
                    if (!userInfo.get("id_card").equals(map.get("id_card"))) {
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, INSERT_FAIL_MSG + "身份证号已存在！");
                        return result;
                    }
                } else {
                    result.put(DATASUCCESS, ERRORFLAG);
                    result.put(DATAMESSAGE, INSERT_FAIL_MSG + "身份证号已存在！");
                    return result;
                }
            }

            paramMap.clear();
            nameAll.clear();
            paramMap.put("phone", map.get("phone") + "");
            nameAll = proUserService.getAll(paramMap);
            if (null != nameAll && !nameAll.isEmpty()) {
                if (1 == nameAll.size()) {
                    Map<String, Object> userInfo = nameAll.get(0);
                    if (!userInfo.get("phone").equals(map.get("phone"))) {
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, INSERT_FAIL_MSG + "手机名已存在！");
                        return result;
                    }
                } else {
                    result.put(DATASUCCESS, ERRORFLAG);
                    result.put(DATAMESSAGE, INSERT_FAIL_MSG + "手机名已存在！");
                    return result;
                }
            }

            if (null != map.get("password") && !temmap.get("password").equals(map.get("password"))) {
                BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
                map.put("password", bCryptPasswordEncoder.encode(map.get("password") + ""));
            }

            temmap.putAll(map);

            int flag = proUserService.update(temmap);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, UPDATE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/sendCode")
    @ApiOperation(value = "根据-{用户表}-发送验证码", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"datarecord\":\"{}\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-发送验证码", value = "query", type = "PC")
    public Map<String, Object> sendCodeForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            String type = null != map.get("type") ? map.get("type") + "" : "";
            String phone = null != map.get("phone") ? map.get("phone") + "" : "";
            String email = null != map.get("email") ? map.get("email") + "" : "";

            if (StringUtils.isBlank(phone) && StringUtils.isBlank(email)) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, "参数不能为空");
                return result;
            }

            String randNum = RandUtil.getRandNum();
            // 发送手机验证码
            if ("phone".equals(type)) {
                redisTemplate.opsForValue().set(RedisConstant.CODE + "phone:" + phone, randNum, 60 * 5, TimeUnit.SECONDS);
                JSONObject jsonObject = SmsSenderUtil.sendVerify(phone, randNum);
                if (Boolean.valueOf(jsonObject.getString("success"))) {
                    result.put(DATASUCCESS, SUCCESSFLAG);
                    result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
                } else {
                    result.put(DATASUCCESS, ERRORFLAG);
                    result.put(DATAMESSAGE, "发送手机验证码失败");
                }
            }

            // 发送邮件验证码
            if ("email".equals(type)) {
//                String content = "您的邮箱为：" + email + "，验证码为：" + randNum + "，验证码的有效期为5分钟，请在有效期内输入！";
                Map<String, Object> messageMap = new HashMap<>();
                messageMap.put("email", email);
                messageMap.put("code", randNum);

                redisTemplate.opsForValue().set(RedisConstant.CODE + "email:" + email, randNum, 60 * 5, TimeUnit.SECONDS);
//                asyncTaskMailService.workflowSendHtmlEmailTask(email, "验证码获取", messageMap);

                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            }


        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/verifyCode")
    @ApiOperation(value = "根据-{用户表}-发送验证码", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"datarecord\":\"{}\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_id", value = "用户Id", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户名(登录账号)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_cn", value = "用户名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "user_name_en", value = "员工英文名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "password", value = "登录密码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email", value = "电子邮箱", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "phone", value = "手机号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "landline", value = "办公电话", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sex", value = "用户性别", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "avatar", value = "头像路径", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sign", value = "个性签名", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "tags", value = "用户标签", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_type", value = "证件类型", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id_no", value = "证件号码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "birthday", value = "用户生日", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "job_status", value = "用户状态(0离职，1在职)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hiredate", value = "入职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "departure_time", value = "离职时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "user_type", value = "用户类型（员工）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "emp_no", value = "员工工号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "access_card_no", value = "门禁卡号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "country", value = "国家/地区", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "province", value = "省", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "city", value = "市", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "address", value = "街道地址", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "work_addr", value = "工作地点（01>总部飞利信大厦  选择楼层 02>非总部 选择省份）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "floor", value = "所在楼层", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inprovince", value = "所在省份", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_code", value = "部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "dept_name", value = "部门名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_dept_code", value = "内部部门代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_code", value = "机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "org_name", value = "机构名称", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "inner_org_code", value = "内部机构代码", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "posts", value = "职位", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_openid", value = "绑定的微信号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_mpopenid", value = "绑定的微信公众号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_miniopenid", value = "绑定的微信小程序", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_unionid", value = "绑定微信UnionID", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mobile_imei", value = "绑定的手机串号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "device_num", value = "绑定的手机设备号", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_taobao", value = "绑定的淘宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_alipay", value = "绑定的支付宝", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "al_dingding", value = "绑定的钉钉", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "is_system_user", value = "是否是系统用户(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "mgr_type", value = "管理员类型（0非管理员 1系统管理员）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_security_level", value = "密码安全级别（0初始 1很弱 2弱 3安全 4很安全）", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(paramType = "body", name = "pwd_update_date", value = "密码最后更新时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_ip", value = "最后登陆IP", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "last_login_date", value = "最后登陆时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_date", value = "冻结时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "freeze_cause", value = "冻结原因", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "zindex", value = "索引", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "wx_msg", value = "微信消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "email_msg", value = "邮件消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "system_msg", value = "系统消息通知(0否1是)", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "remarks", value = "备注", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "status", value = "状态（0删除 1正常 2停用 3冻结）", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "creator", value = "创建者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "create_date", value = "创建时间", required = true, dataTypeClass = Date.class),
            @ApiImplicitParam(paramType = "body", name = "updater", value = "更新者", required = true, dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "update_date", value = "更新时间", required = true, dataTypeClass = Date.class)
    })
    @OperateLog(name = "根据-{用户表}-发送验证码", value = "query", type = "PC")
    public Map<String, Object> verifyCodeForProUserForApp(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            String type = null != map.get("type") ? map.get("type") + "" : "";
            String phone = null != map.get("phone") ? map.get("phone") + "" : "";
            String email = null != map.get("email") ? map.get("email") + "" : "";
            String code = null != map.get("code") ? map.get("code") + "" : "";

            if (StringUtils.isBlank(code)) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, "验证码不能为空");
                return result;
            }

            // 手机验证码
            if ("phone".equals(type) && StringUtils.isNotBlank(phone)) {

            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, "手机号不能为空");
            }
            // 邮件验证码
            if ("email".equals(type) && StringUtils.isNotBlank(email)) {
                String redisCode = redisTemplate.opsForValue().get(RedisConstant.CODE + "email:" + email);
                if (code.equals(redisCode)) {
                    result.put(DATASUCCESS, SUCCESSFLAG);
                    result.put(DATAMESSAGE, "验证通过");
                } else {
                    result.put(DATASUCCESS, ERRORFLAG);
                    result.put(DATAMESSAGE, "验证码不匹配");
                }

            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, "邮箱不能为空");
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

}
