店铺类型
This commit is contained in:
parent
9ef5a10782
commit
e01affeaae
|
@ -95,4 +95,9 @@ public class CacheConstants
|
||||||
* 所有APP信息
|
* 所有APP信息
|
||||||
*/
|
*/
|
||||||
public static final String ALL_APP_LIST = "all_app_list";
|
public static final String ALL_APP_LIST = "all_app_list";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺类型名称列表
|
||||||
|
*/
|
||||||
|
public static final String STORE_TYPE_NAME_LIST = "store_type_name_list";
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,9 @@ import com.ruoyi.ss.refund.service.RefundService;
|
||||||
import com.ruoyi.ss.riskInfo.domain.RiskInfoQuery;
|
import com.ruoyi.ss.riskInfo.domain.RiskInfoQuery;
|
||||||
import com.ruoyi.ss.riskInfo.domain.enums.RiskInfoStatus;
|
import com.ruoyi.ss.riskInfo.domain.enums.RiskInfoStatus;
|
||||||
import com.ruoyi.ss.riskInfo.service.RiskInfoService;
|
import com.ruoyi.ss.riskInfo.service.RiskInfoService;
|
||||||
import com.ruoyi.ss.storeApply.domain.StoreApplyQuery;
|
import com.ruoyi.ss.store.domain.StoreQuery;
|
||||||
import com.ruoyi.ss.storeApply.domain.enums.StoreApplyStatus;
|
import com.ruoyi.ss.store.domain.enums.StoreStatus;
|
||||||
|
import com.ruoyi.ss.store.service.StoreService;
|
||||||
import com.ruoyi.ss.storeApply.service.StoreApplyService;
|
import com.ruoyi.ss.storeApply.service.StoreApplyService;
|
||||||
import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery;
|
import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery;
|
||||||
import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillGroupBy;
|
import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillGroupBy;
|
||||||
|
@ -129,6 +130,9 @@ public class DashboardService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RefundService refundService;
|
private RefundService refundService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StoreService storeService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RecordBalanceService recordBalanceService;
|
private RecordBalanceService recordBalanceService;
|
||||||
|
|
||||||
|
@ -149,10 +153,10 @@ public class DashboardService {
|
||||||
mchApplyQuery.setStatus(MchApplyStatus.APPROVING.getStatus());
|
mchApplyQuery.setStatus(MchApplyStatus.APPROVING.getStatus());
|
||||||
vo.setMchApplyCount(mchApplyService.selectCount(mchApplyQuery));
|
vo.setMchApplyCount(mchApplyService.selectCount(mchApplyQuery));
|
||||||
|
|
||||||
// 店铺申请
|
// 店铺审核
|
||||||
StoreApplyQuery storeApplyQuery = new StoreApplyQuery();
|
StoreQuery storeQuery = new StoreQuery();
|
||||||
storeApplyQuery.setStatus(StoreApplyStatus.WAIT_AUDIT.getStatus());
|
storeQuery.setStatus(StoreStatus.APPROVING.getStatus());
|
||||||
vo.setStoreApplyCount(storeApplyService.selectCount(storeApplyQuery));
|
vo.setStoreApplyCount(storeService.selectCount(storeQuery));
|
||||||
|
|
||||||
// 设备故障
|
// 设备故障
|
||||||
AbnormalQuery abnormalQuery = new AbnormalQuery();
|
AbnormalQuery abnormalQuery = new AbnormalQuery();
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.Date;
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import com.ruoyi.ss.device.domain.enums.DeviceOutageWay;
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,7 +41,7 @@ public class IotDeviceInfo {
|
||||||
info.setW(BigDecimal.ZERO);
|
info.setW(BigDecimal.ZERO);
|
||||||
info.setS("0");
|
info.setS("0");
|
||||||
info.setM(BigDecimal.ZERO);
|
info.setM(BigDecimal.ZERO);
|
||||||
info.setSet(DeviceOutageWay.IMMEDIATE.getValue());
|
info.setSet(null);
|
||||||
info.setTime(BigDecimal.ZERO);
|
info.setTime(BigDecimal.ZERO);
|
||||||
info.setModel(null);
|
info.setModel(null);
|
||||||
info.setVersion(null);
|
info.setVersion(null);
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class Device extends BaseEntity
|
||||||
|
|
||||||
@Excel(name = "开关设置方式")
|
@Excel(name = "开关设置方式")
|
||||||
@ApiModelProperty("开关设置方式")
|
@ApiModelProperty("开关设置方式")
|
||||||
private String outageWay;
|
private String set;
|
||||||
|
|
||||||
@Excel(name = "wifi名称")
|
@Excel(name = "wifi名称")
|
||||||
@ApiModelProperty("wifi名称")
|
@ApiModelProperty("wifi名称")
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package com.ruoyi.ss.device.domain.enums;
|
package com.ruoyi.ss.device.domain.enums;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开关SET
|
* 开关SET
|
||||||
* @author wjh
|
* @author wjh
|
||||||
|
@ -12,16 +12,16 @@ import java.util.Objects;
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Getter
|
@Getter
|
||||||
public enum DeviceOutageWay {
|
public enum DeviceSet {
|
||||||
|
|
||||||
NOT_OUTAGE("0", "正"),
|
POSITIVE("0", "正"),
|
||||||
IMMEDIATE("1", "反");
|
NEGATIVE("1", "反");
|
||||||
|
|
||||||
private final String value;
|
private final String value;
|
||||||
private final String msg;
|
private final String msg;
|
||||||
|
|
||||||
public static DeviceOutageWay parse(String value) {
|
public static DeviceSet parse(String value) {
|
||||||
for (DeviceOutageWay obj : DeviceOutageWay.values()) {
|
for (DeviceSet obj : DeviceSet.values()) {
|
||||||
if (Objects.equals(obj.getValue(), value)) {
|
if (Objects.equals(obj.getValue(), value)) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
package com.ruoyi.ss.device.domain.enums;
|
package com.ruoyi.ss.device.domain.enums;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备状态
|
* 设备状态
|
||||||
* @author wjh
|
* @author wjh
|
||||||
|
@ -16,7 +16,7 @@ public enum DeviceStatus {
|
||||||
|
|
||||||
NORMAL("1", "正常(空闲)"),
|
NORMAL("1", "正常(空闲)"),
|
||||||
USING("2", "使用中"),
|
USING("2", "使用中"),
|
||||||
FIXING("3", "维修中");
|
ADMIN("3", "调度中");
|
||||||
|
|
||||||
private final String status;
|
private final String status;
|
||||||
private final String msg;
|
private final String msg;
|
||||||
|
|
|
@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
sd.update_by,
|
sd.update_by,
|
||||||
sd.update_time,
|
sd.update_time,
|
||||||
sd.remark,
|
sd.remark,
|
||||||
sd.outage_way,
|
sd.set,
|
||||||
sd.wifi,
|
sd.wifi,
|
||||||
sd.deleted,
|
sd.deleted,
|
||||||
sd.last_pull_time,
|
sd.last_pull_time,
|
||||||
|
@ -377,7 +377,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
<if test="outageWay != null">outage_way,</if>
|
<if test="set != null">`set`,</if>
|
||||||
<if test="wifi != null">wifi,</if>
|
<if test="wifi != null">wifi,</if>
|
||||||
<if test="deleted != null">deleted,</if>
|
<if test="deleted != null">deleted,</if>
|
||||||
<if test="lastPullTime != null">last_pull_time,</if>
|
<if test="lastPullTime != null">last_pull_time,</if>
|
||||||
|
@ -436,7 +436,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
<if test="outageWay != null">#{outageWay},</if>
|
<if test="set != null">#{set},</if>
|
||||||
<if test="wifi != null">#{wifi},</if>
|
<if test="wifi != null">#{wifi},</if>
|
||||||
<if test="deleted != null">#{deleted},</if>
|
<if test="deleted != null">#{deleted},</if>
|
||||||
<if test="lastPullTime != null">#{lastPullTime},</if>
|
<if test="lastPullTime != null">#{lastPullTime},</if>
|
||||||
|
@ -528,7 +528,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
<if test="outageWay != null">outage_way = #{outageWay},</if>
|
<if test="set != null">`set` = #{set},</if>
|
||||||
<if test="wifi != null">wifi = #{wifi},</if>
|
<if test="wifi != null">wifi = #{wifi},</if>
|
||||||
<if test="deleted != null">deleted = #{deleted},</if>
|
<if test="deleted != null">deleted = #{deleted},</if>
|
||||||
<if test="lastPullTime != null">last_pull_time = #{lastPullTime},</if>
|
<if test="lastPullTime != null">last_pull_time = #{lastPullTime},</if>
|
||||||
|
@ -615,7 +615,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="realTimePower != null">real_time_power = #{realTimePower},</if>
|
<if test="realTimePower != null">real_time_power = #{realTimePower},</if>
|
||||||
<if test="electricity != null">electricity = #{electricity},</if>
|
<if test="electricity != null">electricity = #{electricity},</if>
|
||||||
<if test="voltage != null">voltage = #{voltage},</if>
|
<if test="voltage != null">voltage = #{voltage},</if>
|
||||||
<if test="outageWay != null">outage_way = #{outageWay},</if>
|
<if test="set != null">`set` = #{set},</if>
|
||||||
<if test="wifi != null">wifi = #{wifi},</if>
|
<if test="wifi != null">wifi = #{wifi},</if>
|
||||||
<if test="lastPullTime != null">last_pull_time = #{lastPullTime},</if>
|
<if test="lastPullTime != null">last_pull_time = #{lastPullTime},</if>
|
||||||
<if test="powerStatus != null">power_status = #{powerStatus},</if>
|
<if test="powerStatus != null">power_status = #{powerStatus},</if>
|
||||||
|
|
|
@ -247,7 +247,7 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
DeviceVO vo = this.selectById(data.getDeviceId());
|
DeviceVO vo = this.selectById(data.getDeviceId());
|
||||||
deviceAssembler.assembleBonusList(vo);
|
deviceAssembler.assembleBonusList(vo);
|
||||||
deviceValidator.afterCheck(vo);
|
deviceValidator.afterCheck(vo);
|
||||||
|
|
||||||
// 若修改了MAC或者型号,则需要重新注册到OneNet
|
// 若修改了MAC或者型号,则需要重新注册到OneNet
|
||||||
if (data.getMac() != null || data.getMac2() != null || data.getModelId() != null) {
|
if (data.getMac() != null || data.getMac2() != null || data.getModelId() != null) {
|
||||||
this.registerToOneNet(vo);
|
this.registerToOneNet(vo);
|
||||||
|
@ -537,7 +537,6 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
ServiceUtil.assertion(amount == null, "增加的电量不能为空");
|
ServiceUtil.assertion(amount == null, "增加的电量不能为空");
|
||||||
ServiceUtil.assertion( amount.compareTo(BigDecimal.ZERO) < 0, "增加的电量不允许小于0");
|
ServiceUtil.assertion( amount.compareTo(BigDecimal.ZERO) < 0, "增加的电量不允许小于0");
|
||||||
ServiceUtil.assertion(StringUtils.isAllBlank(device.getMac(), device.getMac2()), "设备MAC号为空");
|
ServiceUtil.assertion(StringUtils.isAllBlank(device.getMac(), device.getMac2()), "设备MAC号为空");
|
||||||
ServiceUtil.assertion(DeviceStatus.FIXING.getStatus().equals(device.getStatus()), "设备正在维修中,无法使用");
|
|
||||||
|
|
||||||
Integer result = transactionTemplate.execute(status -> {
|
Integer result = transactionTemplate.execute(status -> {
|
||||||
// 更新设备电量
|
// 更新设备电量
|
||||||
|
@ -743,7 +742,6 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
ServiceUtil.assertion( seconds < 0, "增加的时长不允许小于0");
|
ServiceUtil.assertion( seconds < 0, "增加的时长不允许小于0");
|
||||||
ServiceUtil.assertion(device == null || device.getDeviceId() == null, "设备不存在");
|
ServiceUtil.assertion(device == null || device.getDeviceId() == null, "设备不存在");
|
||||||
ServiceUtil.assertion(StringUtils.isAllBlank(device.getMac(), device.getMac2()), "设备MAC号为空");
|
ServiceUtil.assertion(StringUtils.isAllBlank(device.getMac(), device.getMac2()), "设备MAC号为空");
|
||||||
ServiceUtil.assertion(DeviceStatus.FIXING.getStatus().equals(device.getStatus()), "设备正在维修中,无法使用");
|
|
||||||
|
|
||||||
Long deviceId = device.getDeviceId();
|
Long deviceId = device.getDeviceId();
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
@ -819,14 +817,6 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
log.info("update count: {}", i);
|
log.info("update count: {}", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int changeStatus(Long deviceId, DeviceStatus status) {
|
|
||||||
Device device = new Device();
|
|
||||||
device.setDeviceId(deviceId);
|
|
||||||
device.setStatus(status.getStatus());
|
|
||||||
return deviceMapper.updateSmDevice(device);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int logicDel(List<Long> deviceIds) {
|
public int logicDel(List<Long> deviceIds) {
|
||||||
// 校验
|
// 校验
|
||||||
|
@ -958,8 +948,12 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
boolean hasOpen = DevicePowerStatus.ON.getStatus().equals(device.getPowerStatus());
|
boolean hasOpen = DevicePowerStatus.ON.getStatus().equals(device.getPowerStatus());
|
||||||
// 若设备有正在使用中的订单,则正在使用
|
// 若设备有正在使用中的订单,则正在使用
|
||||||
boolean hasUsingBill = device.getUsingBillCount() != null && device.getUsingBillCount() > 0;
|
boolean hasUsingBill = device.getUsingBillCount() != null && device.getUsingBillCount() > 0;
|
||||||
if (hasOpen || hasUsingBill) {
|
|
||||||
|
// 有订单为使用中,无订单且通电为调度中,否则为空闲
|
||||||
|
if (hasUsingBill) {
|
||||||
device.setStatus(DeviceStatus.USING.getStatus());
|
device.setStatus(DeviceStatus.USING.getStatus());
|
||||||
|
} else if (hasOpen) {
|
||||||
|
device.setStatus(DeviceStatus.ADMIN.getStatus());
|
||||||
} else {
|
} else {
|
||||||
device.setStatus(DeviceStatus.NORMAL.getStatus());
|
device.setStatus(DeviceStatus.NORMAL.getStatus());
|
||||||
}
|
}
|
||||||
|
@ -993,6 +987,7 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
device.setVersion(deviceInfo.getVersion());
|
device.setVersion(deviceInfo.getVersion());
|
||||||
device.setVxs(deviceInfo.getVxs());
|
device.setVxs(deviceInfo.getVxs());
|
||||||
device.setImsi(deviceInfo.getImsi());
|
device.setImsi(deviceInfo.getImsi());
|
||||||
|
device.setSet(deviceInfo.getSet());
|
||||||
|
|
||||||
// 判断是否支持WIFI,支持则更新
|
// 判断是否支持WIFI,支持则更新
|
||||||
if (ModelTag.hasTag(device.getModelTags(), ModelTag.WIFI)) {
|
if (ModelTag.hasTag(device.getModelTags(), ModelTag.WIFI)) {
|
||||||
|
@ -1069,6 +1064,7 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
data.setLastOnlineTime(device.getLastOnlineTime());
|
data.setLastOnlineTime(device.getLastOnlineTime());
|
||||||
data.setVersion(device.getVersion());
|
data.setVersion(device.getVersion());
|
||||||
data.setImsi(device.getImsi());
|
data.setImsi(device.getImsi());
|
||||||
|
data.setSet(device.getSet());
|
||||||
return deviceMapper.updateSmDevice(data);
|
return deviceMapper.updateSmDevice(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1383,20 +1379,6 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
this.syncEle(device.getDeviceId(), "设备监控-同步电量");
|
this.syncEle(device.getDeviceId(), "设备监控-同步电量");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 若当前设备数据库的时长并且电量<=0,且在这之后用户没有发open命令,则执行一次同步(关闭)
|
|
||||||
// boolean hasOpen = DeviceUserOperaType.OPEN.getType().equals(device.getUserOperaType()); // 是否开启过
|
|
||||||
// LocalDateTime lastOperaTime = device.getUserOperaTime(); // 上次操作的时间
|
|
||||||
// BigDecimal lastOperaEle = device.getUserOperaEle(); // 上次开启的总用电量
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// BigDecimal expireEle = device.getExpireEle(); // 过期电量
|
|
||||||
// boolean hasOperaAfterExpireEle = lastOperaEle != null && ( expireEle == null || lastOperaEle.compareTo(expireEle) > 0); // 是否在结束电量后操作
|
|
||||||
// boolean hasOpenAfterExpireEle = hasOpen && hasOperaAfterExpireEle; // 是否在结束电量后开启
|
|
||||||
// boolean hasEle = device.getSurplusEleDb().compareTo(BigDecimal.ZERO) > 0; // 剩余电量
|
|
||||||
// if (!hasTime && !hasEle && !hasOpenAfterExpireTime && !hasOpenAfterExpireEle && !isClose) {
|
|
||||||
// this.switchDevice(device, DevicePowerStatus.OFF, "设备监控-发现异常未关闭设备");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 根据上一次用户的操作来判断该怎么关闭设备
|
// 根据上一次用户的操作来判断该怎么关闭设备
|
||||||
// 若上次操作为充值时间,则判断是否还有剩余时间
|
// 若上次操作为充值时间,则判断是否还有剩余时间
|
||||||
boolean isClose = DevicePowerStatus.OFF.getStatus().equals(device.getPowerStatus()); // 是否关闭
|
boolean isClose = DevicePowerStatus.OFF.getStatus().equals(device.getPowerStatus()); // 是否关闭
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.ruoyi.ss.help.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import com.ruoyi.common.core.domain.ValidGroup;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教程对象 ss_help
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Help extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Excel(name = "标题")
|
||||||
|
@ApiModelProperty("标题")
|
||||||
|
@NotBlank(message = "标题不能为空", groups = {ValidGroup.Create.class})
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Excel(name = "状态", readConverterExp = "1=启用,2=禁用")
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
@NotBlank(message = "状态不能为空", groups = {ValidGroup.Create.class})
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Excel(name = "视频url")
|
||||||
|
@ApiModelProperty("视频url")
|
||||||
|
@NotBlank(message = "视频url不能为空", groups = {ValidGroup.Create.class})
|
||||||
|
private String videoUrl;
|
||||||
|
|
||||||
|
@Excel(name = "封面url")
|
||||||
|
@ApiModelProperty("封面url")
|
||||||
|
private String coverUrl;
|
||||||
|
|
||||||
|
@Excel(name = "编码")
|
||||||
|
@ApiModelProperty("编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.ruoyi.ss.help.domain;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HelpQuery extends HelpVO {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("精准教程编码")
|
||||||
|
private String eqCode;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.ruoyi.ss.help.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HelpVO extends Help{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.ruoyi.ss.help.domain.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum HelpStatus {
|
||||||
|
|
||||||
|
ENABLED("1", "启用"),
|
||||||
|
DISABLED("2", "禁用");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String name;
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.ruoyi.ss.help.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.ss.help.domain.Help;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpVO;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpQuery;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教程Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-26
|
||||||
|
*/
|
||||||
|
public interface HelpMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询教程
|
||||||
|
*
|
||||||
|
* @param id 教程主键
|
||||||
|
* @return 教程
|
||||||
|
*/
|
||||||
|
HelpVO selectHelpById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询教程列表
|
||||||
|
*
|
||||||
|
* @param query 教程
|
||||||
|
* @return 教程集合
|
||||||
|
*/
|
||||||
|
List<HelpVO> selectHelpList(@Param("query")HelpQuery query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增教程
|
||||||
|
*
|
||||||
|
* @param help 教程
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertHelp(Help help);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增教程
|
||||||
|
*/
|
||||||
|
int batchInsert(@Param("list") List<? extends Help> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量修改教程
|
||||||
|
*/
|
||||||
|
int batchUpdate(@Param("list") List<? extends Help> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改教程
|
||||||
|
*
|
||||||
|
* @param help 教程
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateHelp(@Param("data") Help help);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除教程
|
||||||
|
*
|
||||||
|
* @param id 教程主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteHelpById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除教程
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteHelpByIds(Long[] ids);
|
||||||
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.ss.help.mapper.HelpMapper">
|
||||||
|
|
||||||
|
<resultMap type="HelpVO" id="HelpResult" autoMapping="true"/>
|
||||||
|
|
||||||
|
<sql id="selectHelpVo">
|
||||||
|
select
|
||||||
|
sh.id,
|
||||||
|
sh.title,
|
||||||
|
sh.status,
|
||||||
|
sh.video_url,
|
||||||
|
sh.cover_url,
|
||||||
|
sh.create_time,
|
||||||
|
sh.update_time,
|
||||||
|
sh.remark,
|
||||||
|
code
|
||||||
|
from ss_help sh
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="searchCondition">
|
||||||
|
<if test="query.id != null "> and sh.id = #{query.id}</if>
|
||||||
|
<if test="query.title != null and query.title != ''"> and sh.title like concat('%', #{query.title}, '%')</if>
|
||||||
|
<if test="query.status != null and query.status != ''"> and sh.status = #{query.status}</if>
|
||||||
|
<if test="query.videoUrl != null and query.videoUrl != ''"> and sh.video_url like concat('%', #{query.videoUrl}, '%')</if>
|
||||||
|
<if test="query.remark != null and query.remark != ''"> and sh.remark like concat('%', #{query.remark}, '%')</if>
|
||||||
|
<if test="query.code != null and query.code != ''"> and sh.code like concat('%', #{query.code}, '%')</if>
|
||||||
|
<if test="query.eqCode != null and query.eqCode != ''"> and sh.code = #{query.eqCode}</if>
|
||||||
|
${query.params.dataScope}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectHelpList" parameterType="HelpQuery" resultMap="HelpResult">
|
||||||
|
<include refid="selectHelpVo"/>
|
||||||
|
<where>
|
||||||
|
<include refid="searchCondition"/>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectHelpById" parameterType="Long" resultMap="HelpResult">
|
||||||
|
<include refid="selectHelpVo"/>
|
||||||
|
where sh.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertHelp" parameterType="Help">
|
||||||
|
insert into ss_help
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="title != null and title != ''">title,</if>
|
||||||
|
<if test="status != null and status != ''">status,</if>
|
||||||
|
<if test="videoUrl != null and videoUrl != ''">video_url,</if>
|
||||||
|
<if test="coverUrl != null">cover_url,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="code != null">code,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="title != null and title != ''">#{title},</if>
|
||||||
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
|
<if test="videoUrl != null and videoUrl != ''">#{videoUrl},</if>
|
||||||
|
<if test="coverUrl != null">#{coverUrl},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="code != null">#{code},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateHelp" parameterType="Help">
|
||||||
|
update ss_help
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<include refid="updateColumns"/>
|
||||||
|
</trim>
|
||||||
|
where id = #{data.id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<sql id="updateColumns">
|
||||||
|
<if test="data.title != null and data.title != ''">title = #{data.title},</if>
|
||||||
|
<if test="data.status != null and data.status != ''">status = #{data.status},</if>
|
||||||
|
<if test="data.videoUrl != null and data.videoUrl != ''">video_url = #{data.videoUrl},</if>
|
||||||
|
<if test="data.coverUrl != null">cover_url = #{data.coverUrl},</if>
|
||||||
|
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||||
|
<if test="data.updateTime != null">update_time = #{data.updateTime},</if>
|
||||||
|
<if test="data.remark != null">remark = #{data.remark},</if>
|
||||||
|
<if test="data.code != null">code = #{data.code},</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<delete id="deleteHelpById" parameterType="Long">
|
||||||
|
delete from ss_help where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteHelpByIds" parameterType="String">
|
||||||
|
delete from ss_help where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.ruoyi.ss.help.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.ss.help.domain.Help;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpQuery;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教程Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-26
|
||||||
|
*/
|
||||||
|
public interface HelpService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询教程
|
||||||
|
*
|
||||||
|
* @param id 教程主键
|
||||||
|
* @return 教程
|
||||||
|
*/
|
||||||
|
public HelpVO selectHelpById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询教程列表
|
||||||
|
*
|
||||||
|
* @param help 教程
|
||||||
|
* @return 教程集合
|
||||||
|
*/
|
||||||
|
public List<HelpVO> selectHelpList(HelpQuery help);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增教程
|
||||||
|
*
|
||||||
|
* @param help 教程
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertHelp(Help help);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改教程
|
||||||
|
*
|
||||||
|
* @param help 教程
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateHelp(Help help);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除教程
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的教程主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteHelpByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除教程信息
|
||||||
|
*
|
||||||
|
* @param id 教程主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteHelpById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过教程编码获取教程详情
|
||||||
|
*
|
||||||
|
* @param code 教程编码
|
||||||
|
* @return 教程详情
|
||||||
|
*/
|
||||||
|
public HelpVO selectByCode(String code);
|
||||||
|
}
|
|
@ -0,0 +1,120 @@
|
||||||
|
package com.ruoyi.ss.help.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
|
import com.ruoyi.ss.help.domain.Help;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpQuery;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpVO;
|
||||||
|
import com.ruoyi.ss.help.mapper.HelpMapper;
|
||||||
|
import com.ruoyi.ss.help.service.HelpService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教程Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-26
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class HelpServiceImpl implements HelpService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private HelpMapper helpMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询教程
|
||||||
|
*
|
||||||
|
* @param id 教程主键
|
||||||
|
* @return 教程
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public HelpVO selectHelpById(Long id)
|
||||||
|
{
|
||||||
|
return helpMapper.selectHelpById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询教程列表
|
||||||
|
*
|
||||||
|
* @param help 教程
|
||||||
|
* @return 教程
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<HelpVO> selectHelpList(HelpQuery help)
|
||||||
|
{
|
||||||
|
return helpMapper.selectHelpList(help);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增教程
|
||||||
|
*
|
||||||
|
* @param help 教程
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertHelp(Help help)
|
||||||
|
{
|
||||||
|
help.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return helpMapper.insertHelp(help);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改教程
|
||||||
|
*
|
||||||
|
* @param help 教程
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateHelp(Help help)
|
||||||
|
{
|
||||||
|
help.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return helpMapper.updateHelp(help);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除教程
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的教程主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteHelpByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return helpMapper.deleteHelpByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除教程信息
|
||||||
|
*
|
||||||
|
* @param id 教程主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteHelpById(Long id)
|
||||||
|
{
|
||||||
|
return helpMapper.deleteHelpById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HelpVO selectByCode(String code) {
|
||||||
|
if (StringUtils.isBlank(code)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
HelpQuery query = new HelpQuery();
|
||||||
|
query.setEqCode(code);
|
||||||
|
return this.selectOne(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
private HelpVO selectOne(HelpQuery query) {
|
||||||
|
List<HelpVO> list = this.selectHelpList(query);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return list.get(0);
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,8 +17,6 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.core.domain.JsonViewProfile;
|
import com.ruoyi.common.core.domain.JsonViewProfile;
|
||||||
import com.ruoyi.common.core.domain.ValidGroup;
|
import com.ruoyi.common.core.domain.ValidGroup;
|
||||||
import com.ruoyi.common.utils.RegexpUtils;
|
import com.ruoyi.common.utils.RegexpUtils;
|
||||||
import com.ruoyi.common.valid.EnumValid;
|
|
||||||
import com.ruoyi.ss.store.domain.enums.StoreType;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -124,14 +122,9 @@ public class Store extends BaseEntity
|
||||||
private String county;
|
private String county;
|
||||||
|
|
||||||
@Excel(name = "店铺类型")
|
@Excel(name = "店铺类型")
|
||||||
@ApiModelProperty("店铺类型(1:商场,2:学校,3:娱乐场所,4:出租房,5:其它)")
|
@ApiModelProperty("店铺类型")
|
||||||
@NotNull(message = "店铺类型不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
@NotNull(message = "店铺类型不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
||||||
@EnumValid(
|
private Long typeId;
|
||||||
clazz = StoreType.class,
|
|
||||||
message = "非法的店铺类型",
|
|
||||||
method = "getType"
|
|
||||||
)
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
@ApiModelProperty("联系人")
|
@ApiModelProperty("联系人")
|
||||||
@NotNull(message = "联系人不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
@NotNull(message = "联系人不允许为空", groups = {ValidGroup.Create.class, ValidGroup.FrontCreate.class})
|
||||||
|
@ -163,4 +156,9 @@ public class Store extends BaseEntity
|
||||||
@ApiModelProperty("最后一次审核记录ID")
|
@ApiModelProperty("最后一次审核记录ID")
|
||||||
@JsonView(JsonViewProfile.App.class)
|
@JsonView(JsonViewProfile.App.class)
|
||||||
private Long applyId;
|
private Long applyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺描述")
|
||||||
|
@Size(max = 1000, message = "店铺描述长度不能超过1000个字符")
|
||||||
|
@JsonView(JsonViewProfile.App.class)
|
||||||
|
private String description;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,12 @@ public class StoreBO extends Store {
|
||||||
bo.setProvince(getProvince());
|
bo.setProvince(getProvince());
|
||||||
bo.setCity(getCity());
|
bo.setCity(getCity());
|
||||||
bo.setCounty(getCounty());
|
bo.setCounty(getCounty());
|
||||||
bo.setType(getType());
|
bo.setTypeId(getTypeId());
|
||||||
bo.setContactName(getContactName());
|
bo.setContactName(getContactName());
|
||||||
bo.setContactMobile(getContactMobile());
|
bo.setContactMobile(getContactMobile());
|
||||||
bo.setBusinessTimeStart(getBusinessTimeStart());
|
bo.setBusinessTimeStart(getBusinessTimeStart());
|
||||||
bo.setBusinessTimeEnd(getBusinessTimeEnd());
|
bo.setBusinessTimeEnd(getBusinessTimeEnd());
|
||||||
|
bo.setDescription(getDescription());
|
||||||
return bo;
|
return bo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,13 +49,14 @@ public class StoreBO extends Store {
|
||||||
bo.setProvince(getProvince());
|
bo.setProvince(getProvince());
|
||||||
bo.setCity(getCity());
|
bo.setCity(getCity());
|
||||||
bo.setCounty(getCounty());
|
bo.setCounty(getCounty());
|
||||||
bo.setType(getType());
|
bo.setTypeId(getTypeId());
|
||||||
bo.setContactName(getContactName());
|
bo.setContactName(getContactName());
|
||||||
bo.setContactMobile(getContactMobile());
|
bo.setContactMobile(getContactMobile());
|
||||||
bo.setUseOutTime(getUseOutTime());
|
bo.setUseOutTime(getUseOutTime());
|
||||||
bo.setBusinessTimeStart(getBusinessTimeStart());
|
bo.setBusinessTimeStart(getBusinessTimeStart());
|
||||||
bo.setBusinessTimeEnd(getBusinessTimeEnd());
|
bo.setBusinessTimeEnd(getBusinessTimeEnd());
|
||||||
bo.setStatus(StoreStatus.WAIT_SUBMIT.getStatus());
|
bo.setStatus(StoreStatus.WAIT_SUBMIT.getStatus());
|
||||||
|
bo.setDescription(getDescription());
|
||||||
return bo;
|
return bo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,11 +77,11 @@ public class StoreBO extends Store {
|
||||||
bo.setProvince(getProvince());
|
bo.setProvince(getProvince());
|
||||||
bo.setCity(getCity());
|
bo.setCity(getCity());
|
||||||
bo.setCounty(getCounty());
|
bo.setCounty(getCounty());
|
||||||
bo.setType(getType());
|
bo.setTypeId(getTypeId());
|
||||||
bo.setContactName(getContactName());
|
bo.setContactName(getContactName());
|
||||||
bo.setContactMobile(getContactMobile());
|
bo.setContactMobile(getContactMobile());
|
||||||
bo.setUseOutTime(getUseOutTime());
|
bo.setUseOutTime(getUseOutTime());
|
||||||
|
bo.setDescription(getDescription());
|
||||||
bo.setShow(getShow());
|
bo.setShow(getShow());
|
||||||
if (bo.getShow()) {
|
if (bo.getShow()) {
|
||||||
bo.setStatus(StoreStatus.PASS.getStatus());
|
bo.setStatus(StoreStatus.PASS.getStatus());
|
||||||
|
@ -106,10 +108,11 @@ public class StoreBO extends Store {
|
||||||
bo.setProvince(getProvince());
|
bo.setProvince(getProvince());
|
||||||
bo.setCity(getCity());
|
bo.setCity(getCity());
|
||||||
bo.setCounty(getCounty());
|
bo.setCounty(getCounty());
|
||||||
bo.setType(getType());
|
bo.setTypeId(getTypeId());
|
||||||
bo.setContactName(getContactName());
|
bo.setContactName(getContactName());
|
||||||
bo.setContactMobile(getContactMobile());
|
bo.setContactMobile(getContactMobile());
|
||||||
bo.setShow(getShow());
|
bo.setShow(getShow());
|
||||||
|
bo.setDescription(getDescription());
|
||||||
if (bo.getShow()) {
|
if (bo.getShow()) {
|
||||||
bo.setStatus(StoreStatus.PASS.getStatus());
|
bo.setStatus(StoreStatus.PASS.getStatus());
|
||||||
} else {
|
} else {
|
||||||
|
@ -120,9 +123,10 @@ public class StoreBO extends Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户配置店铺
|
* 用户配置店铺(废弃)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public StoreBO filterConfigByApp() {
|
public StoreBO filterConfigByApp() {
|
||||||
StoreBO bo = new StoreBO();
|
StoreBO bo = new StoreBO();
|
||||||
bo.setStoreId(getStoreId());
|
bo.setStoreId(getStoreId());
|
||||||
|
|
|
@ -19,10 +19,7 @@ import lombok.Data;
|
||||||
* @author wjh
|
* @author wjh
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class StoreQuery extends Store {
|
public class StoreQuery extends StoreVo {
|
||||||
|
|
||||||
@ApiModelProperty("用户名称")
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
@ApiModelProperty("当前所在位置")
|
@ApiModelProperty("当前所在位置")
|
||||||
@Size(min = 2, max = 2, message = "当前位置必须传入经度和纬度两个值", groups = {ValidGroup.Query.class})
|
@Size(min = 2, max = 2, message = "当前位置必须传入经度和纬度两个值", groups = {ValidGroup.Query.class})
|
||||||
|
|
|
@ -80,6 +80,12 @@ public class StoreVo extends Store {
|
||||||
@ApiModelProperty("使用中设备数量")
|
@ApiModelProperty("使用中设备数量")
|
||||||
private Long usingDeviceCount;
|
private Long usingDeviceCount;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺类型图标")
|
||||||
|
private String typeIcon;
|
||||||
|
|
||||||
public void setDeviceStatusMap(Map<String, Object> statusMap) {
|
public void setDeviceStatusMap(Map<String, Object> statusMap) {
|
||||||
if (statusMap == null) {
|
if (statusMap == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.ruoyi.ss.store.domain.enums;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺类型
|
|
||||||
* 2024/4/28
|
|
||||||
* @author wjh
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum StoreType {
|
|
||||||
|
|
||||||
SHOP("1"), // 商场
|
|
||||||
SCHOOL("2"), // 学校
|
|
||||||
ENTERTAINMENT("3"), // 娱乐场所
|
|
||||||
RENTAL_HOUSE("4"), // 出租房
|
|
||||||
OTHER("5"); // 其它
|
|
||||||
|
|
||||||
private final String type;
|
|
||||||
|
|
||||||
}
|
|
|
@ -27,17 +27,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ss.province,
|
ss.province,
|
||||||
ss.city,
|
ss.city,
|
||||||
ss.county,
|
ss.county,
|
||||||
ss.type,
|
ss.type_id,
|
||||||
ss.contact_name,
|
ss.contact_name,
|
||||||
ss.contact_mobile,
|
ss.contact_mobile,
|
||||||
ss.show,
|
ss.show,
|
||||||
ss.status,
|
ss.status,
|
||||||
ss.use_out_time,
|
ss.use_out_time,
|
||||||
ss.apply_id,
|
ss.apply_id,
|
||||||
|
ss.description,
|
||||||
if(su.is_real, su.real_name, su.user_name) as user_name,
|
if(su.is_real, su.real_name, su.user_name) as user_name,
|
||||||
su.vip_service_rate as mch_vip_service_rate
|
su.vip_service_rate as mch_vip_service_rate,
|
||||||
|
sst.name as type_name,
|
||||||
|
sst.icon as type_icon
|
||||||
from sm_store ss
|
from sm_store ss
|
||||||
left join sm_user su on su.user_id = ss.user_id
|
left join sm_user su on su.user_id = ss.user_id
|
||||||
|
left join ss_store_type sst on sst.id = ss.type_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="searchCondition">
|
<sql id="searchCondition">
|
||||||
|
@ -46,7 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="query.show != null "> and ss.show = #{query.show}</if>
|
<if test="query.show != null "> and ss.show = #{query.show}</if>
|
||||||
<if test="query.storeId != null "> and ss.store_id = #{query.storeId}</if>
|
<if test="query.storeId != null "> and ss.store_id = #{query.storeId}</if>
|
||||||
<if test="query.isDefault != null "> and ss.is_default = #{query.isDefault}</if>
|
<if test="query.isDefault != null "> and ss.is_default = #{query.isDefault}</if>
|
||||||
<if test="query.type != null "> and ss.type = #{query.type}</if>
|
<if test="query.typeId != null "> and ss.type_id = #{query.typeId}</if>
|
||||||
|
<if test="query.typeName != null and query.typeName != ''"> and sst.name like concat('%', #{query.typeName}, '%')</if>
|
||||||
<if test="query.address != null and query.address != ''"> and ss.address like concat('%', #{query.address}, '%')</if>
|
<if test="query.address != null and query.address != ''"> and ss.address like concat('%', #{query.address}, '%')</if>
|
||||||
<if test="query.deleted != null "> and ss.deleted = #{query.deleted}</if>
|
<if test="query.deleted != null "> and ss.deleted = #{query.deleted}</if>
|
||||||
<if test="query.deleted == null "> and ss.deleted = false</if>
|
<if test="query.deleted == null "> and ss.deleted = false</if>
|
||||||
|
@ -195,13 +200,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="province != null">province,</if>
|
<if test="province != null">province,</if>
|
||||||
<if test="city != null">city,</if>
|
<if test="city != null">city,</if>
|
||||||
<if test="county != null">county,</if>
|
<if test="county != null">county,</if>
|
||||||
<if test="type != null">`type`,</if>
|
<if test="typeId != null">type_id,</if>
|
||||||
<if test="contactName != null">`contact_name`,</if>
|
<if test="contactName != null">`contact_name`,</if>
|
||||||
<if test="contactMobile != null">`contact_mobile`,</if>
|
<if test="contactMobile != null">`contact_mobile`,</if>
|
||||||
<if test="show != null">`show`,</if>
|
<if test="show != null">`show`,</if>
|
||||||
<if test="status != null">`status`,</if>
|
<if test="status != null">`status`,</if>
|
||||||
<if test="useOutTime != null">use_out_time,</if>
|
<if test="useOutTime != null">use_out_time,</if>
|
||||||
<if test="applyId != null">apply_id,</if>
|
<if test="applyId != null">apply_id,</if>
|
||||||
|
<if test="description != null">description,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="name != null">#{name},</if>
|
<if test="name != null">#{name},</if>
|
||||||
|
@ -219,13 +225,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="province != null">#{province},</if>
|
<if test="province != null">#{province},</if>
|
||||||
<if test="city != null">#{city},</if>
|
<if test="city != null">#{city},</if>
|
||||||
<if test="county != null">#{county},</if>
|
<if test="county != null">#{county},</if>
|
||||||
<if test="type != null">#{type},</if>
|
<if test="typeId != null">#{typeId},</if>
|
||||||
<if test="contactName != null">#{contactName},</if>
|
<if test="contactName != null">#{contactName},</if>
|
||||||
<if test="contactMobile != null">#{contactMobile},</if>
|
<if test="contactMobile != null">#{contactMobile},</if>
|
||||||
<if test="show != null">#{show},</if>
|
<if test="show != null">#{show},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="useOutTime != null">#{useOutTime},</if>
|
<if test="useOutTime != null">#{useOutTime},</if>
|
||||||
<if test="applyId != null">#{applyId},</if>
|
<if test="applyId != null">#{applyId},</if>
|
||||||
|
<if test="description != null">#{description},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -250,7 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="data.province != null">province = #{data.province},</if>
|
<if test="data.province != null">province = #{data.province},</if>
|
||||||
<if test="data.city != null">city = #{data.city},</if>
|
<if test="data.city != null">city = #{data.city},</if>
|
||||||
<if test="data.county != null">county = #{data.county},</if>
|
<if test="data.county != null">county = #{data.county},</if>
|
||||||
<if test="data.type != null">`type` = #{data.type},</if>
|
<if test="data.typeId != null">type_id = #{data.typeId},</if>
|
||||||
<if test="data.updateTime != null">`update_time` = #{data.updateTime},</if>
|
<if test="data.updateTime != null">`update_time` = #{data.updateTime},</if>
|
||||||
<if test="data.updateBy != null">`update_by` = #{data.updateBy},</if>
|
<if test="data.updateBy != null">`update_by` = #{data.updateBy},</if>
|
||||||
<if test="data.contactName != null">`contact_name` = #{data.contactName},</if>
|
<if test="data.contactName != null">`contact_name` = #{data.contactName},</if>
|
||||||
|
@ -259,6 +266,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="data.status != null">`status` = #{data.status},</if>
|
<if test="data.status != null">`status` = #{data.status},</if>
|
||||||
<if test="data.useOutTime != null">use_out_time = #{data.useOutTime},</if>
|
<if test="data.useOutTime != null">use_out_time = #{data.useOutTime},</if>
|
||||||
<if test="data.applyId != null">apply_id = #{data.applyId},</if>
|
<if test="data.applyId != null">apply_id = #{data.applyId},</if>
|
||||||
|
<if test="data.description != null">description = #{data.description},</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<update id="updateByQuery">
|
<update id="updateByQuery">
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.ruoyi.ss.storeType.domain;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺类型对象 ss_store_type
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreType extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Excel(name = "名称")
|
||||||
|
@ApiModelProperty("名称")
|
||||||
|
@NotBlank(message = "名称不能为空")
|
||||||
|
@Size(max = 30, message = "名称长度不能超过30个字符")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Excel(name = "图标")
|
||||||
|
@ApiModelProperty("图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@ApiModelProperty("排序")
|
||||||
|
@NotNull(message = "排序不能为空")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.ruoyi.ss.storeType.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StoreTypeQuery extends StoreTypeVO {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.ruoyi.ss.storeType.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StoreTypeVO extends StoreType {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.ruoyi.ss.storeType.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StoreTypeNameVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("名称")
|
||||||
|
private String name;
|
||||||
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.ruoyi.ss.storeType.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import com.ruoyi.ss.store.domain.StoreNameVO;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreType;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreTypeQuery;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreTypeVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺类型Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-27
|
||||||
|
*/
|
||||||
|
public interface StoreTypeMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询店铺类型
|
||||||
|
*
|
||||||
|
* @param id 店铺类型主键
|
||||||
|
* @return 店铺类型
|
||||||
|
*/
|
||||||
|
StoreTypeVO selectStoreTypeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店铺类型列表
|
||||||
|
*
|
||||||
|
* @param query 店铺类型
|
||||||
|
* @return 店铺类型集合
|
||||||
|
*/
|
||||||
|
List<StoreTypeVO> selectStoreTypeList(@Param("query")StoreTypeQuery query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增店铺类型
|
||||||
|
*
|
||||||
|
* @param storeType 店铺类型
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertStoreType(StoreType storeType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增店铺类型
|
||||||
|
*/
|
||||||
|
int batchInsert(@Param("list") List<? extends StoreType> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量修改店铺类型
|
||||||
|
*/
|
||||||
|
int batchUpdate(@Param("list") List<? extends StoreType> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改店铺类型
|
||||||
|
*
|
||||||
|
* @param storeType 店铺类型
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateStoreType(@Param("data") StoreType storeType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除店铺类型
|
||||||
|
*
|
||||||
|
* @param id 店铺类型主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteStoreTypeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除店铺类型
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteStoreTypeByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部店铺类型名称
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreNameVO> selectListName(@Param("query")StoreTypeQuery query);
|
||||||
|
}
|
|
@ -0,0 +1,88 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.ss.storeType.mapper.StoreTypeMapper">
|
||||||
|
|
||||||
|
<resultMap type="StoreTypeVO" id="StoreTypeResult" autoMapping="true"/>
|
||||||
|
|
||||||
|
<sql id="selectStoreTypeVo">
|
||||||
|
select
|
||||||
|
sst.id,
|
||||||
|
sst.name,
|
||||||
|
sst.icon,
|
||||||
|
sst.sort,
|
||||||
|
sst.create_time
|
||||||
|
from ss_store_type sst
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="searchCondition">
|
||||||
|
<if test="query.id != null "> and sst.id = #{query.id}</if>
|
||||||
|
<if test="query.name != null and query.name != ''"> and sst.name like concat('%', #{query.name}, '%')</if>
|
||||||
|
${query.params.dataScope}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectStoreTypeList" parameterType="StoreTypeQuery" resultMap="StoreTypeResult">
|
||||||
|
<include refid="selectStoreTypeVo"/>
|
||||||
|
<where>
|
||||||
|
<include refid="searchCondition"/>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStoreTypeById" parameterType="Long" resultMap="StoreTypeResult">
|
||||||
|
<include refid="selectStoreTypeVo"/>
|
||||||
|
where sst.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertStoreType" parameterType="StoreType" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into ss_store_type
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null and name != ''">name,</if>
|
||||||
|
<if test="icon != null and icon != ''">icon,</if>
|
||||||
|
<if test="sort != null">sort,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
|
<if test="icon != null and icon != ''">#{icon},</if>
|
||||||
|
<if test="sort != null">#{sort},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateStoreType" parameterType="StoreType">
|
||||||
|
update ss_store_type
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<include refid="updateColumns"/>
|
||||||
|
</trim>
|
||||||
|
where id = #{data.id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<sql id="updateColumns">
|
||||||
|
<if test="data.name != null and data.name != ''">name = #{data.name},</if>
|
||||||
|
<if test="data.icon != null and data.icon != ''">icon = #{data.icon},</if>
|
||||||
|
<if test="data.sort != null">sort = #{data.sort},</if>
|
||||||
|
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<delete id="deleteStoreTypeById" parameterType="Long">
|
||||||
|
delete from ss_store_type where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteStoreTypeByIds" parameterType="String">
|
||||||
|
delete from ss_store_type where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectListName" parameterType="StoreTypeQuery" resultType="StoreTypeNameVO">
|
||||||
|
select
|
||||||
|
sst.id,
|
||||||
|
sst.name
|
||||||
|
from ss_store_type sst
|
||||||
|
<where>
|
||||||
|
<include refid="searchCondition"/>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.ruoyi.ss.storeType.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.ss.store.domain.StoreNameVO;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreType;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreTypeQuery;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreTypeVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺类型Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-27
|
||||||
|
*/
|
||||||
|
public interface StoreTypeService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询店铺类型
|
||||||
|
*
|
||||||
|
* @param id 店铺类型主键
|
||||||
|
* @return 店铺类型
|
||||||
|
*/
|
||||||
|
public StoreTypeVO selectStoreTypeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店铺类型列表
|
||||||
|
*
|
||||||
|
* @param storeType 店铺类型
|
||||||
|
* @return 店铺类型集合
|
||||||
|
*/
|
||||||
|
public List<StoreTypeVO> selectStoreTypeList(StoreTypeQuery storeType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增店铺类型
|
||||||
|
*
|
||||||
|
* @param storeType 店铺类型
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertStoreType(StoreType storeType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改店铺类型
|
||||||
|
*
|
||||||
|
* @param storeType 店铺类型
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateStoreType(StoreType storeType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除店铺类型
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的店铺类型主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteStoreTypeByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部店铺类型名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<StoreNameVO> selectListAllName();
|
||||||
|
}
|
|
@ -0,0 +1,142 @@
|
||||||
|
package com.ruoyi.ss.storeType.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
|
import com.ruoyi.ss.store.domain.StoreNameVO;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreType;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreTypeQuery;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreTypeVO;
|
||||||
|
import com.ruoyi.ss.storeType.mapper.StoreTypeMapper;
|
||||||
|
import com.ruoyi.ss.storeType.service.StoreTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺类型Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-27
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StoreTypeServiceImpl implements StoreTypeService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private StoreTypeMapper storeTypeMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TransactionTemplate transactionTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店铺类型
|
||||||
|
*
|
||||||
|
* @param id 店铺类型主键
|
||||||
|
* @return 店铺类型
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public StoreTypeVO selectStoreTypeById(Long id)
|
||||||
|
{
|
||||||
|
return storeTypeMapper.selectStoreTypeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店铺类型列表
|
||||||
|
*
|
||||||
|
* @param storeType 店铺类型
|
||||||
|
* @return 店铺类型
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<StoreTypeVO> selectStoreTypeList(StoreTypeQuery storeType)
|
||||||
|
{
|
||||||
|
return storeTypeMapper.selectStoreTypeList(storeType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增店铺类型
|
||||||
|
*
|
||||||
|
* @param storeType 店铺类型
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertStoreType(StoreType storeType)
|
||||||
|
{
|
||||||
|
storeType.setCreateTime(DateUtils.getNowDate());
|
||||||
|
|
||||||
|
Integer result = transactionTemplate.execute(status -> {
|
||||||
|
int rows = storeTypeMapper.insertStoreType(storeType);
|
||||||
|
if (rows > 0) {
|
||||||
|
clearCache();
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
});
|
||||||
|
return result == null ? 0 : result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改店铺类型
|
||||||
|
*
|
||||||
|
* @param storeType 店铺类型
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateStoreType(StoreType storeType)
|
||||||
|
{
|
||||||
|
Integer result = transactionTemplate.execute(status -> {
|
||||||
|
int rows = storeTypeMapper.updateStoreType(storeType);
|
||||||
|
if (rows > 0) {
|
||||||
|
clearCache();
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
});
|
||||||
|
return result == null ? 0 : result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除店铺类型
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的店铺类型主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteStoreTypeByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
Integer result = transactionTemplate.execute(status -> {
|
||||||
|
int rows = storeTypeMapper.deleteStoreTypeByIds(ids);
|
||||||
|
if (rows > 0) {
|
||||||
|
clearCache();
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
});
|
||||||
|
return result == null ? 0 : result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部店铺类型名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<StoreNameVO> selectListAllName() {
|
||||||
|
List<StoreNameVO> list = redisCache.getCacheObject(CacheConstants.STORE_TYPE_NAME_LIST);
|
||||||
|
if (CollectionUtils.isEmptyElement(list)) {
|
||||||
|
PageHelper.orderBy("sst.sort asc");
|
||||||
|
list = storeTypeMapper.selectListName(new StoreTypeQuery());
|
||||||
|
if (CollectionUtils.isNotEmptyElement(list)) {
|
||||||
|
redisCache.setCacheObject(CacheConstants.STORE_TYPE_NAME_LIST, list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearCache() {
|
||||||
|
redisCache.deleteObject(CacheConstants.STORE_TYPE_NAME_LIST);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.ruoyi.web.controller.app;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpQuery;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpVO;
|
||||||
|
import com.ruoyi.ss.help.domain.enums.HelpStatus;
|
||||||
|
import com.ruoyi.ss.help.service.HelpService;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/app/help")
|
||||||
|
public class AppHelpController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HelpService helpService;
|
||||||
|
|
||||||
|
@ApiOperation("获取教程列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
@Anonymous
|
||||||
|
public TableDataInfo list(HelpQuery query) {
|
||||||
|
startPage();
|
||||||
|
query.setStatus(HelpStatus.ENABLED.getCode());
|
||||||
|
List<HelpVO> list = helpService.selectHelpList(query);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取教程详情")
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@Anonymous
|
||||||
|
public AjaxResult detail(@RequestParam(required = false) String code, @RequestParam(required = false) Long id) {
|
||||||
|
if (StringUtils.hasText(code)) {
|
||||||
|
return success(helpService.selectByCode(code));
|
||||||
|
} else if (id != null) {
|
||||||
|
return success(helpService.selectHelpById(id));
|
||||||
|
}
|
||||||
|
return success(null);
|
||||||
|
}
|
||||||
|
}
|
|
@ -97,12 +97,13 @@ public class AppStoreController extends BaseController {
|
||||||
@ApiOperation("修改店铺配置")
|
@ApiOperation("修改店铺配置")
|
||||||
@PutMapping("/config")
|
@PutMapping("/config")
|
||||||
public AjaxResult configStore(@RequestBody @Validated(ValidGroup.FrontUpdate.class) StoreBO data) {
|
public AjaxResult configStore(@RequestBody @Validated(ValidGroup.FrontUpdate.class) StoreBO data) {
|
||||||
StoreVo store = storeService.selectSmStoreById(data.getStoreId());
|
// StoreVo store = storeService.selectSmStoreById(data.getStoreId());
|
||||||
if (!storeValidator.canOperaStore(store, getUserId())) {
|
// if (!storeValidator.canOperaStore(store, getUserId())) {
|
||||||
return error("这不是您的店铺,无法修改");
|
// return error("这不是您的店铺,无法修改");
|
||||||
}
|
// }
|
||||||
data = data.filterConfigByApp();
|
// data = data.filterConfigByApp();
|
||||||
return toAjax(storeService.updateSmStore(data));
|
// return toAjax(storeService.updateSmStore(data));
|
||||||
|
return error("当前接口已废弃,请使用 PUT /app/store");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
package com.ruoyi.web.controller.ss;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.ValidGroup;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ss.help.domain.Help;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpQuery;
|
||||||
|
import com.ruoyi.ss.help.domain.HelpVO;
|
||||||
|
import com.ruoyi.ss.help.service.HelpService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教程Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ss/help")
|
||||||
|
public class HelpController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private HelpService helpService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询教程列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:help:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(HelpQuery query)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
startOrderBy();
|
||||||
|
List<HelpVO> list = helpService.selectHelpList(query);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出教程列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:help:export')")
|
||||||
|
@Log(title = "教程", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, HelpQuery query)
|
||||||
|
{
|
||||||
|
List<HelpVO> list = helpService.selectHelpList(query);
|
||||||
|
ExcelUtil<HelpVO> util = new ExcelUtil<HelpVO>(HelpVO.class);
|
||||||
|
util.exportExcel(response, list, "教程数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教程详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:help:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(helpService.selectHelpById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增教程
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:help:add')")
|
||||||
|
@Log(title = "教程", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody @Validated(ValidGroup.Create.class) Help help)
|
||||||
|
{
|
||||||
|
return toAjax(helpService.insertHelp(help));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改教程
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:help:edit')")
|
||||||
|
@Log(title = "教程", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) Help help)
|
||||||
|
{
|
||||||
|
return toAjax(helpService.updateHelp(help));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除教程
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:help:remove')")
|
||||||
|
@Log(title = "教程", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(helpService.deleteHelpByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.ruoyi.web.controller.ss;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.ValidGroup;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreType;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreTypeQuery;
|
||||||
|
import com.ruoyi.ss.storeType.domain.StoreTypeVO;
|
||||||
|
import com.ruoyi.ss.storeType.service.StoreTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺类型Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-27
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ss/storeType")
|
||||||
|
public class StoreTypeController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private StoreTypeService storeTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店铺类型列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:storeType:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(StoreTypeQuery query)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
startOrderBy();
|
||||||
|
List<StoreTypeVO> list = storeTypeService.selectStoreTypeList(query);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部店铺类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/listAll")
|
||||||
|
public AjaxResult listAll() {
|
||||||
|
return success(storeTypeService.selectListAllName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出店铺类型列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:storeType:export')")
|
||||||
|
@Log(title = "店铺类型", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, StoreTypeQuery query)
|
||||||
|
{
|
||||||
|
List<StoreTypeVO> list = storeTypeService.selectStoreTypeList(query);
|
||||||
|
ExcelUtil<StoreTypeVO> util = new ExcelUtil<StoreTypeVO>(StoreTypeVO.class);
|
||||||
|
util.exportExcel(response, list, "店铺类型数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取店铺类型详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:storeType:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(storeTypeService.selectStoreTypeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增店铺类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:storeType:add')")
|
||||||
|
@Log(title = "店铺类型", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody @Validated(ValidGroup.Create.class) StoreType storeType)
|
||||||
|
{
|
||||||
|
return toAjax(storeTypeService.insertStoreType(storeType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改店铺类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:storeType:edit')")
|
||||||
|
@Log(title = "店铺类型", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) StoreType storeType)
|
||||||
|
{
|
||||||
|
return toAjax(storeTypeService.updateStoreType(storeType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除店铺类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ss:storeType:remove')")
|
||||||
|
@Log(title = "店铺类型", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(storeTypeService.deleteStoreTypeByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user