PageResult<SuperiorApiLogDO> selectPage(SuperiorApiLogPageReqVO reqVO)

This commit is contained in:
Owen 2025-03-03 20:17:16 +08:00
parent 7b62d6f7a8
commit 9f0094ec73
6 changed files with 58 additions and 24 deletions

View File

@ -101,8 +101,9 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
logVO.setHaokaProductId(param.getProductId());
logVO.setHaokaSuperiorApiId(param.getSuperiorApiId());
Boolean isSupport = true;
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
try {
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
// OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
if (onSaleProductPreOrder == null) {
String msg = "关联上级产品不存在";
logVO.setSuccess(false);
@ -148,7 +149,13 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
return ApiDealResp.failed(e.getMessage());
} finally {
if (isSupport) {
superiorApiLogService.createSuperiorApiLog(logVO);
if (onSaleProductPreOrder != null
&& onSaleProductPreOrder.getSuperiorApiRespVO() != null
&& onSaleProductPreOrder.getSuperiorApiRespVO().getApiFrom() != null
&& ApiFrom.fromId(onSaleProductPreOrder.getSuperiorApiRespVO().getApiFrom()) == ApiFrom.LianTong) {
} else {
superiorApiLogService.createSuperiorApiLog(logVO);
}
}
}
}

View File

@ -26,6 +26,7 @@ import cn.iocoder.yudao.module.haoka.service.superiorproductconfig.SuperiorProdu
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import jakarta.annotation.Resource;
import lombok.val;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
@ -124,7 +125,11 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
OrderApiCreateResp superApiResponse = new OrderApiCreateResp();
if (!"成功".equals(rspCode)) {
superApiResponse.setOrderStatusCode("0");
superApiResponse.setSupplierOrderStatusDesc(ziLiaoResponse.getRspDesc());
String rspDesc = ziLiaoResponse.getRspDesc();
if (StringUtils.isEmpty(rspDesc)){
rspDesc=rspCode;
}
superApiResponse.setSupplierOrderStatusDesc(rspDesc);
return ApiDealResp.ok(superApiResponse);
}
@ -233,9 +238,8 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
KingOrderSyncResponse response = apiLianTongService.lianTongOrderSyncV2(haokaSuperiorApiId, syncV2);
logVO.setResponse(JSON.toJSONString(response));
if (!"0000".equals(response.getRspCode())) {
superApiResponse.setOrderStatusCode("0");
superApiResponse.setSupplierOrderStatusDesc(preOrderResponse.getRspDesc());
superApiResponse.setSupplierOrderStatusDesc(response.getRspDesc());
return ApiDealResp.ok(superApiResponse);
// return ApiDealResp.failed(response.getRspDesc());
}
@ -246,7 +250,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
// * 商城订单编码mallOrderId部分流程返回
// * 预占号码preNumber
// * {\"mallOrderId\":\"363067187203\",\"orderNo\":\"1962041937730469\",\"preNumber\":\"13104876751\",\"shortUrl\":\"https://uc.gtimg.cn/AjIxeJEl\"}
// */
// */ {"body":"","rspCode":"E.num.99","rspDesc":"只允许上架、预配、选占号码做选占","uuid":"05e2a454-a896-4055-a94c-cbd2b6c8d98c"}
// private String body;

View File

@ -54,6 +54,8 @@ public interface OrdersService extends IService<OrdersDO> {
*/
PageResult<OrdersDO> getOrdersPage(OrdersPageReqVO pageReqVO);
void auditOrdersAsync(OrdersSaveReqVO updateReqVO);
void auditOrders(OrdersSaveReqVO updateReqVO);
/**
@ -66,12 +68,14 @@ public interface OrdersService extends IService<OrdersDO> {
/**
* 提交订单
*
* @param updateReqVO
*/
void submitOrders(OrdersSaveReqVO updateReqVO);
/**
* 强制修改订单提交状态
*
* @param updateReqVO
*/
void submitUpStreamStatus(OrdersSaveReqVO updateReqVO);

View File

@ -34,6 +34,7 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@ -341,7 +342,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
// 自动生产 调用审核
OrdersSaveReqVO ordersSaveReqVO = BeanUtils.toBean(ordersDO, OrdersSaveReqVO.class);
ordersSaveReqVO.setStatus(450L);
ordersService.auditOrders(ordersSaveReqVO);
ordersService.auditOrdersAsync(ordersSaveReqVO);
}
/**
@ -383,6 +384,26 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
updateObj.setSuperiorProductConfigId(oldOrderDo.getSuperiorProductConfigId());
updateObj.setSuperiorApiId(oldOrderDo.getSuperiorApiId());
ordersMapper.updateById(updateObj);
// 抖音订单判断备注更新
ordersService.syncDouDian(oldOrderDo,updateObj);
// 状态变化发送短信提醒
if (updateObj.getStatus() != null && updateObj.getStatus().equals(oldOrderDo.getStatus())) {
smsTaskService.sendSMS(
updateObj.getStatus(),
updateObj.getId(),
updateObj.getSource(),
updateObj.getOnSaleProductId(),
updateObj.getRefundStatus(),
updateObj.getCallStatus(),
updateObj.getAddressMobile(),
updateObj
);
}
}
@Async
public void syncDouDian(OrdersDO oldOrderDo,OrdersDO updateObj){
// 抖音订单判断备注更新
if("2".equals(oldOrderDo.getSource())){
String sellerMemo = oldOrderDo.getSellerMemo();
@ -407,20 +428,13 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
douDianOrderCatchService.logisticsAdd(updateObj.getRealSourceId(),"","",trackingNumber);
}
}
// 状态变化发送短信提醒
if (updateObj.getStatus() != null && updateObj.getStatus().equals(oldOrderDo.getStatus())) {
}
smsTaskService.sendSMS(
updateObj.getStatus(),
updateObj.getId(),
updateObj.getSource(),
updateObj.getOnSaleProductId(),
updateObj.getRefundStatus(),
updateObj.getCallStatus(),
updateObj.getAddressMobile(),
updateObj
);
}
@Async
@Override
public void auditOrdersAsync(OrdersSaveReqVO updateReqVO){
auditOrders( updateReqVO);
}
@Override
@ -532,9 +546,9 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
/**
* 调用运营商产生订单(在运营商侧创建订单)
*
* @param ordersDO
*/
private OrdersDO createOrderToOperators(OrdersDO ordersDO) {
private OrdersDO createOrderToOperators(OrdersDO ordersDOUnreleasable) {
var ordersDO = getOrders(ordersDOUnreleasable.getId());
// 向上游提交订单
OrderApiCreateParam param = new OrderApiCreateParam();
BeanUtils.copyProperties(ordersDO, param);

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.haoka.controller.admin.smstask.vo.*;
import cn.iocoder.yudao.module.haoka.dal.dataobject.smstask.SmsTaskDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.scheduling.annotation.Async;
/**
* 短信任务 Service 接口
@ -53,6 +54,7 @@ public interface SmsTaskService {
* @return 短信任务分页
*/
PageResult<SmsTaskDO> getSmsTaskPage(SmsTaskPageReqVO pageReqVO);
/**
* @param orderStatus
* @param orderId
@ -62,7 +64,8 @@ public interface SmsTaskService {
* @param callStatus
* @param sentToPhone
*/
public void sendSMS(Long orderStatus, Long orderId, String source, Long onSaleProductId,
String refundStatus, Long callStatus, String sentToPhone, OrdersDO ordersDO);
@Async
void sendSMS(Long orderStatus, Long orderId, String source, Long onSaleProductId,
String refundStatus, Long callStatus, String sentToPhone, OrdersDO ordersDO);
}

View File

@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -99,6 +100,7 @@ public class SmsTaskServiceImpl implements SmsTaskService {
* @param callStatus
* @param sentToPhone
*/
@Async
public void sendSMS(Long orderStatus, Long orderId, String source, Long onSaleProductId,
String refundStatus, Long callStatus, String sentToPhone, OrdersDO ordersDO) {
try {