feat:接口调整
This commit is contained in:
@@ -76,5 +76,11 @@ public class StoreDao {
|
||||
return storeMapper.list();
|
||||
}
|
||||
|
||||
public List<StoreDO> getStoreNumByStoreCodes(List<String> storeCodeIds) {
|
||||
if(CollectionUtils.isEmpty(storeCodeIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return storeMapper.getStoreNumByStoreCodes(storeCodeIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,4 +43,6 @@ public interface StoreMapper {
|
||||
|
||||
List<StoreAreaDTO> getStoreAreaList( @Param("storeIds") List<String> storeIds);
|
||||
|
||||
List<StoreDO> getStoreNumByStoreCodes(@Param("storeCodeIds") List<String> storeCodeIds);
|
||||
|
||||
}
|
||||
|
||||
@@ -144,6 +144,15 @@
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getStoreNumByStoreCodes" resultMap="BaseResultMap">
|
||||
select *
|
||||
from store_${enterpriseId}
|
||||
where is_delete = 'effective'
|
||||
<if test="storeCodeIds != null">
|
||||
<foreach collection="storeCodeIds" item="item" separator="," open="and store_num in (" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/7/23 9:24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class StoreCodeDTO {
|
||||
|
||||
private List<String> storeCodeList;
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import com.cool.store.dto.store.StoreUserPositionDTO;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/5/13 9:56
|
||||
@@ -23,6 +25,6 @@ public interface StoreService {
|
||||
|
||||
PageInfo<MiniShopsResponse> getStoreListByMobile(String mobile,Integer pageNum,Integer pageSize,String storeName,String storeNum);
|
||||
|
||||
PageInfo<StoreUserPositionDTO> getStoreUser(Integer pageSize, Integer pageNum);
|
||||
List<StoreUserPositionDTO> getStoreUser(List<String> storeCodeList);
|
||||
|
||||
}
|
||||
|
||||
@@ -110,15 +110,13 @@ public class StoreServiceImpl implements StoreService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<StoreUserPositionDTO> getStoreUser(Integer pageSize, Integer pageNum) {
|
||||
if (pageSize>=100){
|
||||
public List<StoreUserPositionDTO> getStoreUser(List<String> storeCodeList) {
|
||||
if (CollectionUtils.isNotEmpty(storeCodeList)&&storeCodeList.size()>=100){
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE,"单次最多获取100条门店数据");
|
||||
}
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<StoreDO> list = storeDao.list();
|
||||
PageInfo info = new PageInfo<>(list);
|
||||
List<StoreDO> list = storeDao.getStoreNumByStoreCodes(storeCodeList);
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return info;
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<StoreUserPositionDTO> result = new ArrayList<>();
|
||||
list.forEach(x->{
|
||||
@@ -143,8 +141,7 @@ public class StoreServiceImpl implements StoreService {
|
||||
storeUserPositionDTO.setUserList(userList);
|
||||
result.add(storeUserPositionDTO);
|
||||
});
|
||||
info.setList(result);
|
||||
return info;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.*;
|
||||
import com.cool.store.dto.store.StoreUserPositionDTO;
|
||||
import com.cool.store.request.OpenApiStoreRequest;
|
||||
import com.cool.store.request.StoreCodeDTO;
|
||||
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
|
||||
import com.cool.store.request.xgj.ReceiptCallBackRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
@@ -20,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -74,8 +76,8 @@ public class OpenApiController {
|
||||
}
|
||||
@ApiOperation("获取门店人员信息")
|
||||
@PostMapping("/getStoreUser")
|
||||
public ApiResponse<PageInfo<StoreUserPositionDTO>> getStoreUser(@RequestBody @Validated OpenApiStoreRequest dto) {
|
||||
return ApiResponse.success(storeService.getStoreUser(dto.getPageSize(),dto.getPageNum()));
|
||||
public ApiResponse<List<StoreUserPositionDTO>> getStoreUser(@RequestBody @Validated StoreCodeDTO dto) {
|
||||
return ApiResponse.success(storeService.getStoreUser(dto.getStoreCodeList()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user