| | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dto.*; |
| | | import com.doumee.dao.business.join.DispatchUnitJoinMapper; |
| | | import com.doumee.dao.business.join.DuLogJoinMapper; |
| | | import com.doumee.dao.business.join.DuSolutionJoinMapper; |
| | | import com.doumee.dao.business.join.DuWorkTypeJoinMapper; |
| | | import com.doumee.dao.business.join.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.DispatchUnitService; |
| | |
| | | |
| | | @Autowired |
| | | private DuSolutionMapper duSolutionMapper; |
| | | |
| | | @Autowired |
| | | private SolutionWorktypeJoinMapper solutionWorktypeJoinMapper; |
| | | |
| | | @Autowired |
| | | private DuWorktypeMapper duWorktypeMapper; |
| | |
| | | } |
| | | if(dispatchUnitMapper.selectCount(new QueryWrapper<DispatchUnit>().lambda() |
| | | .ne(DispatchUnit::getId,saveDispatchUnitDTO.getId()) |
| | | .ne(DispatchUnit::getBaseId,saveDispatchUnitDTO.getId()) |
| | | .eq(DispatchUnit::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .eq(DispatchUnit::getName,saveDispatchUnitDTO.getName()) |
| | | .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | |
| | | dispatchUnit.setEditDate(new Date()); |
| | | dispatchUnit.setEditor(loginUserInfo.getId()); |
| | | dispatchUnitMapper.updateById(dispatchUnit); |
| | | |
| | | dispatchUnitMapper.update(null,new UpdateWrapper<DispatchUnit>().lambda().set(DispatchUnit::getDataType,Constants.ONE).eq(DispatchUnit::getBaseId,dispatchUnit.getId()) |
| | | .eq(DispatchUnit::getDataType,Constants.TWO) |
| | | ); |
| | | |
| | | |
| | | //存储操作记录 |
| | | this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.EDIT_UNIT,null); |
| | |
| | | if(Objects.isNull(saveDuWorkTypeDTO.getWorkTypeId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+saveDuSolutionDTO.getSolutionName()+"】该方案下"+saveDuWorkTypeDTO.getWorkTypeName()+"该工种信息异常"); |
| | | } |
| | | //验证方案与工种的关系 |
| | | if(solutionWorktypeJoinMapper.selectCount(new QueryWrapper<SolutionWorktype>().lambda().eq(SolutionWorktype::getSolutionId,saveDuSolutionDTO.getSolutionId()) |
| | | .eq(SolutionWorktype::getWorktypeId,saveDuWorkTypeDTO.getWorkTypeId()))<=0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+saveDuSolutionDTO.getSolutionName()+"】该方案下"+saveDuWorkTypeDTO.getWorkTypeName()+"该工种信息无绑定关系"); |
| | | }; |
| | | if(duWorktypeMapper.selectCount(new QueryWrapper<DuWorktype>() |
| | | .lambda().eq(DuWorktype::getDuSolutionId,duSolution.getId()) |
| | | .eq(DuWorktype::getIsdeleted,Constants.ZERO) |