|
@@ -16,6 +16,7 @@ import cn.iocoder.yudao.module.contract.enums.OrderStatusEnum;
|
|
|
import cn.iocoder.yudao.module.contract.service.basicData.BasicSupplierService;
|
|
|
import cn.iocoder.yudao.module.contract.service.client.ClientService;
|
|
|
import cn.iocoder.yudao.module.contract.service.contractTemplate.ContractTemplateService;
|
|
|
+import cn.iocoder.yudao.module.contract.service.exportContract.ExportContractService;
|
|
|
import cn.iocoder.yudao.module.contract.service.order.OrderService;
|
|
|
import cn.iocoder.yudao.module.contract.service.orderContract.OrderContractService;
|
|
|
import cn.iocoder.yudao.module.contract.webservice.holders.TABLE_OF_ZJS004HHolder;
|
|
@@ -25,6 +26,8 @@ import cn.iocoder.yudao.module.contract.webservice.holders.TABLE_OF_ZSD_JS_009Ho
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -64,6 +67,8 @@ public class ContractWebService {
|
|
|
private OrderContractService orderContractService;
|
|
|
@Resource
|
|
|
private BasicSupplierService basicSupplierService;
|
|
|
+ @Resource
|
|
|
+ private ExportContractService exportContractService;
|
|
|
|
|
|
|
|
|
public String getOrderList(String vbeln) {
|
|
@@ -101,7 +106,12 @@ public class ContractWebService {
|
|
|
if(!"Y4".equals(orderDO.getHtdymb())){
|
|
|
//非出口合同-作废时更新
|
|
|
if (!"3".equals(order.getZzxshtzt())) {
|
|
|
- log.info("销售凭证:{}已存在并非作废状态,不操作", orderDO.getVbeln());
|
|
|
+ log.info("销售凭证:{}已存在并非作废状态,重新通知{}", orderDO.getVbeln(),order.getZzxshtzt());
|
|
|
+ OrderContractDO orderContract = orderContractService.getOne(new LambdaQueryWrapper<OrderContractDO>().eq(OrderContractDO::getOrderId,orderDO.getId()),false);
|
|
|
+ if(orderContract == null){
|
|
|
+ orderContract = new OrderContractDO();
|
|
|
+ }
|
|
|
+ pushOrderStatus(orderDO.getVbeln(),order.getZzxshtzt(),orderContract);
|
|
|
continue;
|
|
|
} else {
|
|
|
update = update + 1;
|
|
@@ -110,7 +120,14 @@ public class ContractWebService {
|
|
|
}else{
|
|
|
//出口合同-未生成合同时可更新
|
|
|
if ("1".equals(order.getStatus())) {
|
|
|
- log.info("出口合同-销售凭证:{}已生成合同,不操作", orderDO.getVbeln());
|
|
|
+ log.info("出口合同-销售凭证:{}已生成合同,重新通知{}", orderDO.getVbeln(),order.getZzxshtzt());
|
|
|
+ ExportContractDO exportContractDO = exportContractService.getOne(new QueryWrapper<ExportContractDO>().like("CONCAT(',',vbelns,',')",","+orderDO.getVbeln()+",").ne("status","3"),false);
|
|
|
+ if(exportContractDO == null){
|
|
|
+ //未生成合同时通知已接收数据
|
|
|
+ exportContractDO = new ExportContractDO();
|
|
|
+ exportContractDO.setStatus("1");
|
|
|
+ }
|
|
|
+ pushOrderStatus(orderDO.getVbeln(),exportContractDO);
|
|
|
continue;
|
|
|
} else {
|
|
|
update = update + 1;
|
|
@@ -133,6 +150,14 @@ public class ContractWebService {
|
|
|
//异步创建合同
|
|
|
orderContractService.createOrderContract(orderDO);
|
|
|
add = add+1;
|
|
|
+ }else{
|
|
|
+ ExportContractDO exportContractDO = exportContractService.getOne(new QueryWrapper<ExportContractDO>().like("CONCAT(',',vbelns,',')",","+orderDO.getVbeln()+",").ne("status","3"),false);
|
|
|
+ if(exportContractDO == null){
|
|
|
+ //未生成合同时通知已接收数据
|
|
|
+ exportContractDO = new ExportContractDO();
|
|
|
+ exportContractDO.setStatus("1");
|
|
|
+ pushOrderStatus(orderDO.getVbeln(),exportContractDO);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
log.info("订单同步WebService结束");
|