fix:所属大区新增品牌筛选
This commit is contained in:
@@ -3,6 +3,7 @@ package com.cool.store.dao;
|
|||||||
import com.cool.store.dto.region.BigRegionDTO;
|
import com.cool.store.dto.region.BigRegionDTO;
|
||||||
import com.cool.store.entity.BigRegionDO;
|
import com.cool.store.entity.BigRegionDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.FranchiseBrandEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.BigRegionMapper;
|
import com.cool.store.mapper.BigRegionMapper;
|
||||||
import com.cool.store.request.QueryBigRegionRequest;
|
import com.cool.store.request.QueryBigRegionRequest;
|
||||||
@@ -12,6 +13,7 @@ import tk.mybatis.mapper.entity.Example;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,8 +27,11 @@ public class BigRegionDAO {
|
|||||||
@Resource
|
@Resource
|
||||||
BigRegionMapper bigRegionMapper;
|
BigRegionMapper bigRegionMapper;
|
||||||
|
|
||||||
public List<BigRegionDTO> queryAllBigRegion(String keyword){
|
public List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand){
|
||||||
return bigRegionMapper.queryAllBigRegion(keyword);
|
if (Objects.isNull(joinBrand)) {
|
||||||
|
joinBrand = FranchiseBrandEnum.ZXJP.getCode();
|
||||||
|
}
|
||||||
|
return bigRegionMapper.queryAllBigRegion(keyword, joinBrand);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigRegionDO queryOrgInfoByBigRegionAndJoinMode(Long regionId, Integer joinMode){
|
public BigRegionDO queryOrgInfoByBigRegionAndJoinMode(Long regionId, Integer joinMode){
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public interface BigRegionMapper extends Mapper<BigRegionDO> {
|
|||||||
* @param keyword
|
* @param keyword
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BigRegionDTO> queryAllBigRegion(String keyword);
|
List<BigRegionDTO> queryAllBigRegion(@Param("keyword") String keyword, @Param("joinBrand") Integer joinBrand);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据所属大区与加盟模式查询新管家信息
|
* 根据所属大区与加盟模式查询新管家信息
|
||||||
|
|||||||
@@ -38,6 +38,9 @@
|
|||||||
<if test="keyword!=null and keyword !=''">
|
<if test="keyword!=null and keyword !=''">
|
||||||
and region_name like CONCAT('%',#{keyword},'%')
|
and region_name like CONCAT('%',#{keyword},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="joinBrand != null">
|
||||||
|
and join_brand = #{joinBrand}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ public class BigRegionDO {
|
|||||||
@Column(name = "hqt_region_name")
|
@Column(name = "hqt_region_name")
|
||||||
private String hqtRegionName;
|
private String hqtRegionName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加盟品牌
|
||||||
|
*/
|
||||||
|
@Column(name = "join_brand")
|
||||||
|
private Integer joinBrand;
|
||||||
|
|
||||||
public String getHqtRegionName() {
|
public String getHqtRegionName() {
|
||||||
return hqtRegionName;
|
return hqtRegionName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public interface BigRegionService {
|
|||||||
* @param keyword 关键字
|
* @param keyword 关键字
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BigRegionDTO> queryAllBigRegion(String keyword);
|
List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据门店所属大区和加盟模式查询新管家对应组织信息
|
* 根据门店所属大区和加盟模式查询新管家对应组织信息
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ public class BigRegionServiceImpl implements BigRegionService {
|
|||||||
BigRegionDAO bigRegionDAO;
|
BigRegionDAO bigRegionDAO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BigRegionDTO> queryAllBigRegion(String keyword){
|
public List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand){
|
||||||
return bigRegionDAO.queryAllBigRegion(keyword);
|
return bigRegionDAO.queryAllBigRegion(keyword, joinBrand);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1170,7 +1170,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
|||||||
shopInfoDO.setManagerRegionId(isCreateStoreDTO.getPid());
|
shopInfoDO.setManagerRegionId(isCreateStoreDTO.getPid());
|
||||||
updateList.add(shopInfoDO);
|
updateList.add(shopInfoDO);
|
||||||
}
|
}
|
||||||
List<BigRegionDTO> bigRegionDTOS = bigRegionDAO.queryAllBigRegion(null);
|
List<BigRegionDTO> bigRegionDTOS = bigRegionDAO.queryAllBigRegion(null, null);
|
||||||
Map<Long, BigRegionDTO> bigRegionDTOMap = bigRegionDTOS.stream().collect(Collectors.toMap(BigRegionDTO::getRegionId, x -> x));
|
Map<Long, BigRegionDTO> bigRegionDTOMap = bigRegionDTOS.stream().collect(Collectors.toMap(BigRegionDTO::getRegionId, x -> x));
|
||||||
//XX大区 正烧鸡
|
//XX大区 正烧鸡
|
||||||
List<Long> storeManageIds = bigRegionDTOS.stream().filter(x -> x.getStoreManageRegionId() != null).map(BigRegionDTO::getStoreManageRegionId).collect(Collectors.toList());
|
List<Long> storeManageIds = bigRegionDTOS.stream().filter(x -> x.getStoreManageRegionId() != null).map(BigRegionDTO::getStoreManageRegionId).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -28,8 +28,9 @@ public class BigRegionController {
|
|||||||
|
|
||||||
@PostMapping("/queryAllBigRegion")
|
@PostMapping("/queryAllBigRegion")
|
||||||
@ApiOperation("获取所有可选择的大区")
|
@ApiOperation("获取所有可选择的大区")
|
||||||
public ResponseResult<List<BigRegionDTO>> queryContentInfo(@RequestParam(required = false) String keyword) {
|
public ResponseResult<List<BigRegionDTO>> queryContentInfo(@RequestParam(required = false) String keyword,
|
||||||
return ResponseResult.success(bigRegionService.queryAllBigRegion(keyword));
|
@RequestParam(required = false) Integer joinBrand) {
|
||||||
|
return ResponseResult.success(bigRegionService.queryAllBigRegion(keyword, joinBrand));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/queryBigRegion")
|
@PostMapping("/queryBigRegion")
|
||||||
|
|||||||
Reference in New Issue
Block a user