From 7d2bfc4bbfbd21c7826e9c7a328011dd5f306931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E5=A4=A7=E5=8F=94?= <494979559@qq.com> Date: Mon, 13 May 2024 15:05:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BA=97=E9=93=BA=E3=80=81?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E3=80=81=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/domain/entity/SmArticleClassify.java | 9 ++ .../common/core/domain/entity/SmUser.java | 3 + .../ruoyi/ss/abnormal/domain/Abnormal.java | 7 +- .../ss/abnormal/mapper/AbnormalMapper.java | 3 +- .../ss/abnormal/service/IAbnormalService.java | 3 +- .../service/impl/AbnormalServiceImpl.java | 9 +- .../main/java/com/ruoyi/ss/ad/domain/Ad.java | 35 +++++ .../java/com/ruoyi/ss/ad/domain/AdQuery.java | 11 ++ .../java/com/ruoyi/ss/ad/domain/AdVO.java | 11 ++ .../java/com/ruoyi/ss/ad/mapper/AdMapper.java | 78 +++++++++++ .../java/com/ruoyi/ss/ad/mapper/AdMapper.xml | 123 ++++++++++++++++++ .../com/ruoyi/ss/ad/service/IAdService.java | 72 ++++++++++ .../ss/ad/service/impl/AdServiceImpl.java | 114 ++++++++++++++++ .../ruoyi/ss/article/domain/SmArticle.java | 2 - .../ss/article/domain/enums/LicenceType.java | 7 +- .../service/impl/SmArticleServiceImpl.java | 1 - .../service/SmBusinessRecordServiceImpl.java | 1 - .../ss/channel/service/ChannelValidator.java | 2 - .../com/ruoyi/ss/device/domain/SmDevice.java | 24 +++- .../ruoyi/ss/device/domain/SmDeviceBO.java | 54 ++++++++ .../ruoyi/ss/device/domain/SmDeviceQuery.java | 5 +- .../ruoyi/ss/device/domain/vo/SmDeviceVo.java | 7 - .../ss/device/mapper/SmDeviceMapper.java | 9 +- .../ruoyi/ss/device/mapper/SmDeviceMapper.xml | 25 +++- .../ss/device/service/DeviceValidator.java | 16 +++ .../ss/device/service/ISmDeviceService.java | 7 +- .../service/impl/DeviceAssemblerImpl.java | 4 +- .../service/impl/DeviceValidatorImpl.java | 91 ++++++++++++- .../service/impl/SmDeviceServiceImpl.java | 37 +++--- .../ruoyi/ss/mchApply/domain/MchApply.java | 10 +- .../ss/mchApply/mapper/MchApplyMapper.java | 3 +- .../ss/mchApply/service/IMchApplyService.java | 3 +- .../service/impl/MchApplyServiceImpl.java | 11 +- .../service/impl/MchApplyValidatorImpl.java | 1 - .../SmMeterReadingRecordServiceImpl.java | 4 +- .../com/ruoyi/ss/model/domain/SmModel.java | 2 - .../java/com/ruoyi/ss/store/domain/Store.java | 5 +- .../com/ruoyi/ss/store/domain/StoreBO.java | 4 - .../ruoyi/ss/store/service/IStoreService.java | 2 - .../service/impl/StoreAssemblerImpl.java | 1 - .../store/service/impl/StoreServiceImpl.java | 21 ++- .../java/com/ruoyi/ss/suit/domain/Suit.java | 11 +- .../java/com/ruoyi/ss/suit/domain/SuitVo.java | 9 +- .../com/ruoyi/ss/suit/mapper/SuitMapper.java | 3 +- .../com/ruoyi/ss/suit/mapper/SuitMapper.xml | 8 +- .../ruoyi/ss/suit/service/ISuitService.java | 8 +- .../ruoyi/ss/suit/service/SuitValidator.java | 1 - .../ss/suit/service/impl/SuitServiceImpl.java | 20 +-- .../suit/service/impl/SuitValidatorImpl.java | 2 +- .../mapper/TransactionBillMapper.xml | 1 + .../service/TransactionBillService.java | 12 +- .../impl/TransactionBillServiceImpl.java | 36 ++++- .../impl/TransactionBillValidatorImpl.java | 2 + .../ss/user/domain/{ => bo}/SmUserBO.java | 2 +- .../domain/bo/UserUpdateServiceRateBO.java | 30 +++++ .../ruoyi/ss/user/mapper/SmUserMapper.java | 7 + .../com/ruoyi/ss/user/mapper/SmUserMapper.xml | 11 ++ .../ruoyi/ss/user/service/ISmUserService.java | 8 ++ .../user/service/impl/SmUserServiceImpl.java | 29 +++++ .../user/service/impl/UserAssemblerImpl.java | 2 - .../user/service/impl/UserValidatorImpl.java | 1 - .../ruoyi/ss/wxPay/service/WxPayService.java | 1 - .../controller/app/AppAccountController.java | 2 - .../web/controller/app/AppAdController.java | 31 +++++ .../controller/app/AppArticleController.java | 7 +- .../web/controller/app/AppAuthController.java | 1 - .../controller/app/AppConfigController.java | 3 - .../controller/app/AppDeviceController.java | 39 ++---- .../controller/app/AppMchApplyController.java | 8 +- .../app/AppResetRecordController.java | 2 - .../controller/app/AppStoreController.java | 2 - .../web/controller/app/AppSuitController.java | 1 - .../app/AppTransactionBillController.java | 9 +- .../web/controller/app/AppUserController.java | 11 +- .../ruoyi/web/controller/ss/AdController.java | 108 +++++++++++++++ .../web/controller/ss/SmDeviceController.java | 17 ++- .../web/controller/ss/SmUserController.java | 14 ++ .../web/controller/ss/StoreController.java | 11 +- 78 files changed, 1104 insertions(+), 203 deletions(-) create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/Ad.java create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/AdQuery.java create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/AdVO.java create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/ad/mapper/AdMapper.java create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/ad/mapper/AdMapper.xml create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/ad/service/IAdService.java create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/ad/service/impl/AdServiceImpl.java create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDeviceBO.java rename smart-switch-service/src/main/java/com/ruoyi/ss/user/domain/{ => bo}/SmUserBO.java (88%) create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/user/domain/bo/UserUpdateServiceRateBO.java create mode 100644 smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppAdController.java create mode 100644 smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/AdController.java diff --git a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/entity/SmArticleClassify.java b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/entity/SmArticleClassify.java index a43d5cd7..c0214c6e 100644 --- a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/entity/SmArticleClassify.java +++ b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/entity/SmArticleClassify.java @@ -1,6 +1,8 @@ package com.ruoyi.common.core.domain.entity; +import com.fasterxml.jackson.annotation.JsonView; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.core.domain.JsonViewProfile; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -22,25 +24,30 @@ public class SmArticleClassify extends BaseEntity /** 分类ID */ @ApiModelProperty("分类ID") + @JsonView(JsonViewProfile.App.class) private Long classifyId; /** 父分类ID */ @ApiModelProperty("父分类ID") + @JsonView(JsonViewProfile.App.class) private Long parentId; /** 祖级列表 */ @ApiModelProperty("祖级列表") + @JsonView(JsonViewProfile.App.class) private String ancestors; /** 分类名称 */ @ApiModelProperty("分类名称") @NotBlank(message = "分类名称不能为空") @Size(min = 0, max = 30, message = "分类名称长度不能超过30个字符") + @JsonView(JsonViewProfile.App.class) private String classifyName; /** 显示顺序 */ @ApiModelProperty("显示顺序") @NotNull(message = "显示顺序不能为空") + @JsonView(JsonViewProfile.App.class) private Integer orderNum; @@ -54,10 +61,12 @@ public class SmArticleClassify extends BaseEntity /** 父分类名称 */ @ApiModelProperty("父分类名称") + @JsonView(JsonViewProfile.App.class) private String parentName; /** 子分类 */ @ApiModelProperty("子分类") + @JsonView(JsonViewProfile.App.class) private List children = new ArrayList(); @ApiModelProperty("是否系统内置") diff --git a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/entity/SmUser.java b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/entity/SmUser.java index c627fe50..0257dc40 100644 --- a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/entity/SmUser.java +++ b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/entity/SmUser.java @@ -135,4 +135,7 @@ public class SmUser extends BaseEntity @ApiModelProperty("是否商家") @JsonView(JsonViewProfile.App.class) private Boolean isMch; + + @ApiModelProperty("服务费费率") + private BigDecimal serviceRate; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/Abnormal.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/Abnormal.java index a5d3c06c..d8f2ca51 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/Abnormal.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/Abnormal.java @@ -1,14 +1,11 @@ package com.ruoyi.ss.abnormal.domain; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.ValidGroup; import com.ruoyi.common.utils.RegexpUtils; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; -import org.springframework.beans.factory.annotation.Autowired; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.java index 0d63d4de..70f0ff25 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.java @@ -1,11 +1,12 @@ package com.ruoyi.ss.abnormal.mapper; -import java.util.List; import com.ruoyi.ss.abnormal.domain.Abnormal; import com.ruoyi.ss.abnormal.domain.AbnormalQuery; import com.ruoyi.ss.abnormal.domain.AbnormalVO; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 设备故障Mapper接口 * diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/IAbnormalService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/IAbnormalService.java index 596f31e5..0bd5e0fc 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/IAbnormalService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/IAbnormalService.java @@ -1,10 +1,11 @@ package com.ruoyi.ss.abnormal.service; -import java.util.List; import com.ruoyi.ss.abnormal.domain.Abnormal; import com.ruoyi.ss.abnormal.domain.AbnormalQuery; import com.ruoyi.ss.abnormal.domain.AbnormalVO; +import java.util.List; + /** * 设备故障Service接口 * diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalServiceImpl.java index 661cf6d8..9855b231 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalServiceImpl.java @@ -1,14 +1,15 @@ package com.ruoyi.ss.abnormal.service.impl; -import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.ss.abnormal.domain.Abnormal; import com.ruoyi.ss.abnormal.domain.AbnormalQuery; import com.ruoyi.ss.abnormal.domain.AbnormalVO; +import com.ruoyi.ss.abnormal.mapper.AbnormalMapper; +import com.ruoyi.ss.abnormal.service.IAbnormalService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.ruoyi.ss.abnormal.mapper.AbnormalMapper; -import com.ruoyi.ss.abnormal.domain.Abnormal; -import com.ruoyi.ss.abnormal.service.IAbnormalService; + +import java.util.List; /** * 设备故障Service业务层处理 diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/Ad.java b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/Ad.java new file mode 100644 index 00000000..1eb2a380 --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/Ad.java @@ -0,0 +1,35 @@ +package com.ruoyi.ss.ad.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 广告对象 ss_ad + * + * @author ruoyi + * @date 2024-05-11 + */ +@Data +public class Ad extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("广告ID") + private Long adId; + + @Excel(name = "广告类型 1:活动推广") + @ApiModelProperty("广告类型 1:活动推广 ") + private String type; + + @Excel(name = "广告图片") + @ApiModelProperty("广告图片") + private String picture; + + @Excel(name = "跳转链接") + @ApiModelProperty("跳转链接") + private String url; +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/AdQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/AdQuery.java new file mode 100644 index 00000000..e16b093b --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/AdQuery.java @@ -0,0 +1,11 @@ +package com.ruoyi.ss.ad.domain; + +import lombok.Data; + +/** + * @author wjh + * 2024/5/11 + */ +@Data +public class AdQuery extends Ad { +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/AdVO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/AdVO.java new file mode 100644 index 00000000..65c4c821 --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/domain/AdVO.java @@ -0,0 +1,11 @@ +package com.ruoyi.ss.ad.domain; + +import lombok.Data; + +/** + * @author wjh + * 2024/5/11 + */ +@Data +public class AdVO extends Ad{ +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/ad/mapper/AdMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/mapper/AdMapper.java new file mode 100644 index 00000000..5adae4ac --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/mapper/AdMapper.java @@ -0,0 +1,78 @@ +package com.ruoyi.ss.ad.mapper; + +import java.util.List; +import com.ruoyi.ss.ad.domain.Ad; +import com.ruoyi.ss.ad.domain.AdQuery; +import com.ruoyi.ss.ad.domain.AdVO; +import org.apache.ibatis.annotations.Param; + +/** + * 广告Mapper接口 + * + * @author ruoyi + * @date 2024-05-11 + */ +public interface AdMapper +{ + /** + * 查询广告 + * + * @param adId 广告主键 + * @return 广告 + */ + public AdVO selectAdByAdId(Long adId); + + /** + * 查询广告列表 + * + * @param ad 广告 + * @return 广告集合 + */ + public List selectAdList(AdQuery ad); + + /** + * 新增广告 + * + * @param ad 广告 + * @return 结果 + */ + public int insertAd(Ad ad); + + /** + * 修改广告 + * + * @param ad 广告 + * @return 结果 + */ + public int updateAd(Ad ad); + + /** + * 删除广告 + * + * @param adId 广告主键 + * @return 结果 + */ + public int deleteAdByAdId(Long adId); + + /** + * 批量删除广告 + * + * @param adIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAdByAdIds(Long[] adIds); + + /** + * 逻辑删除 + * @param ids + * @return + */ + int logicDel(@Param("ids") List ids); + + /** + * 查询一个 + * @param query + * @return + */ + AdVO selectOne(AdQuery query); +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/ad/mapper/AdMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/mapper/AdMapper.xml new file mode 100644 index 00000000..b10886bf --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/mapper/AdMapper.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + select + sa.ad_id, + sa.type, + sa.picture, + sa.url, + sa.create_by, + sa.create_time, + sa.update_by, + sa.update_time, + sa.remark, + sa.deleted + from ss_ad sa + + + + and sa.ad_id = #{adId} + and sa.type = #{type} + and sa.url like concat('%', #{url}, '%') + and sa.deleted = #{deleted} + and sa.deleted = false + + + + + + + + + + insert into ss_ad + + type, + picture, + url, + create_by, + create_time, + update_by, + update_time, + remark, + deleted, + + + #{type}, + #{picture}, + #{url}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{deleted}, + + + + + update ss_ad + + type = #{type}, + picture = #{picture}, + url = #{url}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where ad_id = #{adId} + + + + update ss_ad + set deleted = true + where ad_id in + + #{adId} + + + + + delete from ss_ad where ad_id = #{adId} + + + + delete from ss_ad where ad_id in + + #{adId} + + + diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/ad/service/IAdService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/service/IAdService.java new file mode 100644 index 00000000..0c9a076c --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/service/IAdService.java @@ -0,0 +1,72 @@ +package com.ruoyi.ss.ad.service; + +import java.util.List; +import com.ruoyi.ss.ad.domain.Ad; +import com.ruoyi.ss.ad.domain.AdQuery; +import com.ruoyi.ss.ad.domain.AdVO; + +/** + * 广告Service接口 + * + * @author ruoyi + * @date 2024-05-11 + */ +public interface IAdService +{ + /** + * 查询广告 + * + * @param adId 广告主键 + * @return 广告 + */ + public AdVO selectAdByAdId(Long adId); + + /** + * 查询广告列表 + * + * @param ad 广告 + * @return 广告集合 + */ + public List selectAdList(AdQuery ad); + + /** + * 新增广告 + * + * @param ad 广告 + * @return 结果 + */ + public int insertAd(Ad ad); + + /** + * 修改广告 + * + * @param ad 广告 + * @return 结果 + */ + public int updateAd(Ad ad); + + /** + * 批量删除广告 + * + * @param adIds 需要删除的广告主键集合 + * @return 结果 + */ + public int deleteAdByAdIds(Long[] adIds); + + /** + * 删除广告信息 + * + * @param adId 广告主键 + * @return 结果 + */ + public int deleteAdByAdId(Long adId); + + /** + * 逻辑删除 + * @param ids + * @return + */ + int logicDel(List ids); + + AdVO selectOne(AdQuery query); +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/ad/service/impl/AdServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/service/impl/AdServiceImpl.java new file mode 100644 index 00000000..f13bf9be --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/ad/service/impl/AdServiceImpl.java @@ -0,0 +1,114 @@ +package com.ruoyi.ss.ad.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.ss.ad.domain.AdQuery; +import com.ruoyi.ss.ad.domain.AdVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.ss.ad.mapper.AdMapper; +import com.ruoyi.ss.ad.domain.Ad; +import com.ruoyi.ss.ad.service.IAdService; + +/** + * 广告Service业务层处理 + * + * @author ruoyi + * @date 2024-05-11 + */ +@Service +public class AdServiceImpl implements IAdService +{ + @Autowired + private AdMapper adMapper; + + /** + * 查询广告 + * + * @param adId 广告主键 + * @return 广告 + */ + @Override + public AdVO selectAdByAdId(Long adId) + { + return adMapper.selectAdByAdId(adId); + } + + /** + * 查询广告列表 + * + * @param ad 广告 + * @return 广告 + */ + @Override + public List selectAdList(AdQuery ad) + { + return adMapper.selectAdList(ad); + } + + /** + * 新增广告 + * + * @param ad 广告 + * @return 结果 + */ + @Override + public int insertAd(Ad ad) + { + ad.setCreateTime(DateUtils.getNowDate()); + return adMapper.insertAd(ad); + } + + /** + * 修改广告 + * + * @param ad 广告 + * @return 结果 + */ + @Override + public int updateAd(Ad ad) + { + ad.setUpdateTime(DateUtils.getNowDate()); + return adMapper.updateAd(ad); + } + + /** + * 批量删除广告 + * + * @param adIds 需要删除的广告主键 + * @return 结果 + */ + @Override + public int deleteAdByAdIds(Long[] adIds) + { + return adMapper.deleteAdByAdIds(adIds); + } + + /** + * 删除广告信息 + * + * @param adId 广告主键 + * @return 结果 + */ + @Override + public int deleteAdByAdId(Long adId) + { + return adMapper.deleteAdByAdId(adId); + } + + /** + * 逻辑删除 + * + * @param ids + * @return + */ + @Override + public int logicDel(List ids) { + return adMapper.logicDel(ids); + } + + @Override + public AdVO selectOne(AdQuery query) { + return adMapper.selectOne(query); + } +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/article/domain/SmArticle.java b/smart-switch-service/src/main/java/com/ruoyi/ss/article/domain/SmArticle.java index 58b287ed..46635956 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/article/domain/SmArticle.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/article/domain/SmArticle.java @@ -7,8 +7,6 @@ import com.ruoyi.common.core.domain.JsonViewProfile; import com.ruoyi.common.core.domain.entity.SmArticleClassify; import lombok.Data; -import javax.validation.constraints.NotNull; - /** * 文章对象 as_article * diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/article/domain/enums/LicenceType.java b/smart-switch-service/src/main/java/com/ruoyi/ss/article/domain/enums/LicenceType.java index 0ba468fa..dcae1e5b 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/article/domain/enums/LicenceType.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/article/domain/enums/LicenceType.java @@ -14,9 +14,10 @@ import java.util.Objects; @AllArgsConstructor public enum LicenceType { - USER("user", "ss.licence.user.id"), - PRIVACY("privacy", "ss.licence.privacy.id"), - COLLECT("collection", "ss.licence.collection.id"); + USER("user", "ss.licence.user.id"), // 用户协议 + PRIVACY("privacy", "ss.licence.privacy.id"), // 隐私协议 + COLLECT("collection", "ss.licence.collection.id"), // 个人信息收集清单 + ABOUT("about", "ss.licence.about.id"); // 关于我们 private final String type; // 类型 private final String key; // 配置键值 diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/article/service/impl/SmArticleServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/article/service/impl/SmArticleServiceImpl.java index 2da78b17..ea8fba6b 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/article/service/impl/SmArticleServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/article/service/impl/SmArticleServiceImpl.java @@ -7,7 +7,6 @@ import com.ruoyi.ss.article.domain.SmArticleQuery; import com.ruoyi.ss.article.domain.enums.LicenceType; import com.ruoyi.ss.article.mapper.SmArticleMapper; import com.ruoyi.ss.article.service.ISmArticleService; -import com.ruoyi.system.mapper.SysDictDataMapper; import com.ruoyi.system.service.ISysConfigService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; 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 b8e32f3d..6330169a 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 @@ -1,6 +1,5 @@ package com.ruoyi.ss.businessRecord.service; -import com.ruoyi.common.enums.UserStatus; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.ss.businessRecord.domain.SmBusinessRecord; import com.ruoyi.ss.businessRecord.domain.SmBusinessRecordQuery; diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/ChannelValidator.java b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/ChannelValidator.java index 82e4133f..77011be8 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/ChannelValidator.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/ChannelValidator.java @@ -1,7 +1,5 @@ package com.ruoyi.ss.channel.service; -import com.ruoyi.common.core.domain.ValidateResult; - /** * @author wjh * 2024/5/5 diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDevice.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDevice.java index d66677cb..65ded40c 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDevice.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDevice.java @@ -113,12 +113,12 @@ public class SmDevice extends BaseEntity @Excel(name = "欠费断电") @ApiModelProperty("断电方式:0欠费不断电,1欠费立即断电") - @EnumValid( - clazz = DeviceOutageWay.class, - message = "非法的欠费断电方式", - method = "getValue", - groups = {ValidGroup.Create.class, ValidGroup.Update.class, ValidGroup.FrontUpdate.class} - ) +// @EnumValid( +// clazz = DeviceOutageWay.class, +// message = "非法的超时断电方式", +// method = "getValue", +// groups = {ValidGroup.Create.class, ValidGroup.Update.class, ValidGroup.FrontUpdate.class} +// ) private String outageWay; @Excel(name = "wifi名称") @@ -138,4 +138,16 @@ public class SmDevice extends BaseEntity @ApiModelProperty("设备到期时间") @JsonView(DeviceView.SuitList.class) private LocalDateTime expireTime; + + @ApiModelProperty("所属用户ID") + @NotNull(message = "用户不允许为空", groups = {ValidGroup.Create.class}) + private Long userId; + + @ApiModelProperty("用户自定义图片") + private String customPicture; + + @ApiModelProperty("服务费费率") + @Range(min = 0, max = 100, message = "服务费费率必须在0-100之间") + private BigDecimal serviceRate; + } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDeviceBO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDeviceBO.java new file mode 100644 index 00000000..581f14c1 --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDeviceBO.java @@ -0,0 +1,54 @@ +package com.ruoyi.ss.device.domain; + +import lombok.Data; + +/** + * @author wjh + * 2024/5/10 + */ +@Data +public class SmDeviceBO extends SmDevice { + + /** + * 过滤新增字段 + */ + public SmDeviceBO filterCreate() { + SmDeviceBO bo = new SmDeviceBO(); + bo.setDeviceNo(getDeviceNo()); + bo.setStoreId(getStoreId()); + bo.setDeviceName(getDeviceName()); + bo.setModelId(getModelId()); + bo.setMac(getMac()); + bo.setUserId(getUserId()); + bo.setServiceRate(getServiceRate()); + return bo; + } + + /** + * 过滤更新字段 + */ + public SmDeviceBO filterUpdate() { + SmDeviceBO bo = new SmDeviceBO(); + bo.setDeviceId(getDeviceId()); + bo.setDeviceNo(getDeviceNo()); + bo.setStoreId(getStoreId()); + bo.setDeviceName(getDeviceName()); + bo.setModelId(getModelId()); + bo.setUserId(getUserId()); + bo.setServiceRate(getServiceRate()); + return bo; + } + + /** + * 过滤APP更新字段 + */ + public SmDeviceBO filterUpdateByApp() { + SmDeviceBO bo = new SmDeviceBO(); + bo.setDeviceId(getDeviceId()); + bo.setStoreId(getStoreId()); + bo.setRemark(getRemark()); + bo.setDeviceName(getDeviceName()); + bo.setCustomPicture(getCustomPicture()); + return bo; + } +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDeviceQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDeviceQuery.java index bef943ac..488cd15f 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDeviceQuery.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/SmDeviceQuery.java @@ -55,9 +55,6 @@ public class SmDeviceQuery extends SmDevice { @ApiModelProperty("设备编号列表") private List deviceNos; - @ApiModelProperty("所属商户ID") - private Long userId; - - @ApiModelProperty("商户id列表") + @ApiModelProperty("用户id列表") private List userIds; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/vo/SmDeviceVo.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/vo/SmDeviceVo.java index 8668c788..52546a21 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/vo/SmDeviceVo.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/vo/SmDeviceVo.java @@ -2,17 +2,13 @@ package com.ruoyi.ss.device.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonView; -import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.JsonViewProfile; -import com.ruoyi.common.core.domain.ValidGroup; import com.ruoyi.ss.device.domain.DeviceView; import com.ruoyi.ss.device.domain.SmDevice; import com.ruoyi.ss.suit.domain.SuitVo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; -import javax.validation.constraints.NotNull; import java.math.BigDecimal; import java.time.LocalTime; import java.util.List; @@ -59,9 +55,6 @@ public class SmDeviceVo extends SmDevice { @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") private LocalTime storeBusinessTimeEnd; - @ApiModelProperty("所属商户ID") - private Long userId; - @ApiModelProperty("订单总数量") private Integer orderCount; diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/SmDeviceMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/SmDeviceMapper.java index b8a04c14..3e09cb4d 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/SmDeviceMapper.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/SmDeviceMapper.java @@ -1,6 +1,8 @@ package com.ruoyi.ss.device.mapper; -import com.ruoyi.ss.device.domain.*; +import com.ruoyi.ss.device.domain.SmDevice; +import com.ruoyi.ss.device.domain.SmDeviceCountVO; +import com.ruoyi.ss.device.domain.SmDeviceQuery; import com.ruoyi.ss.device.domain.vo.SmDeviceVo; import org.apache.ibatis.annotations.Param; @@ -138,4 +140,9 @@ public interface SmDeviceMapper * @return */ SmDeviceVo selectSimpleSmDeviceBySn(String deviceNo); + + /** + * 通过用户id修改服务费率 + */ + int updateServiceRateByUserId(@Param("userId") Long userId, @Param("serviceRate") BigDecimal serviceRate); } 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 e2ff56b0..f8f38389 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 @@ -17,9 +17,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sd.mac like concat('%', #{mac}, '%') and sd.online_status = #{onlineStatus} and sd.status = #{status} - and sd.user_name like concat('%', #{userName}, '%') + and su.user_name like concat('%', #{userName}, '%') and sd.nick_name like concat('%', #{nickName}, '%') - and su.user_id = #{userId} + and sd.user_id = #{userId} and sd.store_id = #{storeId} and sd.device_id = #{deviceId} and sd.device_no like concat('%', #{deviceNo}, '%') @@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - and ss.user_id in + and sd.user_id in #{item} @@ -66,12 +66,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sm.picture as picture, sm.tags as model_tags, ss.name as store_name, - su.user_id as user_id, su.user_name as user_name from sm_device sd left join sm_model sm on sm.model_id = sd.model_id left join sm_store ss on ss.store_id = sd.store_id - left join sm_user su on su.user_id = ss.user_id + left join sm_user su on su.user_id = sd.user_id