订单套餐时间(暂未测试)

This commit is contained in:
墨大叔 2024-07-12 17:53:39 +08:00
parent a495de04fc
commit 2296efa998
27 changed files with 199 additions and 92 deletions

View File

@ -0,0 +1,23 @@
package com.ruoyi.iot.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wjh
* 2024/7/11
*/
@Getter
@AllArgsConstructor
public enum IotHttpStatus {
SUCCESS(0, "成功"),
DEVICE_EXIST(10406, "设备已存在");
private final Integer code;
private final String msg;
public boolean equalCode(int code) {
return this.code == code;
}
}

View File

@ -99,5 +99,5 @@ public interface IotService {
/**
* 注册设备
*/
boolean create(String mac);
int create(String mac);
}

View File

@ -234,7 +234,7 @@ public class IotServiceImpl implements IotService {
}
@Override
public boolean create(String mac) {
public int create(String mac) {
String sendUrl = iotHost + IotConstants.CREATE_DEVICE;
CreateDeviceVo createDeviceVo = new CreateDeviceVo();
createDeviceVo.setDevice_name(mac);
@ -242,12 +242,10 @@ public class IotServiceImpl implements IotService {
String result = HttpUtils.sendPostWithToken(sendUrl, JSON.toJSONString(createDeviceVo), Token.getToken());
if (!StringUtils.hasText(result)) {
log.error("与OneNet通信异常");
return false;
return HttpStatus.NOT_FOUND;
}
JSONObject paramsObj = JSON.parseObject(result);
Integer code = paramsObj.getInteger("code");
//记录命令
return HttpStatus.IOT_SUCCESS.equals(code);
return paramsObj.getInteger("code");
}
// 发送MQTT命令

View File

@ -51,7 +51,6 @@ public class SmDevice extends BaseEntity
@Excel(name = "设备名称")
@ApiModelProperty("设备名称")
@JsonView({DeviceView.SuitList.class, JsonViewProfile.App.class})
@NotNull(message = "设备名称不允许为空", groups = {ValidGroup.Create.class, ValidGroup.Update.class})
private String deviceName;
/** 型号id */

View File

@ -341,14 +341,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="bindStore">
update sm_device
set store_id = #{storeId},
user_id = #{userId}
user_id = #{userId},
activation_time = now()
where device_id = #{deviceId} and user_id is null
</update>
<update id="unbindStore">
update sm_device
set store_id = null,
user_id = null
user_id = null,
device_name = '未命名',
activation_time = null
where device_id = #{deviceId}
</update>

View File

@ -41,5 +41,10 @@ public interface DeviceValidator {
/**
* 判断SN是否重复
*/
boolean isRepeat(Long deviceId, String sn);
boolean isRepeatSn(Long deviceId, String sn);
/**
* 判断MAC是否重复
*/
boolean isRepeatMac(Long deviceId, String mac);
}

View File

@ -122,9 +122,10 @@ public interface ISmDeviceService
/**
* 商户解绑设备
*
* @param deviceId 设备id
*/
boolean unbindStore(Long deviceId);
int unbind(Long deviceId);
/**
* 通过mac查询设备
@ -176,11 +177,6 @@ public interface ISmDeviceService
*/
SmDeviceVO selectByDeviceNo(String deviceNo);
/**
* 初始设备录入
* @param smDevice
*/
int addInitDevice(SmDevice smDevice);
/**
* 设备绑定SN码
@ -232,4 +228,9 @@ public interface ISmDeviceService
* 查询一个
*/
SmDeviceVO selectOne(SmDeviceQuery query);
/**
* 获取当前用户正在使用中的设备
*/
List<SmDeviceVO> selectUsingDevice(Long userId);
}

View File

@ -15,7 +15,7 @@ import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.service.IStoreService;
import com.ruoyi.ss.suit.domain.SuitQuery;
import com.ruoyi.ss.suit.domain.SuitVo;
import com.ruoyi.ss.suit.service.ISuitService;
import com.ruoyi.ss.suit.service.SuitService;
import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery;
import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillGroupBy;
import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillStatus;
@ -41,7 +41,7 @@ public class DeviceAssemblerImpl implements DeviceAssembler {
private ISmDeviceTenantService deviceTenantService;
@Autowired
private ISuitService suitService;
private SuitService suitService;
@Autowired
private IStoreService storeService;

View File

@ -11,6 +11,7 @@ import com.ruoyi.ss.device.service.DeviceValidator;
import com.ruoyi.ss.device.service.ISmDeviceService;
import com.ruoyi.ss.store.service.StoreValidator;
import com.ruoyi.ss.user.service.UserValidator;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jetty.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -119,11 +120,20 @@ public class DeviceValidatorImpl extends BaseValidator implements DeviceValidato
}
@Override
public boolean isRepeat(Long deviceId, String sn) {
public boolean isRepeatSn(Long deviceId, String sn) {
if (StringUtil.isBlank(sn)) {
return false;
}
SmDeviceVO device = deviceService.selectByDeviceNo(sn);
return device != null && !Objects.equals(deviceId, device.getDeviceId());
}
@Override
public boolean isRepeatMac(Long deviceId, String mac) {
if (StringUtils.isBlank(mac)) {
return false;
}
SmDeviceVO device = deviceService.selectByMac(mac);
return device != null && !Objects.equals(deviceId, device.getDeviceId());
}
}

View File

@ -7,6 +7,7 @@ import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.iot.domain.IotDeviceInfo;
import com.ruoyi.iot.domain.response.CommandResponse;
import com.ruoyi.iot.enums.IotHttpStatus;
import com.ruoyi.iot.service.IotService;
import com.ruoyi.ss.device.domain.SmDevice;
import com.ruoyi.ss.device.domain.SmDeviceCountVO;
@ -21,13 +22,13 @@ import com.ruoyi.ss.device.service.DeviceAssembler;
import com.ruoyi.ss.device.service.DeviceValidator;
import com.ruoyi.ss.device.service.ISmDeviceService;
import com.ruoyi.ss.deviceBindRecord.service.ISmDeviceBindRecordService;
import com.ruoyi.ss.model.domain.SmModelVo;
import com.ruoyi.ss.model.service.ModelService;
import com.ruoyi.ss.record.time.service.IRecordTimeService;
import com.ruoyi.ss.record.time.service.RecordTimeConverter;
import com.ruoyi.ss.resetRecord.service.ISmResetRecordService;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.service.IStoreService;
import com.ruoyi.ss.suit.service.SuitService;
import com.ruoyi.ss.transactionBill.domain.TransactionBillVo;
import com.ruoyi.ss.transactionBill.service.TransactionBillService;
import com.ruoyi.ss.user.domain.SmUserVo;
import com.ruoyi.ss.user.service.ISmUserService;
import lombok.SneakyThrows;
@ -84,15 +85,18 @@ public class SmDeviceServiceImpl implements ISmDeviceService
@Autowired
private RecordTimeConverter recordTimeConverter;
@Autowired
private ModelService smModelService;
@Autowired
private ISmUserService userService;
@Autowired
private DeviceValidator deviceValidator;
@Autowired
private SuitService suitService;
@Autowired
private TransactionBillService transactionBillService;
/**
* 查询设备
*
@ -119,16 +123,18 @@ public class SmDeviceServiceImpl implements ISmDeviceService
/**
* 新增设备
* F
* @param data 设备
* @return 结果
*/
@Override
public int insertSmDevice(SmDevice data)
{
if (StringUtils.hasText(data.getDeviceNo())) {
ServiceUtil.assertion(deviceValidator.isRepeat(data.getDeviceId(), data.getDeviceNo()), "SN重复");
}
public int insertSmDevice(SmDevice data) {
ServiceUtil.assertion(deviceValidator.isRepeatMac(data.getDeviceId(), data.getMac()), "MAC重复");
ServiceUtil.assertion(deviceValidator.isRepeatSn(data.getDeviceId(), data.getDeviceNo()), "SN重复");
// 创建OneNet设备
int code = iotService.create(data.getMac());
ServiceUtil.assertion(!IotHttpStatus.SUCCESS.equalCode(code) && !IotHttpStatus.DEVICE_EXIST.equalCode(code), "设备注册失败");
data.setCreateTime(DateUtils.getNowDate());
data.setStatus(DeviceStatus.NORMAL.getStatus());
return smDeviceMapper.insertSmDevice(data);
@ -145,7 +151,7 @@ public class SmDeviceServiceImpl implements ISmDeviceService
public int updateSmDevice(SmDevice data)
{
if (StringUtils.hasText(data.getDeviceNo())) {
ServiceUtil.assertion(deviceValidator.isRepeat(data.getDeviceId(), data.getDeviceNo()), "SN重复");
ServiceUtil.assertion(deviceValidator.isRepeatSn(data.getDeviceId(), data.getDeviceNo()), "SN重复");
}
// 修改数据库
@ -255,7 +261,7 @@ public class SmDeviceServiceImpl implements ISmDeviceService
device.setDeviceName("未命名");
device.setMac(dto.getMac());
device.setDeviceNo(dto.getSn());
return this.addInitDevice(device);
return this.insertSmDevice(device);
}
@Override
@ -268,6 +274,16 @@ public class SmDeviceServiceImpl implements ISmDeviceService
return smDeviceMapper.selectOne(query);
}
@Override
public List<SmDeviceVO> selectUsingDevice(Long userId) {
// 查询正在使用中的订单
List<TransactionBillVo> usingBills = transactionBillService.selectUsingBill(userId);
List<Long> deviceIds = usingBills.stream().map(TransactionBillVo::getDeviceId).distinct().collect(Collectors.toList());
// 查询设备列表
return this.selectListByIds(deviceIds);
}
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public boolean addTime(Long deviceId, BigDecimal num, boolean withIot) {
@ -645,7 +661,7 @@ public class SmDeviceServiceImpl implements ISmDeviceService
*/
@Override
public List<SmDeviceVO> selectListByIds(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
if (CollectionUtils.isEmptyElement(ids)) {
return Collections.emptyList();
}
SmDeviceQuery dto = new SmDeviceQuery();
@ -716,48 +732,24 @@ public class SmDeviceServiceImpl implements ISmDeviceService
return smDeviceMapper.selectByDeviceNo(deviceNo);
}
/**
* 初始设备录入
*
* @param smDevice 设备信息
*/
@Override
public int addInitDevice(SmDevice smDevice) {
if (smDevice == null) {
return 0;
}
// 查询设备是否存在存在则忽略
SmDeviceVO device = selectByMac(smDevice.getMac());
ServiceUtil.assertion(device != null, "该设备Mac已存在无需重复录入");
device = selectByDeviceNo(smDevice.getDeviceNo());
ServiceUtil.assertion(device != null, "该设备SN已存在无需重复录入");
Integer result = transactionTemplate.execute(status -> {
int i = this.insertSmDevice(smDevice); // 添加设备
ServiceUtil.assertion(i != 1, "添加设备失败");
// 创建OneNet设备
boolean create = iotService.create(smDevice.getMac());
ServiceUtil.assertion(!create, "创建OneNet设备失败");
return i;
});
return result == null ? 0 : result;
}
@Override
@Transactional
public boolean unbindStore(Long deviceId) {
public int unbind(Long deviceId) {
SmDeviceVO device = smDeviceMapper.selectSmDeviceByDeviceId(deviceId);
ServiceUtil.assertion(device == null || device.getDeleted(), "设备不存在");
ServiceUtil.assertion(DeviceStatus.USING.getStatus().equals(device.getStatus()), "设备正在使用中,无法解除绑定");
int updateCount = smDeviceMapper.unbindStore(deviceId);
ServiceUtil.assertion(updateCount != 1, "当前设备信息已变更,请刷新后重试");
return true;
Integer result = transactionTemplate.execute(status -> {
int updateCount = smDeviceMapper.unbindStore(deviceId);
ServiceUtil.assertion(updateCount != 1, "当前设备信息已变更,请刷新后重试");
// 删除套餐
suitService.logicDelByDeviceId(deviceId);
return updateCount;
});
return result == null ? 0 : result;
}
/**
@ -769,7 +761,7 @@ public class SmDeviceServiceImpl implements ISmDeviceService
@Override
public int bindSn(Long deviceId, String sn) {
Integer result = transactionTemplate.execute(status -> {
ServiceUtil.assertion(deviceValidator.isRepeat(deviceId, sn), "SN重复");
ServiceUtil.assertion(deviceValidator.isRepeatSn(deviceId, sn), "SN重复");
int i = smDeviceMapper.bindSn(deviceId, sn);
ServiceUtil.assertion(i != 1, "设备SN已发生变化请刷新后重试");

View File

@ -75,4 +75,9 @@ public interface SuitMapper
* @return
*/
int selectCount(SuitQuery query);
/**
* 根据设备ID删除套餐
*/
int logicDelByDeviceId(Long deviceId);
}

View File

@ -120,6 +120,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</update>
<update id="logicDelByDeviceId">
update sm_suit
set deleted = true
where device_id = #{deviceId}
</update>
<delete id="deleteSuitBySuitId" parameterType="Long">
delete from sm_suit where suit_id = #{suitId}
</delete>

View File

@ -14,7 +14,7 @@ import java.util.function.Function;
* @author ruoyi
* @date 2024-04-25
*/
public interface ISuitService
public interface SuitService
{
/**
* 查询套餐
@ -98,4 +98,9 @@ public interface ISuitService
* @return
*/
int selectCount(SuitQuery query);
/**
* 根据设备ID删除套餐
*/
int logicDelByDeviceId(Long deviceId);
}

View File

@ -6,7 +6,7 @@ import com.ruoyi.ss.suit.domain.Suit;
import com.ruoyi.ss.suit.domain.SuitQuery;
import com.ruoyi.ss.suit.domain.SuitVo;
import com.ruoyi.ss.suit.mapper.SuitMapper;
import com.ruoyi.ss.suit.service.ISuitService;
import com.ruoyi.ss.suit.service.SuitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -23,7 +23,7 @@ import java.util.stream.Collectors;
* @date 2024-04-25
*/
@Service
public class SuitServiceImpl implements ISuitService
public class SuitServiceImpl implements SuitService
{
@Autowired
private SuitMapper suitMapper;
@ -168,4 +168,12 @@ public class SuitServiceImpl implements ISuitService
public int selectCount(SuitQuery query) {
return suitMapper.selectCount(query);
}
@Override
public int logicDelByDeviceId(Long deviceId) {
if (deviceId == null) {
return 0;
}
return suitMapper.logicDelByDeviceId(deviceId);
}
}

View File

@ -7,7 +7,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ss.device.service.DeviceValidator;
import com.ruoyi.ss.suit.domain.SuitBO;
import com.ruoyi.ss.suit.domain.SuitQuery;
import com.ruoyi.ss.suit.service.ISuitService;
import com.ruoyi.ss.suit.service.SuitService;
import com.ruoyi.ss.suit.service.SuitValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -28,7 +28,7 @@ public class SuitValidatorImpl extends BaseValidator implements SuitValidator {
private DeviceValidator deviceValidator;
@Autowired
private ISuitService suitService;
private SuitService suitService;
@Override
public ValidateResult preLogicDel(List<Long> suitIds) {

View File

@ -12,6 +12,7 @@ import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@ -129,13 +130,13 @@ public class TransactionBill extends BaseEntity
private BigDecimal suitTime;
@ApiModelProperty("套餐开始使用时间")
private Integer suitStartTime;
private LocalDateTime suitStartTime;
@ApiModelProperty("套餐结束使用时间")
private Integer suitEndTime;
private LocalDateTime suitEndTime;
@ApiModelProperty("套餐到期时间")
private Integer suitExpireTime;
private LocalDateTime suitExpireTime;
@ApiModelProperty("店铺ID")
@JsonView(JsonViewProfile.App.class)

View File

@ -73,4 +73,7 @@ public class TransactionBillQuery extends TransactionBill {
@ApiModelProperty("设备ID列表")
private List<Long> deviceIds;
@ApiModelProperty("是否使用中")
private Boolean using;
}

View File

@ -7,6 +7,7 @@ import com.ruoyi.ss.transactionBill.domain.TransactionBillVo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

View File

@ -73,6 +73,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.deviceRechargeStatus != null"> and stb.device_recharge_status = #{query.deviceRechargeStatus} </if>
<if test="query.suitId != null"> and stb.suit_id = #{query.suitId} </if>
<if test="query.storeId != null"> and stb.store_id = #{query.storeId} </if>
<if test="query.using != null">
<if test="query.using">
and now() >= stb.suit_start_time and now() &lt;= stb.suit_end_time and now() &lt;= stb.suit_expire_time
</if>
<if test="!query.using">
and ( now() &lt;= stb.suit_start_time or now() >= stb.suit_end_time or now() >= stb.suit_expire_time)
</if>
</if>
<if test="query.billIds != null and query.billIds.size() > 0">
and stb.bill_id in
<foreach item="item" collection="query.billIds" open="(" separator="," close=")">

View File

@ -254,4 +254,9 @@ public interface TransactionBillService
* @param refundServiceAmount 退款手续费
*/
int addRefundAmount(Long billId, BigDecimal refundAmount, BigDecimal refundMchAmount, BigDecimal refundServiceAmount);
/**
* 查询用户正在使用中的订单
*/
List<TransactionBillVo> selectUsingBill(Long userId);
}

View File

@ -23,7 +23,7 @@ import com.ruoyi.ss.refund.service.RefundService;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.service.IStoreService;
import com.ruoyi.ss.suit.domain.SuitVo;
import com.ruoyi.ss.suit.service.ISuitService;
import com.ruoyi.ss.suit.service.SuitService;
import com.ruoyi.ss.transactionBill.domain.TransactionBill;
import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery;
import com.ruoyi.ss.transactionBill.domain.TransactionBillVo;
@ -53,6 +53,7 @@ import org.springframework.transaction.support.TransactionTemplate;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@ -105,7 +106,7 @@ public class TransactionBillServiceImpl implements TransactionBillService {
private IStoreService storeService;
@Autowired
private ISuitService suitService;
private SuitService suitService;
@Autowired
private ScheduledExecutorService scheduledExecutorService;
@ -571,11 +572,26 @@ public class TransactionBillServiceImpl implements TransactionBillService {
// 修改设备充值状态成功
if (success) {
transactionBillMapper.updateDeviceRechargeStatus(bill.getBillId(), TransactionBillDeviceRechargeStatus.SUCCESS.getStatus());
SmDeviceVO device = deviceService.selectSmDeviceByDeviceId(bill.getDeviceId());
this.updateSuitTimeAfterDevice(billId, device.getExpireTime());
}
return true;
}
/**
* 在设备充值成功后更新套餐时间
* 开始时间 = 设备过期时间 - 套餐时间过期时间 = 设备过期时间
*/
private int updateSuitTimeAfterDevice(Long billId, LocalDateTime deviceExpireTime) {
TransactionBill bill = new TransactionBill();
bill.setBillId(billId);
bill.setSuitStartTime(deviceExpireTime.plusMinutes(-bill.getSuitTime().longValue()));
bill.setSuitEndTime(deviceExpireTime);
bill.setSuitExpireTime(deviceExpireTime);
return transactionBillMapper.updateSmTransactionBill(bill);
}
/**
* 处理设备充值失败
*/
@ -618,7 +634,7 @@ public class TransactionBillServiceImpl implements TransactionBillService {
TransactionBill bill = transactionBillMapper.selectSmTransactionBillByBillNo(billNo);
ServiceUtil.assertion(bill == null || !TransactionBillType.RECHARGE.getType().equals(bill.getType()), "充值订单不存在");
// 修改订单状态为成功
// 修改订单状态
int updateCount = transactionBillMapper.rechargeSuccess(bill.getBillId(), payTime);
ServiceUtil.assertion(updateCount != 1, "修改订单状态失败,请刷新后重试");
@ -820,6 +836,10 @@ public class TransactionBillServiceImpl implements TransactionBillService {
boolean result = transactionBillMapper.bluetoothRechargeSuccess(billNo) == 1;
ServiceUtil.assertion(!result, "蓝牙充值回调失败");
// 更新套餐时间
SmDeviceVO afterDevice = deviceService.selectSmDeviceByDeviceId(bill.getDeviceId());
this.updateSuitTimeAfterDevice(bill.getBillId(), afterDevice.getExpireTime());
boolean addTime = deviceService.addTime(bill.getDeviceId(), bill.getSuitTime(), false);
ServiceUtil.assertion(!addTime, "修改剩余时间失败");
@ -926,4 +946,12 @@ public class TransactionBillServiceImpl implements TransactionBillService {
}
return transactionBillMapper.addRefundAmount(billId, refundAmount, refundMchAmount, refundServiceAmount);
}
@Override
public List<TransactionBillVo> selectUsingBill(Long userId) {
TransactionBillQuery query = new TransactionBillQuery();
query.setUsing(true);
query.setStatus(TransactionBillStatus.SUCCESS.getStatus());
return this.selectSmTransactionBillList(query);
}
}

View File

@ -10,7 +10,7 @@ import com.ruoyi.ss.device.service.ISmDeviceService;
import com.ruoyi.ss.model.domain.enums.ModelTag;
import com.ruoyi.ss.store.service.StoreValidator;
import com.ruoyi.ss.suit.domain.SuitVo;
import com.ruoyi.ss.suit.service.ISuitService;
import com.ruoyi.ss.suit.service.SuitService;
import com.ruoyi.ss.transactionBill.domain.TransactionBill;
import com.ruoyi.ss.transactionBill.service.TransactionBillService;
import com.ruoyi.ss.transactionBill.service.TransactionBillValidator;
@ -39,7 +39,7 @@ public class TransactionBillValidatorImpl extends BaseValidator implements Trans
private ISmChannelService channelService;
@Autowired
private ISuitService suitService;
private SuitService suitService;
@Autowired
private StoreValidator storeValidator;

View File

@ -107,7 +107,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="searchCondition"/>
and su.del_flag = '0'
</where>
order by su.create_time desc
</select>
<select id="selectSmUserByUserId" parameterType="Long" resultMap="SmUserResult">

View File

@ -115,11 +115,11 @@ public class AppDeviceController extends BaseController {
}
}
@ApiOperation("商户解除设备绑定")
@ApiOperation("解除设备绑定")
@DeleteMapping("/mch/unbind/{deviceId}")
public AjaxResult mchUnbind(@PathVariable @ApiParam("设备id") Long deviceId) {
ServiceUtil.assertion(!deviceValidator.isBelong(deviceId, getUserId()), "这不是您的设备");
return success(smDeviceService.unbindStore(deviceId));
return toAjax(smDeviceService.unbind(deviceId));
}
@ApiOperation("设备电量归零")
@ -195,4 +195,11 @@ public class AppDeviceController extends BaseController {
return success(smDeviceService.selectAllMac());
}
@ApiOperation("获取正在使用中的设备列表")
@GetMapping("/usingDevice")
@JsonView(JsonViewProfile.App.class)
public AjaxResult getUsingDevice() {
return success(smDeviceService.selectUsingDevice(getUserId()));
}
}

View File

@ -9,9 +9,8 @@ import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.ss.device.service.DeviceValidator;
import com.ruoyi.ss.suit.domain.SuitBO;
import com.ruoyi.ss.suit.domain.SuitVo;
import com.ruoyi.ss.suit.service.ISuitService;
import com.ruoyi.ss.suit.service.SuitService;
import com.ruoyi.ss.suit.service.SuitValidator;
import com.ruoyi.web.core.annotation.MchRequired;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
@ -31,7 +30,7 @@ public class AppSuitController extends BaseController {
@Autowired
private ISuitService suitService;
private SuitService suitService;
@Autowired
private SuitValidator suitValidator;

View File

@ -56,6 +56,7 @@ public class SmUserController extends BaseController
public TableDataInfo list(SmUserQuery smUser)
{
startPage();
startOrderBy();
List<SmUserVo> list = smUserService.selectSmUserList(smUser);
userAssembler.assembleStoreCount(list);
userAssembler.assembleDeviceCount(list);

View File

@ -26,7 +26,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.ss.suit.domain.Suit;
import com.ruoyi.ss.suit.service.ISuitService;
import com.ruoyi.ss.suit.service.SuitService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
@ -41,7 +41,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
public class SuitController extends BaseController
{
@Autowired
private ISuitService suitService;
private SuitService suitService;
@Autowired
private SuitValidator suitValidator;