소스 검색

bugfix: #2706修改中台数据未显示问题

penghao 2 달 전
부모
커밋
8c6526e86a

+ 3 - 9
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreLicenseInfoVo.java

@@ -1,6 +1,5 @@
 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;
@@ -12,7 +11,7 @@ import java.util.Date;
 /**
  * 门店证照查询结果 VO
  *
- * 对应证照类型(营业执照 / 娱乐经营许可证 / 食品经营许可证
+ * 对应证照类型(营业执照 / 其他资质证明
  * 及其当前状态、提交时间、到期时间等信息。
  */
 @Data
@@ -20,10 +19,10 @@ import java.util.Date;
 @JsonInclude(JsonInclude.Include.ALWAYS)
 public class StoreLicenseInfoVo {
 
-    @ApiModelProperty("证照类型描述:营业执照 / 娱乐经营许可证 / 食品经营许可证")
+    @ApiModelProperty("证照类型描述:营业执照 / 其他资质证明")
     private String imgDescription;
 
-    @ApiModelProperty("证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)")
+    @ApiModelProperty("证照图片类型(14:营业执照;35:其他资质证明)")
     private Integer imgType;
 
     @ApiModelProperty("门店ID")
@@ -76,8 +75,3 @@ public class StoreLicenseInfoVo {
     @ApiModelProperty(value = "分类名称s")
     private String businessClassifyName;
 }
-
-
-
-
-

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

@@ -194,7 +194,7 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
      * @param storeContact    门店联系人(模糊)
      * @param storeTel        门店电话(模糊)
      * @param businessSection 经营板块
-     * @param imgType         证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证
+     * @param imgType         证照图片类型(14:营业执照;35:其他资质证明
      * @param states          证照状态
      * @param startSubmitDate 提交开始时间(yyyy-MM-dd HH:mm:ss)
      * @param endSubmitDate   提交结束时间(yyyy-MM-dd HH:mm:ss)

+ 25 - 27
alien-entity/src/main/resources/mapper/StoreInfoMapper.xml

@@ -8,18 +8,14 @@
         门店证照查询
         证照类型与状态、提交时间、到期时间映射关系:
           - img_type = 14: 营业执照
-          - img_type IN (31, 32): 娱乐经营许可证
-          - img_type IN (24, 25): 食品经营许可证
+          - img_type = 35: 其他资质证明
     -->
     <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 '身份证反面'
+                WHEN si.img_type = 35 THEN '其他资质证明'
                 ELSE ''
             END AS img_description,
             si.img_type AS img_type,
@@ -33,39 +29,44 @@
             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
+                WHEN si.img_type = 35 THEN slh.license_execute_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
+                WHEN si.img_type = 35 THEN slh.created_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
+                WHEN si.img_type = 35 THEN NULL
                 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
+                WHEN si.img_type = 35 THEN slh.reason_refusal
                 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.img_type IN (14, 35)
                                AND si.delete_flag = 0
-                 left join store_user su on s.id = su.store_id
+                 LEFT JOIN store_user su ON s.id = su.store_id
+                 LEFT JOIN (
+                     SELECT slh.store_id, slh.license_execute_status, slh.created_time, slh.reason_refusal, slh.img_url
+                     FROM store_license_history slh
+                     INNER JOIN (
+                         SELECT store_id, MAX(created_time) AS max_time
+                         FROM store_license_history
+                         WHERE license_status = 2 AND delete_flag = 0
+                         GROUP BY store_id
+                     ) slh2 ON slh.store_id = slh2.store_id 
+                             AND slh.created_time = slh2.max_time
+                     WHERE slh.license_status = 2 AND slh.delete_flag = 0
+                 ) slh ON s.id = slh.store_id AND si.img_type = 35
         WHERE s.delete_flag = 0
+            AND si.img_type IS NOT NULL
         <if test="storeName != null and storeName != ''">
             AND s.store_name LIKE CONCAT('%', #{storeName}, '%')
         </if>
@@ -84,25 +85,22 @@
         <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})
+                OR (si.img_type = 35 AND slh.license_execute_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})
+                OR (si.img_type = 35 AND slh.created_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})
+                OR (si.img_type = 35 AND slh.created_time &lt;= #{endSubmitDate})
             )
         </if>
-        ORDER BY s.store_name ASC
+        ORDER BY submit_date DESC, s.store_name ASC
     </select>
 
 </mapper>

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

@@ -1279,7 +1279,7 @@ public class StoreInfoController {
             @ApiImplicitParam(name = "storeContact", value = "联系人", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "storeTel", value = "门店电话", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "businessSection", value = "经营板块", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "imgType", value = "证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "imgType", value = "证照图片类型(14:营业执照;35:其他资质证明)", 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")

+ 26 - 4
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -4147,7 +4147,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
      * @param pageSize        页容
      * @param storeName       门店名称(模糊)
      * @param storeTel        门店电话(模糊)
-     * @param imgType         证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证
+     * @param imgType         证照图片类型(14:营业执照;35:其他资质证明
      * @param states          证照状态
      * @param startSubmitDate 提交开始时间(yyyy-MM-dd HH:mm:ss)
      * @param endSubmitDate   提交结束时间(yyyy-MM-dd HH:mm:ss)
@@ -4168,9 +4168,31 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         IPage<StoreLicenseInfoVo> storeLicensePage = storeInfoMapper.getStoreLicensePage(page, storeName, storeContact, storeTel, businessSection, 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());
+                if(record.getImgType() != null && record.getImgType() == 35){
+                    // 其他资质证明:直接使用状态值描述
+                    // license_execute_status: 1-审核通过, 2-审核中, 3-审核拒绝
+                    switch (record.getStates().toString()) {
+                        case "1":
+                            record.setStatesName("审核通过");
+                            break;
+                        case "2":
+                            record.setStatesName("审核中");
+                            break;
+                        case "3":
+                            record.setStatesName("审核拒绝");
+                            break;
+                        default:
+                            record.setStatesName("未知");
+                            break;
+                    }
+                } else {
+                    // 营业执照:从字典表获取状态名称
+                    StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, record.getStates())
+                            .eq(StoreDictionary::getTypeName, "foodLicenceStatus"));
+                    if(storeDictionary != null){
+                        record.setStatesName(storeDictionary.getDictDetail());
+                    }
+                }
             }
         }
         return storeLicensePage;