| | |
| | | import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.process.MesProProcessDO; |
| | | import cn.iocoder.yudao.module.mes.dal.mysql.pro.process.MesProProcessMapper; |
| | | import cn.iocoder.yudao.module.mes.enums.pro.MesProProcessBillingTypeEnum; |
| | | import cn.iocoder.yudao.module.mes.service.pro.route.MesProRouteProcessService; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.context.annotation.Lazy; |
| | |
| | | validateProcessCodeUnique(saveReqVO.getId(), saveReqVO.getCode()); |
| | | // 2. 校验名称唯一 |
| | | validateProcessNameUnique(saveReqVO.getId(), saveReqVO.getName()); |
| | | // 3. 校验计费类型合法(1-计时 2-计件),否则报工无法确定工资算法 |
| | | if (MesProProcessBillingTypeEnum.valueOfType(saveReqVO.getBillingType()) == null) { |
| | | throw exception(PRO_PROCESS_BILLING_TYPE_INVALID, saveReqVO.getName(), saveReqVO.getBillingType()); |
| | | } |
| | | // 4. 校验工资定额非负(允许 0,表示暂未定价,此时报工工资为 0,核算时可按人调整) |
| | | if (saveReqVO.getWageRate() != null && saveReqVO.getWageRate().signum() < 0) { |
| | | throw exception(PRO_PROCESS_WAGE_RATE_INVALID, saveReqVO.getName(), saveReqVO.getWageRate()); |
| | | } |
| | | } |
| | | |
| | | @Override |