修改 新增工厂时 判断新增的工厂类型为工厂时 再同步新增对应部门

This commit is contained in:
furongxin 2024-06-24 11:28:41 +08:00
parent 23a801ec69
commit fd0cf751ae

View File

@ -59,6 +59,9 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
FactoryInfoDO factoryInfo = BeanUtils.toBean(createReqVO, FactoryInfoDO.class); FactoryInfoDO factoryInfo = BeanUtils.toBean(createReqVO, FactoryInfoDO.class);
factoryInfoMapper.insert(factoryInfo); factoryInfoMapper.insert(factoryInfo);
// 新增的为工厂类型时
if ("3".equals(createReqVO.getType())) {
//同步插入对应 生产部的下级部门 //同步插入对应 生产部的下级部门
DeptRespDTO deptRespDTO = new DeptRespDTO(); DeptRespDTO deptRespDTO = new DeptRespDTO();
deptRespDTO.setFactoryId(factoryInfo.getId()); deptRespDTO.setFactoryId(factoryInfo.getId());
@ -67,6 +70,7 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
deptRespDTO.setLeaderUserId(createReqVO.getLeaderUserId()); deptRespDTO.setLeaderUserId(createReqVO.getLeaderUserId());
deptRespDTO.setStatus(CommonStatusEnum.ENABLE.getStatus()); deptRespDTO.setStatus(CommonStatusEnum.ENABLE.getStatus());
deptApi.createDept(deptRespDTO); deptApi.createDept(deptRespDTO);
}
// 返回 // 返回
return factoryInfo.getId(); return factoryInfo.getId();