|
@@ -213,6 +213,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
private SubscribeDetailMapper subscribeDetailMapper;
|
|
|
@Autowired
|
|
|
private ContractProductBomMapper contractProductBomMapper;
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// private ProduceOrderService produceOrderService;
|
|
|
|
|
|
/**
|
|
|
* 合同和样品单 下拉分页
|
|
@@ -1379,7 +1382,16 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
);
|
|
|
|
|
|
//作废生产相关数据 订单、排除、任务、备料
|
|
|
-
|
|
|
+ long count = baseMapper.getProductionOrderCount(IWrapper.getWrapper()
|
|
|
+ .in("po.produce_status", 1, 2)
|
|
|
+ .eq("po.contract_id", contract.getId())
|
|
|
+ );
|
|
|
+ if (count > 0) {
|
|
|
+ throw new ServiceException("该销售订单存在,生产中或生产完成的生产订单信息,禁止作废!");
|
|
|
+ }
|
|
|
+ baseMapper.removeProductionOrderByContractId(contract.getId());
|
|
|
+ baseMapper.removeProductionOrderDetailByContractId(contract.getId());
|
|
|
+ baseMapper.removeMaterialPreparationoByContractId(contract.getId());
|
|
|
}
|
|
|
|
|
|
@Override
|