店铺申请

This commit is contained in:
墨大叔 2024-08-05 15:42:45 +08:00
parent 9b1ef44141
commit 51a3056fa3
20 changed files with 457 additions and 15 deletions

View File

@ -136,16 +136,19 @@ public class Store extends BaseEntity
@ApiModelProperty("联系人")
@NotNull(message = "联系人不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
@Size(max = 60, message = "联系人长度不能超过60个字符")
@JsonView(JsonViewProfile.App.class)
private String contactName;
@ApiModelProperty("联系电话")
@NotNull(message = "联系电话不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
@Size(min = 11, max = 11, message = "联系电话长度必须为11位")
@Pattern(regexp = RegexpUtils.MOBILE_PHONE_REGEXP, message = "联系电话格式不符合要求")
@JsonView(JsonViewProfile.App.class)
private String contactMobile;
@ApiModelProperty("是否展示店铺")
@NotNull(message = "是否展示店铺不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
@JsonView(JsonViewProfile.AppMch.class)
private Boolean show;
@ApiModelProperty("状态")

View File

@ -197,7 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="data.userId != null">user_id = #{data.userId},</if>
<if test="data.groupSort != null">group_sort = #{data.groupSort},</if>
<if test="data.picture != null">picture = #{data.picture},</if>
<if test="data.address != null and address != ''">address = #{data.address},</if>
<if test="data.address != null and data.address != ''">address = #{data.address},</if>
<if test="data.lng != null">lng = #{data.lng},</if>
<if test="data.lat != null">lat = #{data.lat},</if>
<if test="data.businessTimeStart != null">business_time_start = #{data.businessTimeStart},</if>
@ -216,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<update id="updateByQuery">
update sm_store
update sm_store ss
<trim prefix="SET" suffixOverrides=",">
<include refid="updateColumns"/>
</trim>

View File

@ -78,7 +78,12 @@ public interface StoreValidator {
ValidateResult preSetDefaultByApp(Long userId, Long storeId);
/**
* 是否正在变更
* 是否正在审核
*/
boolean isApproving(Store store);
/**
* 是否正在审核中
*/
boolean hasApproving(List<Long> ids);
}

View File

@ -55,6 +55,11 @@ public class StoreValidatorImpl extends BaseValidator implements StoreValidator
return error("当前店铺存在设备,不能删除");
}
// 判断是否正在审核中
if (this.hasApproving(ids)) {
return error("当前有店铺正在审核中,请稍后重试");
}
return success();
}
@ -267,6 +272,22 @@ public class StoreValidatorImpl extends BaseValidator implements StoreValidator
return store != null && StoreStatus.APPROVING.getStatus().equals(store.getStatus());
}
/**
* 是否正在审核中
*
* @param ids
*/
@Override
public boolean hasApproving(List<Long> ids) {
List<StoreVo> list = storeService.selectStoreByIds(ids);
for (StoreVo store : list) {
if (this.isApproving(store)) {
return true;
}
}
return false;
}
/**
* 校验时间是符合规则

View File

@ -1,5 +1,7 @@
package com.ruoyi.ss.storeApply.domain;
import com.fasterxml.jackson.annotation.JsonView;
import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.ss.store.domain.Store;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -8,6 +10,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.time.LocalDateTime;
/**
* 店铺审核对象 ss_store_apply
*
@ -19,23 +23,27 @@ public class StoreApply extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ApiModelProperty("${comment}")
@JsonView(JsonViewProfile.AppMch.class)
private Long id;
@Excel(name = "审核类型")
@ApiModelProperty("审核类型")
@JsonView(JsonViewProfile.AppMch.class)
private String applyType;
@Excel(name = "审核状态")
@ApiModelProperty("审核状态")
@JsonView(JsonViewProfile.AppMch.class)
private String status;
@Excel(name = "店铺id")
@ApiModelProperty("店铺id")
@JsonView(JsonViewProfile.AppMch.class)
private Long storeId;
@Excel(name = "提交人id")
@ApiModelProperty("提交人id")
@JsonView(JsonViewProfile.AppMch.class)
private Long userId;
@Excel(name = "审核人id")
@ -44,18 +52,22 @@ public class StoreApply extends BaseEntity
@Excel(name = "审核时间")
@ApiModelProperty("审核时间")
private Long verifyTime;
@JsonView(JsonViewProfile.AppMch.class)
private LocalDateTime verifyTime;
@Excel(name = "审核意见")
@ApiModelProperty("审核意见")
@JsonView(JsonViewProfile.AppMch.class)
private String verifyRemark;
@Excel(name = "旧数据json")
@ApiModelProperty("旧数据json")
@JsonView(JsonViewProfile.AppMch.class)
private Store oldData;
@Excel(name = "新数据json")
@ApiModelProperty("新数据json")
@JsonView(JsonViewProfile.AppMch.class)
private Store newData;
}

View File

@ -1,5 +1,7 @@
package com.ruoyi.ss.storeApply.domain;
import com.fasterxml.jackson.annotation.JsonView;
import com.ruoyi.common.core.domain.JsonViewProfile;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -11,11 +13,14 @@ import lombok.Data;
public class StoreApplyVO extends StoreApply {
@ApiModelProperty("店铺名称")
@JsonView(JsonViewProfile.AppMch.class)
private String storeName;
@ApiModelProperty("提交人名称")
@JsonView(JsonViewProfile.AppMch.class)
private String userName;
@ApiModelProperty("审核人名称")
@JsonView(JsonViewProfile.AppMch.class)
private String verifyName;
}

View File

@ -0,0 +1,38 @@
package com.ruoyi.ss.storeApply.domain.bo;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.storeApply.domain.StoreApply;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
import com.ruoyi.ss.storeApply.domain.dto.StoreApplyApprovalDTO;
import lombok.Data;
/**
* 店铺申请审核BO
* @author wjh
* 2024/8/5
*/
@Data
public class StoreApplyApprovalBO {
/**
* 原参数
*/
private StoreApplyApprovalDTO dto;
/**
* 审核单
*/
private StoreApplyVO apply;
/**
* 审核人
*/
private SysUser verifyUser;
/**
* 店铺信息
*/
private StoreVo store;
}

View File

@ -0,0 +1,27 @@
package com.ruoyi.ss.storeApply.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* @author wjh
* 2024/8/5
*/
@Data
public class StoreApplyApprovalDTO {
@ApiModelProperty("申请id")
@NotNull(message = "申请ID不允许为空")
private Long id;
@ApiModelProperty("申请是否通过")
@NotNull(message = "是否通过不允许为空")
private Boolean pass;
@ApiModelProperty("审核意见")
@Size(max = 200, message = "审核意见长度不能超过200个字符")
private String verifyRemark;
}

View File

@ -61,4 +61,14 @@ public interface StoreApplyMapper
* @return 结果
*/
public int deleteStoreApplyByIds(Long[] ids);
/**
* 条件更新
*/
int updateByQuery(@Param("data") StoreApply data, @Param("query") StoreApplyQuery query);
/**
* 查询一个
*/
StoreApplyVO selectOne(@Param("query") StoreApplyQuery query);
}

View File

@ -56,6 +56,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="selectOne" resultMap="StoreApplyResult">
<include refid="selectStoreApplyVo"/>
<where>
<include refid="searchCondition"/>
</where>
</select>
<insert id="insertStoreApply" parameterType="StoreApply" useGeneratedKeys="true" keyProperty="id">
insert into ss_store_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -87,20 +94,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateStoreApply" parameterType="StoreApply">
update ss_store_apply
<trim prefix="SET" suffixOverrides=",">
<if test="data.applyType != null and data.applyType != ''">apply_type = #{data.applyType},</if>
<if test="data.status != null">`status` = #{data.status},</if>
<if test="data.storeId != null">store_id = #{data.storeId},</if>
<if test="data.createTime != null">create_time = #{data.createTime},</if>
<if test="data.userId != null">user_id = #{data.userId},</if>
<if test="data.verifyId != null">verify_id = #{data.verifyId},</if>
<if test="data.verifyTime != null">verify_time = #{data.verifyTime},</if>
<if test="data.verifyRemark != null">verify_remark = #{data.verifyRemark},</if>
<if test="data.oldData != null">old_data = #{data.oldData,typeHandler=com.ruoyi.ss.storeApply.mapper.typehandler.StoreJsonTypeHandler},</if>
<if test="data.newData != null and data.newData != ''">new_data = #{data.newData,typeHandler=com.ruoyi.ss.storeApply.mapper.typehandler.StoreJsonTypeHandler},</if>
<include refid="updateColumns"/>
</trim>
where id = #{data.id}
</update>
<sql id="updateColumns">
<if test="data.applyType != null and data.applyType != ''">apply_type = #{data.applyType},</if>
<if test="data.status != null">`status` = #{data.status},</if>
<if test="data.storeId != null">store_id = #{data.storeId},</if>
<if test="data.createTime != null">create_time = #{data.createTime},</if>
<if test="data.userId != null">user_id = #{data.userId},</if>
<if test="data.verifyId != null">verify_id = #{data.verifyId},</if>
<if test="data.verifyTime != null">verify_time = #{data.verifyTime},</if>
<if test="data.verifyRemark != null">verify_remark = #{data.verifyRemark},</if>
<if test="data.oldData != null">old_data = #{data.oldData,typeHandler=com.ruoyi.ss.storeApply.mapper.typehandler.StoreJsonTypeHandler},</if>
<if test="data.newData != null and data.newData != ''">new_data = #{data.newData,typeHandler=com.ruoyi.ss.storeApply.mapper.typehandler.StoreJsonTypeHandler},</if>
</sql>
<update id="updateByQuery">
update ss_store_apply ssa
<trim prefix="SET" suffixOverrides=",">
<include refid="updateColumns"/>
</trim>
<where>
<include refid="searchCondition"/>
</where>
</update>
<delete id="deleteStoreApplyById" parameterType="Long">
delete from ss_store_apply where id = #{id}
</delete>

View File

@ -2,6 +2,8 @@ package com.ruoyi.ss.storeApply.service;
import com.ruoyi.ss.store.domain.StoreBO;
import com.ruoyi.ss.storeApply.domain.StoreApply;
import com.ruoyi.ss.storeApply.domain.bo.StoreApplyApprovalBO;
import com.ruoyi.ss.storeApply.domain.dto.StoreApplyApprovalDTO;
import com.ruoyi.ss.storeApply.domain.enums.StoreApplyType;
/**
@ -15,4 +17,9 @@ public interface StoreApplyConverter {
*/
StoreApply toPo(StoreBO store, Long userId, StoreApplyType type);
/**
* 审核DTO 转为 BO
*/
StoreApplyApprovalBO toBO(StoreApplyApprovalDTO dto);
}

View File

@ -6,6 +6,7 @@ import com.ruoyi.ss.store.domain.StoreBO;
import com.ruoyi.ss.storeApply.domain.StoreApply;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
import com.ruoyi.ss.storeApply.domain.StoreApplyQuery;
import com.ruoyi.ss.storeApply.domain.bo.StoreApplyApprovalBO;
/**
* 店铺审核Service接口
@ -62,4 +63,24 @@ public interface StoreApplyService
* @return 结果
*/
public int deleteStoreApplyById(Long id);
/**
* 审核
*/
int approval(StoreApplyApprovalBO bo);
/**
* 条件更新
*/
int updateByQuery(StoreApply data, StoreApplyQuery query);
/**
* 查询一个
*/
StoreApplyVO selectOne(StoreApplyQuery query);
/**
* 取消申请
*/
int cancel(Long id);
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.ss.storeApply.service;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
/**
* @author wjh
* 2024/8/5
*/
public interface StoreApplyValidator {
/**
* 申请是否属于用户
*/
boolean isBelong(StoreApplyVO apply, Long userId);
}

View File

@ -1,13 +1,18 @@
package com.ruoyi.ss.storeApply.service.impl;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.ss.store.domain.StoreBO;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.service.StoreService;
import com.ruoyi.ss.storeApply.domain.StoreApply;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
import com.ruoyi.ss.storeApply.domain.bo.StoreApplyApprovalBO;
import com.ruoyi.ss.storeApply.domain.dto.StoreApplyApprovalDTO;
import com.ruoyi.ss.storeApply.domain.enums.StoreApplyStatus;
import com.ruoyi.ss.storeApply.domain.enums.StoreApplyType;
import com.ruoyi.ss.storeApply.service.StoreApplyConverter;
import com.ruoyi.ss.storeApply.service.StoreApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -21,6 +26,9 @@ public class StoreApplyConverterImpl implements StoreApplyConverter {
@Autowired
private StoreService storeService;
@Autowired
private StoreApplyService storeApplyService;
/**
* 创建变更申请
*
@ -50,4 +58,27 @@ public class StoreApplyConverterImpl implements StoreApplyConverter {
return po;
}
/**
* 审核DTO 转为 BO
*
* @param dto
*/
@Override
public StoreApplyApprovalBO toBO(StoreApplyApprovalDTO dto) {
if (dto == null) {
return null;
}
StoreApplyVO apply = storeApplyService.selectStoreApplyById(dto.getId());
ServiceUtil.assertion(apply == null, "申请不存在");
StoreVo store = storeService.selectSmStoreById(apply.getStoreId());
StoreApplyApprovalBO bo = new StoreApplyApprovalBO();
bo.setApply(apply);
bo.setDto(dto);
bo.setVerifyUser(SecurityUtils.getLoginUser().getUser());
bo.setStore(store);
return bo;
}
}

View File

@ -1,8 +1,19 @@
package com.ruoyi.ss.storeApply.service.impl;
import java.time.LocalDateTime;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.ss.store.domain.Store;
import com.ruoyi.ss.store.domain.StoreBO;
import com.ruoyi.ss.store.domain.StoreQuery;
import com.ruoyi.ss.store.domain.enums.StoreStatus;
import com.ruoyi.ss.store.service.StoreService;
import com.ruoyi.ss.storeApply.domain.bo.StoreApplyApprovalBO;
import com.ruoyi.ss.storeApply.domain.dto.StoreApplyApprovalDTO;
import com.ruoyi.ss.storeApply.domain.enums.StoreApplyStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ss.storeApply.mapper.StoreApplyMapper;
@ -10,6 +21,7 @@ import com.ruoyi.ss.storeApply.domain.StoreApply;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
import com.ruoyi.ss.storeApply.domain.StoreApplyQuery;
import com.ruoyi.ss.storeApply.service.StoreApplyService;
import org.springframework.transaction.support.TransactionTemplate;
/**
* 店铺审核Service业务层处理
@ -23,6 +35,12 @@ public class StoreApplyServiceImpl implements StoreApplyService
@Autowired
private StoreApplyMapper storeApplyMapper;
@Autowired
private TransactionTemplate transactionTemplate;
@Autowired
private StoreService storeService;
/**
* 查询店铺审核
*
@ -96,4 +114,106 @@ public class StoreApplyServiceImpl implements StoreApplyService
return storeApplyMapper.deleteStoreApplyById(id);
}
@Override
public int approval(StoreApplyApprovalBO bo) {
ServiceUtil.assertion(bo == null, "参数错误");
StoreApplyApprovalDTO dto = bo.getDto();
ServiceUtil.assertion(dto == null, "原参数不存在");
StoreApplyVO apply = bo.getApply();
ServiceUtil.assertion(apply == null, "申请不存在");
ServiceUtil.assertion(apply.getId() == null, "申请参数有误");
SysUser verifyUser = bo.getVerifyUser();
ServiceUtil.assertion(verifyUser == null, "审核人不存在");
Integer result = transactionTemplate.execute(status -> {
// 修改状态
StoreApply data = new StoreApply();
data.setStatus(dto.getPass() ? StoreApplyStatus.PASS.getStatus() : StoreApplyStatus.REJECT.getStatus());
data.setVerifyId(verifyUser.getUserId());
data.setVerifyTime(LocalDateTime.now());
data.setVerifyRemark(dto.getVerifyRemark());
StoreApplyQuery query = new StoreApplyQuery();
query.setId(apply.getId());
query.setStatus(StoreApplyStatus.WAIT_AUDIT.getStatus());
int update = this.updateByQuery(data, query);
ServiceUtil.assertion(update != 1, "当前申请数据发生变化,请刷新后重试");
if (dto.getPass()) {
// 通过应用到设备中
int applyCount = this.applyToStore(apply);
ServiceUtil.assertion(applyCount != 1, "应用到店铺失败,请刷新后重试");
} else {
// 驳回店铺修改状态为正常
Store store = new Store();
store.setStoreId(apply.getStoreId());
store.setStatus(StoreStatus.NORMAL.getStatus());
int storeUpdate = storeService.updateSmStore(store);
ServiceUtil.assertion(storeUpdate != 1, "店铺状态修改失败,请刷新后重试");
}
return update;
});
return result == null ? 0 : result;
}
/**
* 应用到设备中
*/
private int applyToStore(StoreApply apply) {
Store newData = apply.getNewData();
if (newData == null) {
return 0;
}
newData.setStoreId(apply.getStoreId());
newData.setStatus(StoreStatus.NORMAL.getStatus());
newData.setEnabled(true);
return storeService.updateSmStore(newData);
}
@Override
public int updateByQuery(StoreApply data, StoreApplyQuery query) {
if (query == null) {
return 0;
}
return storeApplyMapper.updateByQuery(data, query);
}
@Override
public StoreApplyVO selectOne(StoreApplyQuery query) {
return storeApplyMapper.selectOne(query);
}
@Override
public int cancel(Long id) {
StoreApplyVO apply = selectStoreApplyById(id);
ServiceUtil.assertion(apply == null, "申请不存在");
Integer result = transactionTemplate.execute(status -> {
// 修改申请状态
StoreApply data = new StoreApply();
data.setStatus(StoreApplyStatus.CANCEL.getStatus());
StoreApplyQuery query = new StoreApplyQuery();
query.setId(id);
query.setStatus(StoreApplyStatus.WAIT_AUDIT.getStatus());
int update = this.updateByQuery(data, query);
ServiceUtil.assertion(update != 1, "当前申请数据发生变化,请刷新后重试");
// 修改店铺状态
Store storeData = new Store();
storeData.setStatus(StoreStatus.NORMAL.getStatus());
StoreQuery storeQuery = new StoreQuery();
storeQuery.setStoreId(apply.getStoreId());
int storeUpdate = storeService.updateByQuery(storeData, storeQuery);
ServiceUtil.assertion(storeUpdate != 1, "店铺状态修改失败,请刷新后重试");
return update;
});
return result == null ? 0 : result;
}
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.ss.storeApply.service.impl;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
import com.ruoyi.ss.storeApply.service.StoreApplyValidator;
import org.springframework.stereotype.Service;
/**
* @author wjh
* 2024/8/5
*/
@Service
public class StoreApplyValidatorImpl implements StoreApplyValidator {
/**
* 申请是否属于用户
*/
@Override
public boolean isBelong(StoreApplyVO apply, Long userId) {
return apply != null && apply.getUserId() != null && apply.getUserId().equals(userId);
}
}

View File

@ -123,6 +123,7 @@ public class AppStoreController extends BaseController {
@Anonymous
public AjaxResult listNearBy(@Validated(ValidGroup.Query.class) StoreQuery query) {
query.setShow(true);
query.setEnabled(true);
List<StoreVo> list = storeService.listNearBy(query);
storeAssembler.assembleDeviceCount(list);
return success(list);

View File

@ -0,0 +1,60 @@
package com.ruoyi.web.controller.mch;
import com.fasterxml.jackson.annotation.JsonView;
import com.github.pagehelper.PageHelper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.ss.store.service.StoreValidator;
import com.ruoyi.ss.storeApply.domain.StoreApplyQuery;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
import com.ruoyi.ss.storeApply.service.StoreApplyService;
import com.ruoyi.ss.storeApply.service.StoreApplyValidator;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
/**
* @author wjh
* 2024/8/5
*/
@RestController
@RequestMapping("/mch/storeApply")
public class MchStoreApplyController extends BaseController {
@Autowired
private StoreApplyService storeApplyService;
@Autowired
private StoreValidator storeValidator;
@Autowired
private StoreApplyValidator storeApplyValidator;
@ApiOperation("查询店铺最后一条申请信息")
@JsonView(JsonViewProfile.AppMch.class)
@GetMapping("/getLastByStore/{storeId}")
public AjaxResult getLastByStore(@PathVariable Long storeId) {
if (!storeValidator.isStoreBelongUser(Collections.singletonList(storeId), getUserId())) {
return error("这不是您的店铺");
}
PageHelper.orderBy(" create_time desc ");
StoreApplyQuery query = new StoreApplyQuery();
query.setStoreId(storeId);
return success(storeApplyService.selectOne(query));
}
@ApiOperation("取消申请")
@PutMapping("/{id}/cancel")
public AjaxResult cancel(@PathVariable @ApiParam("申请ID") Long id) {
StoreApplyVO apply = storeApplyService.selectStoreApplyById(id);
if (!storeApplyValidator.isBelong(apply, getUserId())) {
return error("这不是您的申请,无权取消");
}
return toAjax(storeApplyService.cancel(id));
}
}

View File

@ -2,8 +2,13 @@ package com.ruoyi.web.controller.ss;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import com.ruoyi.ss.storeApply.domain.dto.StoreApplyApprovalDTO;
import com.ruoyi.ss.storeApply.service.StoreApplyConverter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@ -36,6 +41,9 @@ public class StoreApplyController extends BaseController
@Autowired
private StoreApplyService storeApplyService;
@Autowired
private StoreApplyConverter storeApplyConverter;
/**
* 查询店铺审核列表
*/
@ -104,4 +112,16 @@ public class StoreApplyController extends BaseController
{
return toAjax(storeApplyService.deleteStoreApplyByIds(ids));
}
/**
* 审核店铺
*/
@PreAuthorize("@ss.hasPermi('ss:storeApply:approval')")
@Log(title = "店铺审核", businessType = BusinessType.OTHER)
@PutMapping("/approval")
public AjaxResult approval(@RequestBody @Validated StoreApplyApprovalDTO dto) {
return toAjax(storeApplyService.approval(storeApplyConverter.toBO(dto)));
}
}

View File

@ -59,6 +59,8 @@ public class StoreController extends BaseController
{
startPage();
List<StoreVo> list = storeService.selectSmStoreList(store);
storeAssembler.assembleDeviceCount(list);
storeAssembler.assembleRevenue(list);
return getDataTable(list);
}