瀏覽代碼

feat(store): 新增门店证照查询功能

- 在 StoreInfo 实体中调整 reviewDate 字段位置并保持注解一致
- 新增 StoreLicenseInfoVo 类用于封装证照查询结果
- 在 StoreInfoMapper 中增加 getStoreLicensePage 方法及对应 XML 映射
- 在 StoreInfoService 及其实现类中添加 getStoreLicenseList 分页查询方法
- 在 StoreInfoController 中新增 /getStoreLicenseList 接口支持证照信息分页查询
- 补充相关字段如审核时间、续签合同状态等到 StoreInfoVo 和 StoreInfoDto
- 实现证照状态名称转换逻辑,增强前端展示友好性
Lhaibo 4 天之前
父節點
當前提交
44850d915a

+ 5 - 5
alien-entity/src/main/java/shop/alien/entity/store/StoreInfo.java

@@ -266,6 +266,11 @@ public class StoreInfo {
     @TableField("update_entertainment_licence_time")
     private Date updateEntertainmentLicenceTime;
 
+    @ApiModelProperty(value = "审核时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField("review_date")
+    private Date reviewDate;
+
     @ApiModelProperty(value = "续签合同到期时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @TableField("renew_contract_expiration_time")
@@ -306,9 +311,4 @@ public class StoreInfo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @TableField("update_id_card_time")
     private Date updateIdCardTime;
-
-    @ApiModelProperty(value = "审核时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField("review_date")
-    private Date reviewDate;
 }

+ 8 - 0
alien-entity/src/main/java/shop/alien/entity/store/dto/StoreInfoDto.java

@@ -213,6 +213,14 @@ public class StoreInfoDto {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date entertainmentLicenceExpirationTime;
 
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "审核时间")
+    private Date reviewDate;
+
+//    @ApiModelProperty(value = "分类id(词典表 键为 business_classify)(多个ID用逗号拼接)")
+//    @JsonDeserialize(using = StringToListDeserializer.class)
+//    private List<String> businessClassify;
     @ApiModelProperty(value = "营业执照图片URL")
     private String businessLicenseUrl;
 

+ 12 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreInfoVo.java

@@ -1,6 +1,7 @@
 package shop.alien.entity.store.vo;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;
@@ -247,4 +248,15 @@ public class StoreInfoVo extends StoreInfo {
     private JSONObject foodLicence;
     @ApiModelProperty(value = "娱乐经营许可证")
     private JSONObject entertainmentLicence;
+
+    @ApiModelProperty(value = "审核时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date reviewDate;
+
+    @ApiModelProperty(value = "续签合同状态")
+    private Integer renewContractStatus;
+
+    @ApiModelProperty(value = "续签合同拒绝原因")
+    private String contractReason;
+
 }

+ 81 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreLicenseInfoVo.java

@@ -0,0 +1,81 @@
+package shop.alien.entity.store.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 门店证照查询结果 VO
+ *
+ * 对应证照类型(营业执照 / 娱乐经营许可证 / 食品经营许可证)
+ * 及其当前状态、提交时间、到期时间等信息。
+ */
+@Data
+@ApiModel(value = "StoreLicenseInfoVo对象", description = "门店证照信息")
+@JsonInclude(JsonInclude.Include.ALWAYS)
+public class StoreLicenseInfoVo {
+
+    @ApiModelProperty("证照类型描述:营业执照 / 娱乐经营许可证 / 食品经营许可证")
+    private String imgDescription;
+
+    @ApiModelProperty("证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)")
+    private Integer imgType;
+
+    @ApiModelProperty("门店ID")
+    private Integer id;
+
+    @ApiModelProperty("门店名称")
+    private String storeName;
+
+    @ApiModelProperty("门店联系电话")
+    private String storeTel;
+
+    @ApiModelProperty("当前证照状态")
+    private String states;
+
+    @ApiModelProperty("当前证照状态名字")
+    private String statesName;
+
+    @ApiModelProperty("证照图片地址")
+    private String imgUrl;
+
+    @ApiModelProperty("证照最近一次提交时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date submitDate;
+
+    @ApiModelProperty("证照到期时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date expirationTime;
+
+    @ApiModelProperty("用户")
+    private String name;
+
+    @ApiModelProperty("审核失败原因")
+    private String expirationReason;
+
+    @ApiModelProperty(value = "经营板块id(词典表 键为 business_section)")
+    private Integer businessSection;
+
+    @ApiModelProperty(value = "经营板块名称")
+    private String businessSectionName;
+
+    @ApiModelProperty(value = "经营种类ids")
+    private String businessTypes;
+
+    @ApiModelProperty(value = "经营种类名称s")
+    private String businessTypesName;
+
+    @ApiModelProperty(value = "分类ids")
+    private String businessClassify;
+
+    @ApiModelProperty(value = "分类名称s")
+    private String businessClassifyName;
+}
+
+
+

+ 21 - 0
alien-entity/src/main/java/shop/alien/mapper/StoreInfoMapper.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.vo.StoreInfoVo;
+import shop.alien.entity.store.vo.StoreLicenseInfoVo;
 import shop.alien.entity.store.vo.StoreMainInfoVo;
 
 import java.util.List;
@@ -184,4 +185,24 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
             "and ROUND(ST_Distance_Sphere(ST_GeomFromText(CONCAT('POINT(', REPLACE(#{position}, ',', ' '), ')' )), ST_GeomFromText(CONCAT('POINT(', REPLACE(a.store_position, ',', ' '), ')' ))) / 1000, 2) <= 1 " +
             "order by distance3 asc limit 20")
     List<StoreInfoVo> getMoreRecommendedStores(@Param(Constants.WRAPPER) QueryWrapper<StoreInfoVo> queryWrapper, @Param("position") String position);
+
+    /**
+     * 门店证照查询(分页)
+     *
+     * @param page            分页对象
+     * @param storeName       门店名称(模糊)
+     * @param storeTel        门店电话(模糊)
+     * @param imgType         证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)
+     * @param states          证照状态
+     * @param startSubmitDate 提交开始时间(yyyy-MM-dd HH:mm:ss)
+     * @param endSubmitDate   提交结束时间(yyyy-MM-dd HH:mm:ss)
+     * @return 证照分页结果
+     */
+    IPage<StoreLicenseInfoVo> getStoreLicensePage(IPage<StoreLicenseInfoVo> page,
+                                                  @Param("storeName") String storeName,
+                                                  @Param("storeTel") String storeTel,
+                                                  @Param("imgType") Integer imgType,
+                                                  @Param("states") String states,
+                                                  @Param("startSubmitDate") String startSubmitDate,
+                                                  @Param("endSubmitDate") String endSubmitDate);
 }

+ 104 - 0
alien-entity/src/main/resources/mapper/StoreInfoMapper.xml

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="shop.alien.mapper.StoreInfoMapper">
+
+    <!--
+        门店证照查询
+        证照类型与状态、提交时间、到期时间映射关系:
+          - img_type = 14: 营业执照
+          - img_type IN (31, 32): 娱乐经营许可证
+          - img_type IN (24, 25): 食品经营许可证
+    -->
+    <select id="getStoreLicensePage"
+            resultType="shop.alien.entity.store.vo.StoreLicenseInfoVo">
+        SELECT
+            CASE
+                WHEN si.img_type = 14 THEN '营业执照'
+                WHEN si.img_type IN (31, 32) THEN '娱乐经营许可证'
+                WHEN si.img_type IN (24, 25) THEN '食品经营许可证'
+                WHEN si.img_type IN (33) THEN '身份证正面'
+                WHEN si.img_type IN (34) THEN '身份证反面'
+                ELSE ''
+            END AS img_description,
+            si.img_type AS img_type,
+            s.id AS id,
+            s.store_name AS store_name,
+            s.store_tel AS store_tel,
+            su.name AS name,
+            si.img_url,
+            s.business_section_name,
+            s.business_classify_name,
+            s.business_types_name,
+            CASE
+                WHEN si.img_type = 14 THEN s.business_license_status
+                WHEN si.img_type IN (31, 32) THEN s.entertainment_licence_status
+                WHEN si.img_type IN (24, 25) THEN s.food_licence_status
+                WHEN si.img_type IN (33, 34) THEN s.id_card_status
+                ELSE ''
+            END AS states,
+            CASE
+                WHEN si.img_type = 14 THEN s.update_business_license_time
+                WHEN si.img_type IN (31, 32) THEN s.update_entertainment_licence_time
+                WHEN si.img_type IN (24, 25) THEN s.update_food_licence_time
+                WHEN si.img_type IN (33, 34) THEN s.update_id_card_time
+                ELSE NULL
+            END AS submit_date,
+            CASE
+                WHEN si.img_type = 14 THEN s.business_license_expiration_time
+                WHEN si.img_type IN (31, 32) THEN s.entertainment_licence_expiration_time
+                WHEN si.img_type IN (24, 25) THEN s.food_licence_expiration_time
+                WHEN si.img_type IN (33, 34) THEN s.id_card_expiration_time
+                ELSE NULL
+            END AS expiration_time,
+            CASE
+                WHEN si.img_type = 14 THEN s.business_license_reason
+                WHEN si.img_type IN (31, 32) THEN s.entertainment_licence_reason
+                WHEN si.img_type IN (24, 25) THEN s.food_licence_reason
+                WHEN si.img_type IN (33, 34) THEN s.id_card_reason
+                ELSE NULL
+            END AS expiration_reason
+        FROM store_info s
+                 LEFT JOIN store_img si
+                           ON s.id = si.store_id
+                               AND si.img_type IN (14, 24, 25, 31, 32, 33, 34)
+                               AND si.delete_flag = 0
+                 left join store_user su on s.id = su.store_id
+        WHERE s.delete_flag = 0
+        <if test="storeName != null and storeName != ''">
+            AND s.store_name LIKE CONCAT('%', #{storeName}, '%')
+        </if>
+        <if test="storeTel != null and storeTel != ''">
+            AND s.store_tel LIKE CONCAT('%', #{storeTel}, '%')
+        </if>
+        <if test="imgType != null">
+            AND si.img_type = #{imgType}
+        </if>
+        <if test="states != null and states != ''">
+            AND (
+                (si.img_type = 14 AND s.business_license_status = #{states})
+                OR (si.img_type IN (31, 32) AND s.entertainment_licence_status = #{states})
+                OR (si.img_type IN (24, 25) AND s.food_licence_status = #{states})
+            )
+        </if>
+        <if test="startSubmitDate != null and startSubmitDate != ''">
+            AND (
+                (si.img_type = 14 AND s.update_business_license_time &gt;= #{startSubmitDate})
+                OR (si.img_type IN (31, 32) AND s.update_entertainment_licence_time &gt;= #{startSubmitDate})
+                OR (si.img_type IN (24, 25) AND s.update_food_licence_time &gt;= #{startSubmitDate})
+            )
+        </if>
+        <if test="endSubmitDate != null and endSubmitDate != ''">
+            AND (
+                (si.img_type = 14 AND s.update_business_license_time &lt;= #{endSubmitDate})
+                OR (si.img_type IN (31, 32) AND s.update_entertainment_licence_time &lt;= #{endSubmitDate})
+                OR (si.img_type IN (24, 25) AND s.update_food_licence_time &lt;= #{endSubmitDate})
+            )
+        </if>
+        ORDER BY s.store_name ASC
+    </select>
+
+</mapper>
+
+

+ 29 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreInfoController.java

@@ -1103,6 +1103,35 @@ public class StoreInfoController {
     }
 
 
+    @ApiOperation(value = "证照查询")
+    @ApiOperationSupport(order = 23)
+    @GetMapping("/getStoreLicenseList")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
+            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
+            @ApiImplicitParam(name = "storeName", value = "门店名称", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "storeTel", value = "门店电话", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "imgType", value = "证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "states", value = "证照状态", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "startSubmitDate", value = "提交开始时间(yyyy-MM-dd HH:mm:ss)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "endSubmitDate", value = "提交结束时间(yyyy-MM-dd HH:mm:ss)", dataType = "String", paramType = "query")
+    })
+    public R<IPage<StoreLicenseInfoVo>> getStoreLicenseList(
+            @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+            @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
+            @RequestParam(value = "storeName", required = false) String storeName,
+            @RequestParam(value = "storeTel", required = false) String storeTel,
+            @RequestParam(value = "imgType", required = false) Integer imgType,
+            @RequestParam(value = "states", required = false) String states,
+            @RequestParam(value = "startSubmitDate", required = false) String startSubmitDate,
+            @RequestParam(value = "endSubmitDate", required = false) String endSubmitDate) {
+        log.info("StoreInfoController.getStoreLicenseList?pageNum={},pageSize={},storeName={},storeTel={},imgType={},states={},startSubmitDate={},endSubmitDate={}",
+                pageNum, pageSize, storeName, storeTel, imgType, states, startSubmitDate, endSubmitDate);
+        IPage<StoreLicenseInfoVo> page = storeInfoService.getStoreLicenseList(pageNum, pageSize, storeName, storeTel, imgType, states, startSubmitDate, endSubmitDate);
+        return R.data(page);
+    }
+
+
     /**
      * 查询两种类型店铺(丽人美发、运动健身)并按距离筛选
      *

+ 22 - 0
alien-store/src/main/java/shop/alien/store/service/StoreInfoService.java

@@ -446,4 +446,26 @@ public interface StoreInfoService extends IService<StoreInfo> {
      * @return R<IPage<StoreInfoVo>> 分页的门店信息列表
      */
     IPage<StoreInfoVo> getLifeServicesByDistance(Double lon, Double lat, Double distance, Integer sortType, Integer businessType, Integer categoryId, String storeName, int pageNum, int pageSize);
+
+    /**
+     * 门店证照查询(分页)
+     *
+     * @param pageNum         页码
+     * @param pageSize        页容
+     * @param storeName       门店名称(模糊)
+     * @param storeTel        门店电话(模糊)
+     * @param imgType         证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)
+     * @param states          证照状态
+     * @param startSubmitDate 提交开始时间(yyyy-MM-dd HH:mm:ss)
+     * @param endSubmitDate   提交结束时间(yyyy-MM-dd HH:mm:ss)
+     * @return 证照分页结果
+     */
+    IPage<StoreLicenseInfoVo> getStoreLicenseList(int pageNum,
+                                                  int pageSize,
+                                                  String storeName,
+                                                  String storeTel,
+                                                  Integer imgType,
+                                                  String states,
+                                                  String startSubmitDate,
+                                                  String endSubmitDate);
 }

+ 35 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -1820,6 +1820,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         StoreInfo storeInfo = storeInfoMapper.selectById(storeId);
         storeInfo.setStoreApplicationStatus(approvalStatus);
         storeInfo.setReason(reason);
+        storeInfo.setReviewDate(new Date());
         StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, storeInfo.getId()).eq(StoreUser::getDeleteFlag, 0));
         storeInfoMapper.updateById(storeInfo);
 
@@ -3771,6 +3772,40 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         return storeInfoVoList;
     }
 
+    /**
+     * 门店证照查询(分页)
+     *
+     * @param pageNum         页码
+     * @param pageSize        页容
+     * @param storeName       门店名称(模糊)
+     * @param storeTel        门店电话(模糊)
+     * @param imgType         证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)
+     * @param states          证照状态
+     * @param startSubmitDate 提交开始时间(yyyy-MM-dd HH:mm:ss)
+     * @param endSubmitDate   提交结束时间(yyyy-MM-dd HH:mm:ss)
+     * @return 证照分页结果
+     */
+    @Override
+    public IPage<StoreLicenseInfoVo> getStoreLicenseList(int pageNum,
+                                                         int pageSize,
+                                                         String storeName,
+                                                         String storeTel,
+                                                         Integer imgType,
+                                                         String states,
+                                                         String startSubmitDate,
+                                                         String endSubmitDate) {
+        IPage<StoreLicenseInfoVo> page = new Page<>(pageNum, pageSize);
+        IPage<StoreLicenseInfoVo> storeLicensePage = storeInfoMapper.getStoreLicensePage(page, storeName, storeTel, imgType, states, startSubmitDate, endSubmitDate);
+        for (StoreLicenseInfoVo record : storeLicensePage.getRecords()) {
+            if(record.getStates() != null){
+                StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, record.getStates())
+                        .eq(StoreDictionary::getTypeName, "foodLicenceStatus"));
+                record.setStatesName(storeDictionary.getDictDetail());
+            }
+        }
+        return storeLicensePage;
+    }
+
 
     /**
      * 构建树形结构(优化版)