From c6edec808356dc4af4058d52640e8882c11946eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E5=A4=A7=E5=8F=94?= <494979559@qq.com> Date: Tue, 9 Jul 2024 15:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/SmBusinessRecordServiceImpl.java | 4 +- .../domain/enums/DeviceGroupByTable.java | 3 +- .../ruoyi/ss/device/mapper/SmDeviceMapper.xml | 1 + .../service/impl/SmDeviceServiceImpl.java | 12 ++-- .../com/ruoyi/ss/model/domain/SmModel.java | 12 ---- .../com/ruoyi/ss/model/domain/SmModelBO.java | 5 +- .../ruoyi/ss/model/mapper/SmModelMapper.xml | 31 +--------- ...ISmModelService.java => ModelService.java} | 6 +- .../ss/model/service/ModelValidator.java | 11 ++-- ...ServiceImpl.java => ModelServiceImpl.java} | 60 +++++++++++-------- .../service/impl/ModelValidatorImpl.java | 37 +++++------- .../user/service/impl/UserAssemblerImpl.java | 2 +- .../controller/app/AppDeviceController.java | 2 +- .../controller/app/AppStoreController.java | 1 - .../app/AppTransactionBillController.java | 8 +-- .../web/controller/ss/SmModelController.java | 7 +-- .../src/main/resources/application-dev.yml | 2 +- .../src/main/resources/application-test.yml | 4 +- 18 files changed, 84 insertions(+), 124 deletions(-) rename smart-switch-service/src/main/java/com/ruoyi/ss/model/service/{ISmModelService.java => ModelService.java} (93%) rename smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/{SmModelServiceImpl.java => ModelServiceImpl.java} (67%) diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/service/SmBusinessRecordServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/service/SmBusinessRecordServiceImpl.java index 6330169a..fca3602b 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/service/SmBusinessRecordServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/service/SmBusinessRecordServiceImpl.java @@ -11,7 +11,7 @@ import com.ruoyi.ss.device.domain.SmDeviceQuery; import com.ruoyi.ss.device.domain.enums.DeviceOnlineStatus; import com.ruoyi.ss.device.service.ISmDeviceService; import com.ruoyi.ss.model.domain.SmModelQuery; -import com.ruoyi.ss.model.service.ISmModelService; +import com.ruoyi.ss.model.service.ModelService; import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery; import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillStatus; import com.ruoyi.ss.transactionBill.service.TransactionBillService; @@ -43,7 +43,7 @@ public class SmBusinessRecordServiceImpl implements ISmBusinessRecordService private ISmUserService userService; @Autowired - private ISmModelService modelService; + private ModelService modelService; @Autowired private TransactionBillService transactionBillService; diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/enums/DeviceGroupByTable.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/enums/DeviceGroupByTable.java index 573dfe3f..450e43d0 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/enums/DeviceGroupByTable.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/enums/DeviceGroupByTable.java @@ -7,6 +7,7 @@ package com.ruoyi.ss.device.domain.enums; public enum DeviceGroupByTable { sd, // 设备表 - ss // 店铺表 + ss, // 店铺表 + su, // 用户表 } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/SmDeviceMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/SmDeviceMapper.xml index 8a693bd2..ac6764c5 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/SmDeviceMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/SmDeviceMapper.xml @@ -176,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from sm_device sd left join sm_store ss on ss.store_id = sd.store_id + left join sm_user su on su.user_id = sd.user_id diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/SmDeviceServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/SmDeviceServiceImpl.java index 4b0906ec..1ef8efbe 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/SmDeviceServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/SmDeviceServiceImpl.java @@ -22,7 +22,7 @@ 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.ISmModelService; +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; @@ -66,9 +66,6 @@ public class SmDeviceServiceImpl implements ISmDeviceService @Autowired private ISmDeviceBindRecordService smDeviceBindRecordService; - @Autowired - private ISmResetRecordService smResetRecordService; - @Autowired private ScheduledExecutorService scheduledExecutorService; @@ -88,7 +85,7 @@ public class SmDeviceServiceImpl implements ISmDeviceService private RecordTimeConverter recordTimeConverter; @Autowired - private ISmModelService smModelService; + private ModelService smModelService; @Autowired private ISmUserService userService; @@ -749,8 +746,9 @@ public class SmDeviceServiceImpl implements ISmDeviceService boolean create = iotService.create(smDevice.getMac()); ServiceUtil.assertion(!create, "创建OneNet设备失败"); } + log.info("select model in:{}", deviceInfo.getModel()); - SmModelVo model = smModelService.selectByIotModel(deviceInfo.getModel()); + SmModelVo model = smModelService.selectByModel(deviceInfo.getModel()); IotDeviceInfo finalDeviceInfo = deviceInfo; Integer result = transactionTemplate.execute(status -> { @@ -761,7 +759,7 @@ public class SmDeviceServiceImpl implements ISmDeviceService log.info("model is null"); int addModel = smModelService.addInitModel(finalDeviceInfo); ServiceUtil.assertion(addModel != 1, "添加设备型号失败"); - finalModel = smModelService.selectByIotModel(finalDeviceInfo.getModel()); + finalModel = smModelService.selectByModel(finalDeviceInfo.getModel()); } // 添加设备 diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModel.java b/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModel.java index 943f30c5..6a5845bf 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModel.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModel.java @@ -43,18 +43,6 @@ public class SmModel extends BaseEntity @ApiModelProperty("图片") private String picture; - /** 识别码 */ - @Excel(name = "识别码") - @ApiModelProperty("识别码") - @NotNull(message = "识别码不允许为空", groups = {ValidGroup.Create.class}) - private String idCode; - - /** 硬件版本 */ - @Excel(name = "硬件版本") - @ApiModelProperty("硬件版本") - @NotNull(message = "硬件版本不允许为空", groups = {ValidGroup.Create.class}) - private Long versionId; - /** 产品介绍 */ @Excel(name = "产品介绍") @ApiModelProperty("硬件版本") diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModelBO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModelBO.java index efe514dc..621f6516 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModelBO.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModelBO.java @@ -15,17 +15,18 @@ public class SmModelBO extends SmModel { bo.setModel(getModel()); bo.setTags(getTags()); bo.setPicture(getPicture()); - bo.setIdCode(getIdCode()); bo.setIntroduce(getIntroduce()); bo.setRemark(getRemark()); - bo.setVersionId(getVersionId()); return bo; } // 过滤可更新的字段 public SmModelBO filterUpdate() { SmModelBO bo = new SmModelBO(); + bo.setModelId(getModelId()); bo.setModelName(getModelName()); + bo.setModel(getModel()); + bo.setTags(getTags()); bo.setPicture(getPicture()); bo.setIntroduce(getIntroduce()); bo.setRemark(getRemark()); diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/mapper/SmModelMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/model/mapper/SmModelMapper.xml index 363b8235..94617521 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/mapper/SmModelMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/mapper/SmModelMapper.xml @@ -4,22 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - + @@ -28,8 +13,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sm.model_name, sm.model, sm.picture, - sm.id_code, - sm.version_id, sm.introduce, sm.create_by, sm.create_time, @@ -47,15 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sm.model_name like concat('%', #{modelName}, '%') and sm.model = #{model} - and sm.id_code = #{idCode} - and sm.version_id = #{versionId} + and sm.deleted = false + and sm.deleted = #{deleted} @@ -71,7 +53,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from sm_model sm - and sm.deleted = false @@ -81,8 +62,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" model_name, model, picture, - id_code, - version_id, introduce, create_by, create_time, @@ -96,8 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{modelName}, #{model}, #{picture}, - #{idCode}, - #{versionId}, #{introduce}, #{createBy}, #{createTime}, @@ -115,8 +92,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" model_name = #{modelName}, model = #{model}, picture = #{picture}, - id_code = #{idCode}, - version_id = #{versionId}, introduce = #{introduce}, create_by = #{createBy}, create_time = #{createTime}, diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ISmModelService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ModelService.java similarity index 93% rename from smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ISmModelService.java rename to smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ModelService.java index 98a5a51e..525ccb86 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ISmModelService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ModelService.java @@ -14,7 +14,7 @@ import java.util.List; * @author 邱贞招 * @date 2024-02-21 */ -public interface ISmModelService +public interface ModelService { /** * 查询型号列表 @@ -77,9 +77,9 @@ public interface ISmModelService int logicDelete(List modelIds); /** - * 根据物联网的型号查询数据 + * 根据型号查询数据 */ - SmModelVo selectByIotModel(String model); + SmModelVo selectByModel(String model); /** * 创建初始型号 diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ModelValidator.java b/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ModelValidator.java index 0061909a..663e3155 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ModelValidator.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/ModelValidator.java @@ -3,15 +3,16 @@ package com.ruoyi.ss.model.service; import com.ruoyi.common.core.domain.ValidateResult; import com.ruoyi.ss.model.domain.SmModelBO; +import java.util.List; + /** * 2024/4/22 */ public interface ModelValidator { - // 插入前校验 - ValidateResult preInsert(SmModelBO bo); - - // 更新前校验 - ValidateResult preUpdate(SmModelBO bo); + // 判断型号是否重复 + boolean isRepeatModel(Long modelId, String model); + // 判断型号标签是否合法 + boolean hasTags(List tags); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/SmModelServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/ModelServiceImpl.java similarity index 67% rename from smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/SmModelServiceImpl.java rename to smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/ModelServiceImpl.java index 5612b46b..933e1b12 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/SmModelServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/ModelServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.ss.model.service.impl; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ServiceUtil; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.collection.CollectionUtils; import com.ruoyi.iot.domain.IotDeviceInfo; import com.ruoyi.ss.device.domain.vo.SmDeviceVO; import com.ruoyi.ss.device.service.ISmDeviceService; @@ -11,10 +12,10 @@ import com.ruoyi.ss.model.domain.SmModelBO; import com.ruoyi.ss.model.domain.SmModelQuery; import com.ruoyi.ss.model.domain.SmModelVo; import com.ruoyi.ss.model.mapper.SmModelMapper; -import com.ruoyi.ss.model.service.ISmModelService; +import com.ruoyi.ss.model.service.ModelService; +import com.ruoyi.ss.model.service.ModelValidator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; import java.util.Collections; import java.util.List; @@ -28,14 +29,17 @@ import java.util.stream.Collectors; * @date 2024-02-21 */ @Service -public class SmModelServiceImpl implements ISmModelService +public class ModelServiceImpl implements ModelService { @Autowired - private SmModelMapper smModelMapper; + private SmModelMapper modelMapper; @Autowired private ISmDeviceService deviceService; + @Autowired + private ModelValidator modelValidator; + /** * 查询型号列表 * @@ -45,7 +49,7 @@ public class SmModelServiceImpl implements ISmModelService @Override public SmModelVo selectSmModelByModelId(Long modelId) { - return smModelMapper.selectSmModelByModelId(modelId); + return modelMapper.selectSmModelByModelId(modelId); } /** @@ -57,37 +61,41 @@ public class SmModelServiceImpl implements ISmModelService @Override public List selectSmModelList(SmModelQuery smModel) { - return smModelMapper.selectSmModelList(smModel); + return modelMapper.selectSmModelList(smModel); } /** * 新增型号列表 * - * @param smModel 型号列表 + * @param data 型号列表 * @return 结果 */ @Override - public int insertSmModel(SmModelBO smModel) - { - smModel.setCreateTime(DateUtils.getNowDate()); - return smModelMapper.insertSmModel(smModel); + public int insertSmModel(SmModelBO data) { + ServiceUtil.assertion(data == null, "参数不能为空"); + ServiceUtil.assertion(CollectionUtils.isEmptyElement(data.getTags()) && !modelValidator.hasTags(data.getTags()), "非法的标签"); + ServiceUtil.assertion(modelValidator.isRepeatModel(data.getModelId(), data.getModel()), "型号重复"); + data.setCreateTime(DateUtils.getNowDate()); + return modelMapper.insertSmModel(data); } /** - * 修改型号列表 + * 修改型号 * - * @param smModel 型号列表 + * @param data 型号 * @return 结果 */ @Override - public int updateSmModel(SmModelBO smModel) - { - smModel.setUpdateTime(DateUtils.getNowDate()); - return smModelMapper.updateSmModel(smModel); + public int updateSmModel(SmModelBO data) { + ServiceUtil.assertion(data == null, "参数不能为空"); + ServiceUtil.assertion(CollectionUtils.isEmptyElement(data.getTags()) && !modelValidator.hasTags(data.getTags()), "非法的标签"); + ServiceUtil.assertion(modelValidator.isRepeatModel(data.getModelId(), data.getModel()), "型号重复"); + data.setUpdateTime(DateUtils.getNowDate()); + return modelMapper.updateSmModel(data); } /** - * 批量删除型号列表 + * 批量删除型号 * * @param modelIds 需要删除的型号列表主键 * @return 结果 @@ -95,7 +103,7 @@ public class SmModelServiceImpl implements ISmModelService @Override public int deleteSmModelByModelIds(Long[] modelIds) { - return smModelMapper.deleteSmModelByModelIds(modelIds); + return modelMapper.deleteSmModelByModelIds(modelIds); } /** @@ -107,28 +115,28 @@ public class SmModelServiceImpl implements ISmModelService @Override public int deleteSmModelByModelId(Long modelId) { - return smModelMapper.deleteSmModelByModelId(modelId); + return modelMapper.deleteSmModelByModelId(modelId); } @Override public Integer selectCount(SmModelQuery dto) { - return smModelMapper.selectCount(dto); + return modelMapper.selectCount(dto); } @Override public int logicDelete(List modelIds) { this.validatePreLogicDelete(modelIds); - return smModelMapper.logicDeleteByIds(modelIds); + return modelMapper.logicDeleteByIds(modelIds); } @Override - public SmModelVo selectByIotModel(String model) { + public SmModelVo selectByModel(String model) { if (!StringUtils.hasText(model)) { return null; } SmModelQuery query = new SmModelQuery(); query.setModel(model); - List list = smModelMapper.selectSmModelList(query); + List list = modelMapper.selectSmModelList(query); if (CollectionUtils.isEmpty(list)) { return null; } @@ -143,7 +151,7 @@ public class SmModelServiceImpl implements ISmModelService SmModel data = new SmModel(); data.setModelName("未命名"); data.setModel(deviceInfo.getModel()); - return smModelMapper.insertSmModel(data); + return modelMapper.insertSmModel(data); } /** @@ -174,7 +182,7 @@ public class SmModelServiceImpl implements ISmModelService } SmModelQuery dto = new SmModelQuery(); dto.setModelIds(modelIds); - List list = smModelMapper.selectSmModelList(dto); + List list = modelMapper.selectSmModelList(dto); if (CollectionUtils.isEmpty(list)) { return Collections.emptyMap(); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/ModelValidatorImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/ModelValidatorImpl.java index c5dcbe31..c5da87af 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/ModelValidatorImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/service/impl/ModelValidatorImpl.java @@ -3,12 +3,17 @@ package com.ruoyi.ss.model.service.impl; import com.ruoyi.common.core.domain.BaseValidator; import com.ruoyi.common.core.domain.ValidateResult; import com.ruoyi.ss.model.domain.SmModelBO; +import com.ruoyi.ss.model.domain.SmModelVo; import com.ruoyi.ss.model.domain.enums.ModelTag; +import com.ruoyi.ss.model.service.ModelService; import com.ruoyi.ss.model.service.ModelValidator; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.List; +import java.util.Objects; /** * 2024/4/22 @@ -16,37 +21,23 @@ import java.util.List; @Service public class ModelValidatorImpl extends BaseValidator implements ModelValidator { + @Autowired + private ModelService modelService; @Override - public ValidateResult preInsert(SmModelBO bo) { - if (bo == null) { - return error("参数不能为空"); + public boolean isRepeatModel(Long modelId, String model) { + if (StringUtils.isBlank(model)) { + return false; } - - if (!this.hasTags(bo.getTags())) { - return error("非法的标签"); - } - - return success(); - } - - @Override - public ValidateResult preUpdate(SmModelBO bo) { - if (bo == null) { - return error("参数不能为空"); - } - - if (!CollectionUtils.isEmpty(bo.getTags()) && this.hasTags(bo.getTags())) { - return error("非法的标签"); - } - - return success(); + SmModelVo repeat = modelService.selectByModel(model); + return repeat != null && !Objects.equals(repeat.getModelId(), modelId); } /** * 判断标签是否合法 */ - private boolean hasTags(List tags) { + @Override + public boolean hasTags(List tags) { if (!CollectionUtils.isEmpty(tags)) { return ModelTag.contains(tags); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/UserAssemblerImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/UserAssemblerImpl.java index 3ab4618f..f075eb64 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/UserAssemblerImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/UserAssemblerImpl.java @@ -62,7 +62,7 @@ public class UserAssemblerImpl implements UserAssembler { SmDeviceQuery query = new SmDeviceQuery(); query.setUserIds(list.stream().map(SmUserVo::getUserId).collect(Collectors.toList())); query.setGroupBy(DeviceGroupBy.user_id.name()); - query.setGroupByTable(DeviceGroupByTable.ss.name()); + query.setGroupByTable(DeviceGroupByTable.su.name()); Map map = deviceService.selectCommonCountMap(query, SmDeviceCountVO::getUserId); for (SmUserVo user : list) { diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDeviceController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDeviceController.java index 43501950..69466eb0 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDeviceController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDeviceController.java @@ -87,7 +87,7 @@ public class AppDeviceController extends BaseController { @ApiOperation("获取设备详细信息") @GetMapping(value = "/{deviceId}") public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId) { - ServiceUtil.assertion(!deviceValidator.isBelong(deviceId, getUserId()), "这不是您的设备"); +// ServiceUtil.assertion(!deviceValidator.isBelong(deviceId, getUserId()), "这不是您的设备"); SmDeviceVO device = smDeviceService.selectSmDeviceByDeviceId(deviceId); List list = Collections.singletonList(device); deviceAssembler.assembleOrderCountInfo(list); // 订单统计信息 diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppStoreController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppStoreController.java index 14892675..3e9b0d39 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppStoreController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppStoreController.java @@ -107,7 +107,6 @@ public class AppStoreController extends BaseController { return AjaxResult.success(storeService.changeSort(list)); } - @MchRequired @ApiOperation("获取当前用户店铺列表及其数量") @GetMapping("/listCount") @JsonView(StoreView.ListCount.class) diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppTransactionBillController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppTransactionBillController.java index 41be74b0..1095006a 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppTransactionBillController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppTransactionBillController.java @@ -91,7 +91,7 @@ public class AppTransactionBillController extends BaseController /** * 查询收支列表 */ - @MchRequired +// @MchRequired @ApiOperation("查询本人收支列表") @GetMapping("/list") @JsonView(JsonViewProfile.AppMch.class) @@ -114,7 +114,7 @@ public class AppTransactionBillController extends BaseController return AjaxResult.success(bill); } - @MchRequired +// @MchRequired @ApiOperation("获取商户统计信息") @JsonView(JsonViewProfile.AppMch.class) @GetMapping("/landlordCount") @@ -175,7 +175,7 @@ public class AppTransactionBillController extends BaseController return AjaxResult.success(smTransactionBillService.cancelRecharge(billNo, TransactionBillStatus.CANCELED)); } - @MchRequired +// @MchRequired @ApiOperation("提现申请") @PostMapping("/withdraw") public AjaxResult withdraw(@RequestBody @Validated({ValidGroup.Withdraw.class}) TransactionBillBO data) { @@ -189,7 +189,7 @@ public class AppTransactionBillController extends BaseController return AjaxResult.success(smTransactionBillService.selectDeviceRechargeFailList(getUserId())); } - @MchRequired +// @MchRequired @ApiOperation("获取设备充值列表") @GetMapping("/rechargeListByDevice") @JsonView(JsonViewProfile.AppMch.class) diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmModelController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmModelController.java index 7e594882..04c10fa3 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmModelController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmModelController.java @@ -25,8 +25,7 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.ss.model.domain.SmModel; -import com.ruoyi.ss.model.service.ISmModelService; +import com.ruoyi.ss.model.service.ModelService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; @@ -41,7 +40,7 @@ import com.ruoyi.common.core.page.TableDataInfo; public class SmModelController extends BaseController { @Autowired - private ISmModelService smModelService; + private ModelService smModelService; @Autowired private ModelValidator modelValidator; @@ -89,7 +88,6 @@ public class SmModelController extends BaseController public AjaxResult add(@RequestBody @Validated(ValidGroup.Create.class) SmModelBO smModel) { smModel = smModel.filterInsert(); - ServiceUtil.assertion(modelValidator.preInsert(smModel)); return toAjax(smModelService.insertSmModel(smModel)); } @@ -102,7 +100,6 @@ public class SmModelController extends BaseController public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) SmModelBO smModel) { smModel = smModel.filterUpdate(); - ServiceUtil.assertion(modelValidator.preUpdate(smModel)); return toAjax(smModelService.updateSmModel(smModel)); } diff --git a/smart-switch-web/src/main/resources/application-dev.yml b/smart-switch-web/src/main/resources/application-dev.yml index db89ed7e..7664458b 100644 --- a/smart-switch-web/src/main/resources/application-dev.yml +++ b/smart-switch-web/src/main/resources/application-dev.yml @@ -1,5 +1,5 @@ # debug模式,部分权限校验不生效 -debug: false +debug: true # 项目相关配置 ruoyi: diff --git a/smart-switch-web/src/main/resources/application-test.yml b/smart-switch-web/src/main/resources/application-test.yml index ad04e5b3..4bf497d3 100644 --- a/smart-switch-web/src/main/resources/application-test.yml +++ b/smart-switch-web/src/main/resources/application-test.yml @@ -4,7 +4,7 @@ debug: false # 项目相关配置 ruoyi: # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: /www/wwwroot/smart-swith/upload + profile: /home/www/projects/smart-switch/upload wx: # 微信小程序appId @@ -22,7 +22,7 @@ wx: # 通知回调地址 notifyUrl: https://kg.chuantewulian.cn/test-api/app/pay/notify/wx # 测试环境 # 密钥所在位置 - privateKeyPath: /www/wwwroot/smart-switch/wxpay/apiclient_key.pem + privateKeyPath: /home/www/projects/smart-switch/wxpay/apiclient_key.pem # 证书序列号 merchantSerialNumber: 66910F800A60768020F07D39A56AE701574A16AE