| | |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | */ |
| | | @Api(tags = "排产工单") |
| | | @RestController |
| | | @RequestMapping("/mesproductionworkorder/mesProductionWorkOrder") |
| | | @RequestMapping("/mes/mesProductionWorkOrder") |
| | | @Slf4j |
| | | public class MesProductionWorkOrderController extends JeecgController<MesProductionWorkOrder, IMesProductionWorkOrderService> { |
| | | @Autowired |
| | |
| | | mesProductionWorkOrderList.forEach(item -> { |
| | | if (Objects.isNull(item.getId())) { |
| | | item.setWorkOrderStatus(ProductionWorkOrderStatus.NEW.name()); |
| | | item.setCompletenessCheckFlag(CommonConstant.DEFAULT_0); |
| | | item.setEquipmentInspectionFlag(CommonConstant.DEFAULT_0); |
| | | item.setProcessInspectionFlag(CommonConstant.DEFAULT_0); |
| | | item.setActualQuantity(BigDecimal.ZERO); |
| | | item.setFinishedPallets(0); |
| | | } |
| | | }); |
| | | mesProductionWorkOrderService.saveOrUpdateBatch(mesProductionWorkOrderList); |
| | |
| | | @GetMapping(value = "/execute") |
| | | public Result<?> execute(@RequestParam("id") String id) { |
| | | MesProductionWorkOrder workOrder = mesProductionWorkOrderService.getById(id); |
| | | if (!ProductionWorkOrderStatus.PUBLISHED.name().equals(workOrder.getWorkOrderStatus())) { |
| | | if (!ProductionWorkOrderStatus.PUBLISHED.name().equals(workOrder.getWorkOrderStatus()) |
| | | && !CommonConstant.DEFAULT_1.equals(workOrder.getCompletenessCheckFlag()) |
| | | && !CommonConstant.DEFAULT_1.equals(workOrder.getEquipmentInspectionFlag()) |
| | | && !CommonConstant.DEFAULT_1.equals(workOrder.getProcessInspectionFlag())) { |
| | | return Result.error("当前工单状态不能执行!"); |
| | | } |
| | | //todo 齐套性检查、工艺点检、设备点检 的校验逻辑 |
| | | MesProductionWorkOrder executeOrder = new MesProductionWorkOrder() |
| | | .setId(id) |
| | | .setWorkOrderStatus(ProductionWorkOrderStatus.EXECUTING.name()); |