Merge branch 'develop' of gitee.com:peng-ou/haoka-server into develop

This commit is contained in:
Owen 2025-02-23 14:11:56 +08:00
commit 6b194e8c3f
4 changed files with 36 additions and 12 deletions

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.haoka.controller.admin.orderCatch; package cn.iocoder.yudao.module.haoka.controller.admin.orderCatch;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.haoka.controller.admin.orderCatch.po.Message; import cn.iocoder.yudao.module.haoka.controller.admin.orderCatch.po.Message;
import cn.iocoder.yudao.module.haoka.controller.admin.orderCatch.vo.OrderCatchRepVO;
import cn.iocoder.yudao.module.haoka.service.orderCatch.OrderCatchService; import cn.iocoder.yudao.module.haoka.service.orderCatch.OrderCatchService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -41,6 +41,7 @@ public class OrderCatchController {
*/ */
@Async @Async
public void execCatchOrders(List<Message> messages) { public void execCatchOrders(List<Message> messages) {
TenantContextHolder.setTenantId(162L);
orderCatchService.catchOrders(messages); orderCatchService.catchOrders(messages);
} }

View File

@ -202,6 +202,11 @@ public class OrdersSaveReqVO {
private String face; private String face;
@Schema(description = "订单联系状态码") @Schema(description = "订单联系状态码")
private Long callStatus; private Long callStatus;
/**
* 生产方式 1 手动生产 2自动生产
*/
@Schema(description = "生产方式")
private Integer autoType;
/** /**
* 请求参数 * 请求参数
*/ */
@ -253,4 +258,5 @@ public class OrdersSaveReqVO {
*/ */
@Schema(description = "销售归属名称") @Schema(description = "销售归属名称")
private String salesAttributionName; private String salesAttributionName;
} }

View File

@ -1,14 +1,17 @@
package cn.iocoder.yudao.module.haoka.service.orderCatch; package cn.iocoder.yudao.module.haoka.service.orderCatch;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO; import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
import cn.iocoder.yudao.module.haoka.controller.admin.orderCatch.po.Message; import cn.iocoder.yudao.module.haoka.controller.admin.orderCatch.po.Message;
import cn.iocoder.yudao.module.haoka.controller.admin.orders.vo.OrdersSaveReqVO;
import cn.iocoder.yudao.module.haoka.dal.dataobject.onsaleproduct.OnSaleProductDO; import cn.iocoder.yudao.module.haoka.dal.dataobject.onsaleproduct.OnSaleProductDO;
import cn.iocoder.yudao.module.haoka.dal.dataobject.orders.OrdersDO; import cn.iocoder.yudao.module.haoka.dal.dataobject.orders.OrdersDO;
import cn.iocoder.yudao.module.haoka.dal.mysql.onsaleproduct.OnSaleProductMapper; import cn.iocoder.yudao.module.haoka.dal.mysql.onsaleproduct.OnSaleProductMapper;
import cn.iocoder.yudao.module.haoka.dal.mysql.orders.OrdersMapper; import cn.iocoder.yudao.module.haoka.dal.mysql.orders.OrdersMapper;
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService; import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
import cn.iocoder.yudao.module.haoka.service.orders.OrdersService;
import cn.iocoder.yudao.module.haoka.service.ordersynclog.OrderSyncLogService; import cn.iocoder.yudao.module.haoka.service.ordersynclog.OrderSyncLogService;
import cn.iocoder.yudao.module.haoka.utils.GroupListUtil; import cn.iocoder.yudao.module.haoka.utils.GroupListUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -69,7 +72,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
@Resource @Resource
private OnSaleProductService onSaleProductService; private OnSaleProductService onSaleProductService;
@Resource @Resource
private OrderSyncLogService orderSyncLogService; private OrdersService ordersService;
@Override @Override
public void syncOrder(AccessToken accessToken, long createTimeStart, long createTimeEnd) { public void syncOrder(AccessToken accessToken, long createTimeStart, long createTimeEnd) {
// 分页查询订单 // 分页查询订单
@ -239,6 +242,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
ordersDO.setProductId(onSaleProductPreOrder.getParentProduct().getId()); ordersDO.setProductId(onSaleProductPreOrder.getParentProduct().getId());
ordersDO.setSuperiorProductConfigId(onSaleProductPreOrder.getSuperiorProductConfigRespVO().getId()); ordersDO.setSuperiorProductConfigId(onSaleProductPreOrder.getSuperiorProductConfigRespVO().getId());
ordersDO.setSuperiorApiId(onSaleProductPreOrder.getSuperiorApiRespVO().getId()); ordersDO.setSuperiorApiId(onSaleProductPreOrder.getSuperiorApiRespVO().getId());
ordersDO.setProductSku(onSaleProductPreOrder.getParentProduct().getSku());
} }
} }
// 在售商品 // 在售商品
@ -330,7 +334,12 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
} }
} }
orderListAll.addAll(orderList); orderListAll.addAll(orderList);
ordersMapper.insertBatch(orderList); for (OrdersDO ordersDO : orderList) {
OrdersSaveReqVO ordersSaveReqVO = new OrdersSaveReqVO();
BeanUtils.copyProperties(ordersSaveReqVO,ordersDO);
ordersService.createOrders(ordersSaveReqVO);
}
// ordersMapper.insertBatch(orderList);
// 执行解密解密后更新数据库 // 执行解密解密后更新数据库
for (List<OrdersDO> ordersDOS : GroupListUtil.groupList(orderListAll, 50)) { for (List<OrdersDO> ordersDOS : GroupListUtil.groupList(orderListAll, 50)) {
batchDecryptOrderAndUpdate(ordersDOS); batchDecryptOrderAndUpdate(ordersDOS);
@ -414,6 +423,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
ordersDO.setProductId(onSaleProductPreOrder.getParentProduct().getId()); ordersDO.setProductId(onSaleProductPreOrder.getParentProduct().getId());
ordersDO.setSuperiorProductConfigId(onSaleProductPreOrder.getSuperiorProductConfigRespVO().getId()); ordersDO.setSuperiorProductConfigId(onSaleProductPreOrder.getSuperiorProductConfigRespVO().getId());
ordersDO.setSuperiorApiId(onSaleProductPreOrder.getSuperiorApiRespVO().getId()); ordersDO.setSuperiorApiId(onSaleProductPreOrder.getSuperiorApiRespVO().getId());
ordersDO.setProductSku(onSaleProductPreOrder.getParentProduct().getSku());
} }
} }
// 在售商品 // 在售商品
@ -505,7 +515,13 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
} }
} }
orderListAll.addAll(orderList); orderListAll.addAll(orderList);
ordersMapper.insertBatch(orderList); //调用创建订单流程触发发送短信
for (OrdersDO ordersDO : orderList) {
OrdersSaveReqVO ordersSaveReqVO = new OrdersSaveReqVO();
BeanUtils.copyProperties(ordersSaveReqVO,ordersDO);
ordersService.createOrders(ordersSaveReqVO);
}
// ordersMapper.insertBatch(orderList);
} }
// 执行解密解密后更新数据库 // 执行解密解密后更新数据库
for (List<OrdersDO> ordersDOS : GroupListUtil.groupList(orderListAll, 50)) { for (List<OrdersDO> ordersDOS : GroupListUtil.groupList(orderListAll, 50)) {
@ -521,15 +537,15 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
private void updateOrderFields(OrdersDO order, String cipherText, String decryptText) { private void updateOrderFields(OrdersDO order, String cipherText, String decryptText) {
// 检查并更新每个加密字段 // 检查并更新每个加密字段
if (cipherText.equals(order.getEncryptAddress())) { if (cipherText.equals(order.getEncryptAddress())) {
order.setEncryptAddress(decryptText); // 更新为解密后的值 order.setAddress(decryptText); // 更新为解密后的值
} else if (cipherText.equals(order.getEncryptIdCardName())) { } else if (cipherText.equals(order.getEncryptIdCardName())) {
order.setEncryptIdCardName(decryptText); order.setIdCardName(decryptText);
} else if (cipherText.equals(order.getEncryptAddressName())) { } else if (cipherText.equals(order.getEncryptAddressName())) {
order.setEncryptAddressName(decryptText); order.setAddressName(decryptText);
} else if (cipherText.equals(order.getEncryptIdCardNum())) { } else if (cipherText.equals(order.getEncryptIdCardNum())) {
order.setEncryptIdCardNum(decryptText); order.setIdCardNum(decryptText);
} else if (cipherText.equals(order.getEncryptAddressMobile())) { } else if (cipherText.equals(order.getEncryptAddressMobile())) {
order.setEncryptAddressMobile(decryptText); order.setAddressMobile(decryptText);
} }
} }
private void batchDecryptOrderAndUpdate(List<OrdersDO> orderList) { private void batchDecryptOrderAndUpdate(List<OrdersDO> orderList) {

View File

@ -117,12 +117,13 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
orders.setProductId(onSaleProductPreOrder.getParentProduct().getId()); orders.setProductId(onSaleProductPreOrder.getParentProduct().getId());
orders.setSuperiorProductConfigId(onSaleProductPreOrder.getSuperiorProductConfigRespVO().getId()); orders.setSuperiorProductConfigId(onSaleProductPreOrder.getSuperiorProductConfigRespVO().getId());
orders.setSuperiorApiId(onSaleProductPreOrder.getSuperiorApiRespVO().getId()); orders.setSuperiorApiId(onSaleProductPreOrder.getSuperiorApiRespVO().getId());
orders.setProductSku(onSaleProductPreOrder.getParentProduct().getSku());
// 订单就绪 // 订单就绪
orders.setStatus(100L); orders.setStatus(ObjectUtil.isEmpty(orders.getStatus()) ? 100L : orders.getStatus());
// 已支付 // 已支付
orders.setRefundStatus("800"); orders.setRefundStatus(ObjectUtil.isEmpty(orders.getRefundStatus()) ? "800" : orders.getRefundStatus());
// 未激活 // 未激活
orders.setActiveStatus("0"); orders.setActiveStatus(ObjectUtil.isEmpty(orders.getActiveStatus())? "0" : orders.getActiveStatus());
ordersMapper.insert(orders); ordersMapper.insert(orders);