|
@@ -40,7 +40,8 @@ import com.sd.business.service.order.OrderSkuService;
|
|
|
import com.sd.business.service.sku.SkuSpecService;
|
|
|
import com.sd.business.service.work.WorkOrderDetailService;
|
|
|
import com.sd.business.service.work.WorkOrderService;
|
|
|
-import com.sd.business.util.CodeEnum;
|
|
|
+import com.sd.business.util.code.CodeEnum;
|
|
|
+import com.sd.business.util.code.CodeFactory;
|
|
|
import com.sd.business.util.fixation.CoordinateBo;
|
|
|
import com.sd.business.util.fixation.FixationFactory;
|
|
|
import com.sd.business.util.fixation.FixationStrategy;
|
|
@@ -202,11 +203,13 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
|
|
|
@Override
|
|
|
public void schedulingRemaining() {
|
|
|
+ CodeFactory codeFactory = CodeFactory.create(CodeEnum.WORK_ORDER_CODE);
|
|
|
+
|
|
|
commonScheduling((bomSpecId, printingPaperBomSpecId, notFixationList, skuSpecMap) -> {
|
|
|
|
|
|
WorkOrder workOrder = new WorkOrder();
|
|
|
workOrder.setId(IdWorker.getId());
|
|
|
- workOrder.setCode(CodeEnum.WORK_ORDER_CODE.getCode());
|
|
|
+ workOrder.setCode(codeFactory.next());
|
|
|
workOrder.setType(2);
|
|
|
workOrder.setMasterBomSpecId(bomSpecId);
|
|
|
workOrder.setPrintingPaperBomSpecId(printingPaperBomSpecId);
|
|
@@ -352,6 +355,8 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
*/
|
|
|
private void scheduling(Long bomSpecId, Long printingPaperBomSpecId, List<OrderSku> list, Map<Long, SkuSpec> skuSpecMap) {
|
|
|
|
|
|
+ CodeFactory codeFactory = CodeFactory.create(CodeEnum.WORK_ORDER_CODE);
|
|
|
+
|
|
|
if (ObjectUtil.isEmpty(list)) {
|
|
|
return;
|
|
|
}
|
|
@@ -374,11 +379,11 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
}
|
|
|
}
|
|
|
// 固定排版
|
|
|
- fixationScheduling(bomSpecId, printingPaperBomSpecId, fixationList, skuSpecMap);
|
|
|
+ fixationScheduling(bomSpecId, printingPaperBomSpecId, codeFactory, fixationList, skuSpecMap);
|
|
|
|
|
|
WorkOrder workOrder = new WorkOrder();
|
|
|
workOrder.setId(IdWorker.getId());
|
|
|
- workOrder.setCode(CodeEnum.WORK_ORDER_CODE.getCode());
|
|
|
+ workOrder.setCode(codeFactory.next());
|
|
|
workOrder.setType(2);
|
|
|
workOrder.setMasterBomSpecId(bomSpecId);
|
|
|
workOrder.setPrintingPaperBomSpecId(printingPaperBomSpecId);
|
|
@@ -390,7 +395,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
/**
|
|
|
* 固定排版
|
|
|
*/
|
|
|
- private void fixationScheduling(Long bomSpecId, Long printingPaperBomSpecId,
|
|
|
+ private void fixationScheduling(Long bomSpecId, Long printingPaperBomSpecId, CodeFactory codeFactory,
|
|
|
List<OrderSku> list, Map<Long, SkuSpec> skuSpecMap) {
|
|
|
|
|
|
if (ObjectUtil.isEmpty(list)) {
|
|
@@ -405,14 +410,14 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
}
|
|
|
));
|
|
|
|
|
|
- map.forEach(((k, v) -> doFixationScheduling(bomSpecId, printingPaperBomSpecId, k, v)));
|
|
|
+ map.forEach(((k, v) -> doFixationScheduling(bomSpecId, printingPaperBomSpecId, codeFactory, k, v)));
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 固定排版
|
|
|
*/
|
|
|
- private void doFixationScheduling(Long bomSpecId, Long printingPaperBomSpecId,
|
|
|
+ private void doFixationScheduling(Long bomSpecId, Long printingPaperBomSpecId, CodeFactory codeFactory,
|
|
|
WorkOrderFixationSpecEnum workOrderFixationSpecEnum, List<OrderSku> list) {
|
|
|
|
|
|
// 本次所需排版数量
|
|
@@ -432,7 +437,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
// 生产工单
|
|
|
WorkOrder workOrder = new WorkOrder();
|
|
|
workOrder.setId(IdWorker.getId());
|
|
|
- workOrder.setCode(CodeEnum.WORK_ORDER_CODE.getCode());
|
|
|
+ workOrder.setCode(codeFactory.next());
|
|
|
workOrder.setType(1);
|
|
|
workOrder.setFixationSpec(workOrderFixationSpecEnum.getLength() + "*" + workOrderFixationSpecEnum.getWidth());
|
|
|
workOrder.setMasterBomSpecId(bomSpecId);
|
|
@@ -489,7 +494,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
});
|
|
|
|
|
|
// 再次执行判断是否还可以排版
|
|
|
- doFixationScheduling(bomSpecId, printingPaperBomSpecId, workOrderFixationSpecEnum, list);
|
|
|
+ doFixationScheduling(bomSpecId, printingPaperBomSpecId, codeFactory, workOrderFixationSpecEnum, list);
|
|
|
}
|
|
|
|
|
|
/**
|