|
@@ -272,33 +272,33 @@ public class ProduceOrderServiceImpl extends ServiceImpl<ProduceOrderMapper, Pro
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 投产
|
|
|
- */
|
|
|
- @Override
|
|
|
- @DSTransactional
|
|
|
- public synchronized void putProduction(ProduceOrderSelectDto dto) {
|
|
|
- Long orderId = dto.getId();
|
|
|
- Date produceTime = dto.getProduceTime();
|
|
|
-
|
|
|
- Assert.notEmpty(orderId, "投产id不能为空!");
|
|
|
- Assert.notEmpty(produceTime, "投产时间不能为空!");
|
|
|
-
|
|
|
- ProductionOrder productionOrder = this.getById(orderId);
|
|
|
- Assert.notEmpty(productionOrder, "查询不到订单信息!");
|
|
|
-
|
|
|
- if (ObjectUtil.isNotEmpty(productionOrder.getProduceTime())) {
|
|
|
- throw new ServiceException("该订单已投产,请勿重复投产!!");
|
|
|
- }
|
|
|
-
|
|
|
- //生成待备料
|
|
|
- createMaterialPreparation(productionOrder);
|
|
|
-
|
|
|
- productionOrder.setProduceStatus(1);
|
|
|
- productionOrder.setProduceTime(produceTime);
|
|
|
-
|
|
|
- this.updateById(productionOrder);
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 投产
|
|
|
+// */
|
|
|
+// @Override
|
|
|
+// @DSTransactional
|
|
|
+// public synchronized void putProduction(ProduceOrderSelectDto dto) {
|
|
|
+// Long orderId = dto.getId();
|
|
|
+// Date produceTime = dto.getProduceTime();
|
|
|
+//
|
|
|
+// Assert.notEmpty(orderId, "投产id不能为空!");
|
|
|
+// Assert.notEmpty(produceTime, "投产时间不能为空!");
|
|
|
+//
|
|
|
+// ProductionOrder productionOrder = this.getById(orderId);
|
|
|
+// Assert.notEmpty(productionOrder, "查询不到订单信息!");
|
|
|
+//
|
|
|
+// if (ObjectUtil.isNotEmpty(productionOrder.getProduceTime())) {
|
|
|
+// throw new ServiceException("该订单已投产,请勿重复投产!!");
|
|
|
+// }
|
|
|
+//
|
|
|
+// //生成待备料
|
|
|
+// createMaterialPreparation(productionOrder);
|
|
|
+//
|
|
|
+// productionOrder.setProduceStatus(1);
|
|
|
+// productionOrder.setProduceTime(produceTime);
|
|
|
+//
|
|
|
+// this.updateById(productionOrder);
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 修改投产时间
|
|
@@ -478,7 +478,7 @@ public class ProduceOrderServiceImpl extends ServiceImpl<ProduceOrderMapper, Pro
|
|
|
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
- public void deliveryConfirm(ProductionOrderDto dto) {
|
|
|
+ public synchronized void deliveryConfirm(ProductionOrderDto dto) {
|
|
|
this.updateById(dto);
|
|
|
Long id = dto.getId();
|
|
|
ProductionOrder productionOrder = this.getById(id);
|
|
@@ -507,6 +507,19 @@ public class ProduceOrderServiceImpl extends ServiceImpl<ProduceOrderMapper, Pro
|
|
|
|
|
|
//创建生产任务
|
|
|
createOrderDetails(productionOrder);
|
|
|
+
|
|
|
+ //投产
|
|
|
+ if (ObjectUtil.isNotEmpty(productionOrder.getProduceTime())) {
|
|
|
+ throw new ServiceException("该订单已投产,请勿重复投产!!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //生成待备料
|
|
|
+ createMaterialPreparation(productionOrder);
|
|
|
+
|
|
|
+ productionOrder.setProduceStatus(1);
|
|
|
+ productionOrder.setProduceTime(new Date());//投产时间直接当前值
|
|
|
+
|
|
|
+ this.updateById(productionOrder);
|
|
|
}
|
|
|
}
|
|
|
|