|
@@ -81,7 +81,6 @@ public class AfterSalesFlow extends FlowDelegate {
|
|
public void end(Long flowId, Long businessId, JSONObject submitData) {
|
|
public void end(Long flowId, Long businessId, JSONObject submitData) {
|
|
AfterSales afterSales = afterSalesService.getById(businessId);
|
|
AfterSales afterSales = afterSalesService.getById(businessId);
|
|
afterSales.setStatus(FlowStatusEnum1.PASS.getKey());
|
|
afterSales.setStatus(FlowStatusEnum1.PASS.getKey());
|
|
- afterSalesService.updateById(afterSales);
|
|
|
|
|
|
|
|
|
|
|
|
Long contractProductId = afterSales.getContractProductId();
|
|
Long contractProductId = afterSales.getContractProductId();
|
|
@@ -116,22 +115,28 @@ public class AfterSalesFlow extends FlowDelegate {
|
|
accountPayment.setCompanyId(afterSales.getCompanyId());
|
|
accountPayment.setCompanyId(afterSales.getCompanyId());
|
|
|
|
|
|
accountPaymentService.save(accountPayment);
|
|
accountPaymentService.save(accountPayment);
|
|
|
|
+
|
|
|
|
+ afterSales.setPaymentId(accountPayment.getId());
|
|
}
|
|
}
|
|
//如果售后类型=补发10/换货20。审批通过后,生成一条销售订单,与原销售订单信息基本一致:商品清单只有这一条,数量=售后数量,价格=0。默认审批通过
|
|
//如果售后类型=补发10/换货20。审批通过后,生成一条销售订单,与原销售订单信息基本一致:商品清单只有这一条,数量=售后数量,价格=0。默认审批通过
|
|
if (ObjectUtil.equals(afterSales.getType(), "10") || ObjectUtil.equals(afterSales.getType(), "20")) {
|
|
if (ObjectUtil.equals(afterSales.getType(), "10") || ObjectUtil.equals(afterSales.getType(), "20")) {
|
|
- Contract contract = contractService.getById(contractProduct.getContractId());
|
|
|
|
- Assert.notEmpty(contract, "查询不到合同信息!");
|
|
|
|
- contract.setId(null);
|
|
|
|
- contract.setAmount(BigDecimal.ZERO);
|
|
|
|
- contract.setCode(codingRuleService.createCode(CodingRuleEnum.CONTRACT.getKey(), contract.getBuyCorporationId()));
|
|
|
|
- contractService.save(contract);
|
|
|
|
|
|
+ Contract contract1 = contractService.getById(contractProduct.getContractId());
|
|
|
|
+ Assert.notEmpty(contract1, "查询不到合同信息!");
|
|
|
|
+ contract1.setId(null);
|
|
|
|
+ contract1.setAmount(BigDecimal.ZERO);
|
|
|
|
+ contract1.setCode(codingRuleService.createCode(CodingRuleEnum.CONTRACT.getKey(), contract1.getBuyCorporationId()));
|
|
|
|
+ contractService.save(contract1);
|
|
|
|
+
|
|
|
|
+ afterSales.setNewContractId(contract1.getId());
|
|
|
|
|
|
ContractProduct contractProduct1 = contractProductService.getById(contractProductId);
|
|
ContractProduct contractProduct1 = contractProductService.getById(contractProductId);
|
|
contractProduct1.setId(null);
|
|
contractProduct1.setId(null);
|
|
- contractProduct1.setContractId(contract.getId());
|
|
|
|
|
|
+ contractProduct1.setContractId(contract1.getId());
|
|
contractProduct1.setPrice(BigDecimal.ZERO);
|
|
contractProduct1.setPrice(BigDecimal.ZERO);
|
|
contractProduct1.setQuantity(afterSales.getQuantity());
|
|
contractProduct1.setQuantity(afterSales.getQuantity());
|
|
contractProductService.save(contractProduct1);
|
|
contractProductService.save(contractProduct1);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ afterSalesService.updateById(afterSales);
|
|
}
|
|
}
|
|
}
|
|
}
|