|
@@ -21,6 +21,7 @@ import com.fs.erp.dto.ErpOrderQueryRequert;
|
|
import com.fs.erp.dto.ErpOrderQueryResponse;
|
|
import com.fs.erp.dto.ErpOrderQueryResponse;
|
|
import com.fs.erp.service.IErpOrderService;
|
|
import com.fs.erp.service.IErpOrderService;
|
|
import com.fs.fastGpt.mapper.FastGptChatSessionMapper;
|
|
import com.fs.fastGpt.mapper.FastGptChatSessionMapper;
|
|
|
|
+import com.fs.his.config.FsSysConfig;
|
|
import com.fs.his.config.StoreConfig;
|
|
import com.fs.his.config.StoreConfig;
|
|
import com.fs.his.domain.FsInquiryOrder;
|
|
import com.fs.his.domain.FsInquiryOrder;
|
|
import com.fs.his.domain.FsStoreAfterSales;
|
|
import com.fs.his.domain.FsStoreAfterSales;
|
|
@@ -33,6 +34,7 @@ import com.fs.his.mapper.*;
|
|
import com.fs.his.param.FsInquiryOrderFinishParam;
|
|
import com.fs.his.param.FsInquiryOrderFinishParam;
|
|
import com.fs.his.service.*;
|
|
import com.fs.his.service.*;
|
|
import com.fs.his.service.impl.FsPackageOrderServiceImpl;
|
|
import com.fs.his.service.impl.FsPackageOrderServiceImpl;
|
|
|
|
+import com.fs.his.utils.ConfigUtil;
|
|
import com.fs.his.vo.FsSubOrderResultVO;
|
|
import com.fs.his.vo.FsSubOrderResultVO;
|
|
import com.fs.im.dto.*;
|
|
import com.fs.im.dto.*;
|
|
import com.fs.im.service.IImService;
|
|
import com.fs.im.service.IImService;
|
|
@@ -45,6 +47,7 @@ import com.google.gson.Gson;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -72,8 +75,8 @@ public class Task {
|
|
private IFsFollowService fsFollowService;
|
|
private IFsFollowService fsFollowService;
|
|
@Autowired
|
|
@Autowired
|
|
private IFsStoreAfterSalesService fsStoreAfterSalesService;
|
|
private IFsStoreAfterSalesService fsStoreAfterSalesService;
|
|
- @Autowired
|
|
|
|
- IErpOrderService erpOrderService;
|
|
|
|
|
|
+// @Autowired
|
|
|
|
+// IErpOrderService erpOrderService;
|
|
@Autowired
|
|
@Autowired
|
|
FsIntegralOrderMapper integralOrderMapper;
|
|
FsIntegralOrderMapper integralOrderMapper;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -139,6 +142,8 @@ public class Task {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
ITencentCloudCosService tencentCloudCosService;
|
|
ITencentCloudCosService tencentCloudCosService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ConfigUtil configUtil;
|
|
public void videoTranscode() throws Exception
|
|
public void videoTranscode() throws Exception
|
|
{
|
|
{
|
|
|
|
|
|
@@ -232,27 +237,39 @@ public class Task {
|
|
|
|
|
|
public void deliveryOp()
|
|
public void deliveryOp()
|
|
{
|
|
{
|
|
- List<FsStoreOrder> orders = fsStoreOrderMapper.selectOmsOrderdeliveryOp();
|
|
|
|
|
|
+ IErpOrderService erpOrderService = getErpService();
|
|
|
|
+ List<FsStoreOrder> orders = null;
|
|
|
|
+ if (erpOrderService == gyOrderService){
|
|
|
|
+ orders = fsStoreOrderMapper.selectOmsOrderdeliveryOp();
|
|
|
|
+ } else if (erpOrderService == wdtOrderService){
|
|
|
|
+ orders = fsStoreOrderMapper.selectWdtOmsOrderdeliveryOp();
|
|
|
|
+ }
|
|
|
|
+
|
|
for(FsStoreOrder order:orders){
|
|
for(FsStoreOrder order:orders){
|
|
|
|
|
|
ErpOrderQueryRequert request=new ErpOrderQueryRequert();
|
|
ErpOrderQueryRequert request=new ErpOrderQueryRequert();
|
|
|
|
|
|
request.setCode(order.getExtendOrderId());
|
|
request.setCode(order.getExtendOrderId());
|
|
- ErpOrderQueryResponse response=erpOrderService.getOrder(request);
|
|
|
|
- if(response.getOrders()!=null&&response.getOrders().size()>0){
|
|
|
|
- for(ErpOrderQuery orderQuery : response.getOrders()){
|
|
|
|
- if(orderQuery.getDeliverys()!=null&&orderQuery.getDeliverys().size()>0){
|
|
|
|
- for(ErpDeliverys delivery:orderQuery.getDeliverys()){
|
|
|
|
- if(delivery.getDelivery()&& StringUtils.isNotEmpty(delivery.getMail_no())){
|
|
|
|
- //更新商订单状态 删除REDIS
|
|
|
|
- fsStoreOrderService.deliveryOrder(order.getOrderCode(),delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
|
|
|
|
- redisCache.deleteObject("delivery"+":"+order.getExtendOrderId());
|
|
|
|
|
|
+ request.setPlatform_code(order.getOrderCode());
|
|
|
|
+
|
|
|
|
+ if (erpOrderService != null){
|
|
|
|
+ ErpOrderQueryResponse response=erpOrderService.getOrder(request);
|
|
|
|
+ if(response.getOrders()!=null&&response.getOrders().size()>0){
|
|
|
|
+ for(ErpOrderQuery orderQuery : response.getOrders()){
|
|
|
|
+ if(orderQuery.getDeliverys()!=null&&orderQuery.getDeliverys().size()>0){
|
|
|
|
+ for(ErpDeliverys delivery:orderQuery.getDeliverys()){
|
|
|
|
+ if(delivery.getDelivery()&& StringUtils.isNotEmpty(delivery.getMail_no())){
|
|
|
|
+ //更新商订单状态 删除REDIS
|
|
|
|
+ fsStoreOrderService.deliveryOrder(order.getOrderCode(),delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
|
|
|
|
+ redisCache.deleteObject("delivery"+":"+order.getExtendOrderId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -958,4 +975,33 @@ public class Task {
|
|
// }
|
|
// }
|
|
//
|
|
//
|
|
//}
|
|
//}
|
|
|
|
+ @Autowired
|
|
|
|
+ @Qualifier("erpOrderServiceImpl")
|
|
|
|
+ private IErpOrderService gyOrderService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ @Qualifier("wdtErpOrderServiceImpl")
|
|
|
|
+ private IErpOrderService wdtOrderService;
|
|
|
|
+ private IErpOrderService getErpService() {
|
|
|
|
+ FsSysConfig sysConfig = configUtil.getSysConfig();
|
|
|
|
+ Integer erpOpen = sysConfig.getErpOpen();
|
|
|
|
+ if (erpOpen != null && erpOpen == 1){
|
|
|
|
+ //判断erp类型
|
|
|
|
+ Integer erpType = sysConfig.getErpType();
|
|
|
|
+ if (erpType != null){
|
|
|
|
+ IErpOrderService erpOrderService = null;
|
|
|
|
+ if (erpType == 1){
|
|
|
|
+ //管易
|
|
|
|
+ erpOrderService = gyOrderService;
|
|
|
|
+ } else if (erpType == 2){
|
|
|
|
+ //旺店通
|
|
|
|
+ erpOrderService = wdtOrderService;
|
|
|
|
+ }
|
|
|
|
+ return erpOrderService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
}
|
|
}
|