Browse Source

企业微信考勤记录加上外出打卡

yurk 2 years ago
parent
commit
03c79ad5de

+ 18 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -3094,13 +3094,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         if (!StringUtils.isEmpty(code)) {
                             int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
                             if (cnt > 0) {
-                                if(key==0){
-                                    continue;
-                                }
 //                            throw new Exception("项目编号存在重复: " + code);
                                 existCodeList.add(code);
                                 //跳过编号重复的数据
                                 exists=true;
+                                if(key==0){
+                                    continue;
+                                }
                             }
                         }
                         project.setProjectCode(code);
@@ -3295,7 +3295,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 msg.data = MessageUtils.message("data.importSucRow",importCount);
                 if (existCodeList.size() > 0) {
                     String collect = existCodeList.stream().collect(Collectors.joining(","));
-                    msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
+                    if(key==0){
+                        msg.data += MessageUtils.message("data.skip",existCodeList.size(),collect);
+                    }else {
+                        msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
+                    }
+
                 }
                 OperationRecord operationRecord=new OperationRecord();
                 operationRecord.setCompanyId(user.getCompanyId());
@@ -3592,13 +3597,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         if (!StringUtils.isEmpty(code)) {
                             int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
                             if (cnt > 0) {
-                                if(key==0){
-                                    continue;
-                                }
 //                            throw new Exception("项目编号存在重复: " + code);
                                 existCodeList.add(code);
                                 //跳过编号重复的数据
                                 exists=true;
+                                if(key==0){
+                                    continue;
+                                }
                             }
                         }
                         project.setProjectCode(code);
@@ -4270,9 +4275,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
                 //msg.data = "成功导入"+importCount+"条数据。";
                 msg.data = MessageUtils.message("data.importSucRow",importCount);
+                System.out.println(existCodeList);
                 if (existCodeList.size() > 0) {
                     String collect = existCodeList.stream().collect(Collectors.joining(","));
-                    msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
+                    if(key==0){
+                        msg.data += MessageUtils.message("data.skip",existCodeList.size(),collect);
+                    }else {
+                        msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
+                    }
                 }
                 OperationRecord operationRecord=new OperationRecord();
                 operationRecord.setCompanyId(user.getCompanyId());

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -547,7 +547,12 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                             Integer time = (Integer) jsonObject.get("checkin_time");
                             if (jsonObject.get("checkin_type").equals("上班打卡")&&!jsonObject.get("exception_type").equals("未打卡")) {
                                 upList.add(time);
-                            } else if(jsonObject.get("checkin_type").equals("下班打卡")&&!jsonObject.get("exception_type").equals("未打卡")) downList.add(time);
+                            } else if(jsonObject.get("checkin_type").equals("下班打卡")&&!jsonObject.get("exception_type").equals("未打卡")){
+                                downList.add(time);
+                            } else if(jsonObject.get("checkin_type").equals("外出打卡")){
+                                upList.add(time);
+                                downList.add(time);
+                            }
                         }
                     }
                     double restTime = 0.0;//小时为单位
@@ -575,6 +580,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                             System.out.println("下班"+DateTimeUtil.getTimeFromSeconds(integer));
                         }
                     }
+                    System.out.println(upList);
+                    System.out.println(downList);
                     if(upList.isEmpty()||downList.isEmpty()){
                         continue;
                     }

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties

@@ -355,6 +355,7 @@ staff.jobNoNull=工号不能为空
 data.importRepeat=请勿导入重复数据
 data.importSucRow=成功导入"{0}"条数据。
 data.OversizeError=数据量过大,请分时间段导出
+data.skip=自动跳过"{0}"条已存在项目编码:"{1}。
 data.upSkip=自动更新"{0}"条已存在项目编码:"{1}。
 data.exceedMonthError=获取数据时间段不得超过一个月
 data.verificationError=数据有误 验证失败

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_en_US.properties

@@ -355,6 +355,7 @@ staff.jobNoNull=The job number cannot be empty
 data.importRepeat=Do not import duplicate data
 data.importSucRow=Successfully imported '{0}' pieces of data.
 data.OversizeError=The data volume is too large, please export in different time periods
+data.skip=Auto Skip '{0}' item code already exists: '{1}'.
 data.upSkip=Auto update '{0}' item code already exists: '{1}'.
 data.exceedMonthError=The data acquisition period shall not exceed one month.
 data.verificationError=Data error,verification failed