Forráskód Böngészése

feat(store): 添加人工复核功能及相关字段

- 在 StoreInfo 实体类中新增人工复核状态、时间和原因字段
- 在 StoreInfoDto 和 StoreInfoVo 中同步添加人工复核相关字段
- 新增 /manualReview 接口用于 web 端进行人工复核操作
- 更新 getNewStorePage 接口支持按申请时间范围查询
- 扩展 getStoreLicenseList 查询条件,增加联系人和经营板块筛选
- 修改 StoreInfoMapper 及对应 XML 文件以支持新查询参数
- 实现 manualReview 方法更新数据库中的人工复核信息
Lhaibo 13 órája
szülő
commit
1e02fa6fe8

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

@@ -266,6 +266,19 @@ public class StoreInfo {
     @TableField("update_entertainment_licence_time")
     private Date updateEntertainmentLicenceTime;
 
+    @ApiModelProperty(value = "人工复核状态(1:通过,2:拒绝)")
+    @TableField("manual_review_status")
+    private Integer manualReviewStatus;
+
+    @ApiModelProperty(value = "人工复核时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField("manual_review_time")
+    private Date manualReviewTime;
+
+    @ApiModelProperty(value = "人工复核原因")
+    @TableField("manual_review_reason")
+    private String manualReviewReason;
+
     @ApiModelProperty(value = "审核时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @TableField("review_date")

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

@@ -213,6 +213,17 @@ public class StoreInfoDto {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date entertainmentLicenceExpirationTime;
 
+    @ApiModelProperty(value = "人工复核状态(1:通过,2:拒绝)")
+    private Integer manualReviewStatus;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "人工复核时间")
+    private Date manualReviewTime;
+
+    @ApiModelProperty(value = "人工复核原因")
+    private String manualReviewReason;
+
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "审核时间")

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

@@ -249,6 +249,16 @@ public class StoreInfoVo extends StoreInfo {
     @ApiModelProperty(value = "娱乐经营许可证")
     private JSONObject entertainmentLicence;
 
+    @ApiModelProperty(value = "人工复核状态(1:通过,2:拒绝)")
+    private Integer manualReviewStatus;
+
+    @ApiModelProperty(value = "人工复核时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date manualReviewTime;
+
+    @ApiModelProperty(value = "人工复核原因")
+    private String manualReviewReason;
+
     @ApiModelProperty(value = "审核时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date reviewDate;

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

@@ -79,3 +79,5 @@ public class StoreLicenseInfoVo {
 
 
 
+
+

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

@@ -191,7 +191,9 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
      *
      * @param page            分页对象
      * @param storeName       门店名称(模糊)
+     * @param storeContact    门店联系人(模糊)
      * @param storeTel        门店电话(模糊)
+     * @param businessSection 经营板块
      * @param imgType         证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)
      * @param states          证照状态
      * @param startSubmitDate 提交开始时间(yyyy-MM-dd HH:mm:ss)
@@ -200,7 +202,9 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
      */
     IPage<StoreLicenseInfoVo> getStoreLicensePage(IPage<StoreLicenseInfoVo> page,
                                                   @Param("storeName") String storeName,
+                                                  @Param("storeContact") String storeContact,
                                                   @Param("storeTel") String storeTel,
+                                                  @Param("businessSection") String businessSection,
                                                   @Param("imgType") Integer imgType,
                                                   @Param("states") String states,
                                                   @Param("startSubmitDate") String startSubmitDate,

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

@@ -69,9 +69,15 @@
         <if test="storeName != null and storeName != ''">
             AND s.store_name LIKE CONCAT('%', #{storeName}, '%')
         </if>
+        <if test="storeContact != null and storeContact != ''">
+            AND su.name LIKE CONCAT('%', #{storeContact}, '%')
+        </if>
         <if test="storeTel != null and storeTel != ''">
             AND s.store_tel LIKE CONCAT('%', #{storeTel}, '%')
         </if>
+        <if test="businessSection != null and businessSection != ''">
+            AND s.business_section = #{businessSection}
+        </if>
         <if test="imgType != null">
             AND si.img_type = #{imgType}
         </if>

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

@@ -252,7 +252,9 @@ public class StoreInfoController {
             @ApiImplicitParam(name = "weidu", value = "weidu", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "renewContractStatus", value = "门店续签合同状态", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "foodLicenceStatus", value = "门店经营许可证状态", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "foodLicenceWhetherExpiredStatus", value = "门店经营许可证是否过期状态", dataType = "String", paramType = "query")
+            @ApiImplicitParam(name = "foodLicenceWhetherExpiredStatus", value = "门店经营许可证是否过期状态", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "startApplyTime", value = "开始时间", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "endApplyTime", value = "结束时间", dataType = "String", paramType = "query")
     })
     @GetMapping("/getNewStorePage")
     public R<IPage<StoreInfoVo>> getNewStorePage(
@@ -271,7 +273,9 @@ public class StoreInfoController {
             @RequestParam(required = false) String weidu,
             @RequestParam(required = false) String renewContractStatus,
             @RequestParam(required = false) String foodLicenceStatus,
-            @RequestParam(required = false) String foodLicenceWhetherExpiredStatus)
+            @RequestParam(required = false) String foodLicenceWhetherExpiredStatus,
+            @RequestParam(required = false) String startApplyTime,
+            @RequestParam(required = false) String endApplyTime)
     {
         log.info("StoreInfoController.getStoresPage?pageNum={}," +
                         "pageSize={},storeName={},storeContact={}," +
@@ -279,12 +283,12 @@ public class StoreInfoController {
                         "storeApplicationStatus={},storeStatus={}," +
                         "businessSection={},jingdu={},weidu={}," +
                         "renewContractStatus={},foodLicenceStatus={}" +
-                        ",foodLicenceWhetherExpiredStatus={}",
+                        ",foodLicenceWhetherExpiredStatus={},startApplyTime={},endApplyTime={}",
                 pageNum, pageSize, storeName, storeContact,
                 id, storePhone, storeType, expiredState, storeApplicationStatus,
                 storeStatus, businessSection, jingdu, weidu, renewContractStatus,
-                foodLicenceStatus, foodLicenceWhetherExpiredStatus);
-        return R.data(storeInfoService.getNewStorePage(pageNum, pageSize, storeName, storeContact, id, storePhone, storeType, expiredState, storeApplicationStatus, storeStatus, businessSection, jingdu, weidu, renewContractStatus, foodLicenceStatus, foodLicenceWhetherExpiredStatus));
+                foodLicenceStatus, foodLicenceWhetherExpiredStatus, startApplyTime, endApplyTime);
+        return R.data(storeInfoService.getNewStorePage(pageNum, pageSize, storeName, storeContact, id, storePhone, storeType, expiredState, storeApplicationStatus, storeStatus, businessSection, jingdu, weidu, renewContractStatus, foodLicenceStatus, foodLicenceWhetherExpiredStatus, startApplyTime, endApplyTime));
     }
 
     /**
@@ -421,6 +425,25 @@ public class StoreInfoController {
         return R.success("审批完成");
     }
 
+    @ApiOperation(value = "web端人工复核店铺")
+    @ApiOperationSupport(order = 24)
+    @PostMapping("/manualReview")
+    public R<Boolean> manualReview(@RequestBody StoreInfoDto storeInfoDto) {
+        log.info("StoreInfoController.manualReview?storeInfoDto={}", storeInfoDto);
+        try {
+            boolean success = storeInfoService.manualReview(storeInfoDto);
+            if (success) {
+                return R.success("人工复核保存成功");
+            }
+            return R.fail("人工复核保存失败");
+        } catch (IllegalArgumentException e) {
+            return R.fail(e.getMessage());
+        } catch (Exception e) {
+            log.error("StoreInfoController.manualReview ERROR", e);
+            return R.fail("人工复核失败");
+        }
+    }
+
     @ApiOperation(value = "中台web端获取店铺明细详情")
     @ApiOperationSupport(order = 21)
     @GetMapping("/getNewStoreDetail")
@@ -1110,7 +1133,9 @@ public class StoreInfoController {
             @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 = "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 = "states", value = "证照状态", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "startSubmitDate", value = "提交开始时间(yyyy-MM-dd HH:mm:ss)", dataType = "String", paramType = "query"),
@@ -1120,14 +1145,16 @@ public class StoreInfoController {
             @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
             @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
             @RequestParam(value = "storeName", required = false) String storeName,
+            @RequestParam(value = "storeContact", required = false) String storeContact,
             @RequestParam(value = "storeTel", required = false) String storeTel,
+            @RequestParam(value = "businessSection", required = false) String businessSection,
             @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);
+        log.info("StoreInfoController.getStoreLicenseList?pageNum={},pageSize={},storeName={},storeContact={},storeTel={},businessSection={},imgType={},states={},startSubmitDate={},endSubmitDate={}",
+                pageNum, pageSize, storeName, storeContact, storeTel, businessSection, imgType, states, startSubmitDate, endSubmitDate);
+        IPage<StoreLicenseInfoVo> page = storeInfoService.getStoreLicenseList(pageNum, pageSize, storeName, storeContact, storeTel, businessSection, imgType, states, startSubmitDate, endSubmitDate);
         return R.data(page);
     }
 

+ 13 - 1
alien-store/src/main/java/shop/alien/store/service/StoreInfoService.java

@@ -72,7 +72,7 @@ public interface StoreInfoService extends IService<StoreInfo> {
      * @param storeType    门店类型
      * @return IPage<StoreInfoVo>
      */
-    IPage<StoreInfoVo> getNewStorePage(int page, int size, String storeName, String storeContact, String id, String storePhone, String storeType, String expiredState, String storeApplicationStatus, String storeStatus, String businessSection, String jingdu, String weidu, String renewContractStatus, String foodLicenceStatus, String foodLicenceWhetherExpiredStatus);
+    IPage<StoreInfoVo> getNewStorePage(int page, int size, String storeName, String storeContact, String id, String storePhone, String storeType, String expiredState, String storeApplicationStatus, String storeStatus, String businessSection, String jingdu, String weidu, String renewContractStatus, String foodLicenceStatus, String foodLicenceWhetherExpiredStatus, String startApplyTime, String endApplyTime);
 
     /**
      * web-重置门店密码
@@ -194,6 +194,14 @@ public interface StoreInfoService extends IService<StoreInfo> {
     void approveStoreInfo(String storeId, Integer approvalStatus, String reason);
 
     /**
+     * web端人工复核店铺
+     *
+     * @param storeInfoDto 复核信息(包含门店ID、复核状态、时间、原因)
+     * @return true 表示保存成功
+     */
+    boolean manualReview(StoreInfoDto storeInfoDto);
+
+    /**
      * web端导出商铺信息结果
      */
     String exportExcel(String id, String storePhone, String businessSection, String storeApplicationStatus) throws IOException;
@@ -453,7 +461,9 @@ public interface StoreInfoService extends IService<StoreInfo> {
      * @param pageNum         页码
      * @param pageSize        页容
      * @param storeName       门店名称(模糊)
+     * @param storeContact    联系人姓名(模糊)
      * @param storeTel        门店电话(模糊)
+     * @param businessSection 经营板块
      * @param imgType         证照图片类型(14:营业执照;24/25:食品经营许可证;31/32:娱乐经营许可证)
      * @param states          证照状态
      * @param startSubmitDate 提交开始时间(yyyy-MM-dd HH:mm:ss)
@@ -463,7 +473,9 @@ public interface StoreInfoService extends IService<StoreInfo> {
     IPage<StoreLicenseInfoVo> getStoreLicenseList(int pageNum,
                                                   int pageSize,
                                                   String storeName,
+                                                  String storeContact,
                                                   String storeTel,
+                                                  String businessSection,
                                                   Integer imgType,
                                                   String states,
                                                   String startSubmitDate,

+ 30 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -520,11 +520,14 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     }
 
     @Override
-    public IPage<StoreInfoVo> getNewStorePage(int page, int size, String storeName, String storeContact, String id, String storePhone, String storeType, String expiredState, String storeApplicationStatus, String storeStatus, String businessSection, String jingdu, String weidu, String renewContractStatus, String foodLicenceStatus, String foodLicenceWhetherExpiredStatus) {
+    public IPage<StoreInfoVo> getNewStorePage(int page, int size, String storeName, String storeContact, String id, String storePhone, String storeType, String expiredState, String storeApplicationStatus, String storeStatus, String businessSection, String jingdu, String weidu, String renewContractStatus, String foodLicenceStatus, String foodLicenceWhetherExpiredStatus, String startApplyTime, String endApplyTime) {
         checkAndUpdateExpiredRecords();
         IPage<StoreInfoVo> iPage = new Page<>(page, size);
         QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
         queryWrapper.like(storeName != null && !storeName.isEmpty(), "a.store_name", storeName).like(storeContact != null && !storeContact.isEmpty(), "b.name", storeContact).like(storePhone != null && !storePhone.isEmpty(), "b.phone", storePhone).like(storeType != null && !storeType.isEmpty(), "a.store_type", storeType).eq(StringUtils.isNotEmpty(storeApplicationStatus), "a.store_application_status", storeApplicationStatus).eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection).eq(StringUtils.isNotEmpty(storeStatus), "a.store_status", storeStatus).eq(StringUtils.isNotEmpty(renewContractStatus), "a.renew_contract_status", renewContractStatus).eq(StringUtils.isNotEmpty(foodLicenceStatus), "a.food_licence_status", foodLicenceStatus).like(StringUtils.isNotEmpty(id), "a.id", id).eq("a.delete_flag", 0).eq("b.delete_flag", 0).orderByDesc("a.created_time");
+        if (StringUtils.isNotEmpty(startApplyTime) && StringUtils.isNotEmpty(endApplyTime)) {
+            queryWrapper.between("a.created_time", startApplyTime,endApplyTime);
+        }
         //如果查询未过期
         // 获取当前时刻
         Date currentDate = new Date();
@@ -1865,6 +1868,29 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     }
 
     @Override
+    public boolean manualReview(StoreInfoDto storeInfoDto) {
+        if (storeInfoDto == null || storeInfoDto.getId() == null) {
+            throw new IllegalArgumentException("门店ID不能为空");
+        }
+
+        LambdaUpdateWrapper<StoreInfo> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(StoreInfo::getId, storeInfoDto.getId());
+
+        if (storeInfoDto.getManualReviewStatus() != null) {
+            wrapper.set(StoreInfo::getManualReviewStatus, storeInfoDto.getManualReviewStatus());
+        }
+
+        Date reviewTime = storeInfoDto.getManualReviewTime() == null ? new Date() : storeInfoDto.getManualReviewTime();
+        wrapper.set(StoreInfo::getManualReviewTime, reviewTime);
+
+        if (StringUtils.isNotEmpty(storeInfoDto.getManualReviewReason())) {
+            wrapper.set(StoreInfo::getManualReviewReason, storeInfoDto.getManualReviewReason());
+        }
+
+        return storeInfoMapper.update(null, wrapper) > 0;
+    }
+
+    @Override
     public String exportExcel(String id, String storePhone, String businessSection, String storeApplicationStatusStr) throws IOException {
         // 定义格式化模式
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@@ -3789,13 +3815,15 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     public IPage<StoreLicenseInfoVo> getStoreLicenseList(int pageNum,
                                                          int pageSize,
                                                          String storeName,
+                                                         String storeContact,
                                                          String storeTel,
+                                                         String businessSection,
                                                          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);
+        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())