20240115-ljl-multiPay
ljl 12 months ago
parent f51e8a5553
commit 804a410f0f

@ -0,0 +1,22 @@
package com.ms.api.dto.dsorder;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
@Data
public class AlibabaMessage {
private String msgType;
private JSONObject msgData;
public boolean isRefundAfterMsg() {
return "ORDER_BUYER_VIEW_ORDER_REFUND_AFTER_SALES".equals(msgType);
}
public boolean isRefundInMsg() {
return "ORDER_BUYER_VIEW_ORDER_BUYER_REFUND_IN_SALES".equals(msgType);
}
public boolean isRefundMsg() {
return isRefundAfterMsg() || isRefundInMsg();
}
}

@ -7,4 +7,5 @@ import lombok.EqualsAndHashCode;
@Data
public class PurchaseOrderChangeMessageDTO extends DsMessageDTO {
private PurchaseOrderDTO purchaseOrderInfo;
private AlibabaMessage alibabaMsg;
}

@ -1,6 +1,8 @@
package com.ms.biz.consts;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Refund1688Const {
@ -15,4 +17,175 @@ public class Refund1688Const {
public static final String REFUND_STATUS_WAIT_BUYER_SEND = "waitbuyersend";
public static final String REFUND_STATUS_WAIT_SELLER_RECEIVE = "waitsellerreceive";
/**
* 退
*/
public static final String ACTION_BUYER_APPLY_REFUND = "BUYER_APPLY_REFUND";
/**
*
*/
public static final String ACTION_BUYER_RECEIVE_CLOSE = "BUYER_RECEIVE_CLOSE";
/**
*
*/
public static final String ACTION_SELLER_SEND_GOODS_CLOSE = "SELLER_SEND_GOODS_CLOSE";
/**
* 退
*/
public static final String ACTION_BUYER_CANCEL_REFUND_CLOSE = "BUYER_CANCEL_REFUND_CLOSE";
/**
*
*/
public static final String ACTION_BUYER_UPLOAD_BILL = "BUYER_UPLOAD_BILL";
/**
*
*/
public static final String ACTION_SELLER_UPLOAD_BILL = "SELLER_UPLOAD_BILL";
/**
* 退
*/
public static final String ACTION_SELLER_REJECT_REFUND = "SELLER_REJECT_REFUND";
/**
* 退
*/
public static final String ACTION_SELLER_AGREE_REFUND = "SELLER_AGREE_REFUND";
/**
*
*/
public static final String ACTION_SELLER_RECEIVE_GOODS = "SELLER_RECEIVE_GOODS";
/**
*
*/
public static final String ACTION_BUYER_SEND_GOODS = "BUYER_SEND_GOODS";
/**
* 退
*/
public static final String ACTION_BUYER_MODIFY_REFUND_PROTOCOL = "BUYER_MODIFY_REFUND_PROTOCOL";
/**
*
*/
public static final String ACTION_BUYER_APPLY_SUPPORT = "BUYER_APPLY_SUPPORT";
/**
*
*/
public static final String ACTION_SELLER_APPLY_SUPPORT = "SELLER_APPLY_SUPPORT";
/**
* 退
*/
public static final String ACTION_SYSTEM_AGREE_REFUND_PROTOCOL = "SYSTEM_AGREE_REFUND_PROTOCOL";
/**
* 退退
*/
public static final String ACTION_SYSTEM_AGREE_REFUND = "SYSTEM_AGREE_REFUND";
/**
* 退退
*/
public static final String ACTION_SYSTEM_SEND_GOODS = "SYSTEM_SEND_GOODS";
/**
*
*/
public static final String ACTION_SYSTEM_MODIFY_REFUND_PROTOCOL = "SYSTEM_MODIFY_REFUND_PROTOCOL";
/**
*
*/
public static final String ACTION_SYSTEM_NOTIFY_APPLY_SUPPORT = "SYSTEM_NOTIFY_APPLY_SUPPORT";
/**
* 退
*/
public static final String ACTION_SELLER_AGREE_REFUND_PROCOTOL = "SELLER_AGREE_REFUND_PROCOTOL";
/**
* 退
*/
public static final String ACTION_SELLER_REJECT_REFUND_PROCOTOL = "SELLER_REJECT_REFUND_PROCOTOL";
/**
* ,,
*/
public static final String ACTION_CRM_APPLY_TIMEOUT_CLOSE = "CRM_APPLY_TIMEOUT_CLOSE";
/**
* CRM
*/
public static final String ACTION_CRM_APPLY_SUPPORT = "CRM_APPLY_SUPPORT";
/**
* CRM
*/
public static final String ACTION_CRM_INTERVENE_TASK = "CRM_INTERVENE_TASK";
/**
* CRM
*/
public static final String ACTION_CRM_DISMISS_TASK = "CRM_DISMISS_TASK";
/**
* CRM
*/
public static final String ACTION_CRM_FINISH_TASK = "CRM_FINISH_TASK";
/**
* 退
*/
public static final String ACTION_BUYER_STEP_PAY_ORDER_CLOSE = "BUYER_STEP_PAY_ORDER_CLOSE";
/**
* 退
*/
public static final String ACTION_BUYER_STEP_CONFIRM_CLOSE = "BUYER_STEP_CONFIRM_CLOSE";
/**
* 退
*/
public static final String ACTION_BUYER_CLOSE_TRADE_CLOSE = "BUYER_CLOSE_TRADE_CLOSE";
/**
* 退
*/
public static final String ACTION_SELLER_CONFIRM_ORDER_CLOSE = "SELLER_CONFIRM_ORDER_CLOSE";
/**
* 退
*/
public static final String ACTION_SELLER_STEP_PUSH_CLOSE = "SELLER_STEP_PUSH_CLOSE";
public static boolean isCloseAction(String refundAction) {
List<String> closeActions = Arrays.asList(
ACTION_BUYER_CANCEL_REFUND_CLOSE,
ACTION_CRM_APPLY_TIMEOUT_CLOSE,
ACTION_BUYER_STEP_PAY_ORDER_CLOSE,
ACTION_BUYER_STEP_CONFIRM_CLOSE,
ACTION_BUYER_CLOSE_TRADE_CLOSE,
ACTION_SELLER_CONFIRM_ORDER_CLOSE,
ACTION_SELLER_STEP_PUSH_CLOSE
);
return closeActions.contains(refundAction);
}
public static boolean isAgreeRefundAction(String refundAction) {
List<String> closeActions = Arrays.asList(
ACTION_SELLER_AGREE_REFUND,
ACTION_SYSTEM_AGREE_REFUND
);
return closeActions.contains(refundAction);
}
}

@ -0,0 +1,21 @@
package com.ms.biz.service;
import com.ms.dal.entity.RefundPurchaseOrder;
/**
*
*/
public interface RefundPurchaseOrderService {
int deleteByPrimaryKey(Long id);
int insert(RefundPurchaseOrder record);
int insertSelective(RefundPurchaseOrder record);
RefundPurchaseOrder selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(RefundPurchaseOrder record);
int updateByPrimaryKey(RefundPurchaseOrder record);
}

@ -0,0 +1,21 @@
package com.ms.biz.service;
import com.ms.dal.entity.RefundPurchaseOrderSku;
/**
*
*/
public interface RefundPurchaseOrderSkuService {
int deleteByPrimaryKey(Long id);
int insert(RefundPurchaseOrderSku record);
int insertSelective(RefundPurchaseOrderSku record);
RefundPurchaseOrderSku selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(RefundPurchaseOrderSku record);
int updateByPrimaryKey(RefundPurchaseOrderSku record);
}

@ -100,7 +100,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
for (DsSuccessRetDTO successRet: response.getSuccessList()) {
for (PurchaseOrderDTO purchaseOrderDTO: successRet.getRelatePurchaseOrderInfos()) {
String purOrderId = orderIdAndPurOrderIdMap.get(purchaseOrderDTO.getPlatformOrderId());
PurchaseOrder purchaseOrder = buildPurchaseOrderByDTO(purchaseOrderDTO, purOrderId);
PurchaseOrder purchaseOrder = buildPurchaseOrderByDTO(shopId, purchaseOrderDTO, purOrderId);
purchaseOrders.add(purchaseOrder);
List<PurchaseOrderItem> items = buildPurchaseOrderItemsByPurchaseOrderDTO(purchaseOrder, purchaseOrderDTO, purOrderId);
purchaseOrderItems.addAll(items);
@ -114,7 +114,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
purchaseOrderItemMapper.insertBatch(purchaseOrderItems);
}
private PurchaseOrder buildPurchaseOrderByDTO(PurchaseOrderDTO purchaseOrderDTO, String purOrderId) {
private PurchaseOrder buildPurchaseOrderByDTO(Long shopId, PurchaseOrderDTO purchaseOrderDTO, String purOrderId) {
Date purchaseOrderSendTime = null;
Date purchaseOrderStartTime = null;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -133,6 +133,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
PurchaseOrder purchaseOrder = new PurchaseOrder();
purchaseOrder.setPurchaseOrderId(Long.valueOf(purchaseOrderId));
purchaseOrder.setShopId(shopId);
purchaseOrder.setPurOrderId(purOrderId);
purchaseOrder.setOrderId(Long.valueOf(purchaseOrderDTO.getPlatformOrderId()));
purchaseOrder.setPurchasePlatform(purchaseOrderDTO.getPurchasePlatform());
@ -161,6 +162,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
PurchaseOrderItem item = new PurchaseOrderItem();
item.setPurOrderId(purOrderId);
item.setPurchaseOrderId(purchaseOrder.getPurchaseOrderId());
item.setShopId(purchaseOrder.getShopId());
item.setOrderId(Long.valueOf(purchaseOrderDTO.getPlatformOrderId()));
item.setPurchaseNum(itemDTO.getPurchaseNum());
item.setSkuId(itemDTO.getSkuId());

@ -17,6 +17,7 @@ import com.doudian.open.api.supplyCenter_order_syncSupplierInfo.param.SupplyCent
import com.doudian.open.api.supplyCenter_refund_operate.param.Address;
import com.doudian.open.api.supplyCenter_refund_operate.param.SkuRefundInfosItem;
import com.doudian.open.api.supplyCenter_refund_operate.param.SupplyCenterRefundOperateParam;
import com.doudian.open.utils.StringUtil;
import com.jinritemai.cloud.base.core.util.AuthThreadLocalUtil;
import com.ms.biz.consts.*;
import com.ms.biz.quque.Group;
@ -59,6 +60,8 @@ public class DsMessageServiceImpl implements DsMessageService {
private PurchaseOrderMapper purchaseOrderMapper;
private PurchaseOrderItemMapper purchaseOrderItemMapper;
private LogisticsMapper logisticsMapper;
private RefundPurchaseOrderMapper refundPurchaseOrderMapper;
private RefundPurchaseOrderSkuMapper refundPurchaseOrderSkuMapper;
@Override
public int deleteByPrimaryKey(Long id) {
@ -256,7 +259,9 @@ public class DsMessageServiceImpl implements DsMessageService {
String purchaseOrderStatus = purchaseOrderDTO.getPurchaseOrderStatus();
handlePurchaseOrderRefund(purchaseOrderDTO, purchaseOrder, skuIdAndPlatformPurchaseOrderSkuMap);
if (messageDTO.getAlibabaMsg() != null && messageDTO.getAlibabaMsg().isRefundMsg()) {
handlePurchaseOrderRefund(purchaseOrderDTO, purchaseOrder, messageDTO.getAlibabaMsg());
}
log.error("handleDsMessage purchaseOrderStatus: " + purchaseOrderStatus);
@ -377,10 +382,17 @@ public class DsMessageServiceImpl implements DsMessageService {
DDApi.supplyCenterOrderCancel(param);
}
private void handlePurchaseOrderRefund(PurchaseOrderDTO purchaseOrderDTO, PurchaseOrder purchaseOrder, Map<Long, PlatformPurchaseOrderSku> skuIdAndPlatformPurchaseOrderSkuMap) {
if (purchaseOrderDTO.getRefundInfo() == null || purchaseOrderDTO.getRefundInfo().isEmpty()) {
private void handlePurchaseOrderRefund(PurchaseOrderDTO purchaseOrderDTO, PurchaseOrder purchaseOrder, AlibabaMessage alibabaMessage) {
if (alibabaMessage == null || purchaseOrderDTO.getRefundInfo() == null || purchaseOrderDTO.getRefundInfo().isEmpty()) {
return;
}
String refundId = (String) alibabaMessage.getMsgData().get("refundId");
RefundInfoDTO refundInfo = purchaseOrderDTO.getRefundInfo().get(refundId);
if (refundInfo == null) {
throw new RuntimeException("未找到售后信息");
}
saveRefundPurchaseOrder(refundInfo, purchaseOrder);
Map<String, Long> subItemIdAndSkuIdMap = new HashMap<>();
for (PurchaseOrderItemDTO itemDTO: purchaseOrderDTO.getItems()) {
@ -394,71 +406,110 @@ public class DsMessageServiceImpl implements DsMessageService {
SupplyCenterRefundOperateParam param = new SupplyCenterRefundOperateParam();
param.setPurOrderId(purchaseOrder.getPurOrderId());
List<SkuRefundInfosItem> skuRefundInfosItems = new ArrayList<>();
for (Map.Entry<String, RefundInfoDTO> entry: purchaseOrderDTO.getRefundInfo().entrySet()) {
Set<String> subItemIds = entry.getValue().getOrderEntryCountMap().keySet();
for (String subItemId: subItemIds) {
if (!subItemIdAndSkuIdMap.containsKey(subItemId)) {
log.info("sku unFound, subItemId: " + subItemId + "subItemIdAndSkuIdMap: " + subItemIdAndSkuIdMap);
continue;
}
Long skuId = subItemIdAndSkuIdMap.get(subItemId);
if (!skuIdAndPurSkuOrderIdMap.containsKey(String.valueOf(skuId))) {
log.info("purSkuOrderId unFound skuId: " + skuId + "skuIdAndPurSkuOrderIdMap: " + skuIdAndPurSkuOrderIdMap);
continue;
}
String purSkuOrderId = skuIdAndPurSkuOrderIdMap.get(String.valueOf(skuId));
SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(purSkuOrderId, entry.getValue());
skuRefundInfosItems.add(skuRefundInfosItem);
Set<String> subItemIds = refundInfo.getOrderEntryCountMap().keySet();
for (String subItemId: subItemIds) {
if (!subItemIdAndSkuIdMap.containsKey(subItemId)) {
log.info("sku unFound, subItemId: " + subItemId + "subItemIdAndSkuIdMap: " + subItemIdAndSkuIdMap);
continue;
}
Long skuId = subItemIdAndSkuIdMap.get(subItemId);
if (!skuIdAndPurSkuOrderIdMap.containsKey(String.valueOf(skuId))) {
log.info("purSkuOrderId unFound skuId: " + skuId + "skuIdAndPurSkuOrderIdMap: " + skuIdAndPurSkuOrderIdMap);
continue;
}
String purSkuOrderId = skuIdAndPurSkuOrderIdMap.get(String.valueOf(skuId));
SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(purSkuOrderId, refundInfo, alibabaMessage);
skuRefundInfosItems.add(skuRefundInfosItem);
}
param.setSkuRefundInfos(skuRefundInfosItems);
DDApi.supplyCenterRefundOperate(param);
}
private SkuRefundInfosItem buildSkuRefundInfosItem(String purSkuOrderId, RefundInfoDTO refundInfo) {
Address address = new Address();
address.setUserName(refundInfo.getSellerRealName());
address.setDetail(refundInfo.getSellerReceiveAddress());
address.setMobile(refundInfo.getSellerMobile());
private void saveRefundPurchaseOrder(RefundInfoDTO refundInfo, PurchaseOrder purchaseOrder) {
RefundPurchaseOrder refundPurchaseOrder = refundPurchaseOrderMapper.getByRefundId(refundInfo.getRefundId());
if (refundPurchaseOrder == null) {
refundPurchaseOrder = new RefundPurchaseOrder();
refundPurchaseOrder.setGmtCreate(new Date());
}
refundPurchaseOrder.setOrderId(String.valueOf(purchaseOrder.getOrderId()));
refundPurchaseOrder.setPurOrderId(purchaseOrder.getPurOrderId());
refundPurchaseOrder.setRefundId(refundInfo.getRefundId());
refundPurchaseOrder.setOnlyRefund(refundInfo.getOnlyRefund());
refundPurchaseOrder.setRefundGoods(refundInfo.getRefundGoods());
refundPurchaseOrder.setRejectReason(refundInfo.getRejectReason() == null ? "" : refundInfo.getRejectReason());
refundPurchaseOrder.setGoodsReceived(refundInfo.getGoodsReceived() ? 1 : 0);
refundPurchaseOrder.setGoodsStatus(refundInfo.getGoodsStatus());
refundPurchaseOrder.setShopId(purchaseOrder.getShopId());
refundPurchaseOrder.setStatus(refundInfo.getStatus());
refundPurchaseOrder.setSellerMobile(refundInfo.getSellerMobile());
refundPurchaseOrder.setSellerTel(refundInfo.getSellerTel());
refundPurchaseOrder.setSellerRealName(refundInfo.getSellerRealName());
refundPurchaseOrder.setSellerReceiveAddress(refundInfo.getSellerReceiveAddress());
refundPurchaseOrder.setGmtTimeOut(refundInfo.getGmtTimeOut());
refundPurchaseOrder.setGmtModified(new Date());
if (refundPurchaseOrder.getRefundPurchaseOrderId() != null) {
refundPurchaseOrderMapper.insertSelective(refundPurchaseOrder);
} else {
refundPurchaseOrderMapper.updateByPrimaryKeySelective(refundPurchaseOrder);
}
}
private SkuRefundInfosItem buildSkuRefundInfosItem(String purSkuOrderId, RefundInfoDTO refundInfo, AlibabaMessage alibabaMessage) {
SkuRefundInfosItem skuRefundInfosItem = new SkuRefundInfosItem();
skuRefundInfosItem.setPurSkuOrderId(purSkuOrderId);
skuRefundInfosItem.setRejectReason(refundInfo.getRejectReason());
skuRefundInfosItem.setAddress(address);
if (StringUtil.isNotEmpty(refundInfo.getSellerRealName()) || StringUtil.isNotEmpty(refundInfo.getSellerMobile()) || StringUtil.isNotEmpty(refundInfo.getSellerReceiveAddress())) {
Address address = new Address();
address.setUserName(refundInfo.getSellerRealName());
address.setDetail(refundInfo.getSellerReceiveAddress());
address.setMobile(refundInfo.getSellerMobile());
skuRefundInfosItem.setAddress(address);
}
skuRefundInfosItem.setCloseReason("");
skuRefundInfosItem.setOperationType(getOperateType(refundInfo));
skuRefundInfosItem.setAftersaleType(getAftersaleType(refundInfo));
skuRefundInfosItem.setOperationType(getOperateType(refundInfo, alibabaMessage));
skuRefundInfosItem.setAftersaleType(getAftersaleType(refundInfo, alibabaMessage));
return skuRefundInfosItem;
}
private int getOperateType(RefundInfoDTO refundInfo) {
int operateType = 0;
if (refundInfo.getStatus().equals(Refund1688Const.REFUND_STATUS_WAIT_SELLER_AGREE)) {
operateType = 0;
} else if (refundInfo.getStatus().equals(Refund1688Const.REFUND_STATUS_WAIT_BUYER_SEND)) {
operateType = 2;
} else if (refundInfo.getStatus().equals(Refund1688Const.REFUND_STATUS_WAIT_SELLER_RECEIVE)) {
operateType = 2;
} else if (refundInfo.getOnlyRefund() == 1 && refundInfo.getStatus().equals(Refund1688Const.REFUND_STATUS_REFUND_SUCCESS)) {
operateType = 1;
} else if (refundInfo.getOnlyRefund() == 0 && refundInfo.getGoodsStatus() == 3 && refundInfo.getStatus().equals(Refund1688Const.REFUND_STATUS_REFUND_SUCCESS)) {
operateType = 6;
} else if (refundInfo.getOnlyRefund() == 0 && refundInfo.getGoodsStatus() == 3 && refundInfo.getStatus().equals(Refund1688Const.REFUND_STATUS_REFUND_CLOSE)) {
operateType = 7;
} else if (refundInfo.getOnlyRefund() == 1 && refundInfo.getStatus().equals(Refund1688Const.REFUND_STATUS_REFUND_CLOSE)) {
operateType = 3;
} else if (refundInfo.getStatus().equals(Refund1688Const.REFUND_STATUS_REFUND_CLOSE)) {
operateType = 5;
}
return operateType;
private int getOperateType(RefundInfoDTO refundInfo, AlibabaMessage alibabaMessage) {
JSONObject msgData = alibabaMessage.getMsgData();
String refundAction = (String) msgData.get("refundAction");
if (refundAction.equals(Refund1688Const.ACTION_BUYER_APPLY_REFUND)) {
return 0;
}
if (Refund1688Const.isCloseAction(refundAction)) {
return 5;
}
if (refundAction.equals(Refund1688Const.ACTION_SELLER_AGREE_REFUND_PROCOTOL)) {
return 2;
}
if (refundInfo.getGoodsStatus() == 3 && refundAction.equals(Refund1688Const.ACTION_SELLER_REJECT_REFUND)) {
return 7;
}
if (refundInfo.getGoodsStatus() == 3 && Refund1688Const.isAgreeRefundAction(refundAction)) {
return 4;
}
if (refundAction.equals(Refund1688Const.ACTION_BUYER_SEND_GOODS)) {
return 6;
}
if (Refund1688Const.isAgreeRefundAction(refundAction)) {
return 1;
}
if (refundAction.equals(Refund1688Const.ACTION_SELLER_REJECT_REFUND)) {
return 3;
}
}
private int getAftersaleType(RefundInfoDTO refundInfo) {
if (refundInfo.getOnlyRefund() == 1 && refundInfo.getGoodsReceived()) {
return 1;
} else if (refundInfo.getOnlyRefund() == 1) {
private int getAftersaleType(RefundInfoDTO refundInfo, AlibabaMessage alibabaMessage) {
if (alibabaMessage.isRefundInMsg() && refundInfo.getOnlyRefund() == 1) {
return 2;
}
if (alibabaMessage.isRefundAfterMsg() && refundInfo.getOnlyRefund() == 1) {
return 1;
}
return 3;
}

@ -0,0 +1,53 @@
package com.ms.biz.service.impl;
import com.ms.dal.entity.RefundPurchaseOrder;
import com.ms.dal.service.RefundPurchaseOrderService;
import com.ms.dal.mapper.RefundPurchaseOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
public class RefundPurchaseOrderServiceImpl implements RefundPurchaseOrderService{
@Autowired
private RefundPurchaseOrderMapper refundPurchaseOrderMapper;
@Override
public int deleteByPrimaryKey(Long id) {
return refundPurchaseOrderMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(RefundPurchaseOrder record) {
return refundPurchaseOrderMapper.insert(record);
}
@Override
public int insertSelective(RefundPurchaseOrder record) {
return refundPurchaseOrderMapper.insertSelective(record);
}
@Override
public RefundPurchaseOrder selectByPrimaryKey(Long id) {
return refundPurchaseOrderMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(RefundPurchaseOrder record) {
return refundPurchaseOrderMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(RefundPurchaseOrder record) {
return refundPurchaseOrderMapper.updateByPrimaryKey(record);
}
}

@ -0,0 +1,53 @@
package com.ms.biz.service.impl;
import com.ms.dal.entity.RefundPurchaseOrderSku;
import com.ms.dal.service.RefundPurchaseOrderSkuService;
import com.ms.dal.mapper.RefundPurchaseOrderSkuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
public class RefundPurchaseOrderSkuServiceImpl implements RefundPurchaseOrderSkuService{
@Autowired
private RefundPurchaseOrderSkuMapper refundPurchaseOrderSkuMapper;
@Override
public int deleteByPrimaryKey(Long id) {
return refundPurchaseOrderSkuMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(RefundPurchaseOrderSku record) {
return refundPurchaseOrderSkuMapper.insert(record);
}
@Override
public int insertSelective(RefundPurchaseOrderSku record) {
return refundPurchaseOrderSkuMapper.insertSelective(record);
}
@Override
public RefundPurchaseOrderSku selectByPrimaryKey(Long id) {
return refundPurchaseOrderSkuMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(RefundPurchaseOrderSku record) {
return refundPurchaseOrderSkuMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(RefundPurchaseOrderSku record) {
return refundPurchaseOrderSkuMapper.updateByPrimaryKey(record);
}
}

@ -18,6 +18,11 @@ public class PurchaseOrder implements Serializable {
*/
private Long purchaseOrderId;
/**
* ID
*/
private Long shopId;
/**
*
*/

@ -23,6 +23,11 @@ public class PurchaseOrderItem implements Serializable {
*/
private Long purchaseOrderId;
/**
* ID
*/
private Long shopId;
/**
*
*/

@ -0,0 +1,106 @@
package com.ms.dal.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 退
* @TableName refund_purchase_order
*/
@Data
public class RefundPurchaseOrder implements Serializable {
/**
*
*/
private Long refundPurchaseOrderId;
/**
* 退
*/
private String refundId;
/**
*
*/
private String purOrderId;
/**
* id
*/
private String orderId;
/**
* id
*/
private Long shopId;
/**
*
*/
private String rejectReason;
/**
* 退
*/
private Integer onlyRefund;
/**
* 退
*/
private Integer refundGoods;
/**
*
*/
private Integer goodsReceived;
/**
* 1 2 3退
*/
private Integer goodsStatus;
/**
*
*/
private String sellerMobile;
/**
*
*/
private String sellerTel;
/**
*
*/
private String sellerRealName;
/**
*
*/
private String sellerReceiveAddress;
/**
*
*/
private Date gmtTimeOut;
/**
*
*/
private String status;
/**
*
*/
private Date gmtCreate;
/**
*
*/
private Date gmtModified;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,66 @@
package com.ms.dal.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 退
* @TableName refund_purchase_order_sku
*/
@Data
public class RefundPurchaseOrderSku implements Serializable {
/**
*
*/
private Long refundPurchaseOrderSkuId;
/**
* 退
*/
private String refundId;
/**
* id
*/
private Long shopId;
/**
*
*/
private String purOrderId;
/**
*
*/
private String purSkuOrderId;
/**
* id
*/
private String orderId;
/**
* 1688
*/
private String subItemId;
/**
* sku
*/
private Integer num;
/**
*
*/
private Date gmtCreate;
/**
*
*/
private Date gmtModified;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,28 @@
package com.ms.dal.mapper;
import com.ms.dal.entity.RefundPurchaseOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Entity com.ms.dal.entity.RefundPurchaseOrder
*/
@Mapper
public interface RefundPurchaseOrderMapper {
int deleteByPrimaryKey(Long id);
int insert(RefundPurchaseOrder record);
int insertOrUpdate(RefundPurchaseOrder record);
int insertSelective(RefundPurchaseOrder record);
RefundPurchaseOrder selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(RefundPurchaseOrder record);
int updateByPrimaryKey(RefundPurchaseOrder record);
RefundPurchaseOrder getByRefundId(@Param("refundId") String refundId);
}

@ -0,0 +1,26 @@
package com.ms.dal.mapper;
import com.ms.dal.entity.RefundPurchaseOrderSku;
import org.apache.ibatis.annotations.Mapper;
/**
* @Entity com.ms.dal.entity.RefundPurchaseOrderSku
*/
@Mapper
public interface RefundPurchaseOrderSkuMapper {
int deleteByPrimaryKey(Long id);
int insert(RefundPurchaseOrderSku record);
int insertOrUpdate(RefundPurchaseOrderSku record);
int insertSelective(RefundPurchaseOrderSku record);
RefundPurchaseOrderSku selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(RefundPurchaseOrderSku record);
int updateByPrimaryKey(RefundPurchaseOrderSku record);
}

@ -7,6 +7,7 @@
<resultMap id="BaseResultMap" type="com.ms.dal.entity.PurchaseOrderItem">
<id property="purchaseOrderItemId" column="purchase_order_item_id" jdbcType="BIGINT"/>
<result property="purchaseOrderId" column="purchase_order_id" jdbcType="BIGINT"/>
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
<result property="purOrderId" column="pur_order_id" jdbcType="VARCHAR"/>
<result property="subItemId" column="sub_item_id" jdbcType="VARCHAR"/>
<result property="orderId" column="order_id" jdbcType="BIGINT"/>
@ -21,8 +22,8 @@
</resultMap>
<sql id="Base_Column_List">
purchase_order_item_id,purchase_order_id,pur_order_id,
sub_item_id,order_id,ware_id,sku_id,
purchase_order_item_id,purchase_order_id,shop_id,
pur_order_id,sub_item_id,order_id,ware_id,sku_id,
purchase_url,purchase_price,purchase_num,
status,gmt_create,gmt_modified
</sql>
@ -46,13 +47,13 @@
</delete>
<insert id="insert" keyColumn="purchase_order_item_id" keyProperty="purchaseOrderItemId" parameterType="com.ms.dal.entity.PurchaseOrderItem" useGeneratedKeys="true">
insert into purchase_order_item
( purchase_order_item_id,purchase_order_id,pur_order_id
,sub_item_id,order_id,ware_id,sku_id
( purchase_order_item_id,purchase_order_id,shop_id
,pur_order_id,sub_item_id,order_id,ware_id,sku_id
,purchase_url,purchase_price,purchase_num
,status,gmt_create,gmt_modified
)
values (#{purchaseOrderItemId,jdbcType=BIGINT},#{purchaseOrderId,jdbcType=BIGINT},#{purOrderId,jdbcType=VARCHAR}
,#{subItemId,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT},#{wareId,jdbcType=BIGINT},#{skuId,jdbcType=BIGINT}
values (#{purchaseOrderItemId,jdbcType=BIGINT},#{purchaseOrderId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT}
,#{purOrderId,jdbcType=VARCHAR},#{subItemId,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT},#{wareId,jdbcType=BIGINT},#{skuId,jdbcType=BIGINT}
,#{purchaseUrl,jdbcType=VARCHAR},#{purchasePrice,jdbcType=DECIMAL},#{purchaseNum,jdbcType=SMALLINT}
,#{status,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}
)
@ -63,6 +64,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderItemId != null">purchase_order_item_id,</if>
<if test="purchaseOrderId != null">purchase_order_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="purOrderId != null">pur_order_id,</if>
<if test="subItemId != null">sub_item_id,</if>
<if test="orderId != null">order_id,</if>
@ -78,6 +80,7 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderItemId != null">#{purchaseOrderItemId,jdbcType=BIGINT},</if>
<if test="purchaseOrderId != null">#{purchaseOrderId,jdbcType=BIGINT},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="purOrderId != null">#{purOrderId,jdbcType=VARCHAR},</if>
<if test="subItemId != null">#{subItemId,jdbcType=VARCHAR},</if>
<if test="orderId != null">#{orderId,jdbcType=BIGINT},</if>
@ -95,6 +98,9 @@
<if test="purchaseOrderId != null">
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="purOrderId != null">
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
</if>
@ -135,6 +141,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderItemId != null">purchase_order_item_id,</if>
<if test="purchaseOrderId != null">purchase_order_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="purOrderId != null">pur_order_id,</if>
<if test="subItemId != null">sub_item_id,</if>
<if test="orderId != null">order_id,</if>
@ -150,6 +157,7 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderItemId != null">#{purchaseOrderItemId,jdbcType=BIGINT},</if>
<if test="purchaseOrderId != null">#{purchaseOrderId,jdbcType=BIGINT},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="purOrderId != null">#{purOrderId,jdbcType=VARCHAR},</if>
<if test="subItemId != null">#{subItemId,jdbcType=VARCHAR},</if>
<if test="orderId != null">#{orderId,jdbcType=BIGINT},</if>
@ -169,6 +177,9 @@
<if test="purchaseOrderId != null">
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="purOrderId != null">
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
</if>
@ -209,6 +220,7 @@
update purchase_order_item
set
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT},
shop_id = #{shopId,jdbcType=BIGINT},
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
sub_item_id = #{subItemId,jdbcType=VARCHAR},
order_id = #{orderId,jdbcType=BIGINT},
@ -224,13 +236,14 @@
</update>
<insert id="insertBatch" keyColumn="purchase_order_item_id" keyProperty="purchaseOrderItemId" useGeneratedKeys="true">
insert into purchase_order_item
(purchase_order_item_id,purchase_order_id,sub_item_id
,order_id,pur_order_id,ware_id,sku_id,purchase_url
(purchase_order_item_id,purchase_order_id,shop_id
,sub_item_id,order_id,pur_order_id,ware_id,sku_id,purchase_url
,purchase_price,purchase_num,status
,gmt_create,gmt_modified)
values
<foreach item="item" collection="list" separator="," >
(#{item.purchaseOrderItemId,jdbcType=BIGINT},#{item.purchaseOrderId,jdbcType=BIGINT},#{item.subItemId,jdbcType=VARCHAR},#{item.orderId,jdbcType=BIGINT}
(#{item.purchaseOrderItemId,jdbcType=BIGINT},#{item.purchaseOrderId,jdbcType=BIGINT},#{item.shopId,jdbcType=BIGINT}
,#{item.subItemId,jdbcType=VARCHAR},#{item.orderId,jdbcType=BIGINT}
,#{item.purOrderId,jdbcType=VARCHAR},#{item.wareId,jdbcType=BIGINT},#{item.skuId,jdbcType=BIGINT},#{item.purchaseUrl,jdbcType=VARCHAR}
,#{item.purchasePrice,jdbcType=DECIMAL},#{item.purchaseNum,jdbcType=SMALLINT},#{item.status,jdbcType=VARCHAR}
,#{item.gmtCreate,jdbcType=TIMESTAMP},#{item.gmtModified,jdbcType=TIMESTAMP})

@ -6,6 +6,7 @@
<resultMap id="BaseResultMap" type="com.ms.dal.entity.PurchaseOrder">
<id property="purchaseOrderId" column="purchase_order_id" jdbcType="BIGINT"/>
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
<result property="purOrderId" column="pur_order_id" jdbcType="VARCHAR"/>
<result property="orderId" column="order_id" jdbcType="BIGINT"/>
<result property="purchasePlatform" column="purchase_platform" jdbcType="VARCHAR"/>
@ -28,7 +29,7 @@
</resultMap>
<sql id="Base_Column_List">
purchase_order_id,pur_order_id,order_id,
purchase_order_id,shop_id,pur_order_id,order_id,
purchase_platform,purchase_order_sn,purchase_order_buyer,
purchase_order_seller,purchase_order_payment,purchase_order_status,
purchase_order_logistics_name,purchase_order_waybill_code,purchase_order_send_time,
@ -62,14 +63,14 @@
</delete>
<insert id="insert" keyColumn="purchase_order_id" keyProperty="purchaseOrderId" parameterType="com.ms.dal.entity.PurchaseOrder" useGeneratedKeys="true">
insert into purchase_order
( purchase_order_id,pur_order_id,order_id
( purchase_order_id,shop_id,pur_order_id,order_id
,purchase_platform,purchase_order_sn,purchase_order_buyer
,purchase_order_seller,purchase_order_payment,purchase_order_status
,purchase_order_logistics_name,purchase_order_waybill_code,purchase_order_send_time
,purchase_order_fullname,purchase_order_mobile,purchase_order_full_address
,purchase_order_start_time,logistics_is_accept,status
,gmt_create,gmt_modified)
values (#{purchaseOrderId,jdbcType=BIGINT},#{purOrderId,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT}
values (#{purchaseOrderId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{purOrderId,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT}
,#{purchasePlatform,jdbcType=VARCHAR},#{purchaseOrderSn,jdbcType=VARCHAR},#{purchaseOrderBuyer,jdbcType=VARCHAR}
,#{purchaseOrderSeller,jdbcType=VARCHAR},#{purchaseOrderPayment,jdbcType=DECIMAL},#{purchaseOrderStatus,jdbcType=VARCHAR}
,#{purchaseOrderLogisticsName,jdbcType=VARCHAR},#{purchaseOrderWaybillCode,jdbcType=VARCHAR},#{purchaseOrderSendTime,jdbcType=TIMESTAMP}
@ -82,6 +83,7 @@
insert into purchase_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderId != null">purchase_order_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="purOrderId != null">pur_order_id,</if>
<if test="orderId != null">order_id,</if>
<if test="purchasePlatform != null">purchase_platform,</if>
@ -104,6 +106,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderId != null">#{purchaseOrderId,jdbcType=BIGINT},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="purOrderId != null">#{purOrderId,jdbcType=VARCHAR},</if>
<if test="orderId != null">#{orderId,jdbcType=BIGINT},</if>
<if test="purchasePlatform != null">#{purchasePlatform,jdbcType=VARCHAR},</if>
@ -189,6 +192,7 @@
insert into purchase_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderId != null">purchase_order_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="purOrderId != null">pur_order_id,</if>
<if test="orderId != null">order_id,</if>
<if test="purchasePlatform != null">purchase_platform,</if>
@ -211,6 +215,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderId != null">#{purchaseOrderId,jdbcType=BIGINT},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="purOrderId != null">#{purOrderId,jdbcType=VARCHAR},</if>
<if test="orderId != null">#{orderId,jdbcType=BIGINT},</if>
<if test="purchasePlatform != null">#{purchasePlatform,jdbcType=VARCHAR},</if>
@ -235,6 +240,9 @@
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.PurchaseOrder">
update purchase_order
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="purOrderId != null">
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
</if>
@ -298,6 +306,7 @@
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.PurchaseOrder">
update purchase_order
set
shop_id = #{shopId,jdbcType=BIGINT},
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
order_id = #{orderId,jdbcType=BIGINT},
purchase_platform = #{purchasePlatform,jdbcType=VARCHAR},
@ -321,7 +330,7 @@
</update>
<insert id="insertBatch" keyColumn="purchase_order_id" keyProperty="purchaseOrderId" useGeneratedKeys="true">
insert into purchase_order
(purchase_order_id,order_id,purchase_platform,pur_order_id
(purchase_order_id,shop_id,order_id,purchase_platform,pur_order_id
,purchase_order_sn,purchase_order_buyer,purchase_order_seller
,purchase_order_payment,purchase_order_status,purchase_order_logistics_name
,purchase_order_waybill_code,purchase_order_send_time,purchase_order_fullname
@ -330,7 +339,7 @@
,gmt_modified)
values
<foreach item="item" collection="list" separator="," >
(#{item.purchaseOrderId,jdbcType=BIGINT},#{item.orderId,jdbcType=BIGINT},#{item.purchasePlatform,jdbcType=VARCHAR},#{item.purOrderId,jdbcType=VARCHAR}
(#{item.purchaseOrderId,jdbcType=BIGINT},#{item.shopId,jdbcType=BIGINT},#{item.orderId,jdbcType=BIGINT},#{item.purchasePlatform,jdbcType=VARCHAR},#{item.purOrderId,jdbcType=VARCHAR}
,#{item.purchaseOrderSn,jdbcType=VARCHAR},#{item.purchaseOrderBuyer,jdbcType=VARCHAR},#{item.purchaseOrderSeller,jdbcType=VARCHAR}
,#{item.purchaseOrderPayment,jdbcType=DECIMAL},#{item.purchaseOrderStatus,jdbcType=VARCHAR},#{item.purchaseOrderLogisticsName,jdbcType=VARCHAR}
,#{item.purchaseOrderWaybillCode,jdbcType=VARCHAR},#{item.purchaseOrderSendTime,jdbcType=TIMESTAMP},#{item.purchaseOrderFullname,jdbcType=VARCHAR}

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ms.dal.mapper.RefundPurchaseOrderMapper">
<resultMap id="BaseResultMap" type="com.ms.dal.entity.RefundPurchaseOrder">
<id property="refundPurchaseOrderId" column="refund_purchase_order_id" jdbcType="BIGINT"/>
<result property="refundId" column="refund_id" jdbcType="VARCHAR"/>
<result property="purOrderId" column="pur_order_id" jdbcType="VARCHAR"/>
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
<result property="rejectReason" column="reject_reason" jdbcType="VARCHAR"/>
<result property="onlyRefund" column="only_refund" jdbcType="TINYINT"/>
<result property="refundGoods" column="refund_goods" jdbcType="TINYINT"/>
<result property="goodsReceived" column="goods_received" jdbcType="TINYINT"/>
<result property="goodsStatus" column="goods_status" jdbcType="TINYINT"/>
<result property="sellerMobile" column="seller_mobile" jdbcType="VARCHAR"/>
<result property="sellerTel" column="seller_tel" jdbcType="VARCHAR"/>
<result property="sellerRealName" column="seller_real_name" jdbcType="VARCHAR"/>
<result property="sellerReceiveAddress" column="seller_receive_address" jdbcType="VARCHAR"/>
<result property="gmtTimeOut" column="gmt_time_out" jdbcType="TIMESTAMP"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/>
<result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
refund_purchase_order_id,refund_id,pur_order_id,
order_id,shop_id,reject_reason,
only_refund,refund_goods,goods_received,
goods_status,seller_mobile,seller_tel,
seller_real_name,seller_receive_address,gmt_time_out,
status,gmt_create,gmt_modified
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from refund_purchase_order
where refund_purchase_order_id = #{refundPurchaseOrderId,jdbcType=BIGINT}
</select>
<select id="getByRefundId" resultType="com.ms.dal.entity.RefundPurchaseOrder">
select
<include refid="Base_Column_List" />
from refund_purchase_order
where refund_id = #{refundId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from refund_purchase_order
where refund_purchase_order_id = #{refundPurchaseOrderId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="refund_purchase_order_id" keyProperty="refundPurchaseOrderId" parameterType="com.ms.dal.entity.RefundPurchaseOrder" useGeneratedKeys="true">
insert into refund_purchase_order
( refund_purchase_order_id,refund_id,pur_order_id
,order_id,shop_id,reject_reason
,only_refund,refund_goods,goods_received
,goods_status,seller_mobile,seller_tel
,seller_real_name,seller_receive_address,gmt_time_out
,status,gmt_create,gmt_modified
)
values (#{refundPurchaseOrderId,jdbcType=BIGINT},#{refundId,jdbcType=VARCHAR},#{purOrderId,jdbcType=VARCHAR}
,#{orderId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT},#{rejectReason,jdbcType=VARCHAR}
,#{onlyRefund,jdbcType=TINYINT},#{refundGoods,jdbcType=TINYINT},#{goodsReceived,jdbcType=TINYINT}
,#{goodsStatus,jdbcType=TINYINT},#{sellerMobile,jdbcType=VARCHAR},#{sellerTel,jdbcType=VARCHAR}
,#{sellerRealName,jdbcType=VARCHAR},#{sellerReceiveAddress,jdbcType=VARCHAR},#{gmtTimeOut,jdbcType=TIMESTAMP}
,#{status,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}
)
</insert>
<update id="insertOrUpdate" keyColumn="refund_purchase_order_id" keyProperty="refundPurchaseOrderId" parameterType="com.ms.dal.entity.RefundPurchaseOrder"
useGeneratedKeys="true">
insert into refund_purchase_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundPurchaseOrderId != null">refund_purchase_order_id,</if>
<if test="refundId != null">refund_id,</if>
<if test="purOrderId != null">pur_order_id,</if>
<if test="orderId != null">order_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="rejectReason != null">reject_reason,</if>
<if test="onlyRefund != null">only_refund,</if>
<if test="refundGoods != null">refund_goods,</if>
<if test="goodsReceived != null">goods_received,</if>
<if test="goodsStatus != null">goods_status,</if>
<if test="sellerMobile != null">seller_mobile,</if>
<if test="sellerTel != null">seller_tel,</if>
<if test="sellerRealName != null">seller_real_name,</if>
<if test="sellerReceiveAddress != null">seller_receive_address,</if>
<if test="gmtTimeOut != null">gmt_time_out,</if>
<if test="status != null">status,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="refundPurchaseOrderId != null">#{refundPurchaseOrderId,jdbcType=BIGINT},</if>
<if test="refundId != null">#{refundId,jdbcType=VARCHAR},</if>
<if test="purOrderId != null">#{purOrderId,jdbcType=VARCHAR},</if>
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="rejectReason != null">#{rejectReason,jdbcType=VARCHAR},</if>
<if test="onlyRefund != null">#{onlyRefund,jdbcType=TINYINT},</if>
<if test="refundGoods != null">#{refundGoods,jdbcType=TINYINT},</if>
<if test="goodsReceived != null">#{goodsReceived,jdbcType=TINYINT},</if>
<if test="goodsStatus != null">#{goodsStatus,jdbcType=TINYINT},</if>
<if test="sellerMobile != null">#{sellerMobile,jdbcType=VARCHAR},</if>
<if test="sellerTel != null">#{sellerTel,jdbcType=VARCHAR},</if>
<if test="sellerRealName != null">#{sellerRealName,jdbcType=VARCHAR},</if>
<if test="sellerReceiveAddress != null">#{sellerReceiveAddress,jdbcType=VARCHAR},</if>
<if test="gmtTimeOut != null">#{gmtTimeOut,jdbcType=TIMESTAMP},</if>
<if test="status != null">#{status,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
ON DUPLICATE KEY UPDATE
<trim suffixOverrides=",">
<if test="refundId != null">
refund_id = #{refundId,jdbcType=VARCHAR},
</if>
<if test="purOrderId != null">
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
</if>
<if test="orderId != null">
order_id = #{orderId,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="rejectReason != null">
reject_reason = #{rejectReason,jdbcType=VARCHAR},
</if>
<if test="onlyRefund != null">
only_refund = #{onlyRefund,jdbcType=TINYINT},
</if>
<if test="refundGoods != null">
refund_goods = #{refundGoods,jdbcType=TINYINT},
</if>
<if test="goodsReceived != null">
goods_received = #{goodsReceived,jdbcType=TINYINT},
</if>
<if test="goodsStatus != null">
goods_status = #{goodsStatus,jdbcType=TINYINT},
</if>
<if test="sellerMobile != null">
seller_mobile = #{sellerMobile,jdbcType=VARCHAR},
</if>
<if test="sellerTel != null">
seller_tel = #{sellerTel,jdbcType=VARCHAR},
</if>
<if test="sellerRealName != null">
seller_real_name = #{sellerRealName,jdbcType=VARCHAR},
</if>
<if test="sellerReceiveAddress != null">
seller_receive_address = #{sellerReceiveAddress,jdbcType=VARCHAR},
</if>
<if test="gmtTimeOut != null">
gmt_time_out = #{gmtTimeOut,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</trim>
</update>
<insert id="insertSelective" keyColumn="refund_purchase_order_id" keyProperty="refundPurchaseOrderId" parameterType="com.ms.dal.entity.RefundPurchaseOrder" useGeneratedKeys="true">
insert into refund_purchase_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundPurchaseOrderId != null">refund_purchase_order_id,</if>
<if test="refundId != null">refund_id,</if>
<if test="purOrderId != null">pur_order_id,</if>
<if test="orderId != null">order_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="rejectReason != null">reject_reason,</if>
<if test="onlyRefund != null">only_refund,</if>
<if test="refundGoods != null">refund_goods,</if>
<if test="goodsReceived != null">goods_received,</if>
<if test="goodsStatus != null">goods_status,</if>
<if test="sellerMobile != null">seller_mobile,</if>
<if test="sellerTel != null">seller_tel,</if>
<if test="sellerRealName != null">seller_real_name,</if>
<if test="sellerReceiveAddress != null">seller_receive_address,</if>
<if test="gmtTimeOut != null">gmt_time_out,</if>
<if test="status != null">status,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="refundPurchaseOrderId != null">#{refundPurchaseOrderId,jdbcType=BIGINT},</if>
<if test="refundId != null">#{refundId,jdbcType=VARCHAR},</if>
<if test="purOrderId != null">#{purOrderId,jdbcType=VARCHAR},</if>
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="rejectReason != null">#{rejectReason,jdbcType=VARCHAR},</if>
<if test="onlyRefund != null">#{onlyRefund,jdbcType=TINYINT},</if>
<if test="refundGoods != null">#{refundGoods,jdbcType=TINYINT},</if>
<if test="goodsReceived != null">#{goodsReceived,jdbcType=TINYINT},</if>
<if test="goodsStatus != null">#{goodsStatus,jdbcType=TINYINT},</if>
<if test="sellerMobile != null">#{sellerMobile,jdbcType=VARCHAR},</if>
<if test="sellerTel != null">#{sellerTel,jdbcType=VARCHAR},</if>
<if test="sellerRealName != null">#{sellerRealName,jdbcType=VARCHAR},</if>
<if test="sellerReceiveAddress != null">#{sellerReceiveAddress,jdbcType=VARCHAR},</if>
<if test="gmtTimeOut != null">#{gmtTimeOut,jdbcType=TIMESTAMP},</if>
<if test="status != null">#{status,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.RefundPurchaseOrder">
update refund_purchase_order
<set>
<if test="refundId != null">
refund_id = #{refundId,jdbcType=VARCHAR},
</if>
<if test="purOrderId != null">
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
</if>
<if test="orderId != null">
order_id = #{orderId,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="rejectReason != null">
reject_reason = #{rejectReason,jdbcType=VARCHAR},
</if>
<if test="onlyRefund != null">
only_refund = #{onlyRefund,jdbcType=TINYINT},
</if>
<if test="refundGoods != null">
refund_goods = #{refundGoods,jdbcType=TINYINT},
</if>
<if test="goodsReceived != null">
goods_received = #{goodsReceived,jdbcType=TINYINT},
</if>
<if test="goodsStatus != null">
goods_status = #{goodsStatus,jdbcType=TINYINT},
</if>
<if test="sellerMobile != null">
seller_mobile = #{sellerMobile,jdbcType=VARCHAR},
</if>
<if test="sellerTel != null">
seller_tel = #{sellerTel,jdbcType=VARCHAR},
</if>
<if test="sellerRealName != null">
seller_real_name = #{sellerRealName,jdbcType=VARCHAR},
</if>
<if test="sellerReceiveAddress != null">
seller_receive_address = #{sellerReceiveAddress,jdbcType=VARCHAR},
</if>
<if test="gmtTimeOut != null">
gmt_time_out = #{gmtTimeOut,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</set>
where refund_purchase_order_id = #{refundPurchaseOrderId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.RefundPurchaseOrder">
update refund_purchase_order
set
refund_id = #{refundId,jdbcType=VARCHAR},
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
order_id = #{orderId,jdbcType=VARCHAR},
shop_id = #{shopId,jdbcType=BIGINT},
reject_reason = #{rejectReason,jdbcType=VARCHAR},
only_refund = #{onlyRefund,jdbcType=TINYINT},
refund_goods = #{refundGoods,jdbcType=TINYINT},
goods_received = #{goodsReceived,jdbcType=TINYINT},
goods_status = #{goodsStatus,jdbcType=TINYINT},
seller_mobile = #{sellerMobile,jdbcType=VARCHAR},
seller_tel = #{sellerTel,jdbcType=VARCHAR},
seller_real_name = #{sellerRealName,jdbcType=VARCHAR},
seller_receive_address = #{sellerReceiveAddress,jdbcType=VARCHAR},
gmt_time_out = #{gmtTimeOut,jdbcType=TIMESTAMP},
status = #{status,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where refund_purchase_order_id = #{refundPurchaseOrderId,jdbcType=BIGINT}
</update>
</mapper>

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ms.dal.mapper.RefundPurchaseOrderSkuMapper">
<resultMap id="BaseResultMap" type="com.ms.dal.entity.RefundPurchaseOrderSku">
<id property="refundPurchaseOrderSkuId" column="refund_purchase_order_sku_id" jdbcType="BIGINT"/>
<result property="refundId" column="refund_id" jdbcType="VARCHAR"/>
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
<result property="purOrderId" column="pur_order_id" jdbcType="VARCHAR"/>
<result property="purSkuOrderId" column="pur_sku_order_id" jdbcType="VARCHAR"/>
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
<result property="subItemId" column="sub_item_id" jdbcType="VARCHAR"/>
<result property="num" column="num" jdbcType="INTEGER"/>
<result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/>
<result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
refund_purchase_order_sku_id,refund_id,shop_id,
pur_order_id,pur_sku_order_id,order_id,
sub_item_id,num,gmt_create,
gmt_modified
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from refund_purchase_order_sku
where refund_purchase_order_sku_id = #{refundPurchaseOrderSkuId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from refund_purchase_order_sku
where refund_purchase_order_sku_id = #{refundPurchaseOrderSkuId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="refund_purchase_order_sku_id" keyProperty="refundPurchaseOrderSkuId" parameterType="com.ms.dal.entity.RefundPurchaseOrderSku" useGeneratedKeys="true">
insert into refund_purchase_order_sku
( refund_purchase_order_sku_id,refund_id,shop_id
,pur_order_id,pur_sku_order_id,order_id
,sub_item_id,num,gmt_create
,gmt_modified)
values (#{refundPurchaseOrderSkuId,jdbcType=BIGINT},#{refundId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT}
,#{purOrderId,jdbcType=VARCHAR},#{purSkuOrderId,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR}
,#{subItemId,jdbcType=VARCHAR},#{num,jdbcType=INTEGER},#{gmtCreate,jdbcType=TIMESTAMP}
,#{gmtModified,jdbcType=TIMESTAMP})
</insert>
<update id="insertOrUpdate" keyColumn="refund_purchase_order_sku_id" keyProperty="refundPurchaseOrderSkuId" parameterType="com.ms.dal.entity.RefundPurchaseOrderSku"
useGeneratedKeys="true">
insert into refund_purchase_order_sku
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundPurchaseOrderSkuId != null">refund_purchase_order_sku_id,</if>
<if test="refundId != null">refund_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="purOrderId != null">pur_order_id,</if>
<if test="purSkuOrderId != null">pur_sku_order_id,</if>
<if test="orderId != null">order_id,</if>
<if test="subItemId != null">sub_item_id,</if>
<if test="num != null">num,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="refundPurchaseOrderSkuId != null">#{refundPurchaseOrderSkuId,jdbcType=BIGINT},</if>
<if test="refundId != null">#{refundId,jdbcType=VARCHAR},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="purOrderId != null">#{purOrderId,jdbcType=VARCHAR},</if>
<if test="purSkuOrderId != null">#{purSkuOrderId,jdbcType=VARCHAR},</if>
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
<if test="subItemId != null">#{subItemId,jdbcType=VARCHAR},</if>
<if test="num != null">#{num,jdbcType=INTEGER},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
ON DUPLICATE KEY UPDATE
<trim suffixOverrides=",">
<if test="refundId != null">
refund_id = #{refundId,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="purOrderId != null">
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
</if>
<if test="purSkuOrderId != null">
pur_sku_order_id = #{purSkuOrderId,jdbcType=VARCHAR},
</if>
<if test="orderId != null">
order_id = #{orderId,jdbcType=VARCHAR},
</if>
<if test="subItemId != null">
sub_item_id = #{subItemId,jdbcType=VARCHAR},
</if>
<if test="num != null">
num = #{num,jdbcType=INTEGER},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</trim>
</update>
<insert id="insertSelective" keyColumn="refund_purchase_order_sku_id" keyProperty="refundPurchaseOrderSkuId" parameterType="com.ms.dal.entity.RefundPurchaseOrderSku" useGeneratedKeys="true">
insert into refund_purchase_order_sku
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundPurchaseOrderSkuId != null">refund_purchase_order_sku_id,</if>
<if test="refundId != null">refund_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="purOrderId != null">pur_order_id,</if>
<if test="purSkuOrderId != null">pur_sku_order_id,</if>
<if test="orderId != null">order_id,</if>
<if test="subItemId != null">sub_item_id,</if>
<if test="num != null">num,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="refundPurchaseOrderSkuId != null">#{refundPurchaseOrderSkuId,jdbcType=BIGINT},</if>
<if test="refundId != null">#{refundId,jdbcType=VARCHAR},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="purOrderId != null">#{purOrderId,jdbcType=VARCHAR},</if>
<if test="purSkuOrderId != null">#{purSkuOrderId,jdbcType=VARCHAR},</if>
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
<if test="subItemId != null">#{subItemId,jdbcType=VARCHAR},</if>
<if test="num != null">#{num,jdbcType=INTEGER},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.RefundPurchaseOrderSku">
update refund_purchase_order_sku
<set>
<if test="refundId != null">
refund_id = #{refundId,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="purOrderId != null">
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
</if>
<if test="purSkuOrderId != null">
pur_sku_order_id = #{purSkuOrderId,jdbcType=VARCHAR},
</if>
<if test="orderId != null">
order_id = #{orderId,jdbcType=VARCHAR},
</if>
<if test="subItemId != null">
sub_item_id = #{subItemId,jdbcType=VARCHAR},
</if>
<if test="num != null">
num = #{num,jdbcType=INTEGER},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</set>
where refund_purchase_order_sku_id = #{refundPurchaseOrderSkuId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.RefundPurchaseOrderSku">
update refund_purchase_order_sku
set
refund_id = #{refundId,jdbcType=VARCHAR},
shop_id = #{shopId,jdbcType=BIGINT},
pur_order_id = #{purOrderId,jdbcType=VARCHAR},
pur_sku_order_id = #{purSkuOrderId,jdbcType=VARCHAR},
order_id = #{orderId,jdbcType=VARCHAR},
sub_item_id = #{subItemId,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where refund_purchase_order_sku_id = #{refundPurchaseOrderSkuId,jdbcType=BIGINT}
</update>
</mapper>

@ -1,6 +1,7 @@
package com.ms.web.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.doudian.open.api.supplyCenter_cargo_detail.data.SupplyCenterCargoDetailData;
import com.doudian.open.api.supplyCenter_cargo_detail.param.SupplyCenterCargoDetailParam;
@ -11,6 +12,7 @@ import com.ms.api.dto.dsapi.response.CheckDsAppAuthExpireResponseDTO;
import com.ms.api.dto.dsapi.response.GetAuthInfoResponseDTO;
import com.ms.api.dto.dsapi.response.GetAuthShopMemberInfosResponseDTO;
import com.ms.api.dto.dsapi.response.GetSourceItemInfosResponseDTO;
import com.ms.api.dto.dsorder.AlibabaMessage;
import com.ms.biz.common.R;
import com.ms.biz.common.Ret;
import com.ms.api.dto.dsorder.DsMessageCallbackDTO;
@ -115,6 +117,10 @@ public class Test {
}
public static void main(String[] args) throws ParseException {
String dd = "{\"msgType\": \"ORDER_BUYER_VIEW_ORDER_BUYER_REFUND_IN_SALES\",\"msgData\":{\"buyerMemberId\":\"b2b-2216888144113f9b08\",\"currentStatus\":\"refundsuccess\",\"orderId\":3643602985932141341,\"refundAction\":\"SELLER_AGREE_REFUND\",\"sellerMemberId\":\"b2b-22103074731230f732\",\"msgSendTime\":\"2023-11-23 17:48:34\",\"operator\":\"system\",\"refundId\":\"TQ246736332522144113\"}}";
AlibabaMessage msg= JSONObject.parseObject(dd, AlibabaMessage.class);
System.out.println(msg.getMsgData().get("buyerMemberId"));
Long shopId = 111111111L;
String shopName = SecurityTool.MD5(shopId.toString());
assert shopName != null;
@ -136,8 +142,8 @@ public class Test {
System.out.println(JSON.parseObject(JSON.toJSONString(data)));
String str = "{\"data\":\"{\\\"activity_id\\\":\\\"0\\\",\\\"after\\\":\\\"false\\\",\\\"before\\\":\\\"true\\\",\\\"channel_id\\\":\\\"0\\\",\\\"channel_type\\\":0,\\\"process_time\\\":1699455945,\\\"product_id\\\":\\\"3649553844716833566\\\",\\\"shop_id\\\":\\\"121233657\\\",\\\"sku_id\\\":\\\"3384401776121602\\\"}\",\"tag\":\"420\",\"msg_id\":\"66533861744835594630:0:420:1699455945:2560971988:7264840234423027259\"}";
DoudianMessage msg = JSON.parseObject(str, DoudianMessage.class);
System.out.println(msg);
DoudianMessage msg1 = JSON.parseObject(str, DoudianMessage.class);
System.out.println(msg1);
System.out.println(Double.valueOf(CommonTool.doubleTrans(CommonTool.noZeros(2.00d))));
System.out.println("ni号顺11".length());

Loading…
Cancel
Save