fix printer bug

This commit is contained in:
Jack 2024-11-20 17:13:00 +08:00
parent 256c6efe5b
commit 8e00494264
6 changed files with 102 additions and 22 deletions

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2024. 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.common.constant;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
@Component
public class SFExpressConstant {
public int Cons_CreatedOrder = 1;
public int Cons_CanceledOrder = 2;
public int Cons_AcceptOrder = 10;
public int Cons_ArriveStore = 12;
public int Cons_Delivering = 15;
public int Cons_DeliverySuccess = 17;
public int Cons_WithDrawOrder = 22;
public int Cons_ReportException = 91;
public int Cons_CancelingOrder = 31;
public Map SF_Order_Status_Map = new HashMap<Integer,String>(){{
put(Cons_CreatedOrder,"订单创建");
put(Cons_CanceledOrder,"订单取消");
put(Cons_AcceptOrder,"配送员接单/配送员改派");
put(Cons_ArriveStore,"配送员到店");
put(Cons_Delivering,"配送员配送中(已取货)");
put(Cons_DeliverySuccess,"配送员妥投完单");
put(Cons_WithDrawOrder,"配送员撤单");
put(Cons_ReportException,"骑士上报异常");
put(Cons_CancelingOrder,"取消中");
}};
}

View File

@ -1,13 +0,0 @@
/*
* Copyright (c) 2024. 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.common.constant;
public class SFExpressError {
}

View File

@ -30,21 +30,21 @@ public class SFExpressController {
@ApiOperation(value = "顺丰同城店铺发单", notes = "顺丰同城店铺发单")
@RequestMapping(value = "/create-order", method = RequestMethod.POST)
public SFExpressApiRes createorder(@RequestParam(name = "shop_order_id", defaultValue = "DD-20241119-0001") String shopOrderId) {
public SFExpressApiRes createOrder(@RequestParam(name = "shop_order_id", defaultValue = "") String shopOrderId) {
return sfExpressApiService.createOrder(shopOrderId);
}
@ApiOperation(value = "顺丰同城店铺取消订单", notes = "顺丰同城店铺取消订单")
@RequestMapping(value = "/cancel-order", method = RequestMethod.POST)
public SFExpressApiRes cancelOrder(@RequestParam(name = "order_id", defaultValue = "JS4151806257378") String orderId) {
public SFExpressApiRes cancelOrder(@RequestParam(name = "order_id", defaultValue = "") String orderId) {
Map<String, Object> params = new HashMap<>();
params.put("order_id",orderId);
return sfExpressApiService.cancelOrder(params);
}
@ApiOperation(value = "顺丰同城店铺订单加小费", notes = "顺丰同城店铺订单加小费")
@RequestMapping(value = "/add-order-gratuityfee", method = RequestMethod.POST)
public SFExpressApiRes addordergratuityfee(@RequestParam(name = "order_id", defaultValue = "JS4151806257378") String orderId,
@RequestMapping(value = "/add-order-gratuity-fee", method = RequestMethod.POST)
public SFExpressApiRes addOrderGratuityFee(@RequestParam(name = "order_id", defaultValue = "") String orderId,
@RequestParam(name = "gratuity_fee", defaultValue = "DD-20241119-0001") Integer gratuityFee) {
Map<String, Object> params = new HashMap<>();
params.put("order_id",orderId);
@ -54,25 +54,36 @@ public class SFExpressController {
@ApiOperation(value = "顺丰同城店铺催单", notes = "顺丰同城店铺催单")
@RequestMapping(value = "/reminder-order", method = RequestMethod.POST)
public SFExpressApiRes reminderOrder(@RequestParam(name = "order_id", defaultValue = "JS4151806257378") String orderId) {
public SFExpressApiRes reminderOrder(@RequestParam(name = "order_id", defaultValue = "") String orderId) {
Map<String, Object> params = new HashMap<>();
params.put("order_id",orderId);
return sfExpressApiService.reminderOrder(params);
}
@ApiOperation(value = "订单状态流查询", notes = "订单状态流查询")
@RequestMapping(value = "/list-order-feed", method = RequestMethod.POST)
public SFExpressApiRes listOrderFeed(@RequestParam(name = "order_id", defaultValue = "") String orderId) {
Map<String, Object> params = new HashMap<>();
params.put("order_id",orderId);
return sfExpressApiService.listOrderFeed(params);
}
@ApiOperation(value = "获取配送员实时坐标接口", notes = "获取配送员实时坐标接口")
@RequestMapping(value = "/rider-latest-position", method = RequestMethod.POST)
public SFExpressApiRes riderLatestPosition(@RequestParam(name = "order_id", defaultValue = "JS4151806257378") String orderId) {
public SFExpressApiRes riderLatestPosition(@RequestParam(name = "order_id", defaultValue = "") String orderId) {
Map<String, Object> params = new HashMap<>();
params.put("order_id",orderId);
return sfExpressApiService.riderLatestPosition(params);
}
@ApiOperation(value = "获取配送员轨迹H5", notes = "获取配送员轨迹H5")
@RequestMapping(value = "/rider-viewv2", method = RequestMethod.POST)
public SFExpressApiRes riderViewV2(@RequestParam(name = "order_id", defaultValue = "JS4151806257378") String orderId) {
@RequestMapping(value = "/rider-view/v2", method = RequestMethod.POST)
public SFExpressApiRes riderViewV2(@RequestParam(name = "order_id", defaultValue = "") String orderId) {
Map<String, Object> params = new HashMap<>();
params.put("order_id",orderId);
return sfExpressApiService.riderViewV2(params);
}
}

View File

@ -58,6 +58,14 @@ public interface SFExpressApiService {
*/
SFExpressApiRes reminderOrder(Map<String, Object> params);
/**
* 订单状态流查询此接口可获取到指定订单操作记录当接收顺丰状态回调失败时可以主动查询此接口补齐订单操作与状态
* :支持查6个月内的数据
* @param params
* @return
*/
SFExpressApiRes listOrderFeed(Map<String, Object> params);
/**
* 获取配送员实时坐标接口此接口用于获取订单配送员的实时经纬度坐标一般情况下骑士经纬度30s更新一次
*
@ -82,7 +90,8 @@ public interface SFExpressApiService {
*/
SFExpressApiRes changeOrder(Map<String, Object> params);
// 顺丰同城回调相关业务
// *********** 顺丰同城回调相关业务 ****************
/**
* 接收顺丰原因订单取消回调

View File

@ -211,6 +211,36 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
return JsonUtil.json2object(retRespStr, SFExpressApiRes.class);
}
/**
* 订单状态流查询此接口可获取到指定订单操作记录当接收顺丰状态回调失败时可以主动查询此接口补齐订单操作与状态
* :支持查6个月内的数据
*
* @param params
* @return
*/
@Override
public SFExpressApiRes listOrderFeed(Map<String, Object> params) {
if (params == null || params.get("order_id") == null) {
return new SFExpressApiRes().fail(1003,"请求参数有误!");
}
params.putAll(buildCommonParams());
// 转换 json 字符串参数
String paramJSON = JsonUtil.toJSONString(params);
// 根据参数生成请求签名
String send_url = buildUrl("listorderfeed", paramJSON);
String retRespStr = HttpUtil.post(send_url, paramJSON);
if (StrUtil.isEmpty(retRespStr)) {
logger.error("顺丰同城:订单状态流查询异常,无返回值!");
return new SFExpressApiRes().fail(-1,"顺丰同城:无返回值!");
}
return JsonUtil.json2object(retRespStr, SFExpressApiRes.class);
}
/**
* 获取配送员实时坐标接口此接口用于获取订单配送员的实时经纬度坐标一般情况下骑士经纬度30s更新一次
*
@ -278,6 +308,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
return null;
}
/**
* 接收顺丰原因订单取消回调
*

View File

@ -204,6 +204,7 @@ public class ShopStorePrinterServiceImpl extends BaseServiceImpl<ShopStorePrinte
updateWrapper.set("model_id", record.getModel_id());
updateWrapper.set("region_id", record.getRegion_id());
updateWrapper.set("paper_with", record.getPaper_with());
updateWrapper.set("printer_key", record.getPrinter_key());
updateWrapper.set("website_url", record.getWebsite_url());
if (record.getStatus() == null) {
updateWrapper.set("status", ConstantError.Enable);