Browse Source

优化代码,补充注释,添加数字、常量枚举。去除魔法数字

zhaoxian 4 năm trước cách đây
mục cha
commit
d3b1694358

+ 4 - 3
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatCheckinDataController.java

@@ -3,6 +3,7 @@ package cn.com.ctop.oa.modules.controller;
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
+import cn.com.ctop.oa.modules.entity.WechatCheckinSubData;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -68,10 +69,10 @@ public class WechatCheckinDataController {
     @AutoLog(value = "考勤打卡明细-分页列表查询")
     @ApiOperation(value = "考勤打卡明细-分页列表查询", notes = "考勤打卡明细-分页列表查询")
     @PostMapping(value = "/queryPageList")
-    public Result<PageInfo<WechatCheckinData>> queryPageList(@RequestBody Map<String, Object> paramsMap) {
-        Result<PageInfo<WechatCheckinData>> result = new Result<>();
+    public Result<PageInfo<WechatCheckinSubData>> queryPageList(@RequestBody Map<String, Object> paramsMap) {
+        Result<PageInfo<WechatCheckinSubData>> result = new Result<>();
         try {
-            PageInfo<WechatCheckinData> pageData = wechatCheckinDataService.selectPageList(paramsMap);
+            PageInfo<WechatCheckinSubData> pageData = wechatCheckinDataService.selectPageList(paramsMap);
             if (!Check.isNull(pageData)) {
                 result.setResult(pageData);
                 result.setSuccess(true);

+ 0 - 9
module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatCheckinData.java

@@ -137,13 +137,4 @@ public class WechatCheckinData {
      */
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
-
-    /**
-     * 员工名
-     */
-    private String userName;
-    /**
-     * 部门名
-     */
-    private String departName;
 }

+ 23 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatCheckinSubData.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.oa.modules.entity;
+
+import lombok.Data;
+
+/**
+ * 企业微信用户
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-15
+ */
+@Data
+public class WechatCheckinSubData extends WechatCheckinData {
+
+    /**
+     * 员工名
+     */
+    private String userName;
+    /**
+     * 部门名
+     */
+    private String departName;
+}

+ 2 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatCheckinDataMapper.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.oa.modules.mapper;
 
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
+import cn.com.ctop.oa.modules.entity.WechatCheckinSubData;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 import java.util.List;
@@ -17,5 +18,5 @@ public interface WechatCheckinDataMapper extends BaseMapper<WechatCheckinData> {
 
     WechatCheckinData queryEntityByMap(Map<String, Object> paramsMap);
 
-    List<WechatCheckinData> selectPageList(Map<String, Object> paramsMap);
+    List<WechatCheckinSubData> selectPageList(Map<String, Object> paramsMap);
 }

+ 1 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatCheckinDataMapper.xml

@@ -22,7 +22,7 @@
     </select>
 
 
-    <select id="selectPageList" resultType="cn.com.ctop.oa.modules.entity.WechatCheckinData">
+    <select id="selectPageList" resultType="cn.com.ctop.oa.modules.entity.WechatCheckinSubData">
         SELECT
         ck.id,
         ck.depart_id,

+ 2 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatCheckinDataService.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.oa.modules.service;
 
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
+import cn.com.ctop.oa.modules.entity.WechatCheckinSubData;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.github.pagehelper.PageInfo;
 
@@ -15,5 +16,5 @@ import java.util.Map;
 public interface IWechatCheckinDataService extends IService<WechatCheckinData> {
     void getCheckinData(String starttime, String endtime);
 
-    PageInfo<WechatCheckinData> selectPageList(Map<String, Object> paramsMap);
+    PageInfo<WechatCheckinSubData> selectPageList(Map<String, Object> paramsMap);
 }

+ 4 - 3
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatCheckinDataServiceImpl.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.oa.modules.constant.QYWxConstant;
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
+import cn.com.ctop.oa.modules.entity.WechatCheckinSubData;
 import cn.com.ctop.oa.modules.entity.WechatUserList;
 import cn.com.ctop.oa.modules.mapper.WechatCheckinDataMapper;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
@@ -119,7 +120,7 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
                         }
                     }
                 } else {
-                    log.error("获取打卡数据异常");
+                    log.error("获取打卡数据异常,数据-> {}",resultJson);
                 }
             }
         } catch (Exception e) {
@@ -128,7 +129,7 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
     }
 
     @Override
-    public PageInfo<WechatCheckinData> selectPageList(Map<String, Object> paramsMap) {
+    public PageInfo<WechatCheckinSubData> selectPageList(Map<String, Object> paramsMap) {
         Integer pageNo = (Integer) paramsMap.get(PAGE_NO);
         if (null == pageNo || pageNo == 0) {
             pageNo = 1;
@@ -148,7 +149,7 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
             paramsMap.put(STOP_TIME, stopTime);
         }
         PageHelper.startPage(pageNo, pageSize);
-        List<WechatCheckinData> list = wechatCheckinDataMapper.selectPageList(paramsMap);
+        List<WechatCheckinSubData> list = wechatCheckinDataMapper.selectPageList(paramsMap);
         return new PageInfo<>(list);
     }
 }