Commit 7712ef74 authored by lanbaoming's avatar lanbaoming

Merge remote-tracking branch 'origin/dev' into dev

parents f8f2a345 ae5d23a5
......@@ -133,4 +133,31 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
"WHERE w.deleted = 0 AND w.`status` =0 AND trade_type =#{tradeType}"
})
List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(@Param("tradeType") Integer tradeType);
@ResultType(List.class)
@Select({
"<script>",
"SELECT w.*, ",
"r1.title_zh as guojiaName,",
"r2.title_zh as shiName ",
"FROM ecw_warehouse w ",
"LEFT JOIN ecw_region r1 ",
"ON w.guojia = r1.id ",
"LEFT JOIN ecw_region r2 ",
"ON w.shi = r2.id ",
"WHERE w.deleted = 0 AND w.`status` =0 AND trade_type =1 ",
"<when test = 'type == 1'>",
"GROUP BY r1.title_zh",
"</when>",
"<when test = 'type == 2'>",
"AND w.guojia=#{regionId}",
"GROUP BY w.shi",
"</when>",
"<when test = 'type == 3'>",
"AND w.shi=#{regionId}",
"GROUP BY w.title_zh",
"</when>",
"</script>"
})
List<WarehouseTreeRegionVO> getRegionList(@Param("type") Integer type, @Param("regionId") Integer regionId);
}
......@@ -170,4 +170,6 @@ public interface WarehouseService {
LogisticsInfoDto getStartInfoAndDestInfoByLineId(Long lineId);
List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(Integer tradeType);
List<WarehouseTreeRegionVO> getRegionList(Integer type, Integer regionId);
}
......@@ -495,21 +495,27 @@ public class WarehouseServiceImpl implements WarehouseService {
@Override
public List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(Integer tradeType) {
List<WarehouseTreeRegionVO> list =warehouseMapper.getWarehouseTreeRegionList(tradeType);
List<WarehouseTreeRegionVO> list = warehouseMapper.getWarehouseTreeRegionList(tradeType);
list.stream().forEach(s->s.getGuojiaName().replaceAll("\t",""));
Map<String,List<WarehouseTreeRegionVO>> map = (HashMap<String, List<WarehouseTreeRegionVO>>) list.stream()
list.stream().forEach(s -> s.getGuojiaName().replaceAll("\t", ""));
Map<String, List<WarehouseTreeRegionVO>> map = (HashMap<String, List<WarehouseTreeRegionVO>>) list.stream()
.collect(Collectors.groupingBy(WarehouseTreeRegionVO::getGuojiaName));
List<WarehouseTreeRegionVO> regionVOList = new ArrayList<>() ;
for (Map.Entry<String, List<WarehouseTreeRegionVO>> m:map.entrySet()){
WarehouseTreeRegionVO v = new WarehouseTreeRegionVO();
v.setGuojiaName(m.getKey());
v.setChildren(m.getValue());
v.setGuojia(m.getValue().get(0).getGuojia());
v.setId(m.getValue().get(0).getGuojia());
regionVOList.add(v);
}
List<WarehouseTreeRegionVO> regionVOList = new ArrayList<>();
for (Map.Entry<String, List<WarehouseTreeRegionVO>> m : map.entrySet()) {
WarehouseTreeRegionVO v = new WarehouseTreeRegionVO();
v.setGuojiaName(m.getKey());
v.setChildren(m.getValue());
v.setGuojia(m.getValue().get(0).getGuojia());
v.setId(m.getValue().get(0).getGuojia());
regionVOList.add(v);
}
return regionVOList;
}
@Override
public List<WarehouseTreeRegionVO> getRegionList(Integer type, Integer regionId) {
List<WarehouseTreeRegionVO> list = warehouseMapper.getRegionList(type,regionId);
return list;
}
}
......@@ -100,6 +100,12 @@ public class WarehouseController {
return success(list);
}
@GetMapping("/getRegionList")
public CommonResult<List<WarehouseTreeRegionVO>> getRegionList(@RequestParam(value = "type", required = false) Integer type,Integer regionId){
List<WarehouseTreeRegionVO> list = warehouseService.getRegionList(type,regionId);
return success(list);
}
@GetMapping("/page")
@ApiOperation("获得仓库分页")
// @PreAuthorize("@ss.hasPermission('ecw:warehouse:query')")
......
......@@ -3318,11 +3318,11 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
List<ProductDO> productList = Collections.singletonList(productDO);
//商品线路保存在redis。更新成功后移除
//batchSaveKeyInCache(productList, lineChannelList);
batchSaveKeyInCache(productList, lineChannelList);
createReqVO.setSync(true);
createReqVO.setBatch(false);
//batchUpdateAir(createReqVO, warehouseLineList, productList);
batchUpdateAir(createReqVO, warehouseLineList, productList);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment