商家版app 订单列表,修改 order_item_amount 字段
This commit is contained in:
parent
5819d91f23
commit
ad2ea0756f
@ -202,8 +202,8 @@ public class ShopOrderInfo implements Serializable {
|
|||||||
private Long order_picked_time;
|
private Long order_picked_time;
|
||||||
|
|
||||||
@ApiModelProperty(value = "新建时间")
|
@ApiModelProperty(value = "新建时间")
|
||||||
private Long created_at;
|
private Date created_at;
|
||||||
|
|
||||||
@ApiModelProperty(value = "更新时间")
|
@ApiModelProperty(value = "更新时间")
|
||||||
private Long updated_at;
|
private Date updated_at;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,8 +44,8 @@ public class MchOrderItemDTO implements Serializable {
|
|||||||
@ApiModelProperty(value = "商品价格单价")
|
@ApiModelProperty(value = "商品价格单价")
|
||||||
private BigDecimal item_unit_price;
|
private BigDecimal item_unit_price;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品成本金额")
|
@ApiModelProperty(value = "商品实际总金额: item_unit_price * order_item_quantity")
|
||||||
private BigDecimal item_cost_price;
|
private BigDecimal order_item_amount;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品条码")
|
@ApiModelProperty(value = "商品条码")
|
||||||
private String item_barcode;
|
private String item_barcode;
|
||||||
|
|||||||
@ -15,6 +15,18 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface UniCloudPushService {
|
public interface UniCloudPushService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向单个客户端发送推送消息
|
||||||
|
*
|
||||||
|
* @param clientId 客户端 ID
|
||||||
|
* @param title 推送标题
|
||||||
|
* @param content 推送内容
|
||||||
|
* @param payload 推送内容
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Pair<Boolean, String> sendPushMessage(String clientId, String title, String content, JSONObject payload);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向多个客户端ID批量发送推送消息
|
* 向多个客户端ID批量发送推送消息
|
||||||
*
|
*
|
||||||
@ -24,5 +36,5 @@ public interface UniCloudPushService {
|
|||||||
* @param payload 附加数据(JSON对象)
|
* @param payload 附加数据(JSON对象)
|
||||||
* @return 推送结果响应对象
|
* @return 推送结果响应对象
|
||||||
*/
|
*/
|
||||||
Pair<Boolean, String> sendBatchPush(String cloudFunctionUrl, List<String> clientIds, String title, String content, JSONObject payload);
|
Pair<Boolean, String> sendPushMessageBatch(List<String> clientIds, String title, String content, JSONObject payload);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import cn.hutool.json.JSONObject;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.suisung.mall.common.service.UniCloudPushService;
|
import com.suisung.mall.common.service.UniCloudPushService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.data.util.Pair;
|
import org.springframework.data.util.Pair;
|
||||||
import org.springframework.http.*;
|
import org.springframework.http.*;
|
||||||
@ -23,6 +24,7 @@ import org.springframework.web.client.RestClientException;
|
|||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,19 +39,34 @@ public class UniCloudPushServiceImpl implements UniCloudPushService {
|
|||||||
@Resource
|
@Resource
|
||||||
private RestTemplate restTemplate;
|
private RestTemplate restTemplate;
|
||||||
|
|
||||||
|
@Value("${uni-cloud-push.send_msg_url}")
|
||||||
|
private String pushMessageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向单个客户端发送推送消息
|
||||||
|
*
|
||||||
|
* @param clientId 客户端 ID
|
||||||
|
* @param title 推送标题
|
||||||
|
* @param content 推送内容
|
||||||
|
* @param payload 推送内容
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Pair<Boolean, String> sendPushMessage(String clientId, String title, String content, JSONObject payload) {
|
||||||
|
return sendPushMessageBatch(Collections.singletonList(clientId), title, content, payload);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向多个客户端ID批量发送推送消息
|
* 向多个客户端ID批量发送推送消息
|
||||||
*
|
*
|
||||||
* @param clientIds 目标客户端 ID 列表 注意:超过500个,直接忽略
|
* @param clientIds 目标客户端 ID 列表 注意:超过500个,直接忽略 必填项
|
||||||
* @param title 推送标题
|
* @param title 推送标题 可选项
|
||||||
* @param content 推送内容
|
* @param content 推送内容 必填项
|
||||||
* @param payload 附加数据(JSON对象)
|
* @param payload 附加数据(JSON对象) 可选项
|
||||||
* @return 推送结果响应对象
|
* @return 推送结果响应对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Pair<Boolean, String> sendBatchPush(String cloudFunctionUrl, List<String> clientIds, String title, String content, JSONObject payload) {
|
public Pair<Boolean, String> sendPushMessageBatch(List<String> clientIds, String title, String content, JSONObject payload) {
|
||||||
if (StrUtil.isBlank(cloudFunctionUrl) || CollUtil.isEmpty(clientIds) || StrUtil.isBlank(content)) {
|
if (StrUtil.isBlank(pushMessageUrl) || CollUtil.isEmpty(clientIds) || StrUtil.isBlank(content)) {
|
||||||
return Pair.of(false, "缺少必要参数");
|
return Pair.of(false, "缺少必要参数");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +84,7 @@ public class UniCloudPushServiceImpl implements UniCloudPushService {
|
|||||||
JSONObject requestBody = buildPushRequest(clientIds, title, content, payload);
|
JSONObject requestBody = buildPushRequest(clientIds, title, content, payload);
|
||||||
|
|
||||||
// 执行HTTP请求
|
// 执行HTTP请求
|
||||||
ResponseEntity<String> response = executeHttpRequest(cloudFunctionUrl, requestBody);
|
ResponseEntity<String> response = executeHttpRequest(pushMessageUrl, requestBody);
|
||||||
|
|
||||||
// 处理响应结果
|
// 处理响应结果
|
||||||
return processResponse(response);
|
return processResponse(response);
|
||||||
|
|||||||
@ -39,4 +39,6 @@ getui: # 个推配置
|
|||||||
appid: KXgzOaKSzd5HG3p9IPaVa8
|
appid: KXgzOaKSzd5HG3p9IPaVa8
|
||||||
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
||||||
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
||||||
domain: https://restapi.getui.com/v2/
|
domain: https://restapi.getui.com/v2/
|
||||||
|
uni-cloud-push:
|
||||||
|
send_msg_url: https://fc-mp-39e3d50a-2d2b-415a-9664-2e48974bcfbd.next.bspapp.com/sendMessage
|
||||||
@ -39,3 +39,5 @@ getui: # 个推配置
|
|||||||
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
||||||
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
||||||
domain: https://restapi.getui.com/v2/
|
domain: https://restapi.getui.com/v2/
|
||||||
|
uni-cloud-push:
|
||||||
|
send_msg_url: https://fc-mp-39e3d50a-2d2b-415a-9664-2e48974bcfbd.next.bspapp.com/sendMessage
|
||||||
|
|||||||
@ -39,3 +39,5 @@ getui: # 个推配置
|
|||||||
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
||||||
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
||||||
domain: https://restapi.getui.com/v2/
|
domain: https://restapi.getui.com/v2/
|
||||||
|
uni-cloud-push:
|
||||||
|
send_msg_url: https://fc-mp-39e3d50a-2d2b-415a-9664-2e48974bcfbd.next.bspapp.com/sendMessage
|
||||||
|
|||||||
@ -38,4 +38,6 @@ getui: # 个推配置
|
|||||||
appid: KXgzOaKSzd5HG3p9IPaVa8
|
appid: KXgzOaKSzd5HG3p9IPaVa8
|
||||||
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
||||||
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
||||||
domain: https://restapi.getui.com/v2/
|
domain: https://restapi.getui.com/v2/
|
||||||
|
uni-cloud-push:
|
||||||
|
send_msg_url: https://fc-mp-39e3d50a-2d2b-415a-9664-2e48974bcfbd.next.bspapp.com/sendMessage
|
||||||
@ -39,4 +39,6 @@ getui: # 个推配置
|
|||||||
appid: KXgzOaKSzd5HG3p9IPaVa8
|
appid: KXgzOaKSzd5HG3p9IPaVa8
|
||||||
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
appkey: neXXX9r1Tc7gMxN2PIcHA1
|
||||||
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
mastersecret: jYnpS1xYhh6GfyZQMlciJ
|
||||||
domain: https://restapi.getui.com/v2/
|
domain: https://restapi.getui.com/v2/
|
||||||
|
uni-cloud-push:
|
||||||
|
send_msg_url: https://fc-mp-39e3d50a-2d2b-415a-9664-2e48974bcfbd.next.bspapp.com/sendMessage
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||||
|
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||||
|
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||||
|
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||||
|
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.suisung.mall.shop.config;
|
||||||
|
|
||||||
|
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||||
|
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
public class AsyncConfig implements AsyncConfigurer {
|
||||||
|
@Override
|
||||||
|
public Executor getAsyncExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(5); // 核心线程数
|
||||||
|
executor.setMaxPoolSize(10); // 最大线程数
|
||||||
|
executor.setQueueCapacity(25); // 队列容量
|
||||||
|
executor.setThreadNamePrefix("Async-"); // 线程名前缀
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||||
|
return new CustomAsyncExceptionHandler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CustomAsyncExceptionHandler implements AsyncUncaughtExceptionHandler {
|
||||||
|
@Override
|
||||||
|
public void handleUncaughtException(Throwable ex, Method method, Object... params) {
|
||||||
|
System.err.println("异步方法执行异常: " + ex.getMessage());
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -555,9 +555,10 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
shopMchEntryService.updateMerchEntryEcResultUrlByMchId(shopMchEntry.getId(), ecResultUrl);
|
shopMchEntryService.updateMerchEntryEcResultUrlByMchId(shopMchEntry.getId(), ecResultUrl);
|
||||||
|
|
||||||
// 发短信给商家,及时签署合同 SMS_488465246
|
// 发短信给商家,及时签署合同 SMS_488465246
|
||||||
// 商家您好,您的入驻申请已收到。请尽快登录小发同城商家 APP 完成合同签署,签署时效为 24 小时,望知晓。
|
// 【小发同城商家】恭喜您的开店入驻申请已审核通过!请尽快登录APP平台签署电子合同,签署链接24小时内有效(逾期需重新提交申请)。如有疑问请联系客服,感谢您的支持!
|
||||||
shopMessageTemplateService.aliyunSmsSend(mchMobile, "SMS_489795044", null);//SMS_479760276
|
shopMessageTemplateService.aliyunSmsSend(mchMobile, "SMS_489795044", null);//SMS_479760276
|
||||||
|
|
||||||
|
|
||||||
return Pair.of(true, "商家入网申请电子合同成功");
|
return Pair.of(true, "商家入网申请电子合同成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||||
|
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||||
|
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||||
|
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||||
|
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.suisung.mall.shop.message.service;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public interface PushMessageService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步发送推送通知 商户签约电子合同
|
||||||
|
*
|
||||||
|
* @param mchMobile
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CompletableFuture<Boolean> noticeMerchantSignEcContract(String mchMobile);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步发送推送通知商户,订单的活动情况
|
||||||
|
*
|
||||||
|
* @param storeId 可选参数,storeId 和 orderId 二选一
|
||||||
|
* @param orderId 可选参数,storeId 和 orderId 二选一
|
||||||
|
* @param title 可选参数
|
||||||
|
* @param content 必填参数
|
||||||
|
* @param payload 可选参数
|
||||||
|
*/
|
||||||
|
void noticeMerchantEmployeeOrderAction(Integer storeId, String orderId, String title, String content, JSONObject payload);
|
||||||
|
}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||||
|
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||||
|
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||||
|
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||||
|
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.suisung.mall.shop.message.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.suisung.mall.common.service.UniCloudPushService;
|
||||||
|
import com.suisung.mall.shop.message.service.PushMessageService;
|
||||||
|
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.data.util.Pair;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class PushMessageServiceImpl implements PushMessageService {
|
||||||
|
|
||||||
|
private static final String appName = "小发同城";
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private UniCloudPushService uniCloudPushService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private ShopStoreEmployeeService shopStoreEmployeeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步发送推送通知 商户签约电子合同
|
||||||
|
*
|
||||||
|
* @param mchMobile
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Async("pushAsyncExecutor")
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<Boolean> noticeMerchantSignEcContract(String mchMobile) {
|
||||||
|
// 获取 商家的 cid
|
||||||
|
Pair<Boolean, String> result = uniCloudPushService.sendPushMessage(null,
|
||||||
|
appName + "邀请您签署入驻合同",
|
||||||
|
"恭喜您的开店入驻申请已审核通过!请尽快登录APP平台签署电子合同,签署链接24小时内有效(逾期需重新提交申请)。如有疑问请联系客服,感谢您的支持!",
|
||||||
|
null);
|
||||||
|
|
||||||
|
if (!result.getFirst()) {
|
||||||
|
log.error("商家入驻申请电子合同推送失败:{}", result.getSecond());
|
||||||
|
return CompletableFuture.completedFuture(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CompletableFuture.completedFuture(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步发送推送通知商户(所有用户),订单的活动情况
|
||||||
|
*
|
||||||
|
* @param storeId 可选参数,storeId 和 orderId 二选一
|
||||||
|
* @param orderId 可选参数,storeId 和 orderId 二选一
|
||||||
|
* @param title 可选参数
|
||||||
|
* @param content 必填参数
|
||||||
|
* @param payload 可选参数
|
||||||
|
*/
|
||||||
|
@Async("pushAsyncExecutor")
|
||||||
|
@Override
|
||||||
|
public void noticeMerchantEmployeeOrderAction(Integer storeId, String orderId, String title, String content, JSONObject payload) {
|
||||||
|
List<String> cidList = shopStoreEmployeeService.selectEmployeeGeTuiCidByStoreId(storeId, orderId, null);
|
||||||
|
// 获取 商家的 cid
|
||||||
|
uniCloudPushService.sendPushMessageBatch(cidList, title, content, payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@ import com.rabbitmq.client.Channel;
|
|||||||
import com.suisung.mall.common.api.StateCode;
|
import com.suisung.mall.common.api.StateCode;
|
||||||
import com.suisung.mall.common.constant.MqConstant;
|
import com.suisung.mall.common.constant.MqConstant;
|
||||||
import com.suisung.mall.common.modules.order.ShopOrderInfo;
|
import com.suisung.mall.common.modules.order.ShopOrderInfo;
|
||||||
|
import com.suisung.mall.shop.message.service.PushMessageService;
|
||||||
import com.suisung.mall.shop.order.service.ShopOrderBaseService;
|
import com.suisung.mall.shop.order.service.ShopOrderBaseService;
|
||||||
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
||||||
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
||||||
@ -15,6 +16,7 @@ import org.springframework.amqp.core.Message;
|
|||||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.data.util.Pair;
|
import org.springframework.data.util.Pair;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -42,6 +44,10 @@ public class OrderPayedListener {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SFExpressApiService sfExpressApiService;
|
private SFExpressApiService sfExpressApiService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private PushMessageService pushMessageService;
|
||||||
|
|
||||||
@RabbitHandler
|
@RabbitHandler
|
||||||
public void listener(String data, Channel channel, Message message) throws IOException, InterruptedException {
|
public void listener(String data, Channel channel, Message message) throws IOException, InterruptedException {
|
||||||
String messageId = message.getMessageProperties().getMessageId();
|
String messageId = message.getMessageProperties().getMessageId();
|
||||||
@ -112,9 +118,6 @@ public class OrderPayedListener {
|
|||||||
|
|
||||||
logger.info("顺丰同城下单成功");
|
logger.info("顺丰同城下单成功");
|
||||||
|
|
||||||
// 个推推送消息
|
|
||||||
sfExpressApiService.pushMessageToStoreEmployee(null, orderId, "你有一笔同城订单[" + orderId + "],请及时处理。", "");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,15 +138,15 @@ public interface SFExpressApiService {
|
|||||||
*/
|
*/
|
||||||
ThirdApiRes receiveOrderCompleteNotify(String jsonData, String sign);
|
ThirdApiRes receiveOrderCompleteNotify(String jsonData, String sign);
|
||||||
|
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 个推推送消息到员工
|
// * 个推推送消息到员工
|
||||||
*
|
// *
|
||||||
* @param storeId
|
// * @param storeId
|
||||||
* @param orderId
|
// * @param orderId
|
||||||
* @param message
|
// * @param message
|
||||||
* @param payloadJson
|
// * @param payloadJson
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
void pushMessageToStoreEmployee(Integer storeId, String orderId, String message, String payloadJson);
|
// void pushMessageToStoreEmployee(Integer storeId, String orderId, String message, String payloadJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
package com.suisung.mall.shop.sfexpress.service.impl;
|
package com.suisung.mall.shop.sfexpress.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@ -23,14 +22,13 @@ import com.suisung.mall.common.modules.store.ShopStoreSameCityTransportBase;
|
|||||||
import com.suisung.mall.common.modules.store.ShopStoreSfOrder;
|
import com.suisung.mall.common.modules.store.ShopStoreSfOrder;
|
||||||
import com.suisung.mall.common.pojo.req.*;
|
import com.suisung.mall.common.pojo.req.*;
|
||||||
import com.suisung.mall.common.pojo.res.ThirdApiRes;
|
import com.suisung.mall.common.pojo.res.ThirdApiRes;
|
||||||
import com.suisung.mall.common.service.GeTuiPushService;
|
|
||||||
import com.suisung.mall.common.utils.CommonUtil;
|
import com.suisung.mall.common.utils.CommonUtil;
|
||||||
import com.suisung.mall.common.utils.I18nUtil;
|
import com.suisung.mall.common.utils.I18nUtil;
|
||||||
import com.suisung.mall.common.utils.JsonUtil;
|
import com.suisung.mall.common.utils.JsonUtil;
|
||||||
|
import com.suisung.mall.shop.message.service.PushMessageService;
|
||||||
import com.suisung.mall.shop.order.service.ShopOrderBaseService;
|
import com.suisung.mall.shop.order.service.ShopOrderBaseService;
|
||||||
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
||||||
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportBaseService;
|
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportBaseService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreSfOrderService;
|
import com.suisung.mall.shop.store.service.ShopStoreSfOrderService;
|
||||||
import com.suisung.mall.shop.wechat.service.WxOrderShippingService;
|
import com.suisung.mall.shop.wechat.service.WxOrderShippingService;
|
||||||
@ -79,11 +77,11 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopStoreEmployeeService shopStoreEmployeeService;
|
private PushMessageService pushMessageService;
|
||||||
|
//
|
||||||
@Lazy
|
// @Lazy
|
||||||
@Autowired
|
// @Autowired
|
||||||
private GeTuiPushService geTuiPushService;
|
// private GeTuiPushService geTuiPushService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ThirdApiRes createOrder(String shopOrderId) {
|
public ThirdApiRes createOrder(String shopOrderId) {
|
||||||
@ -225,6 +223,10 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
// 商城订单状态:2020-待配货/待出库审核
|
// 商城订单状态:2020-待配货/待出库审核
|
||||||
shopOrderInfoService.changeOrderStatus(shopOrderId, StateCode.ORDER_STATE_PICKING, 0, 0);
|
shopOrderInfoService.changeOrderStatus(shopOrderId, StateCode.ORDER_STATE_PICKING, 0, 0);
|
||||||
|
|
||||||
|
// 个推推送消息
|
||||||
|
pushMessageService.noticeMerchantEmployeeOrderAction(null, shopOrderId, "您有一笔新的订单", "您有一笔同城订单[" + shopOrderId + "],请及时处理。", null);
|
||||||
|
|
||||||
|
|
||||||
return Pair.of(true, "顺丰同城下单成功!");
|
return Pair.of(true, "顺丰同城下单成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,6 +320,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
throw new ApiException(I18nUtil._("取消顺丰订单失败!"));
|
throw new ApiException(I18nUtil._("取消顺丰订单失败!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return sfExpressApiRes;
|
return sfExpressApiRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,6 +340,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
// 转换 json 字符串参数
|
// 转换 json 字符串参数
|
||||||
String paramJSON = JsonUtil.toJSONString(params);
|
String paramJSON = JsonUtil.toJSONString(params);
|
||||||
|
logger.debug("参数:" + paramJSON);
|
||||||
|
|
||||||
// 根据参数生成请求签名
|
// 根据参数生成请求签名
|
||||||
String send_url = buildUrl("addordergratuityfee", paramJSON);
|
String send_url = buildUrl("addordergratuityfee", paramJSON);
|
||||||
@ -365,6 +369,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
// 转换 json 字符串参数
|
// 转换 json 字符串参数
|
||||||
String paramJSON = JsonUtil.toJSONString(params);
|
String paramJSON = JsonUtil.toJSONString(params);
|
||||||
|
logger.debug("参数:" + paramJSON);
|
||||||
|
|
||||||
// 根据参数生成请求签名
|
// 根据参数生成请求签名
|
||||||
String send_url = buildUrl("reminderorder", paramJSON);
|
String send_url = buildUrl("reminderorder", paramJSON);
|
||||||
@ -395,6 +400,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
// 转换 json 字符串参数
|
// 转换 json 字符串参数
|
||||||
String paramJSON = JsonUtil.toJSONString(params);
|
String paramJSON = JsonUtil.toJSONString(params);
|
||||||
|
logger.debug("参数:" + paramJSON);
|
||||||
|
|
||||||
// 根据参数生成请求签名
|
// 根据参数生成请求签名
|
||||||
String send_url = buildUrl("listorderfeed", paramJSON);
|
String send_url = buildUrl("listorderfeed", paramJSON);
|
||||||
@ -423,6 +429,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
// 转换 json 字符串参数
|
// 转换 json 字符串参数
|
||||||
String paramJSON = JsonUtil.toJSONString(params);
|
String paramJSON = JsonUtil.toJSONString(params);
|
||||||
|
logger.debug("参数:" + paramJSON);
|
||||||
|
|
||||||
// 根据参数生成请求签名
|
// 根据参数生成请求签名
|
||||||
String send_url = buildUrl("riderlatestposition", paramJSON);
|
String send_url = buildUrl("riderlatestposition", paramJSON);
|
||||||
@ -451,6 +458,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
// 转换 json 字符串参数
|
// 转换 json 字符串参数
|
||||||
String paramJSON = JsonUtil.toJSONString(params);
|
String paramJSON = JsonUtil.toJSONString(params);
|
||||||
|
logger.debug("参数:" + paramJSON);
|
||||||
|
|
||||||
// 根据参数生成请求签名
|
// 根据参数生成请求签名
|
||||||
String send_url = buildUrl("riderviewv2", paramJSON);
|
String send_url = buildUrl("riderviewv2", paramJSON);
|
||||||
@ -505,6 +513,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
// 转换 json 字符串参数
|
// 转换 json 字符串参数
|
||||||
String paramJSON = JsonUtil.toJSONString(params);
|
String paramJSON = JsonUtil.toJSONString(params);
|
||||||
|
logger.debug("拣货完成参数:" + paramJSON);
|
||||||
|
|
||||||
// 根据参数生成请求签名
|
// 根据参数生成请求签名
|
||||||
String send_url = buildUrl("notifyproductready", paramJSON);
|
String send_url = buildUrl("notifyproductready", paramJSON);
|
||||||
@ -540,8 +549,9 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
// 更改顺丰同城订单状态
|
// 更改顺丰同城订单状态
|
||||||
ShopStoreSfOrder shopStoreSfOrder = toShopStoreSfOrder(jsonData);
|
ShopStoreSfOrder shopStoreSfOrder = toShopStoreSfOrder(jsonData);
|
||||||
|
|
||||||
|
String orderId = shopStoreSfOrder.getShop_order_id();
|
||||||
// 判断订单的状态,是否已经取消了?已取消,不再执行
|
// 判断订单的状态,是否已经取消了?已取消,不再执行
|
||||||
ShopStoreSfOrder shopStoreSfOrderExist = shopStoreSfOrderService.getBySfOrderId(shopStoreSfOrder.getShop_order_id());
|
ShopStoreSfOrder shopStoreSfOrderExist = shopStoreSfOrderService.getBySfOrderId(orderId);
|
||||||
if (shopStoreSfOrderExist != null && shopStoreSfOrderExist.getOrder_status() != null
|
if (shopStoreSfOrderExist != null && shopStoreSfOrderExist.getOrder_status() != null
|
||||||
&& (shopStoreSfOrderExist.getOrder_status().equals(StateCode.SF_ORDER_STATUS_CANCELED) ||
|
&& (shopStoreSfOrderExist.getOrder_status().equals(StateCode.SF_ORDER_STATUS_CANCELED) ||
|
||||||
(shopStoreSfOrderExist.getOrder_status().equals(StateCode.SF_ORDER_STATUS_CANCELING)))) {
|
(shopStoreSfOrderExist.getOrder_status().equals(StateCode.SF_ORDER_STATUS_CANCELING)))) {
|
||||||
@ -561,6 +571,10 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
return new ThirdApiRes().fail(-1, "取消订单业务处理失败!");
|
return new ThirdApiRes().fail(-1, "取消订单业务处理失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 个推推送消息
|
||||||
|
pushMessageService.noticeMerchantEmployeeOrderAction(null, orderId, "您有一笔取消订单", "您有一笔取消订单[" + orderId + "],请及时处理。", null);
|
||||||
|
|
||||||
|
|
||||||
return new ThirdApiRes().success("success");
|
return new ThirdApiRes().success("success");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -656,8 +670,8 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
// SseEmitterUtil.sendMessage(shopStoreSfOrder.getSf_order_id(), jsonData);
|
// SseEmitterUtil.sendMessage(shopStoreSfOrder.getSf_order_id(), jsonData);
|
||||||
// logger.debug("向 SSE 通道 {} 发送了:{}", shopStoreSfOrder.getSf_order_id(), jsonData);
|
// logger.debug("向 SSE 通道 {} 发送了:{}", shopStoreSfOrder.getSf_order_id(), jsonData);
|
||||||
|
|
||||||
// 个推消息推送
|
// 消息推送
|
||||||
pushMessageToStoreEmployee(null, shopStoreSfOrder.getShop_order_id(), "顺丰同城订单[" + shopStoreSfOrder.getShop_order_id() + "]" + pushRemark, "");
|
pushMessageService.noticeMerchantEmployeeOrderAction(null, shopStoreSfOrder.getShop_order_id(), "", "顺丰同城订单[" + shopStoreSfOrder.getShop_order_id() + "]" + pushRemark, null);
|
||||||
|
|
||||||
return new ThirdApiRes().success("success");
|
return new ThirdApiRes().success("success");
|
||||||
}
|
}
|
||||||
@ -727,8 +741,8 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
// logger.debug("准备发送SSE消息...");
|
// logger.debug("准备发送SSE消息...");
|
||||||
// SseEmitterUtil.sendMessage(shopStoreSfOrder.getSf_order_id(), jsonData);
|
// SseEmitterUtil.sendMessage(shopStoreSfOrder.getSf_order_id(), jsonData);
|
||||||
|
|
||||||
// 个推消息推送
|
// 消息推送
|
||||||
pushMessageToStoreEmployee(null, shopStoreSfOrder.getShop_order_id(), "顺丰同城订单[" + shopStoreSfOrder.getShop_order_id() + "]已完成配送。", "");
|
pushMessageService.noticeMerchantEmployeeOrderAction(null, shopStoreSfOrder.getShop_order_id(), "", "顺丰同城订单[" + shopStoreSfOrder.getShop_order_id() + "]已完成配送。", null);
|
||||||
|
|
||||||
// 通知微信用户确认收货
|
// 通知微信用户确认收货
|
||||||
// wxOrderShippingService.notifyConfirmReceive(shopStoreSfOrder.getShop_order_id());
|
// wxOrderShippingService.notifyConfirmReceive(shopStoreSfOrder.getShop_order_id());
|
||||||
@ -745,28 +759,28 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
* @param payloadJson
|
* @param payloadJson
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
// @Override
|
||||||
public void pushMessageToStoreEmployee(Integer storeId, String orderId, String message, String payloadJson) {
|
// public void pushMessageToStoreEmployee(Integer storeId, String orderId, String message, String payloadJson) {
|
||||||
try {
|
// try {
|
||||||
List<String> cidList = shopStoreEmployeeService.selectEmployeeGeTuiCidByStoreId(storeId, orderId, false);
|
// List<String> cidList = shopStoreEmployeeService.selectEmployeeGeTuiCidByStoreId(storeId, orderId, false);
|
||||||
if (CollUtil.isEmpty(cidList)) {
|
// if (CollUtil.isEmpty(cidList)) {
|
||||||
logger.error("获取不到店铺员工,无法推送消息!");
|
// logger.error("获取不到店铺员工,无法推送消息!");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (StrUtil.isBlank(payloadJson)) {
|
// if (StrUtil.isBlank(payloadJson)) {
|
||||||
payloadJson = new JSONObject().set("page", "orderDetail").set("orderId", orderId).set("storeId", storeId).toString();
|
// payloadJson = new JSONObject().set("page", "orderDetail").set("orderId", orderId).set("storeId", storeId).toString();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// 推送消息到员工
|
// // 推送消息到员工
|
||||||
Pair<Boolean, String> result = geTuiPushService.pushListMessageToCids(cidList, "", message, "payload", payloadJson);
|
// Pair<Boolean, String> result = geTuiPushService.pushListMessageToCids(cidList, "", message, "payload", payloadJson);
|
||||||
if (!result.getFirst()) {
|
// if (!result.getFirst()) {
|
||||||
logger.error("推送消息到员工失败:{}", result.getSecond());
|
// logger.error("推送消息到员工失败:{}", result.getSecond());
|
||||||
}
|
// }
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
logger.error("推送消息到员工时发生异常:{}", e.getMessage(), e);
|
// logger.error("推送消息到员工时发生异常:{}", e.getMessage(), e);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// 私有方法
|
// 私有方法
|
||||||
|
|||||||
@ -629,7 +629,7 @@
|
|||||||
<result property="item_name" column="item_name"/>
|
<result property="item_name" column="item_name"/>
|
||||||
<result property="order_item_quantity" column="order_item_quantity"/>
|
<result property="order_item_quantity" column="order_item_quantity"/>
|
||||||
<result property="item_unit_price" column="item_unit_price"/>
|
<result property="item_unit_price" column="item_unit_price"/>
|
||||||
<result property="item_cost_price" column="item_cost_price"/>
|
<result property="order_item_amount" column="order_item_amount"/>
|
||||||
<result property="item_barcode" column="item_barcode"/>
|
<result property="item_barcode" column="item_barcode"/>
|
||||||
<result property="order_item_image" column="order_item_image"/>
|
<result property="order_item_image" column="order_item_image"/>
|
||||||
<result property="spec_info" column="spec_info"/>
|
<result property="spec_info" column="spec_info"/>
|
||||||
@ -680,7 +680,7 @@
|
|||||||
oit.item_name,
|
oit.item_name,
|
||||||
oit.order_item_quantity,
|
oit.order_item_quantity,
|
||||||
oit.item_unit_price,
|
oit.item_unit_price,
|
||||||
oit.item_cost_price,
|
oit.order_item_amount,
|
||||||
spi.item_barcode,
|
spi.item_barcode,
|
||||||
oit.order_item_image,
|
oit.order_item_image,
|
||||||
oit.spec_info,
|
oit.spec_info,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user