zjy 3 週間 前
コミット
8a64aa8329

+ 0 - 57
alien-entity/src/main/java/shop/alien/entity/store/dto/StoreLicenseHistoryDTO.java

@@ -1,57 +0,0 @@
-package shop.alien.entity.store.dto;
-
-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 org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-/**
- * 商户证照历史记录DTO
- *
- * @author system
- * @since 2025-11-24
- */
-@Data
-@JsonInclude
-@ApiModel(value = "StoreLicenseHistoryDTO对象", description = "商户证照历史记录DTO")
-public class StoreLicenseHistoryDTO {
-
-    @ApiModelProperty(value = "主键")
-    private Integer id;
-
-    @ApiModelProperty(value = "商户ID", required = true)
-    private Integer storeId;
-
-    @ApiModelProperty(value = "证照类型: 1-合同管理, 2-食品经营许可证", required = true)
-    private Integer licenseStatus;
-
-    @ApiModelProperty(value = "审核状态: 1-审核中, 2-审核拒绝, 3-审核通过", required = true)
-    private Integer licenseExecuteStatus;
-
-    @ApiModelProperty(value = "图片URL", required = true)
-    private String imgUrl;
-
-    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
-    private Integer deleteFlag;
-
-    @ApiModelProperty(value = "创建时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date createdTime;
-
-    @ApiModelProperty(value = "创建人ID")
-    private Integer createdUserId;
-
-    @ApiModelProperty(value = "修改时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date updatedTime;
-
-    @ApiModelProperty(value = "修改人ID")
-    private Integer updatedUserId;
-}
-

+ 5 - 2
alien-entity/src/main/java/shop/alien/entity/store/StoreLicenseHistory.java → alien-entity/src/main/java/shop/alien/entity/storePlatform/StoreLicenseHistory.java

@@ -1,4 +1,4 @@
-package shop.alien.entity.store;
+package shop.alien.entity.storePlatform;
 
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
@@ -42,9 +42,12 @@ public class StoreLicenseHistory extends Model<StoreLicenseHistory> {
     @TableField("img_url")
     private String imgUrl;
 
+    @ApiModelProperty(value = "拒绝原因")
+    @TableField("reason_refusal")
+    private String reasonRefusal;
+
     @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
     @TableField("delete_flag")
-    @TableLogic
     private Integer deleteFlag;
 
     @ApiModelProperty(value = "创建时间")

+ 35 - 0
alien-entity/src/main/java/shop/alien/entity/storePlatform/vo/StoreLicenseHistoryDto.java

@@ -0,0 +1,35 @@
+package shop.alien.entity.storePlatform.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.ibatis.type.Alias;
+import shop.alien.entity.storePlatform.StoreLicenseHistory;
+
+/**
+ * 商户证照历史记录展示DTO
+ * <p>
+ * 继承自 StoreLicenseHistory,添加了格式化的展示字段
+ * 注意:此类不用于数据库操作,仅用于数据展示
+ * </p>
+ *
+ * @author system
+ * @since 2025-11-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude
+@Alias("LicenseHistoryDisplayDto")  // 指定 MyBatis 别名,避免与 StoreLicenseHistoryDTO 冲突
+@ApiModel(value = "StoreLicenseHistoryDto对象", description = "商户证照历史记录展示DTO")
+public class StoreLicenseHistoryDto extends StoreLicenseHistory {
+
+    @ApiModelProperty(value = "格式化后的创建时间 (yyyy-MM-dd HH:mm:ss)")
+    private String createdDateFormat;
+
+    @ApiModelProperty(value = "审核状态名称")
+    private String licenseExecuteName;
+
+}
+

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreLicenseHistoryVO.java → alien-entity/src/main/java/shop/alien/entity/storePlatform/vo/StoreLicenseHistoryVO.java

@@ -1,4 +1,4 @@
-package shop.alien.entity.store.vo;
+package shop.alien.entity.storePlatform.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonInclude;

+ 0 - 17
alien-entity/src/main/java/shop/alien/mapper/StoreLicenseHistoryMapper.java

@@ -1,17 +0,0 @@
-package shop.alien.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import shop.alien.entity.store.StoreLicenseHistory;
-
-/**
- * 商户证照历史记录 Mapper 接口
- *
- * @author system
- * @since 2025-11-24
- */
-@Mapper
-public interface StoreLicenseHistoryMapper extends BaseMapper<StoreLicenseHistory> {
-
-}
-

+ 33 - 0
alien-entity/src/main/java/shop/alien/mapper/storePlantform/StoreLicenseHistoryMapper.java

@@ -0,0 +1,33 @@
+package shop.alien.mapper.storePlantform;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import shop.alien.entity.storePlatform.StoreLicenseHistory;
+
+import java.util.List;
+
+/**
+ * 商户证照历史记录 Mapper 接口
+ *
+ * @author system
+ * @since 2025-11-24
+ */
+public interface StoreLicenseHistoryMapper extends BaseMapper<StoreLicenseHistory> {
+
+    /**
+     * 根据商户ID、证照类型和删除标记查询证照历史记录列表
+     *
+     * @param storeId 商户ID
+     * @param licenseStatus 证照类型(1-合同管理,2-食品经营许可证)
+     * @param deleteFlag 删除标记(0-未删除,1-已删除)
+     * @return 证照历史记录列表
+     */
+    @Select("SELECT * FROM store_license_history WHERE store_id = #{storeId} AND license_status = #{licenseStatus} AND delete_flag = #{deleteFlag} ORDER BY created_time DESC")
+    List<StoreLicenseHistory> queryLicenceByStatusList(@Param("storeId") Integer storeId, 
+                                                        @Param("licenseStatus") Integer licenseStatus, 
+                                                        @Param("deleteFlag") Integer deleteFlag);
+
+}
+

+ 55 - 0
alien-store-platform/src/main/java/shop/alien/storeplatform/controller/LicenseController.java

@@ -6,6 +6,10 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.StoreImg;
+import shop.alien.entity.store.WebAudit;
+import shop.alien.entity.storePlatform.vo.StoreLicenseHistoryDto;
+import shop.alien.entity.storePlatform.vo.StoreLicenseHistoryVO;
+import shop.alien.mapper.WebAuditMapper;
 import shop.alien.storeplatform.service.LicenseService;
 
 import java.util.List;
@@ -21,6 +25,10 @@ import java.util.List;
 public class LicenseController {
 
     private final LicenseService licenseService;
+
+    private final WebAuditMapper webAuditMapper;
+
+
     @ApiOperation("获取营业执照图片信息")
     @ApiOperationSupport(order = 1)
     @ApiImplicitParams({
@@ -57,6 +65,53 @@ public class LicenseController {
         return R.data(result);
     }
 
+    @ApiOperation(value = "门店装修-食品经营许可证")
+    @PostMapping("/uploadfoodLicence")
+    public R<String> uploadfoodLicence(@RequestBody StoreImg storeImg) {
+        log.info("StoreInfoController.uploadfoodLicence?storeImg={}", storeImg);
+        int num = licenseService.uploadfoodLicence(storeImg);
+        if (num > 0) {
+            WebAudit webAudit = new WebAudit();
+            webAudit.setStoreInfoId(storeImg.getStoreId().toString());
+            webAudit.setType("7");
+            webAudit.setStatus("0");
+            webAudit.setContent("经营许可证");
+            webAuditMapper.insert(webAudit);
+            return R.success("食品经营许可证图片添加成功");
+        }
+        return R.fail("食品经营许可证图片添加失败");
+    }
+
+
+
+    @ApiOperation("根据商户ID获取经营许可证历史记录")
+    @ApiOperationSupport(order = 3)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "storeId", value = "商户ID", dataType = "Integer", paramType = "query", required = true)
+    })
+    @GetMapping("/queryLicenceByStatusList")
+    public R<List<StoreLicenseHistoryDto>> queryLicenceByStatusList(@RequestParam("storeId") Integer storeId) {
+        log.info("LicenseController.queryLicenceByStatusList: storeId={}", storeId);
+        try {
+            List<StoreLicenseHistoryDto> result = licenseService.queryLicenceByStatusList(storeId);
+            return R.data(result);
+        } catch (Exception e) {
+            log.error("LicenseController.queryLicenceByStatusList ERROR: {}", e.getMessage(), e);
+            return R.fail(e.getMessage());
+        }
+    }
+
+    @ApiOperation(value = "门店装修-续签合同")
+    @PostMapping("/uploadRenewalContract")
+    public R<String> uploadRenewalContract(@RequestBody List<StoreImg> storeImgList) {
+        log.info("StoreInfoController.uploadRenewalContract?storeImgList={}", storeImgList);
+        int num = licenseService.uploadRenewalContract(storeImgList);
+        if (num <= 0) {
+            return R.fail("续签合同图片添加失败");
+        }
+        return R.success("续签合同图片添加成功");
+    }
+
 }
 
 

+ 0 - 171
alien-store-platform/src/main/java/shop/alien/storeplatform/controller/StoreLicenseHistoryController.java

@@ -1,171 +0,0 @@
-package shop.alien.storeplatform.controller;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.*;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.StoreLicenseHistory;
-import shop.alien.entity.store.dto.StoreLicenseHistoryDTO;
-import shop.alien.entity.store.vo.StoreLicenseHistoryVO;
-import shop.alien.storeplatform.service.StoreLicenseHistoryService;
-
-import java.util.List;
-
-/**
- * 商户证照历史记录 Controller
- *
- * @author system
- * @since 2025-11-24
- */
-@Slf4j
-@Api(tags = {"商家端-证照历史管理"})
-@ApiSort(5)
-@CrossOrigin
-@RestController
-@RequestMapping("/storeLicenseHistory")
-@RequiredArgsConstructor
-public class StoreLicenseHistoryController {
-
-    private final StoreLicenseHistoryService storeLicenseHistoryService;
-
-    @ApiOperation("创建证照历史记录")
-    @ApiOperationSupport(order = 1)
-    @PostMapping("/create")
-    public R<StoreLicenseHistory> createLicenseHistory(@RequestBody @Validated StoreLicenseHistoryDTO dto) {
-        log.info("StoreLicenseHistoryController.createLicenseHistory: dto={}", dto);
-        try {
-            StoreLicenseHistory result = storeLicenseHistoryService.createLicenseHistory(dto);
-            return R.data(result, "创建成功");
-        } catch (Exception e) {
-            log.error("StoreLicenseHistoryController.createLicenseHistory ERROR: {}", e.getMessage(), e);
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @ApiOperation("更新证照历史记录")
-    @ApiOperationSupport(order = 2)
-    @PutMapping("/update")
-    public R<Boolean> updateLicenseHistory(@RequestBody @Validated StoreLicenseHistoryDTO dto) {
-        log.info("StoreLicenseHistoryController.updateLicenseHistory: dto={}", dto);
-        try {
-            boolean result = storeLicenseHistoryService.updateLicenseHistory(dto);
-            if (result) {
-                return R.data(true, "更新成功");
-            }
-            return R.fail("更新失败");
-        } catch (Exception e) {
-            log.error("StoreLicenseHistoryController.updateLicenseHistory ERROR: {}", e.getMessage(), e);
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @ApiOperation("删除证照历史记录")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "记录ID", dataType = "Integer", paramType = "query", required = true)
-    })
-    @DeleteMapping("/delete")
-    public R<Boolean> deleteLicenseHistory(@RequestParam("id") Integer id) {
-        log.info("StoreLicenseHistoryController.deleteLicenseHistory: id={}", id);
-        try {
-            boolean result = storeLicenseHistoryService.deleteLicenseHistory(id);
-            if (result) {
-                return R.data(true, "删除成功");
-            }
-            return R.fail("删除失败");
-        } catch (Exception e) {
-            log.error("StoreLicenseHistoryController.deleteLicenseHistory ERROR: {}", e.getMessage(), e);
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @ApiOperation("根据ID获取证照历史记录详情")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "记录ID", dataType = "Integer", paramType = "query", required = true)
-    })
-    @GetMapping("/getById")
-    public R<StoreLicenseHistoryVO> getLicenseHistoryById(@RequestParam("id") Integer id) {
-        log.info("StoreLicenseHistoryController.getLicenseHistoryById: id={}", id);
-        try {
-            StoreLicenseHistoryVO result = storeLicenseHistoryService.getLicenseHistoryById(id);
-            if (result != null) {
-                return R.data(result);
-            }
-            return R.fail("记录不存在");
-        } catch (Exception e) {
-            log.error("StoreLicenseHistoryController.getLicenseHistoryById ERROR: {}", e.getMessage(), e);
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @ApiOperation("根据商户ID获取证照历史记录列表")
-    @ApiOperationSupport(order = 5)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "storeId", value = "商户ID", dataType = "Integer", paramType = "query", required = true)
-    })
-    @GetMapping("/listByStoreId")
-    public R<List<StoreLicenseHistoryVO>> getLicenseHistoryListByStoreId(@RequestParam("storeId") Integer storeId) {
-        log.info("StoreLicenseHistoryController.getLicenseHistoryListByStoreId: storeId={}", storeId);
-        try {
-            List<StoreLicenseHistoryVO> result = storeLicenseHistoryService.getLicenseHistoryListByStoreId(storeId);
-            return R.data(result);
-        } catch (Exception e) {
-            log.error("StoreLicenseHistoryController.getLicenseHistoryListByStoreId ERROR: {}", e.getMessage(), e);
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @ApiOperation("根据商户ID和证照类型获取证照历史记录列表")
-    @ApiOperationSupport(order = 6)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "storeId", value = "商户ID", dataType = "Integer", paramType = "query", required = true),
-            @ApiImplicitParam(name = "licenseStatus", value = "证照类型: 1-合同管理, 2-食品经营许可证", dataType = "Integer", paramType = "query", required = true)
-    })
-    @GetMapping("/listByStoreIdAndType")
-    public R<List<StoreLicenseHistoryVO>> getLicenseHistoryListByStoreIdAndType(
-            @RequestParam("storeId") Integer storeId,
-            @RequestParam("licenseStatus") Integer licenseStatus) {
-        log.info("StoreLicenseHistoryController.getLicenseHistoryListByStoreIdAndType: storeId={}, licenseStatus={}", 
-                 storeId, licenseStatus);
-        try {
-            List<StoreLicenseHistoryVO> result = storeLicenseHistoryService.getLicenseHistoryListByStoreIdAndType(storeId, licenseStatus);
-            return R.data(result);
-        } catch (Exception e) {
-            log.error("StoreLicenseHistoryController.getLicenseHistoryListByStoreIdAndType ERROR: {}", e.getMessage(), e);
-            return R.fail(e.getMessage());
-        }
-    }
-
-    @ApiOperation("分页查询证照历史记录")
-    @ApiOperationSupport(order = 7)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "current", value = "当前页", dataType = "Long", paramType = "query", required = true, defaultValue = "1"),
-            @ApiImplicitParam(name = "size", value = "每页大小", dataType = "Long", paramType = "query", required = true, defaultValue = "10"),
-            @ApiImplicitParam(name = "storeId", value = "商户ID(可选)", dataType = "Integer", paramType = "query", required = false),
-            @ApiImplicitParam(name = "licenseStatus", value = "证照类型(可选): 1-合同管理, 2-食品经营许可证", dataType = "Integer", paramType = "query", required = false),
-            @ApiImplicitParam(name = "licenseExecuteStatus", value = "审核状态(可选): 1-审核中, 2-审核拒绝, 3-审核通过", dataType = "Integer", paramType = "query", required = false)
-    })
-    @GetMapping("/page")
-    public R<Page<StoreLicenseHistoryVO>> getLicenseHistoryPage(
-            @RequestParam(value = "current", defaultValue = "1") Long current,
-            @RequestParam(value = "size", defaultValue = "10") Long size,
-            @RequestParam(value = "storeId", required = false) Integer storeId,
-            @RequestParam(value = "licenseStatus", required = false) Integer licenseStatus,
-            @RequestParam(value = "licenseExecuteStatus", required = false) Integer licenseExecuteStatus) {
-        log.info("StoreLicenseHistoryController.getLicenseHistoryPage: current={}, size={}, storeId={}, licenseStatus={}, licenseExecuteStatus={}", 
-                 current, size, storeId, licenseStatus, licenseExecuteStatus);
-        try {
-            Page<StoreLicenseHistory> page = new Page<>(current, size);
-            Page<StoreLicenseHistoryVO> result = storeLicenseHistoryService.getLicenseHistoryPage(page, storeId, licenseStatus, licenseExecuteStatus);
-            return R.data(result);
-        } catch (Exception e) {
-            log.error("StoreLicenseHistoryController.getLicenseHistoryPage ERROR: {}", e.getMessage(), e);
-            return R.fail(e.getMessage());
-        }
-    }
-}
-

+ 18 - 0
alien-store-platform/src/main/java/shop/alien/storeplatform/service/LicenseService.java

@@ -2,16 +2,34 @@ package shop.alien.storeplatform.service;
 
 
 import shop.alien.entity.store.StoreImg;
+import shop.alien.entity.storePlatform.vo.StoreLicenseHistoryDto;
+import shop.alien.entity.storePlatform.vo.StoreLicenseHistoryVO;
 
 import java.util.List;
 
 public interface LicenseService {
 
+    int uploadfoodLicence(StoreImg storeImg);
+
     List<StoreImg> getbusinessLicenseList (Integer id);
 
     List<StoreImg> getContractList (Integer id);
 
     List<StoreImg> getFoodLicenceList (Integer id);
+
+    /**
+     * 根据商户ID查询证照历史记录列表(带格式化日期)
+     *
+     * @param storeId 商户ID
+     * @return 证照历史记录VO列表
+     */
+    List<StoreLicenseHistoryDto> queryLicenceByStatusList (Integer storeId);
+
+    /**
+     * 店铺续签合同
+     *
+     */
+    int uploadRenewalContract(List<StoreImg> storeImgList);
 }
 
 

+ 0 - 79
alien-store-platform/src/main/java/shop/alien/storeplatform/service/StoreLicenseHistoryService.java

@@ -1,79 +0,0 @@
-package shop.alien.storeplatform.service;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import shop.alien.entity.store.StoreLicenseHistory;
-import shop.alien.entity.store.dto.StoreLicenseHistoryDTO;
-import shop.alien.entity.store.vo.StoreLicenseHistoryVO;
-
-import java.util.List;
-
-/**
- * 商户证照历史记录 Service 接口
- *
- * @author system
- * @since 2025-11-24
- */
-public interface StoreLicenseHistoryService {
-
-    /**
-     * 创建证照历史记录
-     *
-     * @param dto 证照历史记录DTO
-     * @return 创建结果
-     */
-    StoreLicenseHistory createLicenseHistory(StoreLicenseHistoryDTO dto);
-
-    /**
-     * 更新证照历史记录
-     *
-     * @param dto 证照历史记录DTO
-     * @return 更新结果
-     */
-    boolean updateLicenseHistory(StoreLicenseHistoryDTO dto);
-
-    /**
-     * 根据ID删除证照历史记录
-     *
-     * @param id 记录ID
-     * @return 删除结果
-     */
-    boolean deleteLicenseHistory(Integer id);
-
-    /**
-     * 根据ID获取证照历史记录详情
-     *
-     * @param id 记录ID
-     * @return 证照历史记录详情
-     */
-    StoreLicenseHistoryVO getLicenseHistoryById(Integer id);
-
-    /**
-     * 根据商户ID获取证照历史记录列表
-     *
-     * @param storeId 商户ID
-     * @return 证照历史记录列表
-     */
-    List<StoreLicenseHistoryVO> getLicenseHistoryListByStoreId(Integer storeId);
-
-    /**
-     * 根据商户ID和证照类型获取证照历史记录列表
-     *
-     * @param storeId       商户ID
-     * @param licenseStatus 证照类型
-     * @return 证照历史记录列表
-     */
-    List<StoreLicenseHistoryVO> getLicenseHistoryListByStoreIdAndType(Integer storeId, Integer licenseStatus);
-
-    /**
-     * 分页查询证照历史记录
-     *
-     * @param page          分页对象
-     * @param storeId       商户ID(可选)
-     * @param licenseStatus 证照类型(可选)
-     * @param licenseExecuteStatus 审核状态(可选)
-     * @return 分页结果
-     */
-    Page<StoreLicenseHistoryVO> getLicenseHistoryPage(Page<StoreLicenseHistory> page, Integer storeId, 
-                                                       Integer licenseStatus, Integer licenseExecuteStatus);
-}
-

+ 197 - 5
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/LicenseServiceImpl.java

@@ -3,32 +3,224 @@ package shop.alien.storeplatform.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
-import shop.alien.entity.store.StoreImg;
+import shop.alien.entity.store.*;
+import shop.alien.entity.storePlatform.vo.StoreLicenseHistoryDto;
+import shop.alien.entity.storePlatform.vo.StoreLicenseHistoryVO;
+import shop.alien.entity.storePlatform.StoreLicenseHistory;
 import shop.alien.mapper.StoreImgMapper;
+import shop.alien.mapper.StoreInfoMapper;
+import shop.alien.mapper.storePlantform.StoreLicenseHistoryMapper;
 import shop.alien.storeplatform.service.LicenseService;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
+import java.util.Optional;
 
-
+/**
+ * 证照管理服务实现类
+ * <p>
+ * 提供商户证照图片和证照历史记录的管理功能,包括:
+ * 1. 营业执照、合同、食品经营许可证等图片的查询
+ * 2. 证照历史记录的增删改查操作
+ * </p>
+ *
+ * @author system
+ * @since 2025-11-24
+ */
 @Slf4j
 @Service
 @RequiredArgsConstructor
 public class LicenseServiceImpl implements LicenseService {
 
+    /** 商户图片数据访问对象 */
     private final StoreImgMapper storeImgMapper;
 
+    /** 商户证照历史记录数据访问对象 */
+    private final StoreLicenseHistoryMapper licenseHistoryMapper;
+
+    private final StoreInfoMapper storeInfoMapper;
+
+
+    @Override
+    public int uploadfoodLicence(StoreImg storeImg) {
+        storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType,24).eq(StoreImg::getStoreId,storeImg.getStoreId()));
+        storeImg.setImgType(24);
+        storeImg.setImgDescription("经营许可证审核通过前图片");
+        storeImgMapper.insert(storeImg);
+
+        // 经营许可证历史表插入
+        StoreLicenseHistory licenseHistory = new StoreLicenseHistory();
+        licenseHistory.setStoreId(storeImg.getStoreId());
+        licenseHistory.setLicenseStatus(2);
+        licenseHistory.setLicenseExecuteStatus(2);
+        licenseHistory.setImgUrl(storeImg.getImgUrl());
+        licenseHistory.setDeleteFlag(0);
+        licenseHistoryMapper.insert(licenseHistory);
+
+        //更新店铺
+        StoreInfo storeInfo = new StoreInfo();
+        storeInfo.setFoodLicenceStatus(2);
+        storeInfo.setId(storeImg.getStoreId());
+        storeInfo.setUpdateFoodLicenceTime(new Date());
+        return storeInfoMapper.updateById(storeInfo);
+    }
+
+    /**
+     * 获取营业执照图片列表
+     * <p>
+     * 查询指定商户的营业执照图片信息(图片类型为14)
+     * </p>
+     *
+     * @param id 商户ID
+     * @return 营业执照图片列表
+     */
+    @Override
     public List<StoreImg> getbusinessLicenseList (Integer id) {
-        return storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 14).eq(StoreImg::getStoreId, id));
+        // 查询图片类型为14(营业执照)的图片列表
+        return storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
+                .eq(StoreImg::getImgType, 14)
+                .eq(StoreImg::getStoreId, id));
     }
 
+    /**
+     * 获取合同图片列表
+     * <p>
+     * 查询指定商户的合同图片信息(图片类型为15)
+     * </p>
+     *
+     * @param id 商户ID
+     * @return 合同图片列表
+     */
+    @Override
     public List<StoreImg> getContractList (Integer id) {
-        return storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 15).eq(StoreImg::getStoreId, id));
+        // 查询图片类型为15(合同)的图片列表
+        return storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
+                .eq(StoreImg::getImgType, 15)
+                .eq(StoreImg::getStoreId, id));
     }
 
+    /**
+     * 获取食品经营许可证图片列表
+     * <p>
+     * 查询指定商户的食品经营许可证图片信息(图片类型为25)
+     * </p>
+     *
+     * @param id 商户ID
+     * @return 食品经营许可证图片列表
+     */
+    @Override
     public List<StoreImg> getFoodLicenceList (Integer id) {
-        return storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 25).eq(StoreImg::getStoreId, id));
+        // 查询图片类型为25(食品经营许可证)的图片列表
+        return storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
+                .eq(StoreImg::getImgType, 25)
+                .eq(StoreImg::getStoreId, id));
+    }
+
+    /**
+     * 根据商户ID查询证照历史记录列表(带格式化日期)
+     * <p>
+     * 查询指定商户的证照历史记录,将创建时间格式化为 yyyy-MM-dd 格式,
+     * 并转换为 VO 对象返回
+     * </p>
+     *
+     * @param storeId 商户ID
+     * @return 证照历史记录VO列表
+     */
+    @Override
+    public List<StoreLicenseHistoryDto> queryLicenceByStatusList (Integer storeId) {
+
+        List<StoreLicenseHistory> licenseList = licenseHistoryMapper.queryLicenceByStatusList(storeId, 2, 1);
+        
+        // 创建日期格式化对象,格式为 yyyy-MM-dd
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        
+        // 创建返回的 VO 列表
+        List<StoreLicenseHistoryDto> voList = new java.util.ArrayList<>();
+        
+        for (StoreLicenseHistory license : licenseList) {
+            // 创建 VO 对象
+            StoreLicenseHistoryDto vo = new StoreLicenseHistoryDto();
+
+            // 将实体对象属性复制到 VO 对象
+            BeanUtils.copyProperties(license, vo);
+            
+            // 将创建时间格式化为 yyyy-MM-dd 格式,去除时分秒
+            if (license.getCreatedTime() != null) {
+                String dateStr = sdf.format(license.getCreatedTime());
+                vo.setCreatedDateFormat(dateStr);
+            }
+            
+            // 设置审核状态名称
+            if (license.getLicenseExecuteStatus() != null) {
+                switch (license.getLicenseExecuteStatus()) {
+                    case 1:
+                        vo.setLicenseExecuteName("审核通过");
+                        break;
+                    case 2:
+                        vo.setLicenseExecuteName("审核中");
+                        break;
+                    case 3:
+                        vo.setLicenseExecuteName("审核失败");
+                        break;
+                    default:
+                        vo.setLicenseExecuteName("未知");
+                        break;
+                }
+            }
+            
+            voList.add(vo);
+        }
+        
+        return voList;
     }
 
+
+    @Override
+    public int uploadRenewalContract(List<StoreImg> storeImgList) {
+        //取出集合中门店id
+        Optional<Integer> storeId = storeImgList.stream().map(StoreImg::getStoreId).findFirst();
+        int value = storeId.orElse(0);
+        int num = 0;
+        //先清除数据
+        storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType,22).eq(StoreImg::getStoreId,value));
+        for (StoreImg renewContract : storeImgList) {
+            StoreImg storeImg = new StoreImg();
+            storeImg.setStoreId(renewContract.getStoreId());
+            storeImg.setImgType(22);
+            storeImg.setImgSort(renewContract.getImgSort());
+            storeImg.setImgDescription("续签合同图片");
+            storeImg.setImgUrl(renewContract.getImgUrl());
+            storeImg.setCreatedUserId(renewContract.getCreatedUserId());
+            num = storeImgMapper.insert(storeImg);
+
+            // 经营许可证历史表删除
+            licenseHistoryMapper.delete(new LambdaQueryWrapper<StoreLicenseHistory>()
+                    .eq(StoreLicenseHistory::getLicenseStatus,1)
+                    .eq(StoreLicenseHistory::getStoreId,storeImg.getStoreId()));
+            // 经营许可证历史表插入
+            StoreLicenseHistory licenseHistory = new StoreLicenseHistory();
+            licenseHistory.setStoreId(storeImg.getStoreId());
+            licenseHistory.setLicenseStatus(1);
+            licenseHistory.setLicenseExecuteStatus(2);
+            licenseHistory.setImgUrl(storeImg.getImgUrl());
+            licenseHistory.setDeleteFlag(0);
+            licenseHistoryMapper.insert(licenseHistory);
+        }
+        if (num > 0) {
+            StoreInfo storeInfo = new StoreInfo();
+            storeInfo.setRenewContractStatus(2);
+            storeInfo.setUpdateRenewContractTime(new Date());
+            storeInfo.setId(value);
+            storeInfoMapper.updateById(storeInfo);
+        }
+        return num;
+    }
+
+
+
 }
 

+ 0 - 241
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/StoreLicenseHistoryServiceImpl.java

@@ -1,241 +0,0 @@
-package shop.alien.storeplatform.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
-import org.springframework.stereotype.Service;
-import shop.alien.entity.result.BusinessException;
-import shop.alien.entity.store.StoreLicenseHistory;
-import shop.alien.entity.store.StoreInfo;
-import shop.alien.entity.store.dto.StoreLicenseHistoryDTO;
-import shop.alien.entity.store.vo.StoreLicenseHistoryVO;
-import shop.alien.mapper.StoreLicenseHistoryMapper;
-import shop.alien.mapper.StoreInfoMapper;
-import shop.alien.storeplatform.service.StoreLicenseHistoryService;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * 商户证照历史记录 Service 实现类
- *
- * @author system
- * @since 2025-11-24
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class StoreLicenseHistoryServiceImpl implements StoreLicenseHistoryService {
-
-    private final StoreLicenseHistoryMapper storeLicenseHistoryMapper;
-    private final StoreInfoMapper storeInfoMapper;
-
-    @Override
-    public StoreLicenseHistory createLicenseHistory(StoreLicenseHistoryDTO dto) {
-        log.info("StoreLicenseHistoryServiceImpl.createLicenseHistory: dto={}", dto);
-        
-        // 验证商户是否存在
-        StoreInfo storeInfo = storeInfoMapper.selectById(dto.getStoreId());
-        if (storeInfo == null) {
-            throw new BusinessException("商户不存在");
-        }
-
-        // 验证证照类型
-        if (dto.getLicenseStatus() == null || (dto.getLicenseStatus() != 1 && dto.getLicenseStatus() != 2)) {
-            throw new BusinessException("证照类型无效");
-        }
-
-        // 验证审核状态
-        if (dto.getLicenseExecuteStatus() == null || 
-            (dto.getLicenseExecuteStatus() < 1 || dto.getLicenseExecuteStatus() > 3)) {
-            throw new BusinessException("审核状态无效");
-        }
-
-        StoreLicenseHistory entity = new StoreLicenseHistory();
-        BeanUtils.copyProperties(dto, entity);
-        
-        int result = storeLicenseHistoryMapper.insert(entity);
-        if (result > 0) {
-            return entity;
-        }
-        throw new BusinessException("创建证照历史记录失败");
-    }
-
-    @Override
-    public boolean updateLicenseHistory(StoreLicenseHistoryDTO dto) {
-        log.info("StoreLicenseHistoryServiceImpl.updateLicenseHistory: dto={}", dto);
-        
-        if (dto.getId() == null) {
-            throw new BusinessException("记录ID不能为空");
-        }
-
-        StoreLicenseHistory existingRecord = storeLicenseHistoryMapper.selectById(dto.getId());
-        if (existingRecord == null) {
-            throw new BusinessException("证照历史记录不存在");
-        }
-
-        StoreLicenseHistory entity = new StoreLicenseHistory();
-        BeanUtils.copyProperties(dto, entity);
-        
-        int result = storeLicenseHistoryMapper.updateById(entity);
-        return result > 0;
-    }
-
-    @Override
-    public boolean deleteLicenseHistory(Integer id) {
-        log.info("StoreLicenseHistoryServiceImpl.deleteLicenseHistory: id={}", id);
-        
-        if (id == null) {
-            throw new BusinessException("记录ID不能为空");
-        }
-
-        StoreLicenseHistory existingRecord = storeLicenseHistoryMapper.selectById(id);
-        if (existingRecord == null) {
-            throw new BusinessException("证照历史记录不存在");
-        }
-
-        // 逻辑删除
-        int result = storeLicenseHistoryMapper.deleteById(id);
-        return result > 0;
-    }
-
-    @Override
-    public StoreLicenseHistoryVO getLicenseHistoryById(Integer id) {
-        log.info("StoreLicenseHistoryServiceImpl.getLicenseHistoryById: id={}", id);
-        
-        if (id == null) {
-            throw new BusinessException("记录ID不能为空");
-        }
-
-        StoreLicenseHistory entity = storeLicenseHistoryMapper.selectById(id);
-        if (entity == null) {
-            return null;
-        }
-
-        return convertToVO(entity);
-    }
-
-    @Override
-    public List<StoreLicenseHistoryVO> getLicenseHistoryListByStoreId(Integer storeId) {
-        log.info("StoreLicenseHistoryServiceImpl.getLicenseHistoryListByStoreId: storeId={}", storeId);
-        
-        if (storeId == null) {
-            throw new BusinessException("商户ID不能为空");
-        }
-
-        LambdaQueryWrapper<StoreLicenseHistory> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(StoreLicenseHistory::getStoreId, storeId)
-               .orderByDesc(StoreLicenseHistory::getCreatedTime);
-        
-        List<StoreLicenseHistory> list = storeLicenseHistoryMapper.selectList(wrapper);
-        return list.stream().map(this::convertToVO).collect(Collectors.toList());
-    }
-
-    @Override
-    public List<StoreLicenseHistoryVO> getLicenseHistoryListByStoreIdAndType(Integer storeId, Integer licenseStatus) {
-        log.info("StoreLicenseHistoryServiceImpl.getLicenseHistoryListByStoreIdAndType: storeId={}, licenseStatus={}", 
-                 storeId, licenseStatus);
-        
-        if (storeId == null) {
-            throw new BusinessException("商户ID不能为空");
-        }
-        if (licenseStatus == null) {
-            throw new BusinessException("证照类型不能为空");
-        }
-
-        LambdaQueryWrapper<StoreLicenseHistory> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(StoreLicenseHistory::getStoreId, storeId)
-               .eq(StoreLicenseHistory::getLicenseStatus, licenseStatus)
-               .orderByDesc(StoreLicenseHistory::getCreatedTime);
-        
-        List<StoreLicenseHistory> list = storeLicenseHistoryMapper.selectList(wrapper);
-        return list.stream().map(this::convertToVO).collect(Collectors.toList());
-    }
-
-    @Override
-    public Page<StoreLicenseHistoryVO> getLicenseHistoryPage(Page<StoreLicenseHistory> page, Integer storeId,
-                                                              Integer licenseStatus, Integer licenseExecuteStatus) {
-        log.info("StoreLicenseHistoryServiceImpl.getLicenseHistoryPage: page={}, storeId={}, licenseStatus={}, licenseExecuteStatus={}", 
-                 page, storeId, licenseStatus, licenseExecuteStatus);
-        
-        LambdaQueryWrapper<StoreLicenseHistory> wrapper = new LambdaQueryWrapper<>();
-        
-        if (storeId != null) {
-            wrapper.eq(StoreLicenseHistory::getStoreId, storeId);
-        }
-        if (licenseStatus != null) {
-            wrapper.eq(StoreLicenseHistory::getLicenseStatus, licenseStatus);
-        }
-        if (licenseExecuteStatus != null) {
-            wrapper.eq(StoreLicenseHistory::getLicenseExecuteStatus, licenseExecuteStatus);
-        }
-        
-        wrapper.orderByDesc(StoreLicenseHistory::getCreatedTime);
-        
-        IPage<StoreLicenseHistory> entityPage = storeLicenseHistoryMapper.selectPage(page, wrapper);
-        
-        // 转换为VO
-        Page<StoreLicenseHistoryVO> voPage = new Page<>(entityPage.getCurrent(), entityPage.getSize(), entityPage.getTotal());
-        List<StoreLicenseHistoryVO> voList = entityPage.getRecords().stream()
-                .map(this::convertToVO)
-                .collect(Collectors.toList());
-        voPage.setRecords(voList);
-        
-        return voPage;
-    }
-
-    /**
-     * 实体转VO
-     */
-    private StoreLicenseHistoryVO convertToVO(StoreLicenseHistory entity) {
-        StoreLicenseHistoryVO vo = new StoreLicenseHistoryVO();
-        BeanUtils.copyProperties(entity, vo);
-        
-        // 获取商户名称
-        if (entity.getStoreId() != null) {
-            StoreInfo storeInfo = storeInfoMapper.selectById(entity.getStoreId());
-            if (storeInfo != null) {
-                vo.setStoreName(storeInfo.getStoreName());
-            }
-        }
-        
-        // 设置证照类型名称
-        if (entity.getLicenseStatus() != null) {
-            switch (entity.getLicenseStatus()) {
-                case 1:
-                    vo.setLicenseStatusName("合同管理");
-                    break;
-                case 2:
-                    vo.setLicenseStatusName("食品经营许可证");
-                    break;
-                default:
-                    vo.setLicenseStatusName("未知");
-                    break;
-            }
-        }
-        
-        // 设置审核状态名称
-        if (entity.getLicenseExecuteStatus() != null) {
-            switch (entity.getLicenseExecuteStatus()) {
-                case 1:
-                    vo.setLicenseExecuteStatusName("审核中");
-                    break;
-                case 2:
-                    vo.setLicenseExecuteStatusName("审核拒绝");
-                    break;
-                case 3:
-                    vo.setLicenseExecuteStatusName("审核通过");
-                    break;
-                default:
-                    vo.setLicenseExecuteStatusName("未知");
-                    break;
-            }
-        }
-        
-        return vo;
-    }
-}
-

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

@@ -1,6 +1,7 @@
 package shop.alien.store.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
@@ -9,12 +10,15 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartRequest;
 import shop.alien.entity.result.R;
+import shop.alien.entity.second.SecondGoodsCategory;
 import shop.alien.entity.store.*;
 import shop.alien.entity.store.dto.StoreInfoDto;
 import shop.alien.entity.store.vo.*;
+import shop.alien.entity.storePlatform.StoreLicenseHistory;
 import shop.alien.mapper.StoreCommentSummaryInterestMapper;
 import shop.alien.mapper.TagsMainMapper;
 import shop.alien.mapper.WebAuditMapper;
+import shop.alien.mapper.storePlantform.StoreLicenseHistoryMapper;
 import shop.alien.store.config.BaseRedisService;
 import shop.alien.store.service.StoreInfoService;
 
@@ -48,6 +52,9 @@ public class StoreInfoController {
 
     private final StoreCommentSummaryInterestMapper storeCommentSummaryInterestMapper;
 
+    /** 商户证照历史记录数据访问对象 */
+    private final StoreLicenseHistoryMapper licenseHistoryMapper;
+
     @ApiOperation("获取所有门店")
     @ApiOperationSupport(order = 1)
     @GetMapping("/getAll")
@@ -615,6 +622,14 @@ public class StoreInfoController {
                 storeInfo.setFoodLicenceStatus(storeInfoDto.getFoodLicenceStatus());
                 boolean flag = storeInfoService.updateById(storeInfo);
                 if (flag) {
+                    // 审核拒绝时修改提交记录
+                    LambdaUpdateWrapper<StoreLicenseHistory> wrapper = new LambdaUpdateWrapper<>();
+                    wrapper.eq(StoreLicenseHistory::getStoreId, storeInfo.getId());
+                    wrapper.eq(StoreLicenseHistory::getLicenseStatus, 2);
+                    wrapper.set(StoreLicenseHistory::getLicenseExecuteStatus, 3);
+                    wrapper.set(StoreLicenseHistory::getDeleteFlag, 1);
+                    licenseHistoryMapper.update(null, wrapper);
+
                     //待审核状态变为已审核
                     WebAudit webAudit = webAuditMapper.selectOne(new LambdaQueryWrapper<WebAudit>().eq(WebAudit::getStoreInfoId, storeInfo.getId()).eq(WebAudit::getDeleteFlag, 0).eq(WebAudit::getType, "7"));
                     if (webAudit != null) {

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

@@ -30,7 +30,9 @@ import shop.alien.entity.store.excelVo.StoreInfoExpiredRecordsExcelVo;
 import shop.alien.entity.store.excelVo.util.ExcelExporter;
 import shop.alien.entity.store.excelVo.util.ExcelGenerator;
 import shop.alien.entity.store.vo.*;
+import shop.alien.entity.storePlatform.StoreLicenseHistory;
 import shop.alien.mapper.*;
+import shop.alien.mapper.storePlantform.StoreLicenseHistoryMapper;
 import shop.alien.store.config.BaseRedisService;
 import shop.alien.store.config.GaoDeMapUtil;
 import shop.alien.store.config.WebSocketProcess;
@@ -135,6 +137,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     private final LifeBlacklistMapper lifeBlacklistMapper;
 
+    /** 商户证照历史记录数据访问对象 */
+    private final StoreLicenseHistoryMapper licenseHistoryMapper;
+
     @Resource
     private StoreIncomeDetailsRecordService storeIncomeDetailsRecordService;
 
@@ -2196,6 +2201,19 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             storeImg.setImgType(24);
             storeImg.setImgDescription("经营许可证审核通过前图片");
             storeImgMapper.insert(storeImg);
+
+            licenseHistoryMapper.delete(new LambdaQueryWrapper<StoreLicenseHistory>()
+                    .eq(StoreLicenseHistory::getLicenseStatus,2)
+                    .eq(StoreLicenseHistory::getStoreId,storeImg.getStoreId()));
+            // 经营许可证历史表插入
+            StoreLicenseHistory licenseHistory = new StoreLicenseHistory();
+            licenseHistory.setStoreId(storeImg.getStoreId());
+            licenseHistory.setLicenseStatus(2);
+            licenseHistory.setLicenseExecuteStatus(2);
+            licenseHistory.setImgUrl(storeImg.getImgUrl());
+            licenseHistory.setDeleteFlag(0);
+            licenseHistoryMapper.insert(licenseHistory);
+
             //更新店铺
             StoreInfo storeInfo = new StoreInfo();
             storeInfo.setFoodLicenceStatus(2);
@@ -2284,6 +2302,23 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         LambdaUpdateWrapper<StoreImg> imgLambdaUpdateWrapper = new LambdaUpdateWrapper();
         imgLambdaUpdateWrapper.in(StoreImg::getId, imgList).set(StoreImg::getImgType, 25).set(StoreImg::getImgDescription,"经营许可证审核通过图片");
         int num = storeImgMapper.update(null, imgLambdaUpdateWrapper);
+
+        // 将原来的食品经营许可证历史表数据删除
+        licenseHistoryMapper.delete(new LambdaQueryWrapper<StoreLicenseHistory>()
+                .eq(StoreLicenseHistory::getStoreId,id)
+                .eq(StoreLicenseHistory::getLicenseStatus,2)
+                .eq(StoreLicenseHistory::getLicenseExecuteStatus,1)
+                .eq(StoreLicenseHistory::getDeleteFlag,0));
+
+        // 将新的食品经营许可证历史表数据变为审核通过
+        LambdaUpdateWrapper<StoreLicenseHistory> wrapper1 = new LambdaUpdateWrapper<>();
+        wrapper1.eq(StoreLicenseHistory::getStoreId, id);
+        wrapper1.eq(StoreLicenseHistory::getLicenseStatus, 2);
+        wrapper1.eq(StoreLicenseHistory::getLicenseExecuteStatus, 2);
+        wrapper1.eq(StoreLicenseHistory::getDeleteFlag, 0);
+        wrapper1.set(StoreLicenseHistory::getLicenseExecuteStatus, 1);
+        licenseHistoryMapper.update(null, wrapper1);
+
         return num;
     }