fix:新增获取接入物联网门店信息开放接口
This commit is contained in:
@@ -72,8 +72,8 @@ public class StoreDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<StoreDO> list() {
|
public List<StoreDO> list(Integer isIot) {
|
||||||
return storeMapper.list();
|
return storeMapper.list(isIot);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<StoreDO> getStoreNumByStoreCodes(List<String> storeCodeIds) {
|
public List<StoreDO> getStoreNumByStoreCodes(List<String> storeCodeIds) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public interface StoreMapper {
|
|||||||
* 分页查询门店数据
|
* 分页查询门店数据
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<StoreDO> list();
|
List<StoreDO> list(@Param("isIot") Integer isIot);
|
||||||
|
|
||||||
List<StoreAreaDTO> getStoreAreaList( @Param("storeIds") List<String> storeIds);
|
List<StoreAreaDTO> getStoreAreaList( @Param("storeIds") List<String> storeIds);
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
<result column="join_brand" property="joinBrand" jdbcType="TINYINT"/>
|
<result column="join_brand" property="joinBrand" jdbcType="TINYINT"/>
|
||||||
<result column="store_type" property="storeType" jdbcType="TINYINT"/>
|
<result column="store_type" property="storeType" jdbcType="TINYINT"/>
|
||||||
<result column="mini_program_order_store_name" property="miniProgramOrderStoreName"/>
|
<result column="mini_program_order_store_name" property="miniProgramOrderStoreName"/>
|
||||||
|
<result column="is_iot" property="isIot" jdbcType="TINYINT"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="getByStoreId" resultMap="BaseResultMap">
|
<select id="getByStoreId" resultMap="BaseResultMap">
|
||||||
@@ -129,7 +130,12 @@
|
|||||||
|
|
||||||
<select id="list" resultMap="BaseResultMap">
|
<select id="list" resultMap="BaseResultMap">
|
||||||
select *
|
select *
|
||||||
from store_${enterpriseId} where is_delete = 'effective' order by id asc
|
from store_${enterpriseId}
|
||||||
|
where is_delete = 'effective'
|
||||||
|
<if test="isIot != null">
|
||||||
|
AND is_iot = #{isIot}
|
||||||
|
</if>
|
||||||
|
order by id asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getStoreAreaList" resultType="com.cool.store.dto.store.StoreAreaDTO">
|
<select id="getStoreAreaList" resultType="com.cool.store.dto.store.StoreAreaDTO">
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.cool.store.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 门店名称DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class StoreNameDTO {
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店编码")
|
||||||
|
private String storeNum;
|
||||||
|
}
|
||||||
@@ -238,5 +238,8 @@ public class StoreDO {
|
|||||||
|
|
||||||
private String miniProgramOrderStoreName;
|
private String miniProgramOrderStoreName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否接入物联网
|
||||||
|
*/
|
||||||
|
private Integer isIot;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
import com.cool.store.dto.StoreDTO;
|
import com.cool.store.dto.StoreDTO;
|
||||||
|
import com.cool.store.dto.StoreNameDTO;
|
||||||
import com.cool.store.dto.store.AuthStoreUserDTO;
|
import com.cool.store.dto.store.AuthStoreUserDTO;
|
||||||
import com.cool.store.dto.store.StoreUserPositionDTO;
|
import com.cool.store.dto.store.StoreUserPositionDTO;
|
||||||
import com.cool.store.response.MiniShopsResponse;
|
import com.cool.store.response.MiniShopsResponse;
|
||||||
@@ -24,6 +25,11 @@ public interface StoreService {
|
|||||||
*/
|
*/
|
||||||
PageInfo<StoreDTO> getStoreExtendFieldInfo(Integer pageSize,Integer pageNum);
|
PageInfo<StoreDTO> getStoreExtendFieldInfo(Integer pageSize,Integer pageNum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询接入物联网的门店
|
||||||
|
*/
|
||||||
|
PageInfo<StoreNameDTO> getIotStoreList(Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
PageInfo<MiniShopsResponse> getStoreListByMobile(String mobile,Integer pageNum,Integer pageSize,String storeName,String storeNum);
|
PageInfo<MiniShopsResponse> getStoreListByMobile(String mobile,Integer pageNum,Integer pageSize,String storeName,String storeNum);
|
||||||
|
|
||||||
List<StoreUserPositionDTO> getStoreUser(List<String> storeCodeList);
|
List<StoreUserPositionDTO> getStoreUser(List<String> storeCodeList);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.dto.StoreNameDTO;
|
||||||
import com.cool.store.dto.store.AuthStoreUserDTO;
|
import com.cool.store.dto.store.AuthStoreUserDTO;
|
||||||
import com.cool.store.dao.EnterpriseUserDAO;
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
import com.cool.store.dao.EnterpriseUserRoleDao;
|
import com.cool.store.dao.EnterpriseUserRoleDao;
|
||||||
@@ -77,7 +78,7 @@ public class StoreServiceImpl implements StoreService {
|
|||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE,"单次最多获取200条门店数据");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE,"单次最多获取200条门店数据");
|
||||||
}
|
}
|
||||||
PageHelper.startPage(pageNum,pageSize);
|
PageHelper.startPage(pageNum,pageSize);
|
||||||
List<StoreDO> list = storeDao.list();
|
List<StoreDO> list = storeDao.list(null);
|
||||||
PageInfo info = new PageInfo<>(list);
|
PageInfo info = new PageInfo<>(list);
|
||||||
if (CollectionUtils.isEmpty(list)){
|
if (CollectionUtils.isEmpty(list)){
|
||||||
return info;
|
return info;
|
||||||
@@ -87,6 +88,22 @@ public class StoreServiceImpl implements StoreService {
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<StoreNameDTO> getIotStoreList(Integer pageNum, Integer pageSize) {
|
||||||
|
if (pageSize > 200) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "单次最多获取200条门店数据");
|
||||||
|
}
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
List<StoreDO> list = storeDao.list(1);
|
||||||
|
PageInfo info = new PageInfo<>(list);
|
||||||
|
if (CollectionUtils.isEmpty(list)){
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
List<StoreNameDTO> result = list.stream().map(v -> new StoreNameDTO(v.getStoreName(), v.getStoreNum())).collect(Collectors.toList());
|
||||||
|
info.setList(result);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<MiniShopsResponse> getStoreListByMobile(String mobile,Integer pageNum,Integer pageSize,String storeName,String storeNum) {
|
public PageInfo<MiniShopsResponse> getStoreListByMobile(String mobile,Integer pageNum,Integer pageSize,String storeName,String storeNum) {
|
||||||
//根据手机号查询 标品userId
|
//根据手机号查询 标品userId
|
||||||
|
|||||||
@@ -68,6 +68,13 @@ public class OpenApiController {
|
|||||||
public ApiResponse<PageInfo<StoreDTO>> getStoreList(@RequestBody @Validated OpenApiStoreRequest dto) {
|
public ApiResponse<PageInfo<StoreDTO>> getStoreList(@RequestBody @Validated OpenApiStoreRequest dto) {
|
||||||
return ApiResponse.success(storeService.getStoreExtendFieldInfo(dto.getPageSize(),dto.getPageNum()));
|
return ApiResponse.success(storeService.getStoreExtendFieldInfo(dto.getPageSize(),dto.getPageNum()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取接入物联网门店信息")
|
||||||
|
@PostMapping("/getIoTStoreList")
|
||||||
|
public ApiResponse<PageInfo<StoreNameDTO>> getIotStoreList(@RequestBody @Validated OpenApiStoreRequest dto) {
|
||||||
|
return ApiResponse.success(storeService.getIotStoreList(dto.getPageNum(), dto.getPageSize()));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("新管家回调 刷新收款单状态")
|
@ApiOperation("新管家回调 刷新收款单状态")
|
||||||
@PostMapping("/changeReceiptStatus")
|
@PostMapping("/changeReceiptStatus")
|
||||||
public ApiResponse<Boolean> changeReceiptStatus(@RequestBody @Validated ReceiptCallBackRequest request){
|
public ApiResponse<Boolean> changeReceiptStatus(@RequestBody @Validated ReceiptCallBackRequest request){
|
||||||
|
|||||||
Reference in New Issue
Block a user