Procházet zdrojové kódy

打卡数据功能开发

user5 před 10 měsíci
rodič
revize
ac67cd85a3

+ 12 - 0
src/main/java/com/jeeplus/modules/sys/dao/UserDao.java

@@ -344,4 +344,16 @@ public interface UserDao extends CrudDao<User> {
 	 * @return
 	 */
 	public User validateLoginName(String loginName);
+
+	/**
+	 * 获取全部人员信息
+	 * @return
+	 */
+	List<User> getAllUserList();
+
+	/**
+	 * 获取全部人员信息(包含企业微信id的人员信息)
+	 * @return
+	 */
+	List<User> getIncludeQwUserIdAllUserList();
 }

+ 10 - 1
src/main/java/com/jeeplus/modules/sys/entity/User.java

@@ -107,6 +107,7 @@ public class User extends DataEntity<User> {
     private String areaRemark;  //部门地区备注(永不标注部门中所在的城市,比如一部中有 苏州、安徽的等等)
 	private String areaPrincipal; //是否为地区负责人	1:是;0:不是
 	private String isTemplate; //长期/临时  0:临时 1:长期
+	private String qwUserId; //企业微信对应的userId
 
 	public String getIsTemplate() {
 		return isTemplate;
@@ -624,7 +625,15 @@ public class User extends DataEntity<User> {
 	public void setAreaPrincipal(String areaPrincipal) {
 		this.areaPrincipal = areaPrincipal;
 	}
-	//	public String getPosition() {
+
+	public String getQwUserId() {
+		return qwUserId;
+	}
+
+	public void setQwUserId(String qwUserId) {
+		this.qwUserId = qwUserId;
+	}
+//	public String getPosition() {
 //		return position;
 //	}
 //

+ 50 - 5
src/main/java/com/jeeplus/modules/sys/service/UserService.java

@@ -21,11 +21,14 @@ import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.sysuseroffice.entity.Useroffice;
 import com.jeeplus.modules.sysuseroffice.service.UserofficeService;
 import com.jeeplus.modules.tools.utils.TwoDimensionCode;
+import com.jeeplus.modules.wexinpackage.access.util.access.RequestAccess;
 import com.jeeplus.modules.workcompanyinfo.service.CompanyinfoService;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
 import io.swagger.client.model.NewPassword;
 import io.swagger.client.model.Nickname;
 import io.swagger.client.model.RegisterUsers;
+import net.sf.json.JSONObject;
+import org.codehaus.jackson.map.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -37,11 +40,7 @@ import java.io.InputStream;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
+import java.util.*;
 
 
 @Service
@@ -637,5 +636,51 @@ public class UserService extends BaseController {
         return userDao.validateLoginName(loginName);
     }
 
+    /**
+     * 查询人员信息并进行处理企业微信userId信息
+     * @return
+     */
+    public List<User> disposeQWUserId(String token){
+        //获取所有人员信息
+        List<User> allUserList = userDao.getAllUserList();
+        JSONObject jsonObject = null;
+        try {
+            String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN";//获取用户信息
+            String sureUrl = url.replace("ACCESS_TOKEN", token);
+            System.out.println("url============="+sureUrl);
+            String qwUserId = "";
+            for (User user : allUserList) {
+
+                ObjectMapper mapper = new ObjectMapper();
+                Map<String,Object> map = new HashMap<>();
+                map.put("mobile",user.getMobile());
+
+                String content = mapper.writeValueAsString(map);
+
+                jsonObject = RequestAccess.httpRequest(sureUrl, "POST", content);
+                System.out.println("jsonObject========="+jsonObject);
+
+                if (0 != jsonObject.getInt("errcode")) {
+                }else{
+                    qwUserId = jsonObject.getString("userid");
+                    user.setQwUserId(qwUserId);
+                    userDao.updateUser(user);
+                }
+
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return allUserList;
+    }
+    /**
+     * 获取全部人员信息
+     * @return
+     */
+    public List<User> getIncludeQwUserIdAllUserList(){
+        //获取所有人员信息
+        List<User> allUserList = userDao.getIncludeQwUserIdAllUserList();
 
+        return allUserList;
+    }
 }

+ 62 - 4
src/main/java/com/jeeplus/modules/wexintheorder/Utils/OrderUtils.java

@@ -17,10 +17,7 @@ import javax.servlet.http.HttpSession;
 import java.io.IOException;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
-import java.time.Instant;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.time.ZoneOffset;
+import java.time.*;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 
@@ -318,4 +315,65 @@ public class OrderUtils {
         System.out.println("格式化后的日期时间: " + formattedDateTime);
         return formattedDateTime;
     }
+
+    public static Map<String,String> getBeforeDayDate(Integer day) {
+        Map<String,String> map = new HashMap<>();
+        // 获取当前日期
+        LocalDate currentDate = LocalDate.now();
+
+        // 获取前一天的日期
+        LocalDate previousDate = currentDate.minusDays(day);
+
+        // 获取前一天的开始时间 (00:00:00)
+        LocalDateTime startOfDay = previousDate.atStartOfDay();
+
+        // 获取前一天的结束时间 (23:59:59)
+        LocalDateTime endOfDay = previousDate.atTime(23, 59, 59);
+
+        // 定义日期时间格式化模式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        // 将前一天的开始时间和结束时间转换为字符串格式
+        String startDate = startOfDay.format(formatter);
+        map.put("startDate",startDate);
+        String endDate = endOfDay.format(formatter);
+        map.put("endDate",endDate);
+
+        return map;
+    }
+
+
+    /**
+     * 获取成员信息
+     * @param token
+     * @return
+     */
+    public static JSONObject getUserInfo(String token){
+        String string = "";
+        JSONObject jsonObject = null;
+        try {
+            String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN";//获取用户信息
+            String sureUrl = url.replace("ACCESS_TOKEN", token);
+            System.out.println("url============="+sureUrl);
+
+            ObjectMapper mapper = new ObjectMapper();
+            Map<String,Object> map = new HashMap<>();
+            map.put("mobile","15240492484");
+
+            String content = mapper.writeValueAsString(map);
+
+            jsonObject = RequestAccess.httpRequest(sureUrl, "POST", content);
+            System.out.println("jsonObject========="+jsonObject);
+            if (0 != jsonObject.getInt("errcode")) {
+                //string = jsonObject.getString("access_token");
+                return jsonObject;
+            }else{
+                string = jsonObject.getString("checkindata");
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        return jsonObject;
+    }
 }

+ 8 - 0
src/main/java/com/jeeplus/modules/wexintheorder/dao/ClockInRecordDao.java

@@ -2,6 +2,7 @@ package com.jeeplus.modules.wexintheorder.dao;
 
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.wexintheorder.entity.ClockInRecordInfo;
 
 @MyBatisDao
@@ -13,4 +14,11 @@ public interface ClockInRecordDao extends CrudDao<ClockInRecordInfo> {
      * @return
      */
     ClockInRecordInfo getByUserIdAndCheckinTime(ClockInRecordInfo info);
+
+    /**
+     * 根据企业微信用户id查询系统用户信息
+     * @param qwUserId
+     * @return
+     */
+    User getUserByQwUSerId(String qwUserId);
 }

+ 26 - 0
src/main/java/com/jeeplus/modules/wexintheorder/entity/ClockInRecordInfo.java

@@ -1,6 +1,7 @@
 package com.jeeplus.modules.wexintheorder.entity;
 
 import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
 
 import java.util.List;
 
@@ -28,6 +29,8 @@ public class ClockInRecordInfo  extends DataEntity<ClockInRecordInfo> {
     private String groupId;     //规则id,表示打卡记录所属规则的id
     private String scheduleId; //班次id,表示打卡记录所属规则中,所属班次的id
     private String timelineId; //时段id,表示打卡记录所属规则中,某一班次中的某一时段的id,如上下班时间为9:00-12:00、13:00-18:00的班次中,9:00-12:00为其中一组时段
+    private String sysUserId; //系统用户id
+    private String userName; //系统用户名称
 
     public String getUserId() {
         return userId;
@@ -45,6 +48,7 @@ public class ClockInRecordInfo  extends DataEntity<ClockInRecordInfo> {
         this.groupName = groupName;
     }
 
+    @ExcelField(title="打卡类型", align=2, sort=2)
     public String getCheckinType() {
         return checkinType;
     }
@@ -53,6 +57,7 @@ public class ClockInRecordInfo  extends DataEntity<ClockInRecordInfo> {
         this.checkinType = checkinType;
     }
 
+    @ExcelField(title="异常类型", align=2, sort=3)
     public String getExceptionType() {
         return exceptionType;
     }
@@ -61,6 +66,7 @@ public class ClockInRecordInfo  extends DataEntity<ClockInRecordInfo> {
         this.exceptionType = exceptionType;
     }
 
+    @ExcelField(title="实际打卡时间", align=2, sort=5)
     public String getCheckinTime() {
         return checkinTime;
     }
@@ -77,6 +83,7 @@ public class ClockInRecordInfo  extends DataEntity<ClockInRecordInfo> {
         this.locationTitle = locationTitle;
     }
 
+    @ExcelField(title="打卡地点", align=2, sort=4)
     public String getLocationDetail() {
         return locationDetail;
     }
@@ -85,6 +92,7 @@ public class ClockInRecordInfo  extends DataEntity<ClockInRecordInfo> {
         this.locationDetail = locationDetail;
     }
 
+    @ExcelField(title="wifi名称", align=2, sort=7)
     public String getWifiName() {
         return wifiName;
     }
@@ -141,6 +149,7 @@ public class ClockInRecordInfo  extends DataEntity<ClockInRecordInfo> {
         this.deviceId = deviceId;
     }
 
+    @ExcelField(title="理论打卡时间", align=2, sort=6)
     public String getSchCheckinTime() {
         return schCheckinTime;
     }
@@ -172,4 +181,21 @@ public class ClockInRecordInfo  extends DataEntity<ClockInRecordInfo> {
     public void setTimelineId(String timelineId) {
         this.timelineId = timelineId;
     }
+
+    public String getSysUserId() {
+        return sysUserId;
+    }
+
+    public void setSysUserId(String sysUserId) {
+        this.sysUserId = sysUserId;
+    }
+
+    @ExcelField(title="姓名", align=2, sort=1)
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
 }

+ 36 - 1
src/main/java/com/jeeplus/modules/wexintheorder/service/ClockInRecordService.java

@@ -5,12 +5,19 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.Lists;
+import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.wexintheorder.Utils.OrderUtils;
 import com.jeeplus.modules.wexintheorder.dao.ClockInRecordDao;
 import com.jeeplus.modules.wexintheorder.entity.ClockInRecordInfo;
 import com.jeeplus.modules.wexintheorder.entity.ClockInRecordSaveInfo;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientBank;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
 import net.sf.json.JSONObject;
 import org.springframework.stereotype.Service;
 
@@ -26,6 +33,29 @@ import java.util.List;
 public class ClockInRecordService extends CrudService<ClockInRecordDao, ClockInRecordInfo> {
 
 
+
+    /**
+     * 获取一个客户信息
+     * @param page 分页对象
+     * @param workClientInfo
+     * @return
+     */
+    public Page<ClockInRecordInfo> findPage(Page<ClockInRecordInfo> page, ClockInRecordInfo clockInRecordInfo) {
+        /*if(!UserUtils.getUser().isAdmin()) {
+            clockInRecordInfo.getSqlMap().put("dsf", dataScopeFilter(clockInRecordInfo.getCurrentUser(), "o", "u", "s", MenuStatusEnum.WORK_CLIENT_INFO.getValue()));
+        }*/
+        //根据项目类型获取对应的客户id个数
+        int count = dao.queryCount(clockInRecordInfo);
+        page.setCount(count);
+        page.setCountFlag(false);
+        clockInRecordInfo.setPage(page);
+        List<ClockInRecordInfo> list = findList(clockInRecordInfo);
+        page.setList(list);
+        return page;
+    }
+
+
+
     public String disposeClockInRecordInfo(JSONObject checkInData){
         String clockInData = "";
         System.out.println(checkInData);
@@ -66,11 +96,16 @@ public class ClockInRecordService extends CrudService<ClockInRecordDao, ClockInR
                 info.setGroupId(checkin.getGroupid());
                 info.setScheduleId(checkin.getSchedule_id());
                 info.setTimelineId(checkin.getTimeline_id());
+                //根据userId查询对应用户id 进行关联
+                User userByQwUSerId = dao.getUserByQwUSerId(info.getUserId());
+                if(null != userByQwUSerId){
+                    info.setSysUserId(userByQwUSerId.getId());
+                }
                 //根据userid和打卡时间查询是否存在打卡记录,若存在,则进行更新,若不存在,则进行新增
                 ClockInRecordInfo userCheckinInfo = dao.getByUserIdAndCheckinTime(info);
                 if(null == userCheckinInfo){
                 }else{
-                    info.setId(userCheckinInfo.getId());;
+                    info.setId(userCheckinInfo.getId());
                 }
                 super.save(info);
 

+ 121 - 42
src/main/java/com/jeeplus/modules/wexintheorder/web/ClockInRecordController.java

@@ -1,19 +1,34 @@
 package com.jeeplus.modules.wexintheorder.web;
 
 import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.UserService;
+import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.wexinpackage.access.util.encryption.AesException;
 import com.jeeplus.modules.wexinpackage.access.util.encryption.WXBizMsgCrypt;
 import com.jeeplus.modules.wexintheorder.Utils.OrderUtils;
+import com.jeeplus.modules.wexintheorder.entity.ClockInRecordInfo;
 import com.jeeplus.modules.wexintheorder.service.ClockInRecordService;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workdevicerecord.entity.WorkDeviceRecord;
 import net.sf.json.JSONObject;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -45,80 +60,144 @@ public class ClockInRecordController extends BaseController {
 
     @Autowired
     private ClockInRecordService clockInRecordService;
+    @Autowired
+    private UserService userService;
 
 
-
-    @RequestMapping(value = "getTest")
-    public void list(HttpServletRequest request, HttpServletResponse response) throws IOException {
-        // 微信加密签名
-        String msg_signature = request.getParameter("msg_signature");
-        // 时间戳
-        String timestamp = request.getParameter("timestamp");
-        // 随机数
-        String nonce = request.getParameter("nonce");
-        // 随机字符串
-        String echostr = request.getParameter("echostr");
-
-        System.out.println("request=" + request.getRequestURL());
-
-        PrintWriter out = response.getWriter();
-        // 通过检验msg_signature对请求进行校验,若校验成功则原样返回echostr,表示接入成功,否则接入失败
-        String result = null;
-        try {
-            WXBizMsgCrypt wxcpt = new WXBizMsgCrypt(TOKEN, ENCODINGAES_KEY, CORP_ID);
-            result = wxcpt.VerifyURL(msg_signature, timestamp, nonce, echostr);
-        } catch (AesException e) {
-            e.printStackTrace();
+    /**
+     * 客户管理列表页面
+     */
+    @RequiresPermissions("clockInRecord:clockInRecord:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(ClockInRecordInfo clockInRecordInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        //进行查询之后进行任何操作,返回还是查询之后的数据页面
+        if (StringUtils.isNotBlank(clockInRecordInfo.getToflag())){
+            if (clockInRecordInfo.getToflag().equals("1")){
+                request.getSession().removeAttribute("clockInRecordInfo");
+                ClockInRecordInfo search=clockInRecordInfo;
+                request.getSession().setAttribute("clockInRecordInfo",search);
+            }
+        }else{
+            if (request.getSession().getAttribute("clockInRecordInfo")!=null){
+                clockInRecordInfo= (ClockInRecordInfo) request.getSession().getAttribute("clockInRecordInfo");
+                model.addAttribute("clockInRecordInfo", clockInRecordInfo);
+            }
         }
-        if (result == null) {
-            result = TOKEN;
+
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
         }
-        out.print(result);
-        out.close();
-        out = null;
+        Page<ClockInRecordInfo> page = clockInRecordService.findPage(new Page<ClockInRecordInfo>(request, response), clockInRecordInfo);
+        model.addAttribute("page", page);
+        return "modules/qw/clickInRecode/ClickInRecordList";
     }
 
-
     /**
      * 查询打卡记录信息
-     * @param model
      * @return
      */
     @RequestMapping(value = "getClockInRecord")
     @ResponseBody
     @Transactional(readOnly = false)
-    public Map<String,Object> getClockInRecord(Model model, @RequestParam String startDate, @RequestParam String endDate){
+    public Map<String,Object> getClockInRecord(@RequestParam Integer day){
         Map<String,Object> map = new HashMap<>();
         String accessToken = OrderUtils.getToken(CORP_ID, CORPSECRET);
+        List<User> includeQwUserIdAllUserList = userService.getIncludeQwUserIdAllUserList();
 
-
+        //获取当前日期前指定天数的时间信息
+        Map<String,String> dateMap = OrderUtils.getBeforeDayDate(day);
+        String startDate = dateMap.get("startDate");
+        String endDate = dateMap.get("endDate");
         List<String> userIdList = Lists.newArrayList();
-        userIdList.add("XuTeng");
         //分批处理
-        if(null!=userIdList && userIdList.size()>0){
+        if(null!=includeQwUserIdAllUserList && includeQwUserIdAllUserList.size()>0){
             int pointsDataLimit = 100;//限制条数
-            Integer size = userIdList.size();
+            Integer size = includeQwUserIdAllUserList.size();
             //判断是否有必要分批
             if(pointsDataLimit<size){
                 int part = size/pointsDataLimit;//分批数
                 //
                 for (int i = 0; i < part; i++) {
                     //100条
-                    List<String> userIds = userIdList.subList(0, pointsDataLimit);
+                    List<User> userList = includeQwUserIdAllUserList.subList(0, pointsDataLimit);
+                    for (User user : userList) {
+                        userIdList.add(user.getQwUserId());
+                    }
+                    JSONObject checkInData = OrderUtils.getCheckInData(accessToken, userIdList,startDate,endDate);
+                    clockInRecordService.disposeClockInRecordInfo(checkInData);
 
                     //剔除
-                    userIdList.subList(0, pointsDataLimit).clear();
+                    includeQwUserIdAllUserList.subList(0, pointsDataLimit).clear();
                 }
-                if(!userIdList.isEmpty()){
-                    String userIds = String.join(", ", userIdList);
+                if(!includeQwUserIdAllUserList.isEmpty()){
+                    for (User user : includeQwUserIdAllUserList) {
+                        userIdList.add(user.getQwUserId());
+                    }
+                    JSONObject checkInData = OrderUtils.getCheckInData(accessToken, userIdList,startDate,endDate);
+                    clockInRecordService.disposeClockInRecordInfo(checkInData);
                 }
             }else{
-                String userIds = String.join(", ", userIdList);
+                for (User user : includeQwUserIdAllUserList) {
+                    userIdList.add(user.getQwUserId());
+                }
+                JSONObject checkInData = OrderUtils.getCheckInData(accessToken, userIdList,startDate,endDate);
+                clockInRecordService.disposeClockInRecordInfo(checkInData);
             }
         }
-        JSONObject checkInData = OrderUtils.getCheckInData(accessToken, userIdList,startDate,endDate);
-        clockInRecordService.disposeClockInRecordInfo(checkInData);
-        map.put("返回结果",checkInData);
+        map.put("返回结果","数据处理成功");
         return map;
     }
+
+
+
+    /**
+     * 导出excel文件
+     */
+    @RequiresPermissions("clockInRecord:clockInRecord:export")
+    @RequestMapping(value = "export", method= RequestMethod.POST)
+    public String exportFile(ClockInRecordInfo clockInRecordInfo, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        try {
+            String fileName = "打卡记录"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<ClockInRecordInfo> page = clockInRecordService.findPage(new Page<ClockInRecordInfo>(request, response, -1), clockInRecordInfo);
+            new ExportExcel("打卡记录", ClockInRecordInfo.class).setDataList(page.getList()).write(response, fileName).dispose();
+            return null;
+        } catch (Exception e) {
+            logger.error("Exception e:"+e);
+            addMessage(redirectAttributes, "导出打卡记录失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:"+ Global.getAdminPath()+"/clockInRecordController/?repage";
+    }
+
+
+
+
+    @RequestMapping(value = "getTest")
+    public void list(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        // 微信加密签名
+        String msg_signature = request.getParameter("msg_signature");
+        // 时间戳
+        String timestamp = request.getParameter("timestamp");
+        // 随机数
+        String nonce = request.getParameter("nonce");
+        // 随机字符串
+        String echostr = request.getParameter("echostr");
+
+        System.out.println("request=" + request.getRequestURL());
+
+        PrintWriter out = response.getWriter();
+        // 通过检验msg_signature对请求进行校验,若校验成功则原样返回echostr,表示接入成功,否则接入失败
+        String result = null;
+        try {
+            WXBizMsgCrypt wxcpt = new WXBizMsgCrypt(TOKEN, ENCODINGAES_KEY, CORP_ID);
+            result = wxcpt.VerifyURL(msg_signature, timestamp, nonce, echostr);
+        } catch (AesException e) {
+            e.printStackTrace();
+        }
+        if (result == null) {
+            result = TOKEN;
+        }
+        out.print(result);
+        out.close();
+        out = null;
+    }
 }

+ 10 - 0
src/main/resources/mappings/modules/sys/UserDao.xml

@@ -91,6 +91,7 @@
 		a.first_flag AS "firstFlag",
 		a.audit_user_id AS "auditUserId",
 		a.area_remark AS "areaRemark",
+		a.qw_user_id AS "qwUserId",
 		s.name AS "company.name",
 		s.parent_id AS "company.parent.id",
 		s.parent_ids AS "company.parentIds",
@@ -1260,6 +1261,9 @@
 			<if test="areaPrincipal!=null and areaPrincipal != ''">
 				,area_principal = #{areaPrincipal}
 			</if>
+			<if test="qwUserId!=null and qwUserId != ''">
+				,qw_user_id = #{qwUserId}
+			</if>
 		</set>
 		where id = #{id}
 	</update>
@@ -1388,6 +1392,12 @@
 		select * from sys_user where login_name = #{loginName}
 	</select>
 
+	<select id="getAllUserList" resultType="User">
+		select * from sys_user where del_flag = 0
+	</select>
 
+	<select id="getIncludeQwUserIdAllUserList" resultType="User">
+		select * from sys_user where del_flag = 0 and (qw_user_id is not null or qw_user_id != '')
+	</select>
 
 </mapper>

+ 1 - 0
src/main/resources/spring-context-shiro.xml

@@ -17,6 +17,7 @@
                 /static/** = anon
                 /userfiles/** = anon
                 ${adminPath}/clockInRecordController/** = anon
+                ${adminPath}/hrUserController/** = anon
                 ${adminPath}/workMaterialCollect/total/** = anon
                 ${adminPath}/ruralProject/signatureOldMessageDispose/** = anon
                 ${adminPath}/weChatCallBack/** = anon