售后问题修改、快递鸟返回错误修改

This commit is contained in:
taozi
2023-04-08 21:43:39 +08:00
parent 631f584494
commit 874c3ccb47
5 changed files with 28 additions and 8 deletions

View File

@ -157,6 +157,8 @@ public interface ShopConstants {
String YSHOP_ORDER_CACHE_KEY = "yshop:order"; String YSHOP_ORDER_CACHE_KEY = "yshop:order";
String YSHOP_ORDER_SALE_STATUS_KEY = "yshop:order:sale:status";
long YSHOP_ORDER_CACHE_TIME = 600L; long YSHOP_ORDER_CACHE_TIME = 600L;
String WECHAT_MENUS = "wechat_menus"; String WECHAT_MENUS = "wechat_menus";

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.NumberUtil;
import co.yixiang.api.YshopException; import co.yixiang.api.YshopException;
import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.common.utils.QueryHelpPlus;
import co.yixiang.constant.ShopConstants;
import co.yixiang.dozer.service.IGenerator; import co.yixiang.dozer.service.IGenerator;
import co.yixiang.enums.AfterSalesStatusEnum; import co.yixiang.enums.AfterSalesStatusEnum;
import co.yixiang.enums.OrderInfoEnum; import co.yixiang.enums.OrderInfoEnum;
@ -28,6 +29,7 @@ import co.yixiang.modules.sales.service.mapper.StoreAfterSalesStatusMapper;
import co.yixiang.modules.sales.service.vo.StoreAfterSalesVo; import co.yixiang.modules.sales.service.vo.StoreAfterSalesVo;
import co.yixiang.modules.sales.service.vo.YxStoreOrderCartInfoVo; import co.yixiang.modules.sales.service.vo.YxStoreOrderCartInfoVo;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.RedisUtils;
import co.yixiang.utils.SecurityUtils; import co.yixiang.utils.SecurityUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -64,11 +66,14 @@ public class StoreAfterSalesServiceImpl extends BaseServiceImpl<StoreAfterSalesM
private final StoreAfterSalesItemMapper storeAfterSalesItemMapper; private final StoreAfterSalesItemMapper storeAfterSalesItemMapper;
private final StoreAfterSalesStatusMapper storeAfterSalesStatusMapper; private final StoreAfterSalesStatusMapper storeAfterSalesStatusMapper;
private final IGenerator generator; private final IGenerator generator;
private final RedisUtils redisUtils;
@Override @Override
public void applyForAfterSales(Long userId, String nickname, StoreAfterSalesParam storeAfterSalesParam) { public void applyForAfterSales(Long userId, String nickname, StoreAfterSalesParam storeAfterSalesParam) {
YxStoreOrder yxStoreOrder = storeOrderMapper.selectOne(Wrappers.<YxStoreOrder>lambdaQuery().eq(YxStoreOrder::getOrderId, storeAfterSalesParam.getOrderCode()).eq(YxStoreOrder::getUid, userId)); YxStoreOrder yxStoreOrder = storeOrderMapper.selectOne(Wrappers.<YxStoreOrder>lambdaQuery().eq(YxStoreOrder::getOrderId, storeAfterSalesParam.getOrderCode()).eq(YxStoreOrder::getUid, userId));
redisUtils.set(ShopConstants.YSHOP_ORDER_SALE_STATUS_KEY + userId + storeAfterSalesParam.getOrderCode(),
yxStoreOrder.getStatus());
checkOrder(yxStoreOrder); checkOrder(yxStoreOrder);
//商品除去优惠后的总价格 //商品除去优惠后的总价格
BigDecimal totalPrice = BigDecimal.ZERO; BigDecimal totalPrice = BigDecimal.ZERO;
@ -250,7 +255,8 @@ public class StoreAfterSalesServiceImpl extends BaseServiceImpl<StoreAfterSalesM
storeAfterSales.setSalesState(1); storeAfterSales.setSalesState(1);
YxStoreOrder yxStoreOrder = storeOrderMapper.selectOne(Wrappers.<YxStoreOrder>lambdaQuery().eq(YxStoreOrder::getOrderId, key)); YxStoreOrder yxStoreOrder = storeOrderMapper.selectOne(Wrappers.<YxStoreOrder>lambdaQuery().eq(YxStoreOrder::getOrderId, key));
yxStoreOrder.setStatus(OrderInfoEnum.STATUS_0.getValue()); Object o = redisUtils.get(ShopConstants.YSHOP_ORDER_SALE_STATUS_KEY + uid + key);
yxStoreOrder.setStatus(o == null ? 0 : Integer.parseInt(o.toString()));
yxStoreOrder.setRefundStatus(OrderInfoEnum.STATUS_0.getValue()); yxStoreOrder.setRefundStatus(OrderInfoEnum.STATUS_0.getValue());
storeOrderMapper.updateById(yxStoreOrder); storeOrderMapper.updateById(yxStoreOrder);
@ -270,6 +276,7 @@ public class StoreAfterSalesServiceImpl extends BaseServiceImpl<StoreAfterSalesM
storeAfterSalesStatus.setOperator("用户操作"); storeAfterSalesStatus.setOperator("用户操作");
storeAfterSalesStatusMapper.insert(storeAfterSalesStatus); storeAfterSalesStatusMapper.insert(storeAfterSalesStatus);
redisUtils.del(ShopConstants.YSHOP_ORDER_SALE_STATUS_KEY + uid + key);
return baseMapper.updateById(storeAfterSales) > 0; return baseMapper.updateById(storeAfterSales) > 0;
} }
@ -314,6 +321,8 @@ public class StoreAfterSalesServiceImpl extends BaseServiceImpl<StoreAfterSalesM
storeAfterSales.setConsignee(consignee); storeAfterSales.setConsignee(consignee);
storeAfterSales.setPhoneNumber(phoneNumber); storeAfterSales.setPhoneNumber(phoneNumber);
storeAfterSales.setAddress(address); storeAfterSales.setAddress(address);
}else {
this.makeMoney(storeAfterSales.getId(),storeAfterSales.getOrderCode());
} }
//操作记录 //操作记录
StoreAfterSalesStatus storeAfterSalesStatus = new StoreAfterSalesStatus(); StoreAfterSalesStatus storeAfterSalesStatus = new StoreAfterSalesStatus();

View File

@ -53,7 +53,7 @@ public class StoreAfterSalesVo {
private Integer salesState; private Integer salesState;
/** 添加时间 */ /** 添加时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp createTime; private Timestamp createTime;
@ -84,35 +84,35 @@ public class StoreAfterSalesVo {
/** /**
* 审核时间 * 审核时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp reviewTime; private Timestamp reviewTime;
/** /**
* 发货时间 * 发货时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp deliveryTime; private Timestamp deliveryTime;
/** /**
* 完成时间 * 完成时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp completeTime; private Timestamp completeTime;
/** /**
* 审核失败时间 * 审核失败时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp auditFailedTime; private Timestamp auditFailedTime;
/** /**
* 撤销时间 * 撤销时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp revocationTime; private Timestamp revocationTime;

View File

@ -61,7 +61,10 @@ public class StoreAfterSalesController {
Object salesCheck = storeAfterSalesService.salesCheck(salesCheckDto.getSalesId(), salesCheckDto.getOrderCode(), Object salesCheck = storeAfterSalesService.salesCheck(salesCheckDto.getSalesId(), salesCheckDto.getOrderCode(),
salesCheckDto.getApprovalStatus(), salesCheckDto.getConsignee(), salesCheckDto.getPhoneNumber(), salesCheckDto.getApprovalStatus(), salesCheckDto.getConsignee(), salesCheckDto.getPhoneNumber(),
salesCheckDto.getAddress()); salesCheckDto.getAddress());
StoreAfterSales storeAfterSales = storeAfterSalesService.makeMoney(salesCheckDto.getSalesId(), salesCheckDto.getOrderCode()); StoreAfterSales storeAfterSales = storeAfterSalesService.lambdaQuery()
.eq(StoreAfterSales::getOrderCode, salesCheckDto.getOrderCode())
.eq(StoreAfterSales::getId, salesCheckDto.getSalesId())
.one();
if (storeAfterSales.getServiceType() == 0) { if (storeAfterSales.getServiceType() == 0) {
BigDecimal bigDecimal = new BigDecimal("100"); BigDecimal bigDecimal = new BigDecimal("100");
int payPrice = bigDecimal.multiply(storeAfterSales.getRefundAmount()).intValue(); int payPrice = bigDecimal.multiply(storeAfterSales.getRefundAmount()).intValue();

View File

@ -9,7 +9,10 @@ import cn.hutool.http.HttpUtil;
import co.yixiang.enums.ShipperCodeEnum; import co.yixiang.enums.ShipperCodeEnum;
import co.yixiang.modules.tools.express.dao.ExpressInfo; import co.yixiang.modules.tools.express.dao.ExpressInfo;
import co.yixiang.modules.tools.express.config.ExpressProperties; import co.yixiang.modules.tools.express.config.ExpressProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.util.Base64Utils; import org.springframework.util.Base64Utils;
@ -67,6 +70,9 @@ public class ExpressService implements Serializable {
try { try {
String result = getOrderTracesByJson(OrderCode,ShipperCode, LogisticCode,lastFourNumber); String result = getOrderTracesByJson(OrderCode,ShipperCode, LogisticCode,lastFourNumber);
ObjectMapper objMap = new ObjectMapper(); ObjectMapper objMap = new ObjectMapper();
objMap.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objMap.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
objMap.setSerializationInclusion(JsonInclude.Include.NON_NULL);
ExpressInfo ei = objMap.readValue(result, ExpressInfo.class); ExpressInfo ei = objMap.readValue(result, ExpressInfo.class);
ei.setShipperName(getVendorName(ShipperCode)); ei.setShipperName(getVendorName(ShipperCode));
return ei; return ei;