|
@@ -71,6 +71,7 @@ import com.fjhx.sale.entity.purchase.po.EhsdPurchase;
|
|
|
import com.fjhx.sale.entity.purchase.po.EhsdPurchaseProduct;
|
|
|
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseProductVo;
|
|
|
import com.fjhx.sale.entity.sale.vo.SaleQuotationVo;
|
|
|
+import com.fjhx.sale.flow.ContractFlow;
|
|
|
import com.fjhx.sale.mapper.contract.ContractMapper;
|
|
|
import com.fjhx.sale.mapper.contract.ContractProductBomMapper;
|
|
|
import com.fjhx.sale.service.claim.ClaimContractService;
|
|
@@ -212,9 +213,11 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
private SubscribeDetailMapper subscribeDetailMapper;
|
|
|
@Autowired
|
|
|
private ContractProductBomMapper contractProductBomMapper;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ContractFlow contractFlow;
|
|
|
|
|
|
|
|
|
* 合同和样品单 下拉分页
|
|
@@ -1277,15 +1280,49 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
public void cancellation(ContractDto contractDto) {
|
|
|
+ Long id = contractDto.getId();
|
|
|
+ Contract contract = getById(id);
|
|
|
+ Assert.notEmpty(contract, "查询不到合同信息");
|
|
|
+
|
|
|
+
|
|
|
+ flowExampleService.update(q -> q
|
|
|
+ .eq(FlowExample::getId, contract.getFlowId())
|
|
|
+ .in(FlowExample::getStatus, 0, 1)
|
|
|
+ .set(FlowExample::getStatus, FlowStatusEnum.CANCELLATION.getKey())
|
|
|
+ .set(BasePo::getUpdateTime, new Date())
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
+ if (Objects.equals(FlowStatusEnum1.UNDER_REVIEW.getKey(), contract.getStatus())) {
|
|
|
+ contractService.update(q -> q
|
|
|
+ .eq(Contract::getId, id)
|
|
|
+ .set(Contract::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
|
|
|
+ .set(BasePo::getUpdateTime, new Date())
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
+ Long oldContractId = contract.getOldContractId();
|
|
|
+ if (ObjectUtil.isNotEmpty(oldContractId)) {
|
|
|
+ contractService.update(q -> q
|
|
|
+ .eq(Contract::getId, contract.getOldContractId())
|
|
|
+ .set(Contract::getStatus, FlowStatusEnum1.PASS.getKey())
|
|
|
+ .set(Contract::getUpdateTime, new Date())
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
contractService.update(q -> q
|
|
|
- .eq(Contract::getId, contractDto.getId())
|
|
|
+ .eq(Contract::getId, id)
|
|
|
.set(Contract::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
|
|
|
.set(BasePo::getUpdateTime, new Date())
|
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
);
|
|
|
|
|
|
- Contract contract = getById(contractDto.getId());
|
|
|
- Assert.notEmpty(contract, "查询不到合同信息");
|
|
|
|
|
|
contractCancelEditAvailableQuantity(contract);
|
|
|
}
|