|
@ -49,7 +49,7 @@ import java.util.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 商品 spu |
|
|
* 商品SPU 查询相关接口 |
|
|
* @author YenHex |
|
|
* @author YenHex |
|
|
* @since 2022-10-09 |
|
|
* @since 2022-10-09 |
|
|
*/ |
|
|
*/ |
|
@ -303,7 +303,7 @@ public class GoodsSpuController { |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("listLast2Month") |
|
|
@PostMapping("listLast2Month") |
|
|
public R<List<GoodsSpu>> listLast2Month(@RequestBody @Valid GoodsHisOrderQuery query){ |
|
|
public R<List<GoodsSpu>> listLast2Month(@RequestBody @Valid GoodsHisOrderQuery query){ |
|
|
LocalDate date = LocalDate.now().plusMonths(-2); |
|
|
LocalDate date = LocalDate.now().plusMonths(-3); |
|
|
List<String> invCodes = dispatchDataMapper.selectLast2MonthInvCode(date,query.getSupplierCode()); |
|
|
List<String> invCodes = dispatchDataMapper.selectLast2MonthInvCode(date,query.getSupplierCode()); |
|
|
if(CollectionUtil.isNotEmpty(invCodes)){ |
|
|
if(CollectionUtil.isNotEmpty(invCodes)){ |
|
|
LambdaQueryWrapper<GoodsSku> skuLqw = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<GoodsSku> skuLqw = new LambdaQueryWrapper<>(); |
|
@ -329,9 +329,9 @@ public class GoodsSpuController { |
|
|
spuLqw.eq(GoodsSpu::getOrderFlag,1); |
|
|
spuLqw.eq(GoodsSpu::getOrderFlag,1); |
|
|
if(CollectionUtil.isNotEmpty(query.getCateIds())){ |
|
|
if(CollectionUtil.isNotEmpty(query.getCateIds())){ |
|
|
spuLqw.and(an->{ |
|
|
spuLqw.and(an->{ |
|
|
an.notIn(GoodsSpu::getCategoryFirst,query.getCateIds()) |
|
|
an.in(GoodsSpu::getCategoryFirst,query.getCateIds()) |
|
|
.or().notIn(GoodsSpu::getCategorySecond,query.getCateIds()) |
|
|
.or().in(GoodsSpu::getCategorySecond,query.getCateIds()) |
|
|
.or().notIn(GoodsSpu::getCategoryThird,query.getCateIds()); |
|
|
.or().in(GoodsSpu::getCategoryThird,query.getCateIds()); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -438,6 +438,16 @@ public class GoodsSpuController { |
|
|
return R.ok(goodsSpu); |
|
|
return R.ok(goodsSpu); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 导出 |
|
|
|
|
|
* @param param |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("/export") |
|
|
|
|
|
public R<List<GoodsSpuExportVo>> export4Post(@RequestBody GoodsSpu param){ |
|
|
|
|
|
return this.export(param); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 导出 |
|
|
* 导出 |
|
|
* @param param |
|
|
* @param param |
|
@ -450,17 +460,25 @@ public class GoodsSpuController { |
|
|
} |
|
|
} |
|
|
List<GoodsSpu> list = goodsSpuService.selectSpuList(param); |
|
|
List<GoodsSpu> list = goodsSpuService.selectSpuList(param); |
|
|
List<GoodsSpuExportVo> exportVoList = list.stream().map(a->{ |
|
|
List<GoodsSpuExportVo> exportVoList = list.stream().map(a->{ |
|
|
GoodsSpuExportVo vo = new GoodsSpuExportVo(); |
|
|
GoodsSpuExportVo vo = CopierUtil.copy(a,new GoodsSpuExportVo()); |
|
|
vo.setId(a.getId()); |
|
|
// vo.setId(a.getId());
|
|
|
vo.setSpuCode(a.getSpuCode()); |
|
|
// vo.setSpuCode(a.getSpuCode());
|
|
|
vo.setName(a.getName()); |
|
|
// vo.setName(a.getName());
|
|
|
vo.setShelf(a.getShelf()); |
|
|
// vo.setShelf(a.getShelf());
|
|
|
vo.setOrderFlag(a.getOrderFlag()); |
|
|
// vo.setOrderFlag(a.getOrderFlag());
|
|
|
vo.setCostFlag(a.getCostFlag()); |
|
|
// vo.setCostFlag(a.getCostFlag());
|
|
|
vo.setGoodsSaleType(a.getGoodsSaleType()); |
|
|
// vo.setGoodsSaleType(a.getGoodsSaleType());
|
|
|
vo.setSpuCunhuoFlag(a.getSpuCunhuoFlag()); |
|
|
// vo.setSpuCunhuoFlag(a.getSpuCunhuoFlag());
|
|
|
vo.setCateCode(a.getCateThirdCode()); |
|
|
vo.setCateCode(a.getCateThirdCode()); |
|
|
vo.setCateName(a.getCateThirdLabel()); |
|
|
vo.setCateName(a.getCateThirdLabel()); |
|
|
|
|
|
// vo.setSaleNum(a.getSaleNum());
|
|
|
|
|
|
// vo.setTasteValue(a.getTasteValue());
|
|
|
|
|
|
// vo.setSkuNumVal(a.getSkuNumVal());
|
|
|
|
|
|
// vo.setBookBelong(a.getBookBelong());
|
|
|
|
|
|
// vo.setBookName(a.getBookName());
|
|
|
|
|
|
// vo.setCateFirstLabel(a.getCateFirstLabel());
|
|
|
|
|
|
// vo.setCateSecondLabel(a.getCateSecondLabel());
|
|
|
|
|
|
// vo.setCateThirdLabel(a.getCateThirdLabel());
|
|
|
return vo; |
|
|
return vo; |
|
|
}).collect(Collectors.toList()); |
|
|
}).collect(Collectors.toList()); |
|
|
return R.ok(exportVoList); |
|
|
return R.ok(exportVoList); |
|
|