Browse Source

转换编码

v1.0
15989082884@163.com 2 years ago
parent
commit
b629a3455e
  1. 29
      src/main/java/com/qs/serve/modules/third/PortalGoodsController.java

29
src/main/java/com/qs/serve/modules/third/PortalGoodsController.java

@ -45,19 +45,20 @@ public class PortalGoodsController {
*/
@PostMapping("getSpuBySku")
public List<OmsSpuToSkuKey> getSpuBySku(@RequestBody SkuToGetSpuParam param){
LambdaQueryWrapper<SysDictData> lqw = new LambdaQueryWrapper<>();
lqw.eq(SysDictData::getGroupKey,"book-code-to-belong");
List<SysDictData> sysDictDataList = dictDataService.list(lqw);
String placeName = null;
for (SysDictData dictData : sysDictDataList) {
if(dictData.getKeyVal().equals(param.getPlaceName())){
placeName = dictData.getLabel();
}
}
if(placeName==null){
log.warn("字典缺账套{}配置",param.getPlaceName());
Assert.throwEx("缺账套["+param.getPlaceName()+"]配置");
}
// LambdaQueryWrapper<SysDictData> lqw = new LambdaQueryWrapper<>();
// lqw.eq(SysDictData::getGroupKey,"book-code-to-belong");
// List<SysDictData> sysDictDataList = dictDataService.list(lqw);
// String placeName = null;
// for (SysDictData dictData : sysDictDataList) {
// if(dictData.getKeyVal().equals(param.getPlaceName())){
// placeName = dictData.getLabel();
// }
// }
// if(placeName==null){
// log.warn("字典缺账套{}配置",param.getPlaceName());
// Assert.throwEx("缺账套["+param.getPlaceName()+"]配置");
// }
String placeName = param.getPlaceName();
List<GoodsSku> skuList = goodsSkuService.getByCodes(param.getInvCodes());
List<OmsSpuToSkuKey> specialSkuKey = new ArrayList<>();
@ -73,7 +74,7 @@ public class PortalGoodsController {
spuLqw.eq(GoodsSpu::getShelf,1);
spuLqw.in(GoodsSpu::getId,spuIds);
List<GoodsSpu> spuList = goodsSpuService.list(spuLqw);
spuIds = spuList.stream().map(a->a.getId).collect(Collectors.toList());
spuIds = spuList.stream().map(a->a.getId()).collect(Collectors.toList());
if(spuIds.size()==0){
spuIds.add(0L);

Loading…
Cancel
Save