|
@@ -3,6 +3,7 @@ package zs.payment.controller;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -10,9 +11,11 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import zs.payment.dao.OrderCallbackDao;
|
|
import zs.payment.dao.OrderCallbackDao;
|
|
|
import zs.payment.entity.OrderCallback;
|
|
import zs.payment.entity.OrderCallback;
|
|
|
|
|
+import zs.payment.enums.CallbackMessageType;
|
|
|
import zs.payment.req.*;
|
|
import zs.payment.req.*;
|
|
|
import zs.payment.entity.Orders;
|
|
import zs.payment.entity.Orders;
|
|
|
import zs.payment.req.aftersales.AfterSalesOrderReq;
|
|
import zs.payment.req.aftersales.AfterSalesOrderReq;
|
|
|
|
|
+import zs.payment.req.aftersales.AfterSalesOrderTypeReq;
|
|
|
import zs.payment.resp.Result;
|
|
import zs.payment.resp.Result;
|
|
|
import zs.payment.service.OrdersService;
|
|
import zs.payment.service.OrdersService;
|
|
|
import zs.payment.utils.HttpUtil;
|
|
import zs.payment.utils.HttpUtil;
|
|
@@ -345,7 +348,7 @@ public class YxSupplyChannelManualController {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/getAfterSalesTypeNameMap")
|
|
@PostMapping("/getAfterSalesTypeNameMap")
|
|
|
- public Result getAfterSalesTypeNameMap(@Valid @RequestBody AfterSalesOrderReq req){
|
|
|
|
|
|
|
+ public Result getAfterSalesTypeNameMap(@Valid @RequestBody AfterSalesOrderTypeReq req){
|
|
|
|
|
|
|
|
String token = redisUtils.get(SUPPLY_TOKEN);
|
|
String token = redisUtils.get(SUPPLY_TOKEN);
|
|
|
if (token == null || token.isEmpty()) {
|
|
if (token == null || token.isEmpty()) {
|
|
@@ -358,6 +361,7 @@ public class YxSupplyChannelManualController {
|
|
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("order_id", req.getOrderId());
|
|
params.put("order_id", req.getOrderId());
|
|
|
|
|
+ params.put("order_item_id",req.getOrderItemId());
|
|
|
|
|
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("x-token", token);
|
|
headers.put("x-token", token);
|
|
@@ -388,6 +392,23 @@ public class YxSupplyChannelManualController {
|
|
|
params.put("order_id", req.getOrderId());
|
|
params.put("order_id", req.getOrderId());
|
|
|
params.put("is_received",req.getIsReceived());
|
|
params.put("is_received",req.getIsReceived());
|
|
|
params.put("order_item_id",req.getOrderItemId());
|
|
params.put("order_item_id",req.getOrderItemId());
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(req.getAmount())){
|
|
|
|
|
+ //退款总额不为空
|
|
|
|
|
+ params.put("amount",req.getAmount());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(req.getRefundType())){
|
|
|
|
|
+ // 退款方式: "0": "退款", "1": "退货退款"
|
|
|
|
|
+ params.put("refund_type",req.getRefundType());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(req.getTechnicalServicesFee())){
|
|
|
|
|
+ //技术服务费
|
|
|
|
|
+ params.put("technical_services_fee",req.getTechnicalServicesFee());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(req.getFreight())){
|
|
|
|
|
+ //运费
|
|
|
|
|
+ params.put("freight",req.getFreight());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("x-token", token);
|
|
headers.put("x-token", token);
|
|
@@ -410,12 +431,20 @@ public class YxSupplyChannelManualController {
|
|
|
|
|
|
|
|
JSONObject reqJson = JSONObject.parseObject(JSONObject.toJSONString(req));
|
|
JSONObject reqJson = JSONObject.parseObject(JSONObject.toJSONString(req));
|
|
|
String messageType = reqJson.getString("message_type");
|
|
String messageType = reqJson.getString("message_type");
|
|
|
- //当 message_type == "goods.alter" 时跳过保存,其他类型才入库
|
|
|
|
|
- if (!"goods.alter".equals(messageType)) {
|
|
|
|
|
- OrderCallback callback = new OrderCallback();
|
|
|
|
|
- callback.setMessage(req);
|
|
|
|
|
- callbackDao.save(callback);
|
|
|
|
|
|
|
+ //当 message_type == 商品类的事件 时跳过保存,其他类型才入库
|
|
|
|
|
+ if (CallbackMessageType.GOODS_ALTER.equalsIgnoreCase(messageType) || CallbackMessageType.GOODS_UNDERCARRIAGE.equalsIgnoreCase(messageType)
|
|
|
|
|
+ || CallbackMessageType.GOODS_ON_SALE.equalsIgnoreCase(messageType) || CallbackMessageType.GOODS_DELETE.equalsIgnoreCase(messageType)) {
|
|
|
|
|
+ return result;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //售后通过
|
|
|
|
|
+ if (CallbackMessageType.AFTER_SALES_PASS.equalsIgnoreCase(messageType)) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ OrderCallback callback = new OrderCallback();
|
|
|
|
|
+ callback.setMessage(req);
|
|
|
|
|
+ callbackDao.save(callback);
|
|
|
|
|
+
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|