| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 生产计划Service实现 |
| | |
| | | initPlanStatisticInfo(t); |
| | | PlansExtListH5VO plan = new PlansExtListH5VO(); |
| | | BeanUtils.copyProperties(t,plan); |
| | | // plan.setDoneNum(); |
| | | plan.setWorkorderList(workorderExtService.findByPlanId(plan,true)); |
| | | return plan; |
| | | } |
| | |
| | | Integer produceNum = workorderList.stream().map(s -> s.getPlanNum()).reduce(Constants.ZERO, Integer::sum); |
| | | Integer surplusNum = plans.getNum() - produceNum; |
| | | if(num.compareTo(BigDecimal.valueOf(surplusNum))>0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误:超出工单剩余可分配数量"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"超出当前工序计划可报工数量"); |
| | | } |
| | | Workorder param = new Workorder(); |
| | | param.setPlanId(autoWorkReportDTO.getPlansId()); |