|
@@ -261,6 +261,12 @@ public class ProduceOrderServiceImpl extends ServiceImpl<ProduceOrderMapper, Pro
|
|
|
Long contractId = produceOrderDto.getContractId();
|
|
|
Assert.notEmpty(produceOrderDto.getContractId(), "合同id不能为空!");
|
|
|
|
|
|
+ //赋值原订单信息
|
|
|
+ ProductionOrder one = this.getOne(q -> q.eq(ProductionOrder::getContractId, contractId));
|
|
|
+ if (ObjectUtil.isNotEmpty(one)) {
|
|
|
+ produceOrderDto.setId(one.getId());
|
|
|
+ }
|
|
|
+
|
|
|
//将数据移到归属公司下
|
|
|
SysDept produceCompany = sysDeptService.getById(produceOrderDto.getProduceCompanyId());
|
|
|
Assert.notEmpty(produceCompany, "查询不到生产公司信息");
|
|
@@ -282,7 +288,7 @@ public class ProduceOrderServiceImpl extends ServiceImpl<ProduceOrderMapper, Pro
|
|
|
|
|
|
produceOrderDto.setCode(contract.getCode());
|
|
|
produceOrderDto.setProduceStatus(0);
|
|
|
- this.save(produceOrderDto);
|
|
|
+ this.saveOrUpdate(produceOrderDto);
|
|
|
|
|
|
|
|
|
//消息推送:给归属公司的 子公司总经理
|
|
@@ -610,7 +616,7 @@ public class ProduceOrderServiceImpl extends ServiceImpl<ProduceOrderMapper, Pro
|
|
|
//如果是第一道工序,结存数量直接等于任务数量
|
|
|
prodTaskProgress.setBalanceQuantity(BigDecimal.ZERO);
|
|
|
if (ObjectUtil.equals(productionProcessesVo.getSourceProcessesId(), 1L)) {
|
|
|
- BigDecimal balanceQuantity = prodTaskProgress.getFinishQuantity().subtract(productionOrderDetail.getQuantity());
|
|
|
+ BigDecimal balanceQuantity = productionOrderDetail.getQuantity().subtract(prodTaskProgress.getFinishQuantity());
|
|
|
if (balanceQuantity.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
balanceQuantity = BigDecimal.ZERO;
|
|
|
}
|