diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/schedule/HaokaUpdateOrderSchedule.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/schedule/HaokaUpdateOrderSchedule.java index 391607aeed..80776f3aae 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/schedule/HaokaUpdateOrderSchedule.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/schedule/HaokaUpdateOrderSchedule.java @@ -56,7 +56,7 @@ public class HaokaUpdateOrderSchedule { private ApiLianTongService apiLianTongService; - @Scheduled(cron = "0 */22 * * * ?") + //@Scheduled(cron = "0 */22 * * * ?") public void updateOrder() { log.info("开始-----------更新订单开始--------------------"); tenantFrameworkService.getTenantIds().forEach((tenantId) -> { diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/LianTongApiDealStrategy.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/LianTongApiDealStrategy.java index 5d50f29dd3..57818f39f1 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/LianTongApiDealStrategy.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/LianTongApiDealStrategy.java @@ -13,11 +13,13 @@ import cn.iocoder.yudao.module.haoka.api.liantong.model.response.KingIdentityCus import cn.iocoder.yudao.module.haoka.api.liantong.model.response.KingOrderSyncResponse; import cn.iocoder.yudao.module.haoka.api.liantong.model.response.KingPreOrderSyncResponse; import cn.iocoder.yudao.module.haoka.api.liantong.util.StringUtils; +import cn.iocoder.yudao.module.haoka.controller.admin.address.vo.AddressVo; import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO; import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO; import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO; import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorapi.SuperiorApiDO; import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorproductconfig.SuperiorProductConfigDO; +import cn.iocoder.yudao.module.haoka.service.address.HaoKaAddressService; import cn.iocoder.yudao.module.haoka.service.api.*; import cn.iocoder.yudao.module.haoka.service.api.models.*; import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService; @@ -46,6 +48,9 @@ public class LianTongApiDealStrategy implements ApiDealStrategy { @Resource private SuperiorProductConfigService superiorProductConfigService; + @Resource + private HaoKaAddressService haoKaAddressService; + private LianTongArea getAddress(String code) { return LianTongAreaUtils.getArea(code); } @@ -67,7 +72,20 @@ public class LianTongApiDealStrategy implements ApiDealStrategy { String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); - LianTongArea receiveAddress = getAddress(param.getAddressDistrictCode()); + String addressDistrictCode = param.getAddressDistrictCode(); + LianTongArea receiveAddress = getAddress(addressDistrictCode); + if (receiveAddress==null){ + AddressVo address = haoKaAddressService.getAddress(addressDistrictCode); + String substring = addressDistrictCode.substring(0, 4)+"00"; + receiveAddress = getAddress(substring); + if (address!=null){ + receiveAddress=new LianTongArea(); + receiveAddress.setName(address.getName()); + receiveAddress.setProvinceCode(address.getProvinceCode()); + receiveAddress.setCityCode(address.getCityCode()); + receiveAddress.setDistrictCode(address.getAreaCode()); + } + } LianTongArea numAddress = getAddress(preProduct.getParentProduct().getBelongAreaCode()); diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderoperatelog/OrderOperateLogService.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderoperatelog/OrderOperateLogService.java index 5997136cf7..663855656b 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderoperatelog/OrderOperateLogService.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderoperatelog/OrderOperateLogService.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.haoka.controller.admin.orderoperatelog.vo.*; import cn.iocoder.yudao.module.haoka.dal.dataobject.orderoperatelog.OrderOperateLogDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.scheduling.annotation.Async; /** * 订单操作日志 Service 接口 @@ -20,6 +21,7 @@ public interface OrderOperateLogService { * @param createReqVO 创建信息 * @return 编号 */ + @Async Long createOrderOperateLog(@Valid OrderOperateLogSaveReqVO createReqVO); /** @@ -52,4 +54,4 @@ public interface OrderOperateLogService { */ PageResult getOrderOperateLogPage(OrderOperateLogPageReqVO pageReqVO); -} \ No newline at end of file +} diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderoperatelog/OrderOperateLogServiceImpl.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderoperatelog/OrderOperateLogServiceImpl.java index 255893ef3f..4bb21b5c27 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderoperatelog/OrderOperateLogServiceImpl.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderoperatelog/OrderOperateLogServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.haoka.service.orderoperatelog; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -29,6 +30,7 @@ public class OrderOperateLogServiceImpl implements OrderOperateLogService { @Resource private OrderOperateLogMapper orderOperateLogMapper; + @Async @Override public Long createOrderOperateLog(OrderOperateLogSaveReqVO createReqVO) { // 插入 @@ -73,4 +75,4 @@ public class OrderOperateLogServiceImpl implements OrderOperateLogService { return orderOperateLogMapper.selectPage(pageReqVO); } -} \ No newline at end of file +}