Kaynağa Gözat

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

ggooalice 2 yıl önce
ebeveyn
işleme
795ff751ba
34 değiştirilmiş dosya ile 41354 ekleme ve 42505 silme
  1. 1 1
      fhKeeper/formulahousekeeper/inva_4_tivo/index.html
  2. 105 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuthRedirectController.java
  3. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskProgressController.java
  4. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  5. 9 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java
  6. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/TaskProgressService.java
  7. 1 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java
  8. 11 11
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java
  9. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  10. 51 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  11. 17 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskProgressServiceImpl.java
  12. 185 33
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java
  13. 16 5
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-bkserver.yml
  14. 8 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-sgai.yml
  15. 7 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml
  16. 1 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties
  17. 1 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_en_US.properties
  18. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml
  19. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml
  20. 40704 42375
      fhKeeper/formulahousekeeper/management-platform/workTime.log
  21. 2 2
      fhKeeper/formulahousekeeper/timesheet/config/index.js
  22. 71 1
      fhKeeper/formulahousekeeper/timesheet/src/components/select.vue
  23. 8 1
      fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json
  24. 8 1
      fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json
  25. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue
  26. 43 24
      fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue
  27. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue
  28. 17 5
      fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue
  29. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue
  30. 21 10
      fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue
  31. 6 3
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  32. 26 6
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  33. 18 4
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue
  34. 2 2
      fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

+ 1 - 1
fhKeeper/formulahousekeeper/inva_4_tivo/index.html

@@ -379,7 +379,7 @@
                         这样可以对员工进行合理的工作安排。
                     </div>
                     <div class="conIngFoot">
-                        <p>北首钢集团</p>
+                        <p>北首钢集团</p>
                         <span>张经理</span>
                     </div>
                 </div>

+ 105 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuthRedirectController.java

@@ -43,6 +43,12 @@ public class AuthRedirectController {
     private String suitId;
     @Value("${suitSecret}")
     private String suitSecret;
+    @Value("${privateDeployURL.pcUrl}")
+    private String pcUrl;
+    @Value("${privateDeployURL.mobUrl}")
+    private String mobUrl;
+    @Value("${corpId}")
+    private String corpId;
 
     @Resource
     SysConfigMapper sysConfigMapper;
@@ -144,7 +150,87 @@ public class AuthRedirectController {
     }
 
 
+    @RequestMapping("/corpInsideWXAuth")
+    public ModelAndView authInside(String code, String state) throws Exception{
+        Map<String,Object> reqParam = new HashMap<String,Object>(16);
+        String userAgent = request.getHeader("User-Agent");
+        //获取设备类型
+        String deviceType = UserAgentUtils.getDeviceType(userAgent);
+        boolean isMobile = "MOBILE".equals(deviceType);
+        WxCorpInfo corpInfo = wxCorpInfoMapper.selectById(corpId);
+        String url = WeiXinCorpController.GET_CORP_INSIDE_USERINFO_URL.replace("ACCESS_TOKEN",getCorpConcactAccessToken(corpInfo)).replace("CODE", code);
+        String forObject = this.restTemplate.getForObject(url, String.class);
+        JSONObject obj = JSONObject.parseObject(forObject);
+        String wxUserId = obj.getString("userid");
+//        String openUserId = obj.getString("open_userid");
+//        String corpId = obj.getString("CorpId");
+
+        System.out.println("wxUserId="+wxUserId);
+        System.out.println(obj.toString());
+        List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("corpwx_userid", wxUserId).eq("company_id", corpInfo.getCompanyId()));
+        Integer companyId = 0;
+        if (userList.size() > 0) {
+            //该用户已存在
+            User curUser = userList.get(0);
+            companyId = curUser.getCompanyId();
+            if (curUser.getIsActive() == 1) {
+                reqParam.put("userId", curUser.getId());
+            } else {
+                //提示账号已停用
+                //reqParam.put("errorMsg", "您的账号已停用,无法登录");
+                reqParam.put("errorMsg", MessageUtils.message("user.inactive"));
+            }
+        } else {
+            //使用UserId比对,之前有的老用户存的是UserId
+            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectById(corpId);
+            if (wxCorpInfo == null) {
+                reqParam.put("errorMsg", MessageUtils.message("user.accountNoExist"));
+            } else {
+                User curUser = userMapper.selectOne(new QueryWrapper<User>().eq("company_id", wxCorpInfo.getCompanyId()).eq("corpwx_userid", wxUserId));
+                if (curUser == null) {
+                    reqParam.put("errorMsg", MessageUtils.message("user.accountNoExist"));
+                }
+                if (curUser != null) {
+                    if (curUser.getIsActive() == 1) {
+                        companyId = curUser.getCompanyId();
+                        reqParam.put("userId", curUser.getId());
+                    } else {
+                        //提示账号已停用
+                        reqParam.put("errorMsg", MessageUtils.message("user.inactive"));
+                    }
+                } else {
+                    reqParam.put("errorMsg", MessageUtils.message("user.accountNoExist"));
+                }
+
+            }
+        }
+        reqParam.put("hasTriedAutoLogin", 1);
+        if (!StringUtils.isEmpty(state) && state.length() > 1) {
+            reqParam.put("path", state);
+        }
 
+        String redirecUrl = null;
+        String router = "index";
+        if (companyId > 0) {
+            HashMap compExpireInfo = getCompExpireInfo(companyId);
+            if (compExpireInfo != null) {
+                //过期了
+                router = "expire";
+                reqParam.put("expDate", compExpireInfo.get("expDate"));
+                reqParam.put("version", compExpireInfo.get("version"));
+            }
+        }
+        if (isMobile) {
+            redirecUrl = mobUrl +"/#/"+ router;
+        } else {
+            redirecUrl = pcUrl +"/#/"+ router;
+        }
+        ModelAndView modelAndView = new ModelAndView(
+                new RedirectView(redirecUrl), reqParam);
+        reqParam.put("isPrivateCorpWX", 1);
+        System.out.println("跳转=="+redirecUrl);
+        return modelAndView;
+    }
 
     private HashMap getCompExpireInfo(Integer companyId) {
         Company company = companyMapper.selectById(companyId);
@@ -241,4 +327,23 @@ public class AuthRedirectController {
         return WeiXinCorpController.SUITE_ACCESS_TOKEN;
     }
 
+
+    //获取企业通讯录的accessToken,在私有化部署的企业内部服务器上跑
+    private String getCorpConcactAccessToken(WxCorpInfo corpInfo) throws Exception {
+        String url = WeiXinCorpController.GET_CORP_TOKEN.replace("ID", corpInfo.getCorpid()).replace("SECRET", corpInfo.getContactSecret());
+        ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
+                HttpMethod.GET, null, String.class);
+        if (responseEntity.getStatusCode() == HttpStatus.OK) {
+            String resp = responseEntity.getBody();
+            JSONObject json = JSONObject.parseObject(resp);
+            if (json.getIntValue("errcode") == 0) {
+                String access_token = json.getString("access_token");
+                corpInfo.setAccessToken(access_token);
+            } else {
+                throw new Exception(json.toJSONString());
+            }
+        }
+        return corpInfo.getAccessToken();
+    }
+
 }

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskProgressController.java

@@ -47,8 +47,8 @@ public class TaskProgressController {
     }
 
     @RequestMapping("/list")
-    public HttpRespMsg list(Integer taskId) {
-        return taskProgressService.getList(taskId);
+    public HttpRespMsg list(Integer taskId,HttpServletRequest request) {
+        return taskProgressService.getList(taskId,request);
     }
 }
 

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -80,6 +80,8 @@ public class WeiXinCorpController {
     //网页获取企业用户信息
     public static final String GET_CORP_USERINFO_URL = "https://qyapi.weixin.qq.com/cgi-bin/service/getuserinfo3rd?suite_access_token=SUITE_ACCESS_TOKEN&code=CODE";
     public static final String GET_LIST_MEMB_AUTH = "https://qyapi.weixin.qq.com/cgi-bin/user/list_member_auth?access_token=ACCESS_TOKEN";
+    //网页获取企业内部用户信息
+    public static final String GET_CORP_INSIDE_USERINFO_URL = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE";
     //获取员工打卡日报统计信息
     public static final String GET_CHECKIN_DAYDATA = "https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckin_daydata?access_token=ACCESS_TOKEN";
 
@@ -3620,7 +3622,7 @@ public class WeiXinCorpController {
         data.put("main_title", mainTitle);
         JSONObject cardImg = new JSONObject();
         cardImg.put("url", "http://www.ttkuaiban.com/card_img.png");
-        cardImg.put("aspect_ratio", 2.23);
+        cardImg.put("aspect_ratio", 2.35);
         data.put("card_image", cardImg);
         JSONArray array = new JSONArray();
         JSONObject docItem = new JSONObject();

+ 9 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2022-10-17
+ * @since 2022-12-06
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -390,11 +390,18 @@ public class TimeType extends Model<TimeType> {
     private Integer notAllowedNoAttendance;
 
     /**
-     * 是否需要微信请假
+     * 1为需要同步企业微信请假,0为不需要同步企业微信请假
      */
     @TableField("wx_leave")
     private Integer wxLeave;
 
+    /**
+     * 是否开通【推送工时数据】 0-否 1-是
+     */
+    @TableField("push_report_data")
+    private Integer pushReportData;
+
+
     @Override
     protected Serializable pkVal() {
         return this.companyId;

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/TaskProgressService.java

@@ -20,5 +20,5 @@ public interface TaskProgressService extends IService<TaskProgress> {
 
     HttpRespMsg deleteProgress(Integer id, HttpServletRequest request);
 
-    HttpRespMsg getList(Integer taskId);
+    HttpRespMsg getList(Integer taskId,HttpServletRequest request);
 }

+ 1 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.management.platform.controller.WeiXinCorpController;
 import com.management.platform.entity.*;
 import com.management.platform.entity.vo.DepartmentMasterVO;
 import com.management.platform.entity.vo.DepartmentVO;
@@ -747,7 +746,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
                 String name;
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                     String corpwxUserId = userList.stream().filter(ul -> ul.getId().equals(key)).findFirst().get().getCorpwxUserid();
-                    name ="$userName="+corpwxUserId==null?"":corpwxUserId+"$";
+                    name ="$userName="+ (corpwxUserId==null?"":corpwxUserId) +"$";
                 }else {
                      name = userList.stream().filter(ul -> ul.getId().equals(key)).findFirst().get().getName();
                 }

+ 11 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -254,7 +254,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     if (salaryCell != null) {
                         salaryCell.setCellType(CellType.STRING);
                         String item = salaryCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setMonthCost(value);
                         if (financeConfig.getMonthCostCalculate()==1) total = total.add(value);
                     }
@@ -268,49 +268,49 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     if (bonusCell != null) {
                         bonusCell.setCellType(CellType.STRING);
                         String bonusString = bonusCell.getStringCellValue();
-                        BigDecimal bonus = bonusString != null ? new BigDecimal(bonusString.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal bonus = !StringUtils.isEmpty(bonusString) ? new BigDecimal(bonusString.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setBonus(bonus);
                         if (financeConfig.getBonusCalculate()==1) total = total.add(bonus);
                     }
                     if (allowanceCell != null) {
                         allowanceCell.setCellType(CellType.STRING);
                         String item = allowanceCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setAllowance(value);
                         if (financeConfig.getAllowanceCalculate()==1) total = total.add(value);
                     }
                     if (inJobCell != null) {
                         inJobCell.setCellType(CellType.STRING);
                         String item = inJobCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setInsuranceLosejob(value);
                         if (financeConfig.getInsuranceLosejobCalculate()==1) total = total.add(value);
                     }
                     if (inMedicalCell != null) {
                         inMedicalCell.setCellType(CellType.STRING);
                         String item = inMedicalCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setInsuranceMedical(value);
                         if (financeConfig.getInsuranceMedicalCalculate()==1) total = total.add(value);
                     }
                     if (inOldCell != null) {
                         inOldCell.setCellType(CellType.STRING);
                         String item = inOldCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setInsuranceOld(value);
                         if (financeConfig.getInsuranceOldCalculate()==1) total = total.add(value);
                     }
                     if (injuryCell != null) {
                         injuryCell.setCellType(CellType.STRING);
                         String item = injuryCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setInsuranceInjury(value);
                         if (financeConfig.getInsuranceInjuryCalculate()==1) total = total.add(value);
                     }
                     if (houseFundCell != null) {
                         houseFundCell.setCellType(CellType.STRING);
                         String item = houseFundCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setHouseFund(value);
                         if (financeConfig.getHouseFundCalculate()==1) total = total.add(value);
                     }
@@ -318,21 +318,21 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     if (field1 != null) {
                         field1.setCellType(CellType.STRING);
                         String item = field1.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setCustomField1(value);
                         if (financeConfig.getField1Calculate() != null && financeConfig.getField1Calculate()==1) total = total.add(value);
                     }
                     if (field2 != null) {
                         field2.setCellType(CellType.STRING);
                         String item = field2.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setCustomField2(value);
                         if (financeConfig.getField2Calculate() != null && financeConfig.getField2Calculate()==1) total = total.add(value);
                     }
                     if (field3 != null) {
                         field3.setCellType(CellType.STRING);
                         String item = field3.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                        BigDecimal value = !StringUtils.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
                         finance.setCustomField3(value);
                         if (financeConfig.getField3Calculate() != null && financeConfig.getField3Calculate()==1) total = total.add(value);
                     }

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

@@ -7701,11 +7701,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             if (leaveSheet.getStartDate().isBefore(localStartDate)){
                                 //平均计算
                                 float DifDay = localStartDate.toEpochDay() - leaveSheet.getStartDate().toEpochDay();
-                                leaveTime+= timeHours*(DifDay/LeaveDay);
+                                leaveTime+= timeHours*(1 - DifDay/LeaveDay);
                             }else {
                                 //当请假时间结束时间跨月
                                 float DifDay = leaveSheet.getEndDate().toEpochDay() - localEndDate.toEpochDay();
-                                leaveTime+= timeHours*(DifDay/LeaveDay);
+                                leaveTime+= timeHours*(1 - DifDay/LeaveDay);
                             }
                         }
                     }

+ 51 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -3198,7 +3198,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             Integer corpwxDeptId = (Integer) data.get("corpwxDeptId");
             Map<String, Object> map = new HashMap<>();
             String date = new SimpleDateFormat("yyyy-MM-dd").format((Date)data.get("createDate"));
-            String corpwxUserid = (String) data.get("corpwxUserId");
             map.put("workingTime", data.get("workingTime"));
             map.put("createDate", date);
             if (id.equals(lastUserId)) {
@@ -3210,7 +3209,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 lastUserData.userId = id;
                 lastUserData.name = name;
                 lastUserData.departmentName = departmentName;
-                lastUserData.corpwxUserId = departmentName;
+                lastUserData.corpwxUserId = corpwxUserId;
                 lastUserData.corpwxDeptId = departmentName;
                 lastUserData.worktimeList = new ArrayList<>();
                 lastUserData.worktimeList.add(map);
@@ -3830,6 +3829,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 //titles.add("考勤时长");
                 titles.add(MessageUtils.message("excel.attDuration"));
             }
+            //titles.add("审核流程状态");
+            titles.add(MessageUtils.message("excel.reviewProcessStatus"));
             //创建表头
             HSSFRow headRow = sheet.createRow(0);
             //设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
@@ -4139,6 +4140,53 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         }
                     }
                     row.createCell(index).setCellValue(cellValue);
+                    index ++;
+                }
+                //审核流程状态
+                Integer packageEngineering = company.getPackageEngineering();
+                if (packageEngineering.equals(0)){
+                    List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id",user.getCompanyId()));
+                    if(String.valueOf(map.get("state")).equals("1")){
+                        row.createCell(index).setCellValue("——");
+                    }else if (String.valueOf(map.get("state")).equals("-1")){
+                        row.createCell(index).setCellValue("导入待审核");
+                    } else {
+                        //部门审核
+                        if(String.valueOf(map.get("is_dept_audit")).equals("1")){
+                            String deptAuditorId = map.get("deptAuditorName")+"";
+                            String departmentName = map.get("departmentName") + "";
+                            for (User item : users) {
+                                if (item.getId().equals(deptAuditorId)){
+                                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                        String deptAuditorName ="$userName="+ item.getCorpwxRealUserid() +"$";
+                                        departmentName = "$departmentName=" + departmentName + "$";
+                                        row.createCell(index).setCellValue("待" + departmentName + "(" + deptAuditorName + ")审核");
+                                    }else {
+                                        row.createCell(index).setCellValue("待" + departmentName + "(" + item.getName() + ")审核");
+                                    }
+                                    break;
+                                }
+
+                            }
+                        }else {
+                            //项目审核或分组审核
+                            if (String.valueOf(map.get("projectAuditState")).equals("0") || String.valueOf(map.get("groupAuditState")).equals("0")){
+                                String projectAuditorName = map.get("projectAuditorName")+"";
+                                String projectAuditorId = map.get("projectAuditorId")+"";
+                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                    for (User item : users) {
+                                        if (item.getId().equals(projectAuditorId)){
+                                            projectAuditorName ="$userName="+ item.getCorpwxUserid() +"$";
+                                            row.createCell(index).setCellValue("待项目审核人" + "(" + projectAuditorName + ")审核");
+                                            break;
+                                        }
+                                    }
+                                }else {
+                                    row.createCell(index).setCellValue("待项目审核人" + "(" + projectAuditorName + ")审核");
+                                }
+                            }
+                        }
+                    }
                 }
                 rowNum++;
             }
@@ -4451,7 +4499,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         continue;
                     }
                     //当前日期在离职日期之后 不需要再添加 跳出
-                    if((curUser.getIsActive()==0&&date.isAfter(curUser.getInactiveDate()))) {
+                    if((curUser.getIsActive()==0&& curUser.getInactiveDate() != null &&date.isAfter(curUser.getInactiveDate()))) {
                         continue;
                     }
                     //去掉非工作日

+ 17 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskProgressServiceImpl.java

@@ -166,10 +166,26 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
     }
 
     @Override
-    public HttpRespMsg getList(Integer taskId) {
+    public HttpRespMsg getList(Integer taskId,HttpServletRequest request) {
+        String token = request.getHeader("token");
+        User user = userMapper.selectById(token);
         //倒序,最新的在最上面
         List<TaskProgress> taskProgressList
                 = taskProgressMapper.selectList(new QueryWrapper<TaskProgress>().eq("task_id", taskId).orderByDesc("id"));
+        List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        for (TaskProgress taskProgress : taskProgressList) {
+            for (User item : users) {
+                if (item.getId().equals(taskProgress.getCreatorId())){
+                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                        taskProgress.setCreatorName(item.getCorpwxRealUserid());
+                    }else {
+                        taskProgress.setCreatorName(item.getName());
+                    }
+                    break;
+                }
+            }
+        }
         HttpRespMsg msg = new HttpRespMsg();
         msg.data = taskProgressList;
         return msg;

+ 185 - 33
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -1,17 +1,16 @@
 package com.management.platform.task;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.injector.methods.SelectById;
 import com.management.platform.controller.WeiXinCorpController;
 import com.management.platform.entity.*;
+import com.management.platform.entity.vo.TokenVo;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
-import com.management.platform.util.DockWithMLD;
-import com.management.platform.util.HttpRespMsg;
-import com.management.platform.util.RedisUtil;
-import com.management.platform.util.WorkDayCalculateUtils;
+import com.management.platform.util.*;
 import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
 import me.chanjar.weixin.mp.api.WxMpService;
 import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
@@ -30,12 +29,18 @@ import org.springframework.util.StringUtils;
 import org.springframework.web.client.RestTemplate;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.security.SecureRandom;
+import java.sql.Timestamp;
 import java.text.DecimalFormat;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
 import java.time.temporal.TemporalAccessor;
+import java.time.temporal.TemporalAdjusters;
 import java.util.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 
@@ -51,10 +56,12 @@ public class TimingTask {
     //是否是开发环境
     @Value("${configEnv.isDev}")
     boolean isDev;
+    @Value("${privateDeployURL.pcUrl}")
+    private String pcUrl;
     //是否是私有化部署
     @Value("${configEnv.isPrivateDeploy}")
     boolean isPrivateDeploy;
-
+    private final static Executor executor = Executors.newFixedThreadPool(3);//启用多线程
 
     @Value("${wx.template_report_fill}")
     public String TEMPLATE_REPORT_FILL;
@@ -64,6 +71,8 @@ public class TimingTask {
     public String appId;
     @Value("${wx.app_secret}")
     public String appSecret;
+    @Value("${corpId}")
+    public String corpId;
     @Autowired
     private RedisUtil redisUtil;
     @Autowired
@@ -81,9 +90,13 @@ public class TimingTask {
     @Resource
     private ReportMapper reportMapper;
     @Resource
+    private TimeAutoExcludeMapper timeAutoExcludeMapper;
+    @Resource
     private WxCorpInfoService wxCorpInfoService;
     @Resource
     private WxCorpInfoMapper wxCorpInfoMapper;
+    @Resource
+    private ReportLogMapper reportLogMapper;
     @Value(value = "${upload.path}")
     private String path;
 
@@ -188,10 +201,69 @@ public class TimingTask {
         }
     }
 
+    //每个月五号推送日报信息
+    @Scheduled(cron = "0 0 1 5 * ?")
+    private void pushReportListByToken(){
+        if(isDev) return;
+        HttpRespMsg msg=new HttpRespMsg();
+        LocalDate now=LocalDate.now().minusMonths(1);
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        now.with(TemporalAdjusters.lastDayOfMonth());
+        LocalDate start=now.with(TemporalAdjusters.firstDayOfMonth());
+        LocalDate end=now.with(TemporalAdjusters.lastDayOfMonth());
+        List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("push_report_data", 1));
+        for (TimeType timeType : timeTypeList) {
+            List<ReportLog> reportLogList = reportLogMapper.selectList(new QueryWrapper<ReportLog>().eq("company_id", timeType.getCompanyId()).ge("operate_date",start.atTime(LocalTime.now())).orderByAsc("operate_date"));
+            List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", timeType.getCompanyId()));
+                List<HashMap<String, Object>> allReportByDate = reportMapper.getAllReportByDate(start.format(df),timeType.getCompanyId(), null, end.format(df), null, 1, null);
+                final CountDownLatch latch=new CountDownLatch(allReportByDate.size());
+                for (HashMap<String, Object> map : allReportByDate) {
+                    java.sql.Date sqlCreateDate= (java.sql.Date) map.get("createDate");
+                    java.sql.Timestamp sqlProjectAuditTime= (Timestamp) map.get("projectAuditTime");
+                    java.sql.Timestamp sqlTime= (Timestamp) map.get("time");
+                    if(sqlCreateDate!=null){
+                        LocalDate createDate = sqlCreateDate.toLocalDate();
+                        map.put("createDate",df.format(createDate));
+                    }
+                    if(sqlProjectAuditTime!=null){
+                        LocalDateTime projectAuditTime = sqlProjectAuditTime.toLocalDateTime();
+                        map.put("projectAuditTime",projectAuditTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                    }
+                    if(sqlTime!=null){
+                        LocalDateTime time = sqlTime.toLocalDateTime();
+                        map.put("time",time.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                    }
+                    executor.execute(new Runnable(){
+                        @Override
+                        public void run() {
+                            List<ReportLog> item=new ArrayList<>();
+                            Integer reportId = (Integer) map.get("id");
+                            for (ReportLog reportLog : reportLogList) {
+                                List<String> list = Arrays.asList(reportLog.getReportIds().split(","));
+                                reportLog.setCreatorName(!userList.stream().filter(
+                                        ul->ul.getId().equals(reportLog.getCreatorId())).findFirst().isPresent()?"":userList.stream().filter(
+                                        ul->ul.getId().equals(reportLog.getCreatorId())).findFirst().get().getName());
+                                reportLog.setOperateName(!userList.stream().filter(
+                                        ul->ul.getId().equals(reportLog.getOperatorId())).findFirst().isPresent()?"":userList.stream().filter(
+                                        ul->ul.getId().equals(reportLog.getOperatorId())).findFirst().get().getName());
+                                if(list.contains(String.valueOf(reportId))&&!reportLog.getMsg().contains("提交")){
+                                    item.add(reportLog);
+                                }
+                            }
+                            map.put("checkLog",item);
+                            latch.countDown();
+                        }
+                    });
+                }
+                msg.data=allReportByDate;
+        }
+    }
+
+
     //每天2:11 同步钉钉用户前2天到未来30天时间段的打卡,请假,出差数据
-    @Scheduled(cron = "0 11 2 ? * *")
+    @Scheduled(cron = "0 53 15 ? * *")
     private void synFanWeiWorkData() {
-        if (isDev) return;
+        /*if (isDev) return;*/
         List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_fanwei", 1));
         List<Integer> compIds = timeTypeList.stream().map(TimeType::getCompanyId).collect(Collectors.toList());
         if(compIds.isEmpty()){
@@ -217,24 +289,50 @@ public class TimingTask {
         //Todo: 获取打卡数据
         HttpRespMsg workDataMsg = dockWithMLD.getResult("http://10.1.10.51:20175/api/cube/restful/interface/getModeDataPageList/getWorkData", jsonString);
         List<Map<String,Object>> workDataList= (List<Map<String, Object>>) workDataMsg.data;
-        for (Map<String, Object> map : workDataList) {
-            UserFvTime userFvTime=new UserFvTime();
-            User user = userMapper.selectOne(new QueryWrapper<User>().eq("job_number", map.get("userId")));
-            if(user==null){
-                continue;
+        List<String> userIds = workDataList.stream().map(map -> String.valueOf(map.get("userId"))).collect(Collectors.toList());
+        List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("job_number", userIds));
+        for (User user : userList) {
+            System.out.println("需要同步的用户列表-----"+userList);
+            LocalTime startTime=null;
+            LocalTime endTime=null;
+            LocalDate workDate=null;
+            for (Map<String, Object> map : workDataList) {
+                if (map.get("userId").equals(user.getJobNumber())) {
+                    if(String.valueOf(map.get("signtype")).equals("签到")){
+                        startTime=LocalTime.parse(String.valueOf(map.get("signtime")), dtf2);
+                        workDate= LocalDate.parse(String.valueOf(map.get("workDate")), dtf);
+                    }
+                    if(String.valueOf(map.get("signtype")).equals("签退")){
+                        endTime=LocalTime.parse(String.valueOf(map.get("signtime")), dtf2);
+                        workDate=LocalDate.parse(String.valueOf(map.get("workDate")),dtf);
+                    }
+                }
             }
+            UserFvTime userFvTime=new UserFvTime();
+            //获取休息设置
+            TimeAutoExclude timeAutoExclude = timeAutoExcludeMapper.selectOne(new QueryWrapper<TimeAutoExclude>().eq("company_id", user.getCompanyId()));
+            System.out.println("泛微同步人员打卡数据----"+user.getName());
             if(compIds.contains(user.getCompanyId())){
-                userFvTime.setWorkDate(LocalDate.parse(String.valueOf(map.get("workDate")),dtf));
-                LocalTime startTime = LocalTime.parse(String.valueOf(map.get("startTime")), dtf2);
-                LocalTime endTime = LocalTime.parse(String.valueOf(map.get("endTime")), dtf2);
-                LocalDateTime time1= LocalDate.now().atTime(startTime);
-                LocalDateTime time2 = LocalDate.now().atTime(endTime);
-                Duration between = Duration.between(time1, time2);
-                userFvTime.setStartTime((String) map.get("startTime"));
-                userFvTime.setEndTime((String) map.get("endTime"));
+                if(startTime==null||endTime==null){
+                    System.out.println("缺少上班或者下班打卡时间----"+user.getName());
+                    continue;
+                }
+                userFvTime.setWorkDate(workDate);
+                Duration between = Duration.between(startTime, endTime);
+                userFvTime.setStartTime(startTime.format(dtf2));
+                userFvTime.setEndTime(endTime.format(dtf2));
                 userFvTime.setCompanyId(user.getCompanyId());
                 userFvTime.setUserId(user.getId());
-                userFvTime.setWorkHours((float)between.toHours());
+                long workHours = between.toHours();
+                long restHours;
+                if(startTime.isBefore(LocalTime.parse(timeAutoExclude.getStartTime(),dtf2))
+                        &&endTime.isAfter(LocalTime.parse(timeAutoExclude.getEndTime(),dtf2))){
+                    Duration bt = Duration.between(LocalTime.parse(timeAutoExclude.getStartTime(),dtf2), LocalTime.parse(timeAutoExclude.getEndTime(),dtf2));
+                    restHours=bt.toHours();
+                }else {
+                    restHours=0;
+                }
+                userFvTime.setWorkHours(BigDecimal.valueOf(workHours).subtract(BigDecimal.valueOf(restHours)).floatValue());
                 Optional<UserFvTime> first = oldUserFvTimeList.stream().filter(ol -> ol.getWorkDate().isEqual(userFvTime.getWorkDate()) && ol.getUserId().equals(userFvTime.getUserId())).findFirst();
                 if(first.isPresent()){
                     userFvTime.setId(first.get().getId());
@@ -253,24 +351,51 @@ public class TimingTask {
             if(user==null){
                 continue;
             }
+            System.out.println("泛微同步人员请假数据----"+user.getName());
             if(compIds.contains(user.getCompanyId())){
                LeaveSheet leaveSheet=new LeaveSheet();
                leaveSheet.setCompanyId(user.getCompanyId());
                leaveSheet.setStatus(0);
                leaveSheet.setOwnerId(user.getId());
                leaveSheet.setOwnerName(user.getName());
-               leaveSheet.setStartDate(LocalDate.parse(String.valueOf(map.get("startDate")),dtf));
-               leaveSheet.setEndDate(LocalDate.parse(String.valueOf(map.get("endDate")),dtf));
-               int timeType = Integer.parseInt(String.valueOf(map.get("timeType")));
+               leaveSheet.setStartDate(LocalDate.parse(String.valueOf(map.get("startDate")),dtf1));
+               leaveSheet.setEndDate(LocalDate.parse(String.valueOf(map.get("endDate")),dtf1));
+               Integer timeType=null;
+               switch (String.valueOf(map.get("timeType"))){
+                   case "小时":timeType=1;
+                       break;
+                   case "天":timeType=0;
+                       break;
+               }
                leaveSheet.setTimeType(timeType);
-               leaveSheet.setTimeDays((Float) map.get("timeDays"));
+               leaveSheet.setTimeDays(Float.parseFloat((String) map.get("timeDays")));
                if (timeType == 0){
                    TimeType allDay = timeTypeMapper.selectOne(new QueryWrapper<TimeType>().eq("company_id", user.getCompanyId()));
                    leaveSheet.setTimeHours(leaveSheet.getTimeDays()*allDay.getAllday());
                }else {
-                   leaveSheet.setTimeHours((Float) map.get("timeHours"));
+                   leaveSheet.setTimeHours(Float.parseFloat((String) map.get("timeHours")));
                }
-               leaveSheet.setLeaveType(Integer.parseInt(String.valueOf(map.get("leaveType"))));
+               Integer leaveType=null;
+               switch (String.valueOf(map.get("leaveType"))){
+                   case "事假":leaveType=0;
+                       break;
+                   case "病假":leaveType=1;
+                       break;
+                   case "年假":leaveType=2;
+                       break;
+                   case "产假":leaveType=3;
+                       break;
+                   case "婚假":leaveType=4;
+                       break;
+                   case "丧假":leaveType=5;
+                       break;
+                   case "调休":leaveType=6;
+                       break;
+                   case "陪产假":leaveType=7;
+                       break;
+                   default:leaveType=8;
+               }
+               leaveSheet.setLeaveType(leaveType);
                leaveSheet.setProcinstId(String.valueOf(map.get("procinstId")));
                leaveSheet.setGmtFinished(String.valueOf(map.get("gmtFinished")));
                 Optional<LeaveSheet> first = oldLeaveSheetList.stream().filter(ol -> ol.getStartDate().isEqual(leaveSheet.getStartDate())&&ol.getEndDate().isEqual(leaveSheet.getEndDate()) && ol.getOwnerId().equals(leaveSheet.getOwnerId())).findFirst();
@@ -291,16 +416,39 @@ public class TimingTask {
             if(user==null){
                 continue;
             }
+            System.out.println("泛微同步人员出差数据----"+user.getName());
             if(compIds.contains(user.getCompanyId())){
                 BusinessTrip businessTrip=new BusinessTrip();
                 businessTrip.setCompanyId(user.getCompanyId());
-                businessTrip.setStartDate(LocalDate.parse(String.valueOf(map.get("startDate")),dtf));
-                businessTrip.setEndDate(LocalDate.parse(String.valueOf(map.get("endDate")),dtf));
-                businessTrip.setWay(Integer.valueOf(String.valueOf(map.get("way"))));
+                businessTrip.setOwnerId(user.getId());
+                businessTrip.setOwnerName(user.getName());
+                businessTrip.setStartDate(LocalDate.parse(String.valueOf(map.get("startDate")),dtf1));
+                businessTrip.setEndDate(LocalDate.parse(String.valueOf(map.get("endDate")),dtf1));
+                Integer way=null;
+                switch (String.valueOf(map.get("way"))){
+                    case "飞机":way=0;
+                    break;
+                    case "高铁/火车":way=1;
+                        break;
+                    case "汽车":way=2;
+                        break;
+                    case "轮船":way=3;
+                        break;
+                    case "其他":way=4;
+                        break;
+                }
+                businessTrip.setWay(way);
                 businessTrip.setCityFrom((String) map.get("cityFrom"));
                 businessTrip.setCityTo((String) map.get("cityTo"));
-                businessTrip.setGoBack(Integer.valueOf(String.valueOf(map.get("goBack"))));
-                businessTrip.setDayCount(Integer.valueOf(String.valueOf(map.get("dayCount"))));
+                Integer goBack=null;
+                switch (String.valueOf(map.get("goBack"))){
+                    case "单程":goBack=0;
+                    break;
+                    case "往返":goBack=1;
+                    break;
+                }
+                businessTrip.setGoBack(goBack);
+                businessTrip.setDayCount(Integer.parseInt(String.valueOf(map.get("dayCount")).substring(0,1)));
                 businessTrip.setProcinstId((String) map.get("procinstId"));
                 businessTrip.setGmtFinished((String)map.get("gmtFinished"));
                 Optional<BusinessTrip> first = oldBusinessTripList.stream().filter(ol -> ol.getStartDate().isEqual(businessTrip.getStartDate())&&ol.getEndDate().isEqual(businessTrip.getEndDate()) && ol.getOwnerId().equals(businessTrip.getOwnerId())).findFirst();
@@ -506,6 +654,10 @@ public class TimingTask {
             token+=s;
         }
         System.out.println(token);
+        LocalDate now=LocalDate.now().minusMonths(1);
+        LocalDate end=now.with(TemporalAdjusters.lastDayOfMonth());
+        LocalDate start=now.with(TemporalAdjusters.firstDayOfMonth());
+        System.out.println(start+"----"+end);
     }
 
     //发送上周填写的工时统计
@@ -631,7 +783,7 @@ public class TimingTask {
                         jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
                         dataJson.add(jsonObj);
                         if(isPrivateDeploy){
-                            json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
+                            json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+corpId+"&redirect_uri="+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
                         }else {
                             json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
                             json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");

+ 16 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-bkserver.yml

@@ -82,10 +82,12 @@ mybatis:
 upload:
   path: /www/staticproject/timesheet/upload/
 
-
-
-
-
+referer:
+  refererDomain:
+    - localhost
+    - gsmb.sgai.com.cn
+    - gspc.sgai.com.cn
+    - dev.huoshishanxin.com
 ##actuator健康检查配置
 management:
   security:
@@ -102,4 +104,13 @@ management:
       enabled: false
 
 configEnv:
-  isDev: true
+  isDev: true
+  # 是否是私有化部署,企业内部应用
+  isPrivateDeploy: true
+
+privateDeployURL:
+  pcUrl: http://dev.huoshishanxin.com
+  mobUrl: http://dev.huoshishanxin.com
+
+# 私有化部署的企业自己的corpId
+corpId: ww0b9aafe69e506b8b

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-sgai.yml

@@ -103,4 +103,11 @@ management:
 
 configEnv:
   isDev: true
-  isPrivateDeploy: true
+  isPrivateDeploy: true
+
+privateDeployURL:
+  pcUrl: http://gspc.sgai.com.cn/#/
+  mobUrl: http://gsmb.sgai.com.cn/#/
+
+# 私有化部署的企业自己的corpId
+corpId: ww69287a3380830fb1

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -15,7 +15,7 @@ spring:
       location: C:/upload/
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://47.101.180.183:3306/man_hour_manager?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
+    url: jdbc:mysql://47.101.180.183:3306/man_mld?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
     username: root
     password: HuoshiDB@2022
     hikari:
@@ -147,4 +147,10 @@ configEnv:
   # 是否是私有化部署,企业内部应用
   isPrivateDeploy: false
 
+privateDeployURL:
+  pcUrl: http://dev.huoshishanxin.com/#/
+  mobUrl: http://dev.huoshishanxin.com/#/
+
+
+
 

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

@@ -691,6 +691,7 @@ excel.validity = 有效期
 excel.deptHeadCount=部门人数
 excel.joinCenterCount=参与的研究中心的数量
 excel.tripPeopleCount=出差的人次
+excel.reviewProcessStatus=审核流程状态
 #推送
 push.fillIn=您今天的工时填报还未完成
 push.name=屈跃庭

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

@@ -691,6 +691,7 @@ excel.validity = term of validity
 excel.deptHeadCount=Department headcount
 excel.joinCenterCount=Number of research centers involved
 excel.tripPeopleCount=Number of people on business trip
+excel.reviewProcessStatus=Review process status
 #推送
 push.fillIn=Your work hour report for today has not been completed.
 push.name=Qu Yue ting

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -60,7 +60,7 @@
         SELECT a.id, c.name,c.job_number as jobNumber,c.corpwx_userid as corpwxUserId,c.corpwx_deptid as corpwxDeptId, b.project_name AS project,b.project_code as projectCode,b.category_name as categoryName, a.working_time AS duration, a.content, a.create_time   AS time,a.create_date as createDate,
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType,a.start_time as startTime,u.job_number as jobNumber,
         a.end_time  as endTime, d.name as subProjectName,d.code as subProjectCode,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
-        a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
+        a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime,a.is_dept_audit as isDeptAudit,a.group_audit_state as groupAuditState,task_group.incharger_id as inchargerId,a.project_audit_state as projectAuditState,a.audit_dept_managerid as deptAuditorName
         ,c.plate1 as plate1,c.plate2 as plate2,c.plate3 as plate3,c.plate4 as plate4,c.plate5 as plate5
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId,a.custom_data as customData
         ,u.name as projectAuditorName, a.project_auditor_id as projectAuditorId, department.department_name as departmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText,a.project_audit_time  as projectAuditTime,project_main.name as projectMainName

Dosya farkı çok büyük olduğundan ihmal edildi
+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


Dosya farkı çok büyük olduğundan ihmal edildi
+ 40704 - 42375
fhKeeper/formulahousekeeper/management-platform/workTime.log


+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,10 +1,10 @@
 var path = require('path')
 
-//  var ip = '127.0.0.1'
+ var ip = '127.0.0.1'
 // var ip = '47.101.180.183'
 // var ip = '47.100.37.243'
 // var ip = '192.168.2.31'
-var ip = '192.168.2.44'
+// var ip = '192.168.2.44'
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 // for (var i in ifaces) {

+ 71 - 1
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -1,5 +1,6 @@
 <template>
-  <div tabindex="0" @blur="selectClihide()" style="display: inline-block;">  
+<div style="display: inline-block;">
+  <div tabindex="0" @blur="selectClihide()" style="display: inline-block;" v-if="!wxCope">
     <!-- <div :style="'width:' + selectWidth + 'px;height:' + selectHeight + 'px'" :class="classDiv ? 'select selectDiv' : 'select'" @click="selectCli" :ref="disabled ? '' : 'selectDiv'"> -->
     <div :class="disabled ? 'disabledTrue' : 'disabledFalse'" @mouseenter="moveIonDiv" @mouseleave="outIonDiv">
         <div :style="`width:${selectWidth}px;height:${selectHeight}px`" :class="classDiv ? 'select selectDiv' : 'select'" @click="selectCli" :ref="disabled ? '' : 'selectDiv'">
@@ -70,6 +71,14 @@
       </div>
     </transition>
   </div>
+  <div v-if="wxCope" class="waihez">
+    <!-- <div @click="dianjis()">点击</div> -->
+    <div :style="`width:${selectWidth}px;height:${selectHeight}px;line-height:${selectHeight}px;background:#fff`" class="select selectDandu" @click="dianjis()">
+        <span v-if="!multiSelect"><ww-open-data type='userName' :openid='selectName'></ww-open-data></span>
+        <!-- <span>你好</span> -->
+    </div>
+  </div>
+</div>
 </template>
 
 <script>
@@ -84,6 +93,10 @@ export default {
         subjectId: {
             type: [String, Number, Array]
         },
+        wxCope: {
+            type: Boolean,
+            default: false,
+        },
         // 是否支持多选
         multiSelect: {
             type: Boolean,
@@ -265,6 +278,54 @@ export default {
         this.dailyListIndex = this.idx
     },
     methods: {
+        dianjis() {
+            if(!this.disabled) {
+                let modes = this.multiSelect ? 'multi' : 'single'
+                let that = this
+                wx.invoke("selectEnterpriseContact", {
+                    "fromDepartmentId": 0,// 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
+                    "mode": modes,// 必填,选择模式,single表示单选,multi表示多选
+                    "type": ["user"],// 必填,选择限制类型,指定department、user中的一个或者多个
+                    "selectedDepartmentIds": [],// 非必填,已选部门ID列表。用于多次选人时可重入,single模式下请勿填入多个id
+                    "selectedUserIds": []// 非必填,已选用户ID列表。用于多次选人时可重入,single模式下请勿填入多个id
+                        },function(res){
+                            console.log(res)
+                            if (res.err_msg == "selectEnterpriseContact:ok"){
+                                console.log(res, '数据来源')
+                                if(typeof res.result == 'string'){
+                                    res.result = JSON.parse(res.result) //由于目前各个终端尚未完全兼容,需要开发者额外判断result类型以保证在各个终端的兼容性
+                                }
+                                var selectedUserList = res.result.userList; // 已选的成员列表
+                                var userId = ''
+                                var userName = ''
+                                for (var i = 0; i < selectedUserList.length; i++) {
+                                        var user = selectedUserList[i];
+                                        userId = user.id; // 已选的单个成员ID
+                                        userName = user.name;// 已选的单个成员名称
+                                        console.log(userId, userName)
+                                }
+                                for(var s in that.options) {
+                                    if(that.options[s].name == userId) {
+                                        that.selectName = userId
+                                        that.wxCoper(that.options[s].id)
+                                    }
+                                }
+                            }
+                        }
+                );
+            }
+        },
+        wxCoper(id) {
+            let obj = {
+                id: id,
+                distinction: this.distinction,
+                index: this.index, // 选中的索引
+                other: this.other,
+                name: this.selectName
+            }
+            console.log(obj)
+            this.$emit("selectCal", obj)
+        },
         selectCli() {
             if(!this.disabled) {
                 this.$refs.selectDiv.focus()
@@ -443,6 +504,15 @@ export default {
 </script>
 
 <style scoped lang="scss">
+    .selectDandu {
+        font-size: 16px;
+    }
+    .waihez {
+        // padding-top: 7px;
+        // box-sizing: border-box;
+        // background: #FFF;
+        display: inline-block;
+    }
     .selectDiv {
         border-color: #409EFF !important;
     }

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -1450,5 +1450,12 @@
   "dao-chu-jia-qi": "Export holidays",
   "an-ji-du-dao-chu": "export by quarter",
   "han-qing-jia": "(including leave)",
-  "ke-fu-wei-xin": "Customer service wechat"
+  "ke-fu-wei-xin": "Customer service wechat",
+  "bian-ji-mo-ban": "Edit a Template",
+  "mo-ban-ming-cheng": "Template Name",
+  "mo-ban-ming-cheng-bu-neng-wei-kong": "template name cannot be empty",
+  "ren-wu-jie-zhi-shi-jian-bu-neng-xiao-yu-kai-shi-shi-jian": "The task expiration time cannot be later than the start time",
+  "ren-wu-lie-biao-ming-cheng-bu-neng-wei-kong": "The task list name cannot be empty",
+  "xin-zeng-ren-wu-lie-biao": "Adding a Task List",
+  "zan-wu-ren-wu": "No job at the moment"
 }

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -1450,5 +1450,12 @@
   "dao-chu-jia-qi": "导出假期",
   "an-ji-du-dao-chu": "按季度导出",
   "han-qing-jia": "(含请假)",
-  "ke-fu-wei-xin": "客服微信"
+  "ke-fu-wei-xin": "客服微信",
+  "zan-wu-ren-wu": "暂无任务",
+  "bian-ji-mo-ban": "编辑模板",
+  "mo-ban-ming-cheng": "模板名称",
+  "xin-zeng-ren-wu-lie-biao": "新增任务列表",
+  "mo-ban-ming-cheng-bu-neng-wei-kong": "模板名称不能为空",
+  "ren-wu-lie-biao-ming-cheng-bu-neng-wei-kong": "任务列表名称不能为空",
+  "ren-wu-jie-zhi-shi-jian-bu-neng-xiao-yu-kai-shi-shi-jian": "任务截止时间不能小于开始时间"
 }

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -558,7 +558,7 @@
                                             timestamp: res.data.timestamp, // 必填,生成签名的时间戳
                                             nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
                                             signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
-                                            jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
+                                            jsApiList: ['selectExternalContact', 'selectEnterpriseContact'], //必填,传入需要使用的接口名称
                                             success: function (result) {
                                                 console.log(result, '请求微信成功')
                                                 console.log(window, 'window')

+ 43 - 24
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -86,35 +86,53 @@
             if (ua.indexOf("wxwork") > 0) {
                 this.isCorpWX = true;
             } 
-            if (localStorage.userInfo != null) {
-                var user = JSON.parse(localStorage.userInfo);
-                if (user.company.packageSimple == 1) {
-                    //简易模式,直接进入工时统计表
-                    this.$router.push({ path: '/simple' });
+            if (this.isCorpWX) {
+                //企业微信环境下,尝试自动登录
+                let href = window.location.href;
+                //判断企业微信,是否存在授权
+                //尝试自动登录
+                if (href.indexOf('hasTriedAutoLogin') == -1) {
+                    this.tryAutoLogin();
+                } else if (href.indexOf("userId") > 0) {
+                    //后台经过验证后,重定向过来带上了userId
+                    var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
+                    if (loginUserId.includes('#/')) {
+                        loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
+                    }
+                    var path = null;
+                    if (href.indexOf('path') > 0) {
+                        path = href.split('path=')[1].split('&')[0];
+                    }
+                    this.loginByUserId(loginUserId, path);
                 } else {
-                    if(user.moduleList.length > 0) {
-                        this.$router.push({ path: user.moduleList[0].path })
+                    if (localStorage.userInfo != null) {
+                        var user = JSON.parse(localStorage.userInfo);
+                        if (user.company.packageSimple == 1) {
+                            //简易模式,直接进入工时统计表
+                            this.$router.push({ path: '/simple' });
+                        } else {
+                            if(user.moduleList.length > 0) {
+                                this.$router.push({ path: user.moduleList[0].path })
+                            }
+                        }
+                    } else if (href.indexOf('errorMsg=') > 0) {
+                        var errorMsg = href.split('errorMsg=')[1].split('#')[0];
+                        this.$message({
+                            message: errorMsg,
+                            type: 'error'
+                        });
                     }
                 }
             } else {
-                if (this.isCorpWX) {
-                    //企业微信环境下,尝试自动登录
-                    let href = window.location.href;
-                    //判断企业微信,是否存在授权
-                    //尝试自动登录
-                    if (href.indexOf('hasTriedAutoLogin') == -1) {
-                        this.tryAutoLogin();
-                    } else if (href.indexOf("userId") > 0) {
-                        //后台经过验证后,重定向过来带上了userId
-                        var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
-                        if (loginUserId.includes('#/')) {
-                            loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
-                        }
-                        var path = null;
-                        if (href.indexOf('path') > 0) {
-                            path = href.split('path=')[1].split('&')[0];
+                if (localStorage.userInfo != null) {
+                    var user = JSON.parse(localStorage.userInfo);
+                    if (user.company.packageSimple == 1) {
+                        //简易模式,直接进入工时统计表
+                        this.$router.push({ path: '/simple' });
+                    } else {
+                        if(user.moduleList.length > 0) {
+                            this.$router.push({ path: user.moduleList[0].path })
                         }
-                        this.loginByUserId(loginUserId, path);
                     }
                 } else {
                     //检查环境,如果是钉钉有$CORPID$
@@ -145,6 +163,7 @@
                     } 
                 }
             }
+            
             let urls = window.location.href
             console.log(urls, '连接')
             if(urls.indexOf('english=1') != '-1' && localStorage.getItem('lang') != 'en') {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -298,7 +298,7 @@
             <div class="ctons">
             <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
                 <div style="display: inline-block;width: 350px">
-                    <el-input style="float:left;" v-model="searchWord" class="input-with-select" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
+                    <el-input style="float:left;" v-if="user.userNameNeedTranslate != 1" v-model="searchWord" class="input-with-select" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
                         <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
                     </el-input>
                 </div>

+ 17 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -185,7 +185,7 @@
                   <el-option :label="item.name" :value="item.id"></el-option>
                   </span> 
               </el-select>
-              <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIds" :distinction="'3'" :disabled="false" :clearable="true" @selectCal="selectCal" v-show="permissions.leaveAll" style="width: 120px"></selectCat>
+              <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIds" :distinction="'3'" :disabled="false" :widthStr="'120'" :clearable="true" @selectCal="selectCal" v-show="permissions.leaveAll" style="width: 120px"></selectCat>
             </div>
             <div>
               <span style="color: #606266">{{ $t('leavetype') }}</span>
@@ -323,7 +323,7 @@
         <div class="ctons" style="width: 98%;">
           <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
             <div style="display: inline-block;width: 350px">
-              <el-input style="float:left;" v-model="keyword" class="input-with-select" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
+              <el-input style="float:left;" v-if="user.userNameNeedTranslate != 1" v-model="keyword" class="input-with-select" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
                   <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
               </el-input>
             </div>
@@ -390,7 +390,19 @@
         <el-col :span="6" >
             <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-left:15px;" >
             <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
-                <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion></el-tree>
+                <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion>
+                  <!-- 添加试试看 -->
+                  <span class="custom-tree-node" slot-scope="{ node, data }">
+                      <!-- <span>{{ node.label }}</span> -->
+                      <span v-if="user.userNameNeedTranslate == '1'">
+                        <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
+                      </span>
+                      <span v-else>
+                        {{ node.label }}
+                        <span v-if="false">{{data}}</span>
+                      </span>
+                  </span>
+                </el-tree>
             </div>
             </el-scrollbar>
         </el-col>
@@ -458,12 +470,12 @@
             <div style="display: inline-block;width: 18%;margin-left:1%">
               <el-button size="small" @click="changeAltime(0)">{{ $t('volumeset') }}</el-button>
             </div>
-            <div style="display: inline-block;width: 26%">
+            <div style="display: inline-block;width: 26%" v-if="user.userNameNeedTranslate != 1">
               <el-input style="float:left;" v-model="keywordAl" class="input-with-select" :placeholder="$t('pleaseenterhepersonnamesearch')" clearable="true" size="small" @clear="clearsearchAl()">
                   <el-button slot="append" @click="searchAl()" icon="el-icon-search"></el-button>
               </el-input>
             </div>
-            <div style="display: inline-block;width: 32%;margin-left:12%">
+            <div style="display: inline-block;width: 32%;">
               <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">{{ $t('screeningDepartment') }}</span>
               <el-cascader
                 ref="selectAl"

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -484,7 +484,7 @@
                 <el-button type="primary" @click="saveProjectSetting()" >{{ $t('btn.determine') }}</el-button>
             </div>
         </el-dialog>
-        <el-dialog title="$t('allocationdata')" v-if="intoAmortizationDialog" :visible.sync="intoAmortizationDialog" customClass="customWidth" width="500px">
+        <el-dialog :title="$t('allocationdata')" v-if="intoAmortizationDialog" :visible.sync="intoAmortizationDialog" customClass="customWidth" width="500px">
             <p>{{'1.' + $t('other.download')}}
             <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+$t('allocationImporttemplates')+'.xlsx'" :download="$t('allocationImporttemplates') + '.xlsx'">{{$t('allocationImporttemplates')+'.xlsx'}}</el-link>
             </p>

+ 21 - 10
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -231,7 +231,7 @@
                                                     </div>
                                                 </draggable>
                                                 <el-button v-if="canAddTask" slot="footer" role="people" @click="addTask(stage)" style="width:300px;" size="small" icon="el-icon-plus"></el-button>
-                                                <el-label v-if="!canAddTask && (stage.taskList.length == 0)" style="width:300px;color:#666;">暂无任务</el-label>
+                                                <el-label v-if="!canAddTask && (stage.taskList.length == 0)" style="width:300px;color:#666;">{{ $t('zan-wu-ren-wu') }}</el-label>
                                             </div>
                                         </v-flex>
                                     <!-- </transition-group > -->
@@ -420,6 +420,8 @@
                         </el-select>
 
                         <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat>
+                        <!-- <selectCat v-if="user.userNameNeedTranslate == '1'" :wxCope="true" :size="'size'" :subjectId="executorItem.executorId" :distinction="'1'" :subject="users"  @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat> -->
+
 
 
                         <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }}</span>
@@ -930,20 +932,20 @@
                 </el-tab-pane>
                 </el-tabs>
             </div>
-            <el-dialog title="编辑模板" append-to-body v-if="setTemplateDialog" :visible.sync="setTemplateDialog" width="500px">
+            <el-dialog :title="$t('bian-ji-mo-ban')" append-to-body v-if="setTemplateDialog" :visible.sync="setTemplateDialog" width="500px">
                 <el-form label-width="20%">
-                    <el-form-item label="模板名称"><el-input v-model="setTemplateData.name" style="width:80%" clearable></el-input></el-form-item>
-                    <el-form-item label=""><el-checkbox v-model="setTemplateData.creWithPro">随项目自动创建</el-checkbox></el-form-item>
+                    <el-form-item :label="$t('mo-ban-ming-cheng')"><el-input v-model="setTemplateData.name" style="width:80%" clearable></el-input></el-form-item>
+                    <el-form-item label=""><el-checkbox v-model="setTemplateData.creWithPro">{{ $t('suixiangmuzidongchuangjian') }}</el-checkbox></el-form-item>
                     <el-form-item v-for="item,index in setTemplateData.stagesList" :key="item.id" :label="index == 0 ? '任务列表' : ''">
                         <el-input v-model="item.stagesName"  style="width:70%" clearable></el-input>
                         <el-link :underline="false" type="primary" style="color:#aaa;" @click="deleteStages(item,index)"  v-if="index != 0">
                             <i class="el-icon-delete"></i>
                         </el-link>
                     </el-form-item>
-                    <el-link style="margin-left:20%" :underline="false" type="primary" @click="addStages()">新增任务列表</el-link>
+                    <el-link style="margin-left:20%" :underline="false" type="primary" @click="addStages()">{{ $t('xin-zeng-ren-wu-lie-biao') }}</el-link>
                 </el-form>
                 <div slot="footer" class="dialog-footer">
-                    <el-button type="primary" @click="setTemplateDialog = false">取消</el-button>
+                    <el-button type="primary" @click="setTemplateDialog = false">{{ $t('btn.cancel') }}</el-button>
                     <el-button type="primary" @click="setTemplateSave()">{{ $t('save') }}</el-button>
                 </div>
             </el-dialog>
@@ -1769,7 +1771,7 @@
             setTemplateSave(){
                 if(this.setTemplateData.name == '' || this.setTemplateData.name == null){
                     this.$message({
-                        message: '模板名称不能为空',
+                        message: this.$t('mo-ban-ming-cheng-bu-neng-wei-kong'),
                         type: 'error'
                     })
                     return
@@ -1777,7 +1779,7 @@
                 for(let i in this.setTemplateData.stagesList){
                     if(this.setTemplateData.stagesList[i].stagesName == '' || this.setTemplateData.stagesList[i].stagesName == null){
                         this.$message({
-                            message: '任务列表名称不能为空',
+                            message: this.$t('ren-wu-lie-biao-ming-cheng-bu-neng-wei-kong'),
                             type: 'error'
                         })
                         return
@@ -1787,7 +1789,7 @@
                 res => {
                     if(res.code == 'ok'){
                         this.$message({
-                            message: '修改成功',
+                            message: this.$t('message.modifyTheSuccess'),
                             type: 'success'
                         })
                         this.getGroupTemplate()
@@ -3193,7 +3195,16 @@
                         });
                     }
                 }
-
+                if(this.addForm.startDate && this.addForm.endDate) {
+                    if(this.addForm.endDate < this.addForm.startDate) {
+                        return this.$message({
+                            showClose: true,
+                            message: this.$t('ren-wu-jie-zhi-shi-jian-bu-neng-xiao-yu-kai-shi-shi-jian'),
+                            type: 'error'
+                        });
+                    }
+                }
+                
                 this.$refs.form1.validate(valid => {
                     if (valid) {
                         delete this.addForm.subTaskList;

+ 6 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -99,7 +99,7 @@
                     <el-form-item style="float:right;" v-if="permissions.structureExport">
                         <el-link type="primary" :underline="false" @click="showExportDialog">{{ $t('exportpersonnel') }}</el-link>
                     </el-form-item>
-                    <el-form-item style="float:right;" v-if="user.dingdingUserid == null && permissions.structureAdd && user.userNameNeedTranslate != '1'">
+                    <el-form-item style="float:right;" v-if="user.timeType.syncDingding == 0 && permissions.structureAdd && user.userNameNeedTranslate != '1'">
                         <el-link type="primary" :underline="false" @click="openInsertDialog(null)">{{ $t('addpersonnel') }}</el-link>
                     </el-form-item>
                     <!--导入薪资-->
@@ -107,7 +107,7 @@
                         <el-link type="primary" :underline="false" @click="importUserSalary(null)">{{ $t('importSalary') }}</el-link>
                     </el-form-item>
                     
-                    <el-form-item style="float:right;" v-if="user.dingdingUserid == null && permissions.structureImport && user.userNameNeedTranslate != '1'">
+                    <el-form-item style="float:right;" v-if="user.timeType.syncDingding == 0 && permissions.structureImport && user.userNameNeedTranslate != '1'">
                         <el-link type="primary" :underline="false" @click="importUserC">{{ $t('bulkimport') }}</el-link>
                     </el-form-item>
                     <el-form-item style="float:right;" v-if="user.corpwxUserid != null && permissions.structureImport && user.companyId==469">
@@ -530,10 +530,11 @@
         <el-dialog :title="$t('permissiontotransfer')" :visible.sync="transferDialog" width="550px" >
             <el-form  label-width="200px">
                 <el-form-item :label="$t('administratorroleto')" >
-                    <el-select v-model="toUserId" style="width:300px" filterable clearable>
+                    <el-select v-model="toUserId" style="width:300px" filterable clearable v-if="user.userNameNeedTranslate != '1'">
                         <el-option v-for="item in allActiveUsers" :key="item.id" :value="item.id" :label="item.name">
                         </el-option>
                     </el-select>
+                    <selectCat :size="'medium'" :widthStr="'300'" v-if="user.userNameNeedTranslate == '1'" :subject="allActiveUsers" :subjectId="toUserId" :distinction="'12'" @selectCal="selectCal"></selectCat>
                 </el-form-item>
                 <el-form-item :label="$t('transferoftheirrole')" >
                     <el-select v-model="myRoleId" style="width:300px">
@@ -3318,6 +3319,8 @@ export default {
         this.depForm.managerId = obj.id
       } else if(obj.distinction == '5'){
         this.depForm.reportAuditUserid = obj.id
+      } else if(obj.distinction == '12'){
+        this.toUserId = obj.id
       }
     }
   },

+ 26 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -848,7 +848,7 @@
         </el-dialog>
 
         <!-- 按周填报弹窗 -->
-        <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="30%" :before-close="handleClose">
+        <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
             <div>
                 <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
                     <p>{{$t('lable.subproject')}}</p>
@@ -879,36 +879,42 @@
                 </div>
                 <div class="zhoFel" v-if="user.timeType.reportAuditType != 3">
                     <p>{{$t('other.reviewer')}}</p>
-                    <el-select v-model="zhoBao.projectAuditorId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
+                    <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
                         <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
                     </el-select>
+
+                    <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
                 </div>
 
                 <template v-if="user.timeType.reportAuditType == 3">
                     <div class="zhoFel">
                         <p>{{ $t('di-yi-shen-he-ren') }}</p>
-                        <el-select v-model="zhoBao.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
+                        <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
                             <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                         </el-select>
+                        <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
                     </div>
                     <div class="zhoFel">
                         <p>{{ $t('di-er-shen-he-ren') }}</p>
-                        <el-select v-model="zhoBao.auditorSec" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
+                        <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
                             <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                         </el-select>
+                        <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
                     </div>
                     <div class="zhoFel">
                         <p>{{ $t('di-san-shen-he-ren') }}</p>
-                        <el-select v-model="zhoBao.auditorThird" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
+                        <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
                             <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                         </el-select>
+                        <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
                     </div>
 
                     <div class="zhoFel">
                         <p>{{ $t('chao-song-ren') }}</p>
-                        <el-select v-model="zhoBao.ccUserid" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
+                        <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
                             <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                         </el-select>
+                        <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
                     </div>
                 </template>
 
@@ -6296,6 +6302,20 @@
             },
             ]);
         },
+        // 自定义事件
+        selectCal(obj) {
+            if(obj.distinction == '1') {
+                this.zhoBao.projectAuditorId = obj.id
+            } else if(obj.distinction == '2') {
+                this.zhoBao.auditorFirst = obj.id
+            } else if(obj.distinction == '3') {
+                this.zhoBao.auditorSec = obj.id
+            } else if(obj.distinction == '4') {
+                this.zhoBao.auditorThird = obj.id
+            } else if(obj.distinction == '5') {
+                this.zhoBao.ccUserid = obj.id
+            }
+        }
     };
 </script>
 

+ 18 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -64,10 +64,13 @@
             </el-form>
         </el-col>
         <!--列表-->
-        <el-table :data="list" ref="multipleTable" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;"
-            @selection-change="handleSelectionChange">
+        <el-table :data="list" ref="multipleTable" v-if="showTable" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;"
+            @selection-change="handleSelectionChange" :default-expand-all="defaultExpandAllFlg">
             <el-table-column type="selection" width="55"></el-table-column>
-            <el-table-column type="expand">
+            <el-table-column type="expand" :label="''">
+                <template slot="header">
+                    <i :class="defaultExpandAllFlg ? 'el-icon-arrow-down' : 'el-icon-arrow-right'" style="cursor: pointer;" @click="defaultExpandAllFlgCli()"></i>
+                </template>
                 <template slot-scope="props">
                     <el-timeline>
                         <el-timeline-item v-for="(item,index) in props.row.data" :key="index">
@@ -468,7 +471,9 @@
 
                 approveinData: null,
                 approveinDialog: false,
-                isbatch: false
+                isbatch: false,
+                defaultExpandAllFlg: false,
+                showTable: true
             };
         },
         filters: {
@@ -949,6 +954,15 @@
                 this.search.userIdArray = arr
                 console.log(this.search.userIdArray, '数据看看')
                 this.usersSearch(false)
+            },
+            defaultExpandAllFlgCli() {
+                this.defaultExpandAllFlg = !this.defaultExpandAllFlg
+                this.list = JSON.parse(JSON.stringify(this.list))
+                this.$nextTick(()=>{this.$refs.multipleTable.doLayout()})
+                this.showTable = false
+                this.$nextTick(() => {
+                    this.showTable = true
+                })
             }
         },
         created() {

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

@@ -4,9 +4,9 @@ const path = require('path');
 const themePath = path.resolve(__dirname,'src/assets/style/theme.less');
 const Timestamp = new Date().getTime();
 
-var ip = '47.101.180.183'
+// var ip = '47.101.180.183'
 // var ip = '192.168.2.7'
-// var ip = '127.0.0.1'
+var ip = '127.0.0.1'
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 // for (var i in ifaces) {