Browse Source

休息时间段

cs 2 years ago
parent
commit
f09ef4a361

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

@@ -15,6 +15,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -48,7 +49,9 @@ public class TimeAutoExcludeController {
             return new HttpRespMsg();
         }
         //新增
-        //先删除掉已设置过的部门
+        //先去重
+        item.setDepartmentId(item.getDepartmentId().stream().distinct().collect(Collectors.toList()));
+        //删除掉已设置过的部门
         timeAutoExcludeService.remove(new QueryWrapper<TimeAutoExclude>().in("d_id",item.getDepartmentId()));
         List<Department> deptList = departmentMapper.selectList(new QueryWrapper<Department>().in("department_id", item.getDepartmentId()));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
@@ -62,7 +65,7 @@ public class TimeAutoExcludeController {
             for (Department deptItem : deptList) {
                 if (deptItem.getDepartmentId().equals(deptId)){
                     if (wxCorpInfo != null && wxCorpInfo.getSaasSyncContact().equals(1)){
-                        timeAutoExclude.setDName(deptItem.getCorpwxDeptid().toString());
+                        timeAutoExclude.setDName(deptItem.getCorpwxDeptid()==null?"":deptItem.getCorpwxDeptid().toString());
                     }else {
                         timeAutoExclude.setDName(deptItem.getDepartmentName());
                     }

+ 3 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/UserDailyWorkItem.java

@@ -1,5 +1,8 @@
 package com.management.platform.entity.vo;
 
+import lombok.Data;
+
+@Data
 public class UserDailyWorkItem {
     public String userId;
     public String createDate;