master:条码一键迁移功能完善;
parent
b89f8e1a5e
commit
767e9d35c7
|
|
@ -34,4 +34,7 @@ public class UserLoginInfoVO extends UserInfoVO {
|
|||
@ApiModelProperty("当前档口状态[1:待审核 2:审核驳回 3:试用期 4:正式使用 5:强制清退 null:未认证]")
|
||||
private Integer currentStoreStatus;
|
||||
|
||||
@ApiModelProperty("库存系统 1步橘 2天友 3发货宝")
|
||||
private Integer stockSys;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@ import cn.hutool.core.bean.BeanUtil;
|
|||
import com.ruoyi.common.core.controller.XktBaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.web.controller.xkt.vo.storePordColor.StoreProdColorResVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storePordColor.StoreProdColorSnResVO;
|
||||
import com.ruoyi.xkt.service.IStoreProductColorService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -36,4 +34,10 @@ public class StoreProductColorController extends XktBaseController {
|
|||
return success(BeanUtil.copyToList(storeProdColorService.fuzzyQueryColorList(storeId, prodArtNum), StoreProdColorResVO.class));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据商品ID查询颜色及已设置颜色条码", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/sn/{storeId}/{storeProdId}")
|
||||
public R<List<StoreProdColorSnResVO>> queryColorAndSetSnList(@PathVariable("storeId") Long storeId, @PathVariable("storeProdId") Long storeProdId) {
|
||||
return success(BeanUtil.copyToList(storeProdColorService.queryColorAndSetSnList(storeId, storeProdId), StoreProdColorSnResVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storePordColor;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class StoreProdColorSnResVO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品当前颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer orderNum;
|
||||
@ApiModelProperty(value = "商品条码")
|
||||
private String sn;
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProdColorSize;
|
||||
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreUnsetSnDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -15,10 +17,28 @@ import java.util.List;
|
|||
@ApiModel
|
||||
public class StoreUnsetSnVO {
|
||||
|
||||
/**
|
||||
* 未设置条码商品列表
|
||||
*/
|
||||
@ApiModelProperty(value = "未设置条码商品列表")
|
||||
List<String> unsetSnList;
|
||||
List<SNSProdVO> unsetList;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class SNSProdVO {
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "商品颜色列表")
|
||||
private List<SNSProdColorVO> colorList;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class SNSProdColorVO {
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ruoyi.xkt.dto.storeProdColor;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Accessors(chain = true)
|
||||
public class StoreProdColorSnResDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品当前颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer orderNum;
|
||||
@ApiModelProperty(value = "商品条码")
|
||||
private String sn;
|
||||
|
||||
}
|
||||
|
|
@ -17,10 +17,27 @@ import java.util.List;
|
|||
@Accessors(chain = true)
|
||||
public class StoreUnsetSnDTO {
|
||||
|
||||
/**
|
||||
* 未设置条码商品列表
|
||||
*/
|
||||
@ApiModelProperty(value = "未设置条码商品列表")
|
||||
List<String> unsetSnList;
|
||||
List<SNSProdDTO> unsetList;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class SNSProdDTO {
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "商品颜色列表")
|
||||
private List<SNSProdColorDTO> colorList;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class SNSProdColorDTO {
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.xkt.service;
|
|||
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorSnResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPricePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
|
||||
|
|
@ -40,4 +41,12 @@ public interface IStoreProductColorService {
|
|||
*/
|
||||
Page<StoreProdColorPriceResDTO> page(StoreProdColorPricePageDTO pageDTO);
|
||||
|
||||
/**
|
||||
* 获取商品颜色及已设置颜色条码
|
||||
*
|
||||
* @param storeId 档口ID
|
||||
* @param storeProdId 档口商品ID
|
||||
* @return
|
||||
*/
|
||||
List<StoreProdColorSnResDTO> queryColorAndSetSnList(Long storeId, Long storeProdId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,22 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.xkt.domain.StoreProduct;
|
||||
import com.ruoyi.xkt.domain.StoreProductColor;
|
||||
import com.ruoyi.xkt.domain.StoreProductColorSize;
|
||||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorSnResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPricePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
import com.ruoyi.xkt.mapper.StoreProductColorMapper;
|
||||
import com.ruoyi.xkt.mapper.StoreProductColorSizeMapper;
|
||||
import com.ruoyi.xkt.mapper.StoreProductMapper;
|
||||
import com.ruoyi.xkt.service.IStoreProductColorService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -14,6 +24,9 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 档口当前商品颜色Service业务层处理
|
||||
|
|
@ -26,6 +39,8 @@ import java.util.List;
|
|||
public class StoreProductColorServiceImpl implements IStoreProductColorService {
|
||||
|
||||
final StoreProductColorMapper storeProdColorMapper;
|
||||
final StoreProductMapper storeProdMapper;
|
||||
final StoreProductColorSizeMapper prodColorSizeMapper;
|
||||
|
||||
/**
|
||||
* 根据商店ID和产品款式编号模糊查询颜色列表
|
||||
|
|
@ -61,5 +76,33 @@ public class StoreProductColorServiceImpl implements IStoreProductColorService {
|
|||
return CollectionUtils.isEmpty(list) ? Page.empty(pageDTO.getPageSize(), pageDTO.getPageNum()) : Page.convert(new PageInfo<>(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品颜色及已设置颜色条码
|
||||
*
|
||||
* @param storeId 档口ID
|
||||
* @param storeProdId 档口商品ID
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<StoreProdColorSnResDTO> queryColorAndSetSnList(Long storeId, Long storeProdId) {
|
||||
StoreProduct storeProd = Optional.ofNullable(this.storeProdMapper.selectById(storeProdId))
|
||||
.orElseThrow(() -> new ServiceException("该商品不存在", HttpStatus.ERROR));
|
||||
List<StoreProductColor> prodColorList = this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
|
||||
.eq(StoreProductColor::getStoreProdId, storeProdId).eq(StoreProductColor::getStoreId, storeId)
|
||||
.eq(StoreProductColor::getDelFlag, Constants.UNDELETED));
|
||||
// 已设置条码的颜色
|
||||
List<StoreProductColorSize> prodColorSizeList = this.prodColorSizeMapper.selectList(new LambdaQueryWrapper<StoreProductColorSize>()
|
||||
.eq(StoreProductColorSize::getStoreProdId, storeProdId).eq(StoreProductColorSize::getDelFlag, Constants.UNDELETED)
|
||||
.isNotNull(StoreProductColorSize::getOtherSnPrefix));
|
||||
// 颜色ID对应的其他系统商品颜色条码
|
||||
Map<Long, String> prodColorOtherSnMap = prodColorSizeList.stream().collect(Collectors
|
||||
.toMap(StoreProductColorSize::getStoreColorId, StoreProductColorSize::getOtherSnPrefix, (v1, v2) -> v2));
|
||||
return prodColorList.stream().map(x -> new StoreProdColorSnResDTO().setStoreProdColorId(x.getId()).setStoreId(storeId).setStoreProdId(storeProdId)
|
||||
.setStoreColorId(x.getStoreColorId()).setProdArtNum(storeProd.getProdArtNum()).setColorName(x.getColorName())
|
||||
.setOrderNum(x.getOrderNum()).setSn(prodColorOtherSnMap.getOrDefault(x.getStoreColorId(), "")))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ public class StoreProductColorSizeServiceImpl implements IStoreProductColorSizeS
|
|||
public StoreUnsetSnDTO getUnSetSnProdList(Long storeId) {
|
||||
List<StoreUnsetSnTempDTO> unsetList = this.prodColorSizeMapper.selectUnsetProdList(storeId);
|
||||
if (CollectionUtils.isEmpty(unsetList)) {
|
||||
return new StoreUnsetSnDTO().setUnsetSnList(Collections.emptyList());
|
||||
return new StoreUnsetSnDTO();
|
||||
}
|
||||
final List<Long> storeProdIdList = unsetList.stream().map(StoreUnsetSnTempDTO::getStoreProdId).collect(Collectors.toList());
|
||||
List<StoreProduct> storeProdList = this.storeProdMapper.selectByIds(storeProdIdList);
|
||||
|
|
@ -429,16 +429,16 @@ public class StoreProductColorSizeServiceImpl implements IStoreProductColorSizeS
|
|||
: storeProdList.stream().collect(Collectors.toMap(StoreProduct::getId, Function.identity()));
|
||||
final List<Long> storeColorIdList = unsetList.stream().map(StoreUnsetSnTempDTO::getStoreColorId).collect(Collectors.toList());
|
||||
List<StoreColor> storeColorList = this.storeColorMapper.selectByIds(storeColorIdList);
|
||||
Map<Long, String> storeColorMap = CollectionUtils.isEmpty(storeColorList) ? new HashMap<>()
|
||||
: storeColorList.stream().collect(Collectors.toMap(StoreColor::getId, StoreColor::getColorName));
|
||||
List<String> unsetSnList = new ArrayList<>();
|
||||
Map<Long, StoreColor> storeColorMap = CollectionUtils.isEmpty(storeColorList) ? new HashMap<>()
|
||||
: storeColorList.stream().collect(Collectors.toMap(StoreColor::getId, x -> x));
|
||||
List<StoreUnsetSnDTO.SNSProdDTO> unsetResList = new ArrayList<>();
|
||||
unsetList.stream().collect(Collectors.groupingBy(StoreUnsetSnTempDTO::getStoreProdId))
|
||||
.forEach((storeProdId, groupList) -> {
|
||||
String str = groupList.stream().map(x -> storeColorMap.get(x.getStoreColorId())).filter(Objects::nonNull).collect(Collectors.joining("、"));
|
||||
// 商品名称 + 颜色名称
|
||||
unsetSnList.add(storeProdMap.get(storeProdId).getProdArtNum() + ":" + str);
|
||||
});
|
||||
return new StoreUnsetSnDTO().setUnsetSnList(unsetSnList);
|
||||
.forEach((storeProdId, colorIdList) -> unsetResList.add(new StoreUnsetSnDTO.SNSProdDTO()
|
||||
.setStoreProdId(storeProdId).setProdArtNum(storeProdMap.get(storeProdId).getProdArtNum())
|
||||
.setColorList(colorIdList.stream().map(x -> storeColorMap.get(x.getStoreColorId()))
|
||||
.map(x -> new StoreUnsetSnDTO.SNSProdColorDTO().setStoreColorId(x.getId()).setColorName(x.getColorName()))
|
||||
.collect(Collectors.toList()))));
|
||||
return new StoreUnsetSnDTO().setUnsetList(unsetResList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue