Procházet zdrojové kódy

门店基础信息 上传续签合同图片保存 获取续签状态

qxy před 1 týdnem
rodič
revize
184314c8ae

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

@@ -29,7 +29,7 @@ public class StoreInfo {
     @TableField("store_name")
     private String storeName;
 
-    @ApiModelProperty(value = "营业状态(0:正常营业, 1:暂停营业, 2:筹建中, 99:永久关门)")
+    @ApiModelProperty(value = "营业状态(-1:注销中, 0:正常营业, 1:暂停营业, 2:筹建中, 99:永久关门)")
     @TableField("business_status")
     private Integer businessStatus;
 
@@ -176,4 +176,13 @@ public class StoreInfo {
     @ApiModelProperty(value = "注销code")
     @TableField("logout_code")
     private String logoutCode;
+
+    @ApiModelProperty(value = "续签合同状态")
+    @TableField("renew_contract_status")
+    private Integer renewContractStatus;
+
+    @ApiModelProperty(value = "续签合同拒绝原因")
+    @TableField("contract_reason")
+    private String contractReason;
+
 }

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

@@ -6,6 +6,8 @@ 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 shop.alien.entity.store.StoreBusinessInfo;
 
 import java.util.Date;
 import java.util.List;
@@ -56,6 +58,7 @@ public class StoreInfoDto {
 
     @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")
@@ -63,7 +66,8 @@ public class StoreInfoDto {
     private Integer createdUserId;
 
     @ApiModelProperty(value = "修改时间")
-    @JsonFormat(pattern = "yyyy-MM-dd h:m:s a", timezone = "GMT+8")
+    @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")
@@ -83,6 +87,7 @@ public class StoreInfoDto {
 
     @ApiModelProperty(value = "到期时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date expirationTime;
 
     @ApiModelProperty(value = "门店坐标")
@@ -152,4 +157,6 @@ public class StoreInfoDto {
     @TableField("commission_rate")
     private String commissionRate;
 
+    @ApiModelProperty(value = "门店营业时间")
+    private List<StoreBusinessInfo> storeBusinessTime;
 }

+ 20 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreMainInfoVo.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import shop.alien.entity.store.StoreBusinessInfo;
+import shop.alien.entity.store.StoreImg;
 import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.StoreLabel;
 
@@ -63,4 +64,23 @@ public class StoreMainInfoVo extends StoreInfo {
 
     @ApiModelProperty(value = "最近地铁站距离")
     private double distance2;
+
+    @ApiModelProperty(value = "营业执照")
+    private List<StoreImg> businessLicenseList;
+
+    @ApiModelProperty(value = "合同照片")
+    private List<StoreImg> contractList;
+
+    @ApiModelProperty(value = "是否连锁转义")
+    private String isChainStr;
+
+    @ApiModelProperty(value = "经营种类ids")
+    private List<String> businessTypesList;
+
+    @ApiModelProperty(value = "到期时间")
+    private String expirationDate;
+
+    @ApiModelProperty(value = "门店注销中倒计时时间毫秒")
+    private long countdown;
+
 }

+ 44 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreBusinessInfoController.java

@@ -1,14 +1,22 @@
 package shop.alien.store.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.StoreBusinessInfo;
+import shop.alien.entity.store.vo.StoreBusinessInfoVo;
+import shop.alien.mapper.StoreBusinessInfoMapper;
 import shop.alien.store.service.StoreBusinessInfoService;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
 
 /**
  * 门店营业时间Controller
@@ -27,6 +35,8 @@ public class StoreBusinessInfoController {
 
     private final StoreBusinessInfoService storeBusinessInfoService;
 
+    private final StoreBusinessInfoMapper storeBusinessInfoMapper;
+
     @ApiOperation("获取门店营业信息")
     @ApiOperationSupport(order = 1)
     @ApiImplicitParams({
@@ -52,6 +62,40 @@ public class StoreBusinessInfoController {
         return R.fail("新增失败");
     }
 
+    @ApiOperation("新增或修改门店营业信息批量保存")
+    @ApiOperationSupport(order = 4)
+    @PostMapping("/saveOrUpdateList")
+    public R<Boolean> saveOrUpdateList(@RequestBody List<StoreBusinessInfo> businessInfoList) {
+        log.info("StoreBusinessInfoController.order?storeBusinessInfoVo={}", businessInfoList);
+        boolean flag = false;
+        List<StoreBusinessInfo> toSave = new ArrayList<>();
+        List<StoreBusinessInfo> toUpdate = new ArrayList<>();
+        for (StoreBusinessInfo businessInfo : businessInfoList) {
+            if (businessInfo.getId() == null || businessInfo.getId() == 0) {
+                toSave.add(businessInfo);
+            } else {
+                toUpdate.add(businessInfo);
+            }
+        }
+
+        if (!toSave.isEmpty()) {
+            businessInfoList.stream().forEach(str -> {
+                LambdaQueryWrapper<StoreBusinessInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                lambdaQueryWrapper.eq(StoreBusinessInfo::getStoreId,str.getStoreId());
+                storeBusinessInfoService.remove(lambdaQueryWrapper);
+            });
+            flag = storeBusinessInfoService.saveBatch(toSave); // 批量保存
+        }
+        if(!toUpdate.isEmpty()){
+            flag = storeBusinessInfoService.updateBatchById(toUpdate); // 批量更新
+        }
+        if(flag){
+            return R.success("成功");
+        }else{
+            return R.fail("失败");
+        }
+    }
+
     @ApiOperation(value = "删除门店营业信息")
     @ApiOperationSupport(order = 3)
     @ApiImplicitParams({

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

@@ -1,5 +1,6 @@
 package shop.alien.store.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
@@ -8,6 +9,7 @@ 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.store.StoreImg;
 import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.StoreInfoDraft;
 import shop.alien.entity.store.dto.StoreInfoDto;
@@ -56,7 +58,7 @@ public class StoreInfoController {
     @ApiOperation("新增或修改门店")
     @ApiOperationSupport(order = 3)
     @PostMapping("/saveOrUpdate")
-    public R saveOrUpdate(@RequestBody StoreInfo storeInfo) {
+    public R saveOrUpdate(@RequestBody StoreInfoDto storeInfo) {
         log.info("StoreInfoController.saveOrUpdate?storeInfo={}", storeInfo);
         return R.data(storeInfoService.saveOrUpdateStoreInfo(storeInfo));
     }
@@ -111,7 +113,7 @@ public class StoreInfoController {
     @PostMapping("/updateStoreCommissionRate")
     public R updateStoreCommissionRate(@RequestBody StoreInfoDto storeInfoDto) {
         log.info("StoreInfoController.updateStoreCommissionRate?storeInfoDto={}", storeInfoDto);
-        if (storeInfoService.editStoreCommissionRate(storeInfoDto) >  0) {
+        if (storeInfoService.editStoreCommissionRate(storeInfoDto) > 0) {
             return R.data("成功");
         }
         return R.fail("失败");
@@ -130,7 +132,7 @@ public class StoreInfoController {
         }
         if ("成功".equals(s)) {
             return R.success(s);
-        }else {
+        } else {
             return R.fail(s);
         }
     }
@@ -351,8 +353,8 @@ public class StoreInfoController {
             @ApiImplicitParam(name = "reason", value = "原因", dataType = "String", paramType = "query")
     })
     @ResponseBody
-    public R approveStoreInfo(@RequestParam("id") String id, @RequestParam("approvalStatus") Integer approvalStatus,@RequestParam(value = "reason",required = false) String reason) {
-        log.info("StoreInfoController.approveStoreInfo?id={}&approvalStatus={}&reason={}", id, approvalStatus,reason);
+    public R approveStoreInfo(@RequestParam("id") String id, @RequestParam("approvalStatus") Integer approvalStatus, @RequestParam(value = "reason", required = false) String reason) {
+        log.info("StoreInfoController.approveStoreInfo?id={}&approvalStatus={}&reason={}", id, approvalStatus, reason);
         storeInfoService.approveStoreInfo(id, approvalStatus, reason);
         return R.success("审批完成");
     }
@@ -410,7 +412,7 @@ public class StoreInfoController {
     @ApiOperation(value = "取消注销店铺")
     @ApiOperationSupport(order = 15)
     @PostMapping("/cancelLogoutStore")
-    public R cancelLogoutStore(@RequestBody StoreInfoVo  storeInfo) {
+    public R cancelLogoutStore(@RequestBody StoreInfoVo storeInfo) {
         log.info("StoreInfoController.cancelLogoutStore?id={}", storeInfo.getId());
         try {
             storeInfoService.cancelLogoutStore(storeInfo);
@@ -502,6 +504,7 @@ public class StoreInfoController {
 
     /**
      * 商家端注销店铺效验
+     *
      * @param id 门店id
      */
     @ApiOperation("商家端注销店铺效验")
@@ -512,4 +515,66 @@ public class StoreInfoController {
         return R.data(storeInfoService.storeInfoVerification(id));
     }
 
+    /**
+     * 手动删除店铺
+     */
+    @ApiOperation("手动删除店铺")
+    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "门店id", dataType = "int", paramType = "query", required = true)})
+    @GetMapping("/deleteManualStoreInfo")
+    public R<StoreUserVo> deleteManualStoreInfo(int id) {
+        log.info("StoreUserController.deleteManualStoreInfo?id={}", id);
+        storeInfoService.deleteManualStoreInfo(id);
+        return R.success("删除成功");
+    }
+
+    @ApiOperation(value = "门店装修-详细信息")
+    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "门店id", dataType = "Long", paramType = "query", required = true)})
+    @GetMapping("/getDecorationDetail")
+    public R<StoreMainInfoVo> getDecorationDetail(Integer id) {
+        log.info("StoreInfoController.getDecorationDetail?id={}", id);
+        return R.data(storeInfoService.getDecorationDetail(id));
+    }
+
+    @ApiOperation(value = "门店装修-续签合同")
+    @PostMapping("/uploadRenewalContract")
+    public R<String> uploadRenewalContract(@RequestBody List<StoreImg> storeImgList) {
+        log.info("StoreInfoController.uploadRenewalContract?storeImgList={}", storeImgList);
+        int num = storeInfoService.uploadRenewalContract(storeImgList);
+        if (num <= 0) {
+            return R.fail("续签合同图片添加失败");
+        }
+        return R.success("续签合同图片添加成功");
+    }
+
+    @ApiOperation(value = "门店装修-续签合同状态及合同图片")
+    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "门店id", dataType = "int", paramType = "query", required = true)})
+    @GetMapping("/getStoreContractStatus")
+    public R<Map<String, Object>> getStoreContractStatus(int id) {
+        log.info("StoreInfoController.getStoreContractStatus?id={}", id);
+        return R.data(storeInfoService.getStoreContractStatus(id));
+    }
+
+    @ApiOperation(value = "门店装修-审核续签合同状态")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "门店id", dataType = "int"),
+            @ApiImplicitParam(name = "contractReason", value = "审核拒绝原因", dataType = "String"),
+            @ApiImplicitParam(name = "renewContractStatus", value = "审核续签合同状态", dataType = "int"),
+    })
+    @PostMapping("/updateContractImageStatus")
+    public R<String> updateContractImageStatus(int id, String contractReason, int renewContractStatus) {
+        log.info("StoreInfoController.updateContractImageStatus?id={}&contractReason={}&renewContractStatus{}", id, contractReason, renewContractStatus);
+        StoreInfo storeInfo = storeInfoService.getOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId, id));
+        if (storeInfo != null) {
+            if (renewContractStatus == 3) {
+                storeInfo.setContractReason(contractReason);
+            }
+            storeInfo.setRenewContractStatus(renewContractStatus);
+            boolean flag = storeInfoService.updateById(storeInfo);
+            if (flag) {
+                return R.success("审核成功");
+            }
+        }
+        return R.fail("审核失败 店铺不存在");
+
+    }
 }

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

@@ -401,7 +401,7 @@ public class StoreUserController {
     }
 
     /**
-     * 商家端撤销注销用户
+     * 手动删除商家账号及店铺
      */
     @ApiOperation("手动删除商家账号及店铺")
     @PostMapping("/deleteStoreAccountInfo")

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

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.multipart.MultipartRequest;
 import shop.alien.entity.result.R;
+import shop.alien.entity.store.StoreImg;
 import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.StoreInfoDraft;
 import shop.alien.entity.store.dto.StoreInfoDto;
@@ -31,6 +32,13 @@ public interface StoreInfoService extends IService<StoreInfo> {
     StoreMainInfoVo getDetail(Integer id);
 
     /**
+     * 门店装修详情
+     * @param id 门店id
+     * @param id 门店id
+     */
+    StoreMainInfoVo getDecorationDetail(Integer id);
+
+    /**
      * 门店信息-修改后展示
      *
      * @param id 门店id
@@ -221,11 +229,28 @@ public interface StoreInfoService extends IService<StoreInfo> {
      * @param storeInfo
      * @return
      */
-    R saveOrUpdateStoreInfo(StoreInfo storeInfo);
+    R saveOrUpdateStoreInfo(StoreInfoDto storeInfo);
 
     /**
      * 商家注销店铺效验
      */
     Map<String,String> storeInfoVerification(int id);
 
+    /**
+     * 手动删除店铺
+     * @param id
+     */
+    void deleteManualStoreInfo(int id);
+
+    /**
+     * 店铺续签合同
+     *
+     */
+    int uploadRenewalContract(List<StoreImg> storeImgList);
+
+    /**
+     * 获取店铺续签合同状态以及店铺状态为审核中合同图片list
+     *
+     */
+    Map<String,Object> getStoreContractStatus(int id);
 }

+ 164 - 13
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -183,6 +183,47 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         return storeMainInfoVo;
     }
 
+    @Override
+    public StoreMainInfoVo getDecorationDetail(Integer id) {
+        StoreInfo storeInfo = storeInfoMapper.selectById(id);
+        StoreMainInfoVo storeMainInfoVo = storeInfoMapper.getStoreInfo(id);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String expirationDate = sdf.format(storeMainInfoVo.getExpirationTime());
+        storeMainInfoVo.setExpirationDate(expirationDate);
+        //审核通过给前台反显未提交
+        if(storeMainInfoVo.getRenewContractStatus() == 1){
+            storeMainInfoVo.setRenewContractStatus(0);
+        }
+
+        if (storeMainInfoVo.getBusinessStatus() == -1) {
+            LocalDateTime localDateTime = storeMainInfoVo.getLogoutTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+            LocalDateTime future = localDateTime.plusDays(7);
+            LocalDateTime now = LocalDateTime.now();
+            Duration duration = Duration.between(now, future);
+            long correct = duration.toMillis();
+            storeMainInfoVo.setCountdown(correct);
+        }
+        //存入门店地址
+        storeMainInfoVo.setStoreAddress(storeInfo.getStoreAddress());
+        //经营种类
+        String[] strings = storeInfo.getBusinessTypes().split(",");
+        storeMainInfoVo.setBusinessTypesList(Arrays.stream(strings).collect(Collectors.toList()));
+        //门店标签
+        storeMainInfoVo.setStoreLabel(storeLabelMapper.selectOne(new LambdaQueryWrapper<StoreLabel>().eq(StoreLabel::getStoreId, id)));
+        //营业时间
+        List<StoreBusinessInfo> storeBusinessInfoList = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().eq(StoreBusinessInfo::getStoreId, id));
+        storeMainInfoVo.setStoreBusinessInfo(storeBusinessInfoList);
+        storeMainInfoVo.setStoreBusinessInfo(storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().eq(StoreBusinessInfo::getStoreId, id)));
+        //营业执照
+        storeMainInfoVo.setBusinessLicenseList(storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 14).eq(StoreImg::getStoreId, id)));
+        //合同照片
+        storeMainInfoVo.setContractList(storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 15).eq(StoreImg::getStoreId, id)));
+        //是否连锁
+        String isChain = (storeInfo.getIsChain() ==0) ?"否":"是";
+        storeMainInfoVo.setIsChainStr(isChain);
+        return storeMainInfoVo;
+    }
+
     /**
      * 门店信息-修改后展示
      *
@@ -1470,27 +1511,75 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     }
 
     @Override
-    public R saveOrUpdateStoreInfo(StoreInfo storeInfo) {
+    public R saveOrUpdateStoreInfo(StoreInfoDto storeInfodto) {
         try {
             boolean flag = false;
-            if (storeInfo.getId() != null) {
+            if (storeInfodto.getId() != null) {
                 //效验当前店铺存在未完成的订单及正在销售的商品
-                verificationStoreInfoStatus(storeInfo);
-                if (storeInfo.getBusinessStatus() == 0) {
-                    StoreInfo storeInfoOne = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId, storeInfo.getId()));
+                verificationStoreInfoStatus(storeInfodto);
+                if (storeInfodto.getBusinessStatus() == 0) {
+
+                    StoreInfo storeInfoOne = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId, storeInfodto.getId()));
                     if (storeInfoOne.getBusinessStatus() == 99) {
                         throw new RuntimeException("该店铺已经永久关闭不能更改状态为正常营业");
                     }
-                }
-                int num = storeInfoMapper.updateById(storeInfo);
-                if (num > 0) {
-                    flag = true;
-                } else {
-                    throw new RuntimeException("修改失败");
+
+                    //获取经营板块id
+                    Integer businessSection = storeInfodto.getBusinessSection();
+                    //查询经营板块名称
+                    StoreDictionary businessSectionName = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessSection).eq(StoreDictionary::getTypeName, "business_section"));
+                    //查询经营种类
+                    List<String> businessTypes = storeInfodto.getBusinessTypes();
+                    List<String> businessTypeNames = new ArrayList<>();
+                    //获取经营种类名称
+                    for (String businessType : businessTypes) {
+                        StoreDictionary storeDictionary =
+                                storeDictionaryMapper
+                                        .selectOne(
+                                                new LambdaQueryWrapper<StoreDictionary>()
+                                                        .eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
+                        businessTypeNames.add(storeDictionary.getDictDetail());
+                    }
+
+                    StoreInfo storeInfo = new StoreInfo();
+                    BeanUtils.copyProperties(storeInfodto, storeInfo);
+//
+                    //存入门店状态
+                    storeInfo.setStoreStatus(storeInfodto.getStoreStatus());
+                    //存入经纬度
+                    storeInfo.setStorePosition(storeInfodto.getStorePositionLongitude() + "," + storeInfodto.getStorePositionLatitude());
+
+                    //板块及类型
+                    storeInfo.setBusinessSection(businessSection);
+                    storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
+                    storeInfo.setBusinessTypes(String.join(",", businessTypes));
+                    storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
+                    //处理一下行政区域信息
+                    EssentialCityCode essentialCityCode1 =
+                            essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
+                    storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
+                    EssentialCityCode essentialCityCode2 =
+                            essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
+                    storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
+                    EssentialCityCode essentialCityCode3 =
+                            essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
+                    storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
+                    storeInfoMapper.updateById(storeInfo);
+                    nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfodto.getStorePositionLongitude()),
+                            Double.parseDouble(storeInfodto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
+
+                    int num = storeInfoMapper.updateById(storeInfoOne);
+                    if (num > 0) {
+                        flag = true;
+                    } else {
+                        throw new RuntimeException("修改失败");
+                    }
                 }
 
             } else {
-                int num = storeInfoMapper.insert(storeInfo);
+                StoreInfo storeInfoOne = new StoreInfo();
+                BeanUtils.copyProperties(storeInfodto, storeInfoOne);
+                int num = storeInfoMapper.insert(storeInfoOne);
                 if (num > 0) {
                     flag = true;
                 } else {
@@ -1537,7 +1626,69 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         return storeInfoMap;
     }
 
-    void verificationStoreInfoStatus(StoreInfo storeInfo) {
+    @Override
+    public void deleteManualStoreInfo(int id) {
+        LambdaQueryWrapper<StoreInfo> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(StoreInfo::getId, id);
+        StoreInfo storeInfo = storeInfoMapper.selectOne(queryWrapper);
+        if(storeInfo!=null && storeInfo.getBusinessStatus() == -1){
+           int num = storeInfoMapper.deleteById(id);
+           if(num<=0){
+               throw new RuntimeException("删除失败");
+           }
+        }
+    }
+
+    @Override
+    public int uploadRenewalContract(List<StoreImg> storeImgList) {
+        int num = 0;
+        for (StoreImg renewContract : storeImgList) {
+            StoreImg storeImg = new StoreImg();
+            storeImg.setStoreId(renewContract.getStoreId());
+            storeImg.setImgType(22);
+            storeImg.setImgSort(0);
+            storeImg.setImgDescription("续签合同图片");
+            storeImg.setImgUrl(renewContract.getImgUrl());
+            storeImg.setCreatedUserId(renewContract.getCreatedUserId());
+            num = storeImgMapper.insert(storeImg);
+            if(num>0){
+                Optional<Integer> storeId = storeImgList.stream().map(StoreImg::getStoreId).findFirst();
+                int value = storeId.orElse(0);
+                StoreInfo storeInfo = new StoreInfo();
+                storeInfo.setRenewContractStatus(2);
+                storeInfo.setId(value);
+                storeInfoMapper.updateById(storeInfo);
+            }
+        }
+            return num;
+    }
+
+    @Override
+    public Map<String, Object> getStoreContractStatus(int id) {
+        Map<String, Object> map = new HashMap<>();
+        StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId,id));
+        //审核通过给前台反显未提交
+        if(storeInfo.getRenewContractStatus() == 1){
+            map.put("renewContractStatus",0);
+        }else{
+            map.put("renewContractStatus",storeInfo.getRenewContractStatus());
+        }
+        //续签合同照片列表
+        List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType, 22).eq(StoreImg::getStoreId, id));
+        if(!CollectionUtils.isEmpty(storeImgList)){
+            map.put("contractImgList",storeImgList);
+        }else{
+            map.put("contractImgList","");
+        }
+        if(storeInfo.getContractReason()!=null){
+            map.put("contractReason",storeInfo.getContractReason());
+        }else{
+            map.put("contractReason","");
+        }
+        return map;
+    }
+
+    void verificationStoreInfoStatus(StoreInfoDto storeInfo) {
         //营业状态 0:正常营业, 1:暂停营业, 2:筹建中, 99:永久关门
          if (storeInfo.getBusinessStatus() == 2 || storeInfo.getBusinessStatus() == 99) {
             //判断店铺有未完成的订单