|
|
@@ -585,8 +585,15 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
public Object pushCompanyData(pushCompanyDataBo in) {
|
|
|
//导入部门
|
|
|
Long kyId=null;
|
|
|
+ String usci = null;
|
|
|
if (!in.getListDep().isEmpty()){
|
|
|
- kyId = pushAddDep(in.getListDep());
|
|
|
+ //假设只设置2级 1级为公司
|
|
|
+ List<pushDataDep> sp1 = in.getListDep().stream().filter(e -> StringUtils.isNotEmpty(e.getUsci())).collect(Collectors.toList());
|
|
|
+ //先新增公司
|
|
|
+ pushDataDep pushDataDep = sp1.get(0);
|
|
|
+ usci = pushDataDep.getUsci();
|
|
|
+ kyId = pushAddDep(in.getListDep(), pushDataDep);
|
|
|
+
|
|
|
}
|
|
|
//导入用户
|
|
|
if (!in.getListUser().isEmpty()){
|
|
|
@@ -596,6 +603,11 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
if (!in.getListUserProject().isEmpty()){
|
|
|
pushAddUserProject(in.getListUserProject(),kyId);
|
|
|
}
|
|
|
+
|
|
|
+ pushRdDataBo pushRdDataBo = new pushRdDataBo();
|
|
|
+ pushRdDataBo.setRdList(in.getRdList());
|
|
|
+ pushRdDataBo.setUsci(usci);
|
|
|
+ pushRdData(pushRdDataBo);
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -802,11 +814,7 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private Long pushAddDep(List<pushDataDep> listDep) {
|
|
|
- //假设只设置2级 1级为公司
|
|
|
- List<pushDataDep> sp1 = listDep.stream().filter(e -> StringUtils.isNotEmpty(e.getUsci())).collect(Collectors.toList());
|
|
|
- //先新增公司
|
|
|
- pushDataDep pushDataDep = sp1.get(0);
|
|
|
+ private Long pushAddDep(List<pushDataDep> listDep, pushDataDep pushDataDep) {
|
|
|
SysDept sysDept1 = sysDeptMapper.selectByusci(pushDataDep.getUsci());
|
|
|
SysDept sysDept = new SysDept();
|
|
|
sysDept.setUsci(pushDataDep.getUsci());
|
|
|
@@ -814,17 +822,28 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
sysDept.setKyId(pushDataDep.getKyId());
|
|
|
sysDept.setParentId(100l);
|
|
|
sysDept.setAncestors("0,100");
|
|
|
+ if (pushDataDep.getMaxDuration()!=null){
|
|
|
+ sysDept.setMaxDuration(pushDataDep.getMaxDuration());
|
|
|
+ }else {
|
|
|
+ sysDept.setMaxDuration(8d);
|
|
|
+ }
|
|
|
if (sysDept1==null){
|
|
|
sysDeptMapper.insertDept(sysDept);
|
|
|
}else {
|
|
|
sysDept.setDeptId(sysDept1.getDeptId());
|
|
|
sysDeptMapper.updateDept(sysDept);
|
|
|
}
|
|
|
- pushDep(listDep, pushDataDep.getKyId(),sysDept1);
|
|
|
+ pushDep(listDep, pushDataDep.getKyId(),sysDept);
|
|
|
return pushDataDep.getDeptId();
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param listDep 所有需要新增部门
|
|
|
+ * @param kyId 刚新增的部门kyId
|
|
|
+ * @param pushDataDep 公司
|
|
|
+ */
|
|
|
private void pushDep(List<pushDataDep> listDep, String kyId, SysDept pushDataDep) {
|
|
|
List<pushDataDep> sp2 = listDep.stream().filter(e ->
|
|
|
Objects.equals(e.getKySuperId(),kyId)).collect(Collectors.toList());
|