添加部门保存接口-用于人力资源部门保存
parent
b59dc8bc82
commit
4fc90fa653
|
|
@ -100,4 +100,12 @@ public class ZcloudDepartmentFacadeImpl implements ZcloudDepartmentFacade {
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<Long> addHumanUserDept(ZcloudDepartmentAddCmd zcloudDepartmentAddCmd) {
|
||||||
|
DepartmentAddCmd addCmd = new DepartmentAddCmd();
|
||||||
|
BeanUtils.copyProperties(zcloudDepartmentAddCmd, addCmd);
|
||||||
|
Long deptId = departmentService.addHumanUserDept(addCmd);
|
||||||
|
return SingleResponse.of(deptId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import com.zcloud.basic.info.dto.DepartmentAddCmd;
|
||||||
import com.zcloud.basic.info.dto.DepartmentTreeQry;
|
import com.zcloud.basic.info.dto.DepartmentTreeQry;
|
||||||
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
||||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
|
|
@ -73,5 +74,27 @@ public class DepartmentAddExe {
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Long executeHumanUserDept(DepartmentAddCmd cmd) {
|
||||||
|
DepartmentE examTypeE = new DepartmentE();
|
||||||
|
BeanUtils.copyProperties(cmd, examTypeE);
|
||||||
|
cmd.setDepartmentId(Tools.get32UUID());
|
||||||
|
Long id = null;
|
||||||
|
try {
|
||||||
|
id = departmentGateway.add(examTypeE);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (id ==null) {
|
||||||
|
throw new BizException("保存失败");
|
||||||
|
}
|
||||||
|
if(CollUtil.isNotEmpty(cmd.getDepartmentIdsList())&& CommonFlagEnum.YES.getCode().equals(cmd.getSuperviseFlag())){
|
||||||
|
List<DepartmentSuperviseE> departmentSuperviseEList =examTypeE.initAdd(cmd.getDepartmentIdsList(), id);
|
||||||
|
departmentSuperviseGateway.addbatch(departmentSuperviseEList);
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,5 +101,10 @@ public class DepartmentServiceImpl implements DepartmentServiceI {
|
||||||
String name = Tools.getTreeFullName(list,"id", "parentId", "name", deptId);
|
String name = Tools.getTreeFullName(list,"id", "parentId", "name", deptId);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long addHumanUserDept(DepartmentAddCmd cmd) {
|
||||||
|
return departmentAddExe.executeHumanUserDept(cmd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,5 +44,7 @@ public interface DepartmentServiceI {
|
||||||
|
|
||||||
|
|
||||||
Collection<DepartmentTreeInfoCO> listAllTreeByCorpType(DepartmentTreeQry qry);
|
Collection<DepartmentTreeInfoCO> listAllTreeByCorpType(DepartmentTreeQry qry);
|
||||||
|
|
||||||
|
Long addHumanUserDept(DepartmentAddCmd cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue