修复物流查询、sku修改之后清除问题
This commit is contained in:
@ -435,8 +435,8 @@ public class StoreOrderController {
|
|||||||
//顺丰轨迹查询处理
|
//顺丰轨迹查询处理
|
||||||
String lastFourNumber = "";
|
String lastFourNumber = "";
|
||||||
if (expressInfoDo.getShipperCode().equals(ShipperCodeEnum.SF.getValue())) {
|
if (expressInfoDo.getShipperCode().equals(ShipperCodeEnum.SF.getValue())) {
|
||||||
YxStoreOrderDto yxStoreOrderDto;
|
YxStoreOrderQueryVo yxStoreOrderDto;
|
||||||
yxStoreOrderDto = storeOrderService.getOrderDetail(Long.valueOf(expressInfoDo.getOrderCode()));
|
yxStoreOrderDto = storeOrderService.getOrderInfo(expressInfoDo.getOrderCode(),null);
|
||||||
lastFourNumber = yxStoreOrderDto.getUserPhone();
|
lastFourNumber = yxStoreOrderDto.getUserPhone();
|
||||||
if (lastFourNumber.length() == 11) {
|
if (lastFourNumber.length() == 11) {
|
||||||
lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
|
lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
|
||||||
|
@ -29,6 +29,7 @@ import co.yixiang.modules.product.service.dto.ProductFormatDto;
|
|||||||
import co.yixiang.modules.product.service.mapper.StoreProductAttrMapper;
|
import co.yixiang.modules.product.service.mapper.StoreProductAttrMapper;
|
||||||
import co.yixiang.modules.product.service.mapper.StoreProductAttrValueMapper;
|
import co.yixiang.modules.product.service.mapper.StoreProductAttrValueMapper;
|
||||||
import co.yixiang.modules.product.vo.YxStoreProductAttrQueryVo;
|
import co.yixiang.modules.product.vo.YxStoreProductAttrQueryVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -42,6 +43,7 @@ import java.util.Collections;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -102,13 +104,23 @@ public class YxStoreProductAttrServiceImpl extends BaseServiceImpl<StoreProductA
|
|||||||
List<String> stringList = new ArrayList<>(productFormatDto.getDetail().values());
|
List<String> stringList = new ArrayList<>(productFormatDto.getDetail().values());
|
||||||
Collections.sort(stringList);
|
Collections.sort(stringList);
|
||||||
|
|
||||||
|
YxStoreProductAttrValue oldAttrValue = storeProductAttrValueService.getOne(new LambdaQueryWrapper<YxStoreProductAttrValue>()
|
||||||
|
.eq(YxStoreProductAttrValue::getSku, productFormatDto.getSku())
|
||||||
|
.eq(YxStoreProductAttrValue::getProductId, productId));
|
||||||
|
|
||||||
|
String unique = IdUtil.simpleUUID();
|
||||||
|
if (Objects.nonNull(oldAttrValue)) {
|
||||||
|
unique = oldAttrValue.getUnique();
|
||||||
|
}
|
||||||
|
|
||||||
YxStoreProductAttrValue yxStoreProductAttrValue = YxStoreProductAttrValue.builder()
|
YxStoreProductAttrValue yxStoreProductAttrValue = YxStoreProductAttrValue.builder()
|
||||||
|
.id(Objects.isNull(oldAttrValue) ? null : oldAttrValue.getId())
|
||||||
.productId(productId)
|
.productId(productId)
|
||||||
.sku(StrUtil.join(",",stringList))
|
.sku(StrUtil.join(",",stringList))
|
||||||
.price(BigDecimal.valueOf(productFormatDto.getPrice()))
|
.price(BigDecimal.valueOf(productFormatDto.getPrice()))
|
||||||
.cost(BigDecimal.valueOf(productFormatDto.getCost()))
|
.cost(BigDecimal.valueOf(productFormatDto.getCost()))
|
||||||
.otPrice(BigDecimal.valueOf(productFormatDto.getOtPrice()))
|
.otPrice(BigDecimal.valueOf(productFormatDto.getOtPrice()))
|
||||||
.unique(IdUtil.simpleUUID())
|
.unique(unique)
|
||||||
.image(productFormatDto.getPic())
|
.image(productFormatDto.getPic())
|
||||||
.barCode(productFormatDto.getBarCode())
|
.barCode(productFormatDto.getBarCode())
|
||||||
.weight(BigDecimal.valueOf(productFormatDto.getWeight()))
|
.weight(BigDecimal.valueOf(productFormatDto.getWeight()))
|
||||||
|
Reference in New Issue
Block a user