Bladeren bron

新增修改商户入驻申请接口

codingliang 1 jaar geleden
bovenliggende
commit
41e8826e6f

+ 9 - 0
src/main/java/com/sqx/modules/shop/controller/AdminShopMessageController.java

@@ -2,6 +2,7 @@ package com.sqx.modules.shop.controller;
 
 import com.sqx.common.utils.Result;
 import com.sqx.modules.shop.dto.ShopAuditDTO;
+import com.sqx.modules.shop.dto.ShopAuditUpdateDTO;
 import com.sqx.modules.shop.service.ShopMessageService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -9,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -30,6 +32,13 @@ public class AdminShopMessageController {
         return shopMessageService.auditShopAuthentication(shopId, dto);
     }
 
+    @ApiOperation("修改商户入驻申请")
+    @PutMapping(value = "{shopId}")
+    public Result updateShopAuthentication(@PathVariable Long shopId, @RequestBody ShopAuditUpdateDTO dto){
+        shopMessageService.updateShopAuthentication(shopId, dto);
+        return Result.success();
+    }
+
     @ApiOperation("查看商户列表")
     @GetMapping(value = "selectShopList")
     public Result selectShopList(Integer page, Integer limit, String shopName, Integer status, Integer shopType){

+ 33 - 0
src/main/java/com/sqx/modules/shop/dto/ShopAuditUpdateDTO.java

@@ -0,0 +1,33 @@
+package com.sqx.modules.shop.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("商户审核信息修改DTO")
+public class ShopAuditUpdateDTO {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("商户封面图")
+    private String shopCover;
+
+    @ApiModelProperty("真实姓名")
+    private String realName;
+
+    @ApiModelProperty("身份证号")
+    private String identityCardNumber;
+
+    @ApiModelProperty("手机")
+    private String phone;
+
+    @ApiModelProperty("营业执照")
+    private String businessLicense;
+
+    @ApiModelProperty("身份证正面照片")
+    private String identityCardPro;
+
+    @ApiModelProperty("身份证反面照片")
+    private String identityCardCon;
+}

+ 7 - 0
src/main/java/com/sqx/modules/shop/service/ShopMessageService.java

@@ -5,6 +5,7 @@ import com.sqx.common.utils.Result;
 import com.sqx.modules.errand.entity.Feedback;
 import com.sqx.modules.goods.entity.GoodsShop;
 import com.sqx.modules.shop.dto.ShopAuditDTO;
+import com.sqx.modules.shop.dto.ShopAuditUpdateDTO;
 
 import java.math.BigDecimal;
 
@@ -44,4 +45,10 @@ public interface ShopMessageService extends IService<GoodsShop> {
 
     Result selectShopCashDepositList(Integer page, Integer limit, Long shopId);
 
+    /**
+     * 修改商户入驻申请
+     * @param shopId 店铺id
+     * @param dto 修改信息
+     */
+    void updateShopAuthentication(Long shopId, ShopAuditUpdateDTO dto);
 }

+ 53 - 0
src/main/java/com/sqx/modules/shop/service/impl/ShopMessageServiceImpl.java

@@ -1,6 +1,7 @@
 package com.sqx.modules.shop.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.common.exception.SqxException;
 import com.sqx.common.utils.Constant;
 import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
@@ -37,6 +39,7 @@ import com.sqx.modules.order.entity.TbOrder;
 import com.sqx.modules.pay.service.CashOutService;
 import com.sqx.modules.shop.dao.ShopMessageDao;
 import com.sqx.modules.shop.dto.ShopAuditDTO;
+import com.sqx.modules.shop.dto.ShopAuditUpdateDTO;
 import com.sqx.modules.shop.service.ShopMessageService;
 import com.sqx.modules.sys.dao.SysUserDao;
 import com.sqx.modules.sys.entity.SysUserEntity;
@@ -499,6 +502,56 @@ public class ShopMessageServiceImpl extends ServiceImpl<ShopMessageDao, GoodsSho
     }
 
     @Override
+    public void updateShopAuthentication(Long shopId, ShopAuditUpdateDTO dto) {
+        GoodsShop goodsShop = baseMapper.selectById(shopId);
+        if (ObjectUtil.isNull(goodsShop)) {
+            throw new SqxException("店铺信息不存在");
+        }
+
+        boolean isNeedUpdate = false;
+        GoodsShop newGoodsShop = new GoodsShop();
+        newGoodsShop.setShopId(shopId);
+        if (StrUtil.isNotBlank(dto.getShopCover())) {
+            newGoodsShop.setShopCover(dto.getShopCover());
+            isNeedUpdate = true;
+        }
+
+        if (StrUtil.isNotBlank(dto.getRealName())) {
+            newGoodsShop.setRealName(dto.getRealName());
+            isNeedUpdate = true;
+        }
+
+        if (StrUtil.isNotBlank(dto.getIdentityCardNumber())) {
+            newGoodsShop.setIdentitycardNumber(dto.getIdentityCardNumber());
+            isNeedUpdate = true;
+        }
+
+        if (StrUtil.isNotBlank(dto.getPhone())) {
+            newGoodsShop.setPhone(dto.getPhone());
+            isNeedUpdate = true;
+        }
+
+        if (StrUtil.isNotBlank(dto.getBusinessLicense())) {
+            newGoodsShop.setBusinessLicense(dto.getBusinessLicense());
+            isNeedUpdate = true;
+        }
+
+        if (StrUtil.isNotBlank(dto.getIdentityCardPro())) {
+            newGoodsShop.setIdentitycardPro(dto.getIdentityCardPro());
+            isNeedUpdate = true;
+        }
+
+        if (StrUtil.isNotBlank(dto.getIdentityCardCon())) {
+            newGoodsShop.setIdentitycardCon(dto.getIdentityCardCon());
+            isNeedUpdate = true;
+        }
+
+        if (isNeedUpdate) {
+            updateById(newGoodsShop);
+        }
+    }
+
+    @Override
     public Result sendMsgs(String phone, String state) {
         return userService.sendMsg(phone,"ruzhu");
     }