|
@@ -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());
|
|
|
}
|