Merge #146 into master from cc_20260520_declare_goods
fix:新增获取门店报货信息接口 * cc_20260520_declare_goods: (2 commits squashed) - fix:新增根据门店编码列表获取门店报货信息接口 - fix:新增字段 Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com> Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com> CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/146
This commit is contained in:
@@ -5,7 +5,7 @@ import com.cool.store.dto.store.StoreAddressDTO;
|
||||
import com.cool.store.dto.store.StoreExtendSoftOpenDTO;
|
||||
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.enums.StoreStatusEnum;
|
||||
import com.cool.store.entity.store.StoreExtendInfoDO;
|
||||
import com.cool.store.mapper.StoreMapper;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -318,4 +318,15 @@ public class StoreDao {
|
||||
public void insertOrUpdateOpenReportTime(String storeId, Date openReportTime) {
|
||||
storeMapper.insertOrUpdateOpenReportTime(storeId, openReportTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店扩展信息
|
||||
*/
|
||||
public Map<String, StoreExtendInfoDO> getExtendInfoMap(List<String> storeIds) {
|
||||
if (CollectionUtils.isEmpty(storeIds)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
List<StoreExtendInfoDO> list = storeMapper.getExtendInfoByStoreIds(storeIds);
|
||||
return CollStreamUtil.toMap(list, StoreExtendInfoDO::getStoreId, v -> v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.dto.store.StoreAreaDTO;
|
||||
import com.cool.store.dto.store.StoreExtendSoftOpenDTO;
|
||||
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.entity.store.StoreExtendInfoDO;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -193,4 +194,9 @@ public interface StoreMapper {
|
||||
* 新增或编辑门店开店流程完成时间
|
||||
*/
|
||||
void insertOrUpdateOpenReportTime(@Param("storeId") String storeId, @Param("openReportTime") Date openReportTime);
|
||||
|
||||
/**
|
||||
* 门店扩展信息
|
||||
*/
|
||||
List<StoreExtendInfoDO> getExtendInfoByStoreIds(@Param("storeIds") List<String> storeIds);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
<result column="addressee_area" property="addresseeArea" jdbcType="VARCHAR"/>
|
||||
<result column="addressee_address" property="addresseeAddress" jdbcType="VARCHAR"/>
|
||||
<result column="branch" property="branch" jdbcType="TINYINT"/>
|
||||
<result column="declare_goods_type" property="declareGoodsType" jdbcType="TINYINT"/>
|
||||
<result column="declare_goods_date" property="declareGoodsDate" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getByStoreId" resultMap="BaseResultMap">
|
||||
@@ -493,4 +495,13 @@
|
||||
ON DUPLICATE KEY UPDATE
|
||||
open_report_time = VALUES(open_report_time)
|
||||
</insert>
|
||||
|
||||
<select id="getExtendInfoByStoreIds" resultType="com.cool.store.entity.store.StoreExtendInfoDO">
|
||||
SELECT *
|
||||
FROM store_extend_info_${enterpriseId}
|
||||
WHERE store_id IN
|
||||
<foreach item="item" collection="storeIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.dto.store;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报送货日期DTO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/5/20
|
||||
*/
|
||||
@Data
|
||||
public class DeclareGoodsDateDTO {
|
||||
@ApiModelProperty("报货日期")
|
||||
private String declareGoods;
|
||||
|
||||
@ApiModelProperty("送货日期")
|
||||
private String deliverGoods;
|
||||
}
|
||||
@@ -267,4 +267,14 @@ public class StoreDO {
|
||||
|
||||
private String joinSupervision;
|
||||
|
||||
/**
|
||||
* 报货类型 0-按周报货 1-按月报货 2-自提
|
||||
*/
|
||||
private Integer declareGoodsType;
|
||||
|
||||
/**
|
||||
* 报送货日期 数组格式"[{"declareGoods": "","deliverGoods":""}]"
|
||||
*/
|
||||
private String declareGoodsDate;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.cool.store.entity.store;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 门店扩展信息
|
||||
* @author wangff
|
||||
* @date 2025-09-16 02:37
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StoreExtendInfoDO implements Serializable {
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
private String storeId;
|
||||
|
||||
@ApiModelProperty("闭店原因")
|
||||
private Integer closeReason;
|
||||
|
||||
@ApiModelProperty("闭店性质")
|
||||
private Integer closeNature;
|
||||
|
||||
@ApiModelProperty("门头类型")
|
||||
private String storefrontType;
|
||||
|
||||
@ApiModelProperty("最新装修日期")
|
||||
private Date latestRenovateDate;
|
||||
|
||||
@ApiModelProperty("最新订货时间")
|
||||
private Date latestOrderTime;
|
||||
|
||||
@ApiModelProperty("标签")
|
||||
private String tags;
|
||||
|
||||
@ApiModelProperty("暂停营业原因")
|
||||
private String closeUpReason;
|
||||
|
||||
@ApiModelProperty("外卖管理部门")
|
||||
private String takeOutManageDept;
|
||||
|
||||
@ApiModelProperty("商圈类型")
|
||||
private String businessType;
|
||||
|
||||
@ApiModelProperty("巡店难度")
|
||||
private String patrolDifficulty;
|
||||
|
||||
@ApiModelProperty("巡店难度原因")
|
||||
private String patrolDiffReason;
|
||||
|
||||
@ApiModelProperty("订货备注")
|
||||
private String orderRemark;
|
||||
|
||||
@ApiModelProperty("积分")
|
||||
private BigDecimal score;
|
||||
|
||||
@ApiModelProperty("是否重点关注")
|
||||
private Integer isFocus;
|
||||
|
||||
@ApiModelProperty("重点关注原因")
|
||||
private String focusReason;
|
||||
|
||||
@ApiModelProperty("私域二维码")
|
||||
private String privateSphereQr;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("抬头类型")
|
||||
private Integer invoiceType;
|
||||
|
||||
@ApiModelProperty("发票抬头")
|
||||
private String invoiceTitle;
|
||||
|
||||
@ApiModelProperty("税号")
|
||||
private String invoiceTin;
|
||||
|
||||
@ApiModelProperty("开始试营业日期")
|
||||
private Date softOpenDate;
|
||||
|
||||
@ApiModelProperty("是否歇业中")
|
||||
private Integer isCloseUp;
|
||||
|
||||
@ApiModelProperty("开业报备流程完成时间")
|
||||
private Date openReportTime;
|
||||
|
||||
@ApiModelProperty("首次在营业状态时间(定时任务更新时间)")
|
||||
private Date softOpenJobTime;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.request.store;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店编码列表请求
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/5/20
|
||||
*/
|
||||
@Data
|
||||
public class StoreNumListRequest {
|
||||
@ApiModelProperty("门店编码列表")
|
||||
@Size(max = 100, message = "单次最多查询100条门店数据")
|
||||
private List<String> storeNums;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.cool.store.vo.store;
|
||||
|
||||
import com.cool.store.annotation.DictField;
|
||||
import com.cool.store.dto.store.DeclareGoodsDateDTO;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店报货信息VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/5/20
|
||||
*/
|
||||
@Data
|
||||
public class StoreDeclareGoodsVO {
|
||||
@ApiModelProperty("门店编码")
|
||||
private String storeNum;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String storeName;
|
||||
|
||||
@ApiModelProperty("报货类型 0-按周报货 1-按月报货 2-自提 3-按2周/次投货 4-按3周/次投货 5-外物流")
|
||||
private Integer declareGoodsType;
|
||||
|
||||
@ApiModelProperty("报送货日期列表")
|
||||
private List<DeclareGoodsDateDTO> declareGoodsDateList;
|
||||
|
||||
@JsonIgnore
|
||||
private String businessTypeCode;
|
||||
|
||||
@ApiModelProperty("商圈类型")
|
||||
@DictField(sourceField = "businessTypeCode")
|
||||
private String businessType;
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.cool.store.dto.store.StoreUserDTO;
|
||||
import com.cool.store.dto.store.StoreUserPositionDTO;
|
||||
import com.cool.store.request.store.StoreListRequest;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import com.cool.store.vo.store.StoreDeclareGoodsVO;
|
||||
import com.cool.store.vo.store.StoreListVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
@@ -62,4 +63,9 @@ public interface StoreService {
|
||||
*/
|
||||
List<StoreUserDTO> getStoreUserPositionList(String storeId, String userName);
|
||||
|
||||
/**
|
||||
* 根据门店编码列表获取门店报货信息
|
||||
*/
|
||||
List<StoreDeclareGoodsVO> getStoreDeclareGoodsByStoreNums(List<String> storeNumList);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.cool.store.dao.SysRoleDao;
|
||||
import com.cool.store.dto.StoreDTO;
|
||||
import com.cool.store.dto.UserSimpleDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.entity.store.StoreExtendInfoDO;
|
||||
import com.cool.store.entity.store.StoreMasterSignerInfoDO;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
@@ -24,10 +25,12 @@ import com.cool.store.request.store.StoreListRequest;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import com.cool.store.service.StoreService;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.service.dict.impl.DictService;
|
||||
import com.cool.store.utils.BeanUtil;
|
||||
import com.cool.store.utils.GeoMapUtil;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.cool.store.vo.SysRoleVO;
|
||||
import com.cool.store.vo.store.StoreDeclareGoodsVO;
|
||||
import com.cool.store.vo.store.StoreListVO;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -81,6 +84,8 @@ public class StoreServiceImpl implements StoreService {
|
||||
StoreMasterSignerInfoDAO storeMasterSignerInfoDAO;
|
||||
@Resource
|
||||
EnterpriseUserRoleMapper enterpriseUserRoleMapper;
|
||||
@Resource
|
||||
DictService dictService;
|
||||
|
||||
@Override
|
||||
public PageInfo<StoreDTO> getStoreExtendFieldInfo(Integer pageSize, Integer pageNum, Boolean queryOperations) {
|
||||
@@ -689,4 +694,49 @@ public class StoreServiceImpl implements StoreService {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreDeclareGoodsVO> getStoreDeclareGoodsByStoreNums(List<String> storeNumList) {
|
||||
if (CollectionUtils.isEmpty(storeNumList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (storeNumList.size() > 100) {
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "单次最多查询100条门店数据");
|
||||
}
|
||||
List<StoreDO> storeList = storeDao.getStoreNumByStoreCodes(storeNumList);
|
||||
if (CollectionUtils.isEmpty(storeList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> storeIds = CollStreamUtil.toList(storeList, StoreDO::getStoreId);
|
||||
Map<String, StoreExtendInfoDO> extendInfoMap = storeDao.getExtendInfoMap(storeIds);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
List<StoreDeclareGoodsVO> list = storeList.stream().map(store -> {
|
||||
StoreDeclareGoodsVO vo = new StoreDeclareGoodsVO();
|
||||
vo.setStoreNum(store.getStoreNum());
|
||||
vo.setStoreName(store.getStoreName());
|
||||
vo.setDeclareGoodsType(store.getDeclareGoodsType());
|
||||
// 将 JSON 字符串转换为 List 对象
|
||||
if (StringUtils.isNotBlank(store.getDeclareGoodsDate())) {
|
||||
try {
|
||||
List<DeclareGoodsDateDTO> dateList = objectMapper.readValue(
|
||||
store.getDeclareGoodsDate(),
|
||||
new TypeReference<List<DeclareGoodsDateDTO>>() {}
|
||||
);
|
||||
vo.setDeclareGoodsDateList(dateList);
|
||||
} catch (Exception e) {
|
||||
log.warn("解析报送货日期JSON失败, storeNum={}, declareGoodsDate={}", store.getStoreNum(), store.getDeclareGoodsDate(), e);
|
||||
vo.setDeclareGoodsDateList(new ArrayList<>());
|
||||
}
|
||||
} else {
|
||||
vo.setDeclareGoodsDateList(Collections.emptyList());
|
||||
}
|
||||
StoreExtendInfoDO extendInfoDO = extendInfoMap.get(store.getStoreId());
|
||||
if (Objects.nonNull(extendInfoDO)) {
|
||||
vo.setBusinessTypeCode(extendInfoDO.getBusinessType());
|
||||
}
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
dictService.fillDictField(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,16 +9,15 @@ import com.cool.store.dto.store.StoreUserPositionDTO;
|
||||
import com.cool.store.dto.wallet.PaymentDTO;
|
||||
import com.cool.store.dto.wx.MiniProgramFreeLoginDTO;
|
||||
import com.cool.store.handler.WeChatHandler;
|
||||
import com.cool.store.enums.close.CloseTypeEnum;
|
||||
import com.cool.store.request.OpenApiStoreRequest;
|
||||
import com.cool.store.request.StoreCodeDTO;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.request.close.store.ThirdCloseStoreApplyRequest;
|
||||
import com.cool.store.request.notice.ThirdHandleMessageRequest;
|
||||
import com.cool.store.request.notice.ThirdMatterRequest;
|
||||
import com.cool.store.request.openapi.ShopListRequest;
|
||||
import com.cool.store.request.openapi.StoreRequest;
|
||||
import com.cool.store.request.openapi.SubRegionRequest;
|
||||
import com.cool.store.request.store.StoreNumListRequest;
|
||||
import com.cool.store.request.privatesphere.PrivateSphereSnRequest;
|
||||
import com.cool.store.request.wallet.AccountTradeCallbackRequest;
|
||||
import com.cool.store.request.wallet.AddTagCallbackNoticeRequest;
|
||||
@@ -33,11 +32,11 @@ import com.cool.store.service.*;
|
||||
import com.cool.store.service.privatesphere.PrivateSphereQrService;
|
||||
import com.cool.store.service.wallet.WalletService;
|
||||
import com.cool.store.service.xinfa.XinFaBusinessService;
|
||||
import com.cool.store.service.xinfa.XinFaDeviceService;
|
||||
import com.cool.store.utils.HttpHelper;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.service.close.CloseStoreService;
|
||||
import com.cool.store.vo.privatesphere.PrivateSphereVO;
|
||||
import com.cool.store.vo.store.StoreDeclareGoodsVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -315,4 +314,10 @@ public class OpenApiController {
|
||||
return ApiResponse.success(xinFaBusinessService.getStoreXinFaDeviceDetail(request.getStoreNum()));
|
||||
}
|
||||
|
||||
@ApiOperation("根据门店编码列表获取门店报货信息")
|
||||
@PostMapping("/getStoreDeclareGoodsInfo")
|
||||
public ApiResponse<List<StoreDeclareGoodsVO>> getStoreDeclareGoodsInfo(@RequestBody @Validated StoreNumListRequest request) {
|
||||
return ApiResponse.success(storeService.getStoreDeclareGoodsByStoreNums(request.getStoreNums()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.common.PageBasicInfo;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dto.store.StoreUserDTO;
|
||||
import com.cool.store.request.store.StoreListRequest;
|
||||
import com.cool.store.request.store.StoreNumListRequest;
|
||||
import com.cool.store.request.UserStoreRequest;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.StoreService;
|
||||
import com.cool.store.vo.store.StoreDeclareGoodsVO;
|
||||
import com.cool.store.vo.store.StoreListVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -50,4 +51,10 @@ public class PCStoreController {
|
||||
public ResponseResult<List<StoreUserDTO>> getStoreUserPositionList(String storeId, String userName) {
|
||||
return ResponseResult.success(storeService.getStoreUserPositionList(storeId, userName));
|
||||
}
|
||||
|
||||
@ApiOperation("根据门店编码列表获取门店报货信息")
|
||||
@PostMapping("/declareGoodsInfo")
|
||||
public ResponseResult<List<StoreDeclareGoodsVO>> getStoreDeclareGoodsInfo(@RequestBody @Validated StoreNumListRequest request) {
|
||||
return ResponseResult.success(storeService.getStoreDeclareGoodsByStoreNums(request.getStoreNums()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user