Browse Source

Merge remote-tracking branch 'origin/dev-api' into dev-api

wangtianteng 1 year ago
parent
commit
79c1a7f1b9
37 changed files with 969 additions and 102 deletions
  1. 15 3
      rouyi-api/src/main/java/com/info666/infraredRemote/controller/GetDeviceInfoController.java
  2. 108 0
      rouyi-api/src/main/java/com/info666/infraredRemote/controller/SmsController.java
  3. 76 0
      rouyi-api/src/main/java/com/info666/infraredRemote/controller/UserLoginController.java
  4. 12 0
      rouyi-api/src/main/resources/application.yml
  5. 25 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/AppConfigController.java
  6. 38 23
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/BasicLibraryController.java
  7. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/ComponentsLibraryController.java
  8. 2 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/QrLibraryController.java
  9. 4 5
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/TemplateLibraryController.java
  10. 11 3
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/UploadController.java
  11. 54 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/UserInfoController.java
  12. 3 2
      ruoyi-admin/src/main/resources/application.yml
  13. 13 0
      ruoyi-common/pom.xml
  14. 43 0
      ruoyi-common/src/main/java/com/ruoyi/common/config/SMSProperties.java
  15. 0 24
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/CodeMsg.java
  16. 0 8
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java
  17. 56 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/ip/IPUtils.java
  18. 4 6
      ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
  19. 61 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/sms/SendMessage.java
  20. 15 0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/ConstantUtil.java
  21. 39 0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisKeys.java
  22. 42 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/BasicLibrary.java
  23. 8 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/TemplateLibrary.java
  24. 55 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/UserAddress.java
  25. 57 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/UserInfo.java
  26. 29 16
      ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/ComponentsAndBasicVo.java
  27. 7 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/GetDeviceInfoVo.java
  28. 19 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SmsResponseVo.java
  29. 16 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserAddressMapper.java
  30. 14 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserInfoMapper.java
  31. 19 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/UserAddressService.java
  32. 14 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/UserInfoService.java
  33. 10 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ComponentsLibraryServiceImpl.java
  34. 25 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserAddressServiceImpl.java
  35. 18 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserInfoServiceImpl.java
  36. 33 0
      ruoyi-system/src/main/resources/mapper/system/platform/UserAddressMapper.xml
  37. 22 0
      ruoyi-system/src/main/resources/mapper/system/platform/UserInfoMapper.xml

+ 15 - 3
rouyi-api/src/main/java/com/info666/infraredRemote/controller/GetDeviceInfoController.java

@@ -35,11 +35,10 @@ public class GetDeviceInfoController {
     @ApiOperation("获取遥控设备信息")
     @PostMapping("/getDeviceInfo")
     public R<List<GetDeviceInfoVo>> getDeviceInfo(@RequestBody BaseParam param) {
-        // TODO: 2023/7/17 跟h5确定后进行变更
         Long temId = null;
         if (param.getId() == null) {
             temId = 1L;
-        }else {
+        } else {
             temId = param.getId();
         }
 
@@ -48,15 +47,28 @@ public class GetDeviceInfoController {
         //获取基本数据
         BasicLibrary basicLibrary = basicLibraryService.getOne(new LambdaQueryWrapper<BasicLibrary>().eq(BasicLibrary::getDelFlag, 0)
                 .eq(BasicLibrary::getId, templateLibrary.getBaseId()), false);
+
         GetDeviceInfoVo deviceInfoVo = new GetDeviceInfoVo();
         deviceInfoVo.setBandValue(basicLibrary.getBandValue());
         deviceInfoVo.setComponentsString(templateLibrary.getComponents());
         deviceInfoVo.setBasicLibrary(basicLibrary);
+        deviceInfoVo.setBackgroundPictureUrl(templateLibrary.getBackgroundPictureUrl());
         // TODO: 2023/7/17  需要跟h5再对一下    之前是list 现在只返回一条,不需要list
         list.add(deviceInfoVo);
-
         return R.ok(list);
     }
 
 
+    /**
+     * 查询已启的模板库列表
+     */
+    @PostMapping("/getEnableTemplateList")
+    public R<List<TemplateLibrary>> getEnableTemplateList() {
+        List<TemplateLibrary> templateIPage = templateLibraryService.list(new LambdaQueryWrapper<TemplateLibrary>()
+                .eq(TemplateLibrary::getStatus, 0)
+                .eq(TemplateLibrary::getDelFlag, 0));
+        return R.ok(templateIPage);
+    }
+
+
 }

+ 108 - 0
rouyi-api/src/main/java/com/info666/infraredRemote/controller/SmsController.java

@@ -0,0 +1,108 @@
+package com.info666.infraredRemote.controller;
+
+import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.core.sms.SendMessage;
+import com.ruoyi.common.utils.RedisKeys;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.ip.IpUtils;
+import com.ruoyi.system.domain.UserInfo;
+import com.ruoyi.system.domain.vo.SmsResponseVo;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Pattern;
+
+@RestController
+@RequestMapping("/api/v1/sms")
+public class SmsController {
+
+    @Autowired
+    private RedisCache redisCache;
+
+    @Autowired
+    private RedisTemplate redisTemplate;
+
+    @Autowired
+    private SendMessage sendMessage;
+
+
+    @PostMapping("/send")
+    public R<SmsResponseVo> sendSms(@RequestBody UserInfo param, HttpServletRequest request) {
+        if (StringUtils.isEmpty(param.getUserPhone()) || Pattern.matches("^1[3-9]\\d{9}$\n", param.getUserPhone())) {
+            return R.fail("手机号格式不正确");
+        }
+
+        //每个公网id地址1天只能发100条
+        //每个手机号一天只能发10条,一分钟只能发一条
+        String ip = IpUtils.getIpAddr(request);
+        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMdd");
+        String strDate = dtf.format(LocalDate.now());
+        String ipKey = RedisKeys.INCR_IP + strDate + "_" + ip;
+        String phoneIconKey = RedisKeys.INCR_PHONE + strDate + "_" + param.getUserPhone();
+        String phone = RedisKeys.SMS_PHONE_TIME + param.getUserPhone();
+        //一分钟发送一次
+        if (redisTemplate.hasKey(phone)) {
+            //存在
+            return R.fail("1分钟内只能发送一次,请稍后再试!");
+        } else {
+            //不存在
+            redisTemplate.opsForValue().set(phone, 1, 1L, TimeUnit.MINUTES);
+        }
+
+        //手机号
+        if (redisTemplate.hasKey(phoneIconKey)) {
+            //存在
+            Integer increment = redisCache.getCacheObject(phoneIconKey);
+            if (increment > 10) {
+                return R.fail("该手机号发送次数过多,已禁止发送!");
+            }
+        } else {
+            //不存在
+            redisTemplate.opsForValue().set(phoneIconKey, 1, 1L, TimeUnit.DAYS);
+        }
+
+        //ip
+        if (redisTemplate.hasKey(ipKey)) {
+            //存在
+            Integer increment = redisCache.getCacheObject(ipKey);
+            if (increment > 100) {
+                return R.fail("发送次数过多,已禁止发送!");
+            }
+        } else {
+            //不存在
+            redisTemplate.opsForValue().set(ipKey, 1, 1L, TimeUnit.DAYS);
+        }
+
+        // 通过RandomStringUtils生成随机验证码
+        String code = RandomStringUtils.randomNumeric(6);
+        SmsResponseVo smsResponse = new SmsResponseVo();
+        try {
+            //手机号和验证码进行发短信
+            SendSmsResponse sendSmsResponse = sendMessage.sendSms(param.getUserPhone(), code);
+
+            if (sendSmsResponse.getMessage().equals("OK")) {
+                redisCache.setCacheObject(RedisKeys.SMS_PHONE_CODE + param.getUserPhone(), code, 5, TimeUnit.MINUTES);
+                smsResponse.setCode(sendSmsResponse.getCode());
+                smsResponse.setMessage(sendSmsResponse.getMessage());
+                smsResponse.setKeyCode(RedisKeys.SMS_PHONE_CODE + param.getUserPhone());
+
+            } else {
+                return R.fail(sendSmsResponse.getMessage());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return R.ok(smsResponse);
+    }
+}

+ 76 - 0
rouyi-api/src/main/java/com/info666/infraredRemote/controller/UserLoginController.java

@@ -0,0 +1,76 @@
+package com.info666.infraredRemote.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.UserAddress;
+import com.ruoyi.system.domain.UserInfo;
+import com.ruoyi.system.domain.vo.SmsResponseVo;
+import com.ruoyi.system.service.UserAddressService;
+import com.ruoyi.system.service.UserInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.regex.Pattern;
+
+/**
+ * @Author: LiMingMing
+ * @Date: 2023/8/1 16:09
+ * @Description: TODO
+ **/
+@RestController
+@RequestMapping("/api/v1/user")
+public class UserLoginController {
+
+    @Autowired
+    private UserInfoService userInfoService;
+
+    @Autowired
+    private UserAddressService userAddressService;
+
+    @Autowired
+    private RedisCache redisCache;
+
+    /**
+     * 登录接口
+     */
+    @PostMapping("/login")
+    public R<SmsResponseVo> sendSms(@RequestBody UserInfo param) {
+        if (StringUtils.isEmpty(param.getUserPhone()) || Pattern.matches("^1[3-9]\\d{9}$\n",param.getUserPhone())){
+            return R.fail("手机号格式不正确");
+        }
+        if (StringUtils.isEmpty(param.getCode())){
+            return R.fail("验证不能为空");
+        }
+        UserInfo userInfo = userInfoService.getOne(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserPhone,param.getUserPhone()),false);
+        if (userInfo == null){
+            param.setCreateTime(DateUtils.getNowDate());
+            userInfoService.save(param);
+        }
+        if (!redisCache.getCacheObject(param.getKeyCode()).equals(param.getCode())){
+            return R.fail("验证码错误");
+        }
+        return R.ok();
+    }
+
+    /**
+     * 上传用户地址
+     */
+    @PostMapping("/uploadAddress")
+    public R<SmsResponseVo> sendSms(@RequestBody UserAddress param) {
+        UserInfo one = userInfoService.getOne(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserPhone, param.getUserPhone()),false);
+        param.setUserId(one.getId());
+        param.setCreateTime(DateUtils.getNowDate());
+        userAddressService.save(param);
+        return R.ok();
+    }
+
+
+
+
+}

+ 12 - 0
rouyi-api/src/main/resources/application.yml

@@ -148,3 +148,15 @@ xss:
   excludes: /system/notice
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
+
+#自定义短信模板配置
+aliyun:
+  sms:
+    accessKeyId: LTAI4GEnYjNkDo3PiCLwmcsS
+    accessKeySecret: PVJvmoubjj3BTRViAxPpcFZvEyAeOj
+    #短信签名
+    signName: 菊辉电子
+    #短信模板
+    templateCode: SMS_283430418
+
+

+ 25 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/AppConfigController.java

@@ -0,0 +1,25 @@
+package com.ruoyi.web.controller.platform;
+
+import com.ruoyi.system.service.AppConfigLibraryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author: LiMingMing
+ * @Date: 2023/7/19 14:27
+ * @Description: app版本更新 配置更新内容
+ **/
+@RestController
+@RequestMapping("/platform/v1/appConfig")
+public class AppConfigController {
+
+    @Autowired
+    private AppConfigLibraryService appConfigLibraryService;
+
+    //CRUD  四个接口
+
+
+
+
+}

+ 38 - 23
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/BasicLibraryController.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.PageInfo;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.DateUtils;
@@ -41,16 +40,11 @@ public class BasicLibraryController extends BaseController {
     @ApiOperation("查询基础库管理列表")
 //    @PreAuthorize("@ss.hasPermi('platform:base:list')")
     @PostMapping("/list")
-    public R<PageInfo<BasicLibrary>> list(@RequestBody BaseParam param) {
+    public R<IPage<BasicLibrary>> list(@RequestBody BaseParam param) {
         IPage<BasicLibrary> basicLibraryIPage = basicLibraryService.page(new Page<BasicLibrary>().setCurrent(param.getCurrent()).setSize(param.getSize()),
                 new LambdaQueryWrapper<BasicLibrary>().like(param.getName()!=null,BasicLibrary::getName,param.getName())
                         .eq(BasicLibrary::getDelFlag,0));
-        PageInfo<BasicLibrary> pageInfo = new PageInfo<>();
-        pageInfo.setRecords(basicLibraryIPage.getRecords());
-        pageInfo.setSize(basicLibraryIPage.getSize());
-        pageInfo.setCurrent(basicLibraryIPage.getCurrent());
-        pageInfo.setTotal(basicLibraryIPage.getTotal());
-        return R.ok(pageInfo);
+        return R.ok(basicLibraryIPage);
     }
 
 
@@ -85,21 +79,42 @@ public class BasicLibraryController extends BaseController {
     @PostMapping("addOrUpdate")
     public R<Boolean> add(@RequestBody BasicLibrary param) {
         //参数校验
-        String[] bootCode = param.getBootCode().split(",");
-        if (bootCode.length != 2){
-            return R.fail("引导码参数格式有误");
-        }
-        if (param.getBootCodeSend() < 0){
-            return R.fail("引导码发送次数参数有误");
-        }
-        String[] dateCode = param.getDateCode().split(",");
-        if (dateCode.length % 2 != 0){
-            return R.fail("数据码参数有误");
-        }
-        String[] overCode = param.getOverCode().split(",");
-        if (overCode.length != 2){
-            return R.fail("结束码参数有误");
-        }
+//        String[] bootCode = param.getBootCode().split(",");
+//        if (bootCode.length != 2){
+//            return R.fail("引导码参数格式有误");
+//        }
+//        if (param.getBootCodeSend() < 0){
+//            return R.fail("引导码发送次数参数有误");
+//        }
+//        String[] synchronizeCode = param.getSynchronizeCode().split(",");
+//        if (synchronizeCode.length != 2){
+//            return R.fail("同步码参数格式有误");
+//        }
+//        if (param.getSynchronizeCodeSend() < 0){
+//            return R.fail("同步码发送次数参数有误");
+//        }
+
+//        String[] dateCode = param.getDateCode().split(",");
+//        if (dateCode.length % 2 != 0){
+//            return R.fail("数据码参数有误");
+//        }
+//        if (StringUtils.isEmpty(param.getDateCode())){
+//            return R.fail("数据码参数不能为空");
+//        }
+//
+//        String[] dateBinary0 = param.getDateBinary0().split(",");
+//        if (dateBinary0.length != 2){
+//            return R.fail("数据码二进制0参数格式有误");
+//        }
+//        String[] dateBinary1 = param.getDateBinary1().split(",");
+//        if (dateBinary1.length != 2){
+//            return R.fail("数据码二进制1参数格式有误");
+//        }
+//
+//        String[] overCode = param.getOverCode().split(",");
+//        if (overCode.length != 2){
+//            return R.fail("结束码参数有误");
+//        }
         if (param.getId() != null) {
             param.setUpdateTime(DateUtils.getNowDate());
         }else {

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/ComponentsLibraryController.java

@@ -44,7 +44,7 @@ public class ComponentsLibraryController extends BaseController {
      */
 //    @PreAuthorize("@ss.hasPermi('platform:components:list')")
     @PostMapping("/list")
-    public R<PageInfo<ComponentsLibrary>> list(@RequestBody BaseParam param) {
+    public R<IPage<ComponentsLibrary>> list(@RequestBody BaseParam param) {
         IPage<ComponentsLibrary> basicLibraryIPage = componentsLibraryService.page(new Page<ComponentsLibrary>().setCurrent(param.getCurrent()).setSize(param.getSize()),
                 new LambdaQueryWrapper<ComponentsLibrary>().like(param.getName()!=null,ComponentsLibrary::getName,param.getName())
                         .eq(ComponentsLibrary::getDelFlag,"0"));
@@ -53,7 +53,7 @@ public class ComponentsLibraryController extends BaseController {
         pageInfo.setSize(param.getSize());
         pageInfo.setCurrent(basicLibraryIPage.getCurrent());
         pageInfo.setTotal(basicLibraryIPage.getTotal());
-        return R.ok(pageInfo);
+        return R.ok(basicLibraryIPage);
     }
 
 

+ 2 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/QrLibraryController.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.PageInfo;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.DateUtils;
@@ -36,16 +35,11 @@ public class QrLibraryController extends BaseController {
      */
 //    @PreAuthorize("@ss.hasPermi('platform:or:list')")
     @PostMapping("/list")
-    public R<PageInfo<QrLibrary>> list(@RequestBody BaseParam param){
+    public R<IPage<QrLibrary>> list(@RequestBody BaseParam param){
         IPage<QrLibrary> qrLibraryIPage = qrLibraryService.page(new Page<QrLibrary>().setCurrent(param.getCurrent()).setSize(param.getSize()),
                 new LambdaQueryWrapper<QrLibrary>().like(param.getName()!=null,QrLibrary::getName,param.getName())
                         .eq(QrLibrary::getDelFlag,0));
-        PageInfo<QrLibrary> pageInfo = new PageInfo<>();
-        pageInfo.setRecords(qrLibraryIPage.getRecords());
-        pageInfo.setTotal(qrLibraryIPage.getTotal());
-        pageInfo.setSize(qrLibraryIPage.getSize());
-        pageInfo.setCurrent(qrLibraryIPage.getCurrent());
-        return R.ok(pageInfo);
+        return R.ok(qrLibraryIPage);
     }
 
 

+ 4 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/TemplateLibraryController.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.PageInfo;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.DateUtils;
@@ -14,7 +13,10 @@ import com.ruoyi.system.domain.TemplateLibrary;
 import com.ruoyi.system.service.TemplateLibraryService;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 红外遥控模板库Controller
@@ -37,9 +39,6 @@ public class TemplateLibraryController extends BaseController {
         IPage<TemplateLibrary> templateIPage = templateLibraryService.page(new Page<TemplateLibrary>().setCurrent(param.getCurrent()).setSize(param.getSize()),
                 new LambdaQueryWrapper<TemplateLibrary>().like(param.getName()!=null,TemplateLibrary::getName,param.getName())
                         .eq(TemplateLibrary::getDelFlag,0));
-        PageInfo<TemplateLibrary> pageInfo = new PageInfo<>();
-        pageInfo.setRecords(templateIPage.getRecords());
-        pageInfo.setTotal(templateIPage.getTotal());
         return R.ok(templateIPage);
     }
 

+ 11 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/UploadController.java

@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.platform;
 
 import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.utils.ConstantUtil;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.system.domain.UploadInfo;
 import org.springframework.web.bind.annotation.*;
@@ -20,14 +21,21 @@ public class UploadController {
 
     @ResponseBody
     @PostMapping("/uploadImage")
-    public R<UploadInfo> addSave(@RequestParam("file") MultipartFile file, @RequestParam("fileName") String fileName) throws IOException {
+    public R<UploadInfo> addSave(@RequestParam("file") MultipartFile file) throws IOException {
+        String originalImgFilename = file.getOriginalFilename();
+        String imgSuffix = originalImgFilename.substring(file.getOriginalFilename().lastIndexOf("."));
+        if (!ConstantUtil.PICTURE.contains(imgSuffix)) {
+            return R.fail("图片类型格式不支持");
+        }
+        //不超过5M
+        if (file.getSize() / 1024  > 5120 ){
+            return R.fail("图片大小超过限制");
+        }
         // 上传文件路径
         String filePath = RuoYiConfig.getUploadPath();
         // 上传并返回新文件名称
         String fileNewName = FileUploadUtils.upload(filePath, file);
         UploadInfo uploadInfo = new UploadInfo();
-
-        uploadInfo.setFileName(fileName);
         uploadInfo.setUrl(fileNewName);
 
         //返回文件名 和存放路径

+ 54 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/UserInfoController.java

@@ -0,0 +1,54 @@
+package com.ruoyi.web.controller.platform;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.system.domain.BaseParam;
+import com.ruoyi.system.domain.UserAddress;
+import com.ruoyi.system.domain.UserInfo;
+import com.ruoyi.system.service.UserAddressService;
+import com.ruoyi.system.service.UserInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 用户信息Controller
+ * 
+ * @author liming
+ * @date 2023-08-01
+ */
+@RestController
+@RequestMapping("/platform/v1/userInfo")
+public class UserInfoController extends BaseController {
+    @Autowired
+    private UserInfoService userInfoService;
+
+    @Autowired
+    private UserAddressService userAddressService;
+
+    /**
+     * 查询用户信息列表
+     */
+//    @PreAuthorize("@ss.hasPermi('system:info:list')")
+    @PostMapping("/list")
+    public R<IPage<UserInfo>> list(@RequestBody  BaseParam param) {
+        IPage<UserInfo> userInfoIPage = userInfoService.page(new Page<UserInfo>().setCurrent(param.getCurrent()).setSize(param.getSize()),
+                new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getDelFlag,0));
+        return R.ok(userInfoIPage);
+    }
+
+
+    /**
+     * 获取用户地址详情信息
+     */
+//    @PreAuthorize("@ss.hasPermi('system:info:query')")
+    @PostMapping(value = "/userAddress")
+    public R<UserAddress> getInfo(@RequestBody BaseParam param) {
+        UserAddress userAddress = userAddressService.getAddress(param.getId());
+        return R.ok(userAddress);
+    }
+
+
+}

+ 3 - 2
ruoyi-admin/src/main/resources/application.yml

@@ -3,13 +3,14 @@ ruoyi:
   # 名称
   name: RuoYi
   # 版本
-  version: 3.8.6
+  version: 1.0.0
   # 版权年份
   copyrightYear: 2023
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-  profile: /home/ruoyi/uploadPath
+#  profile: /home/ruoyi/uploadPath
+  profile: C:/Users/L.M/Desktop/ruoyi/uploadPath
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数字计算 char 字符验证

+ 13 - 0
ruoyi-common/pom.xml

@@ -157,6 +157,19 @@
             </exclusions>
         </dependency>
 
+        <!--阿里云短信sdk-->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+            <version>4.4.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+            <version>1.1.0</version>
+        </dependency>
+
+
     </dependencies>
 
 </project>

+ 43 - 0
ruoyi-common/src/main/java/com/ruoyi/common/config/SMSProperties.java

@@ -0,0 +1,43 @@
+package com.ruoyi.common.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author liming
+ * @date 2023/08/02
+ */
+@Data
+@Configuration
+@ConfigurationProperties(prefix = "aliyun.sms")
+public class SMSProperties {
+
+    /**
+     * accessKeyId
+     */
+//    @Value("${aliyun.sms.accessKeyId}")
+    private String accessKeyId;
+
+
+    /**
+     * accessKeySecret
+     */
+//    @Value("${aliyun.sms.accessKeySecret}")
+    private String accessKeySecret;
+
+    /**
+     * 短信签名
+     */
+//    @Value("${aliyun.sms.signName}")
+    private String signName;
+
+    /**
+     * 短信模板
+     */
+//    @Value("${aliyun.sms.templateCode}")
+    private String templateCode;
+
+
+
+}

+ 0 - 24
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/CodeMsg.java

@@ -35,30 +35,6 @@ public enum CodeMsg implements ErrorEnum{
     CODE_MSG_202(202,"验证码错误"),
     CODE_MSG_221(221, "TOKEN已过期"),
 
-    //业务级别 3xx
-    CODE_MSG_301(301, "员工不存在"),
-    CODE_MSG_302(302, "您办理的号码不是黑龙江号码!"),
-    CODE_MSG_303(303, "您的号码与向您推荐业务的朋友非同一城市,办理失败。!"),
-    CODE_MSG_304(304, "没有找到对应的产品!"),
-
-    //业务级别 4xx
-    StatusMsg_403(403, "xxxx"),
-    StatusMsg_404(404, "数据不存在"),
-    StatusMsg_405(405, "服务器错误%s"),
-    StatusMsg_406(406, "%s 是非法的文件格式"),
-
-    //宽带业务BOSS异常
-    StatusMsg_KD_BOSS(501, "%s"),
-    StatusMsg_KD_502(502, "未获取到您的当前主资费"),
-    StatusMsg_KD_503(503, "您目前的手机账户余额为:%s元。您至少需交%s元话费方可参与本活动。"),
-    StatusMsg_KD_504(504, "您暂无可办理的家庭网组。"),
-    StatusMsg_KD_505(505, "未获取到您要添加的号码的详细信息!"),
-    StatusMsg_KD_506(506, "账户状态为:%s。无法添加"),
-    StatusMsg_KD_507(507, "家庭业务校验失败!"),
-    StatusMsg_KD_508(508, "营销案办理失败:%s"),
-    StatusMsg_KD_509(509, "选择要办理的业务错误,请刷新重试!"),
-
-
     ;
 
     private int code;

+ 0 - 8
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java

@@ -82,14 +82,6 @@ public class R<T> implements Serializable {
         return R.SUCCESS == ret.getCode();
     }
 
-    public boolean isOk() {
-        return this.getCode() == 200;
-    }
-
-    public boolean isNotOk() {
-        return this.getCode() != 200;
-    }
-
     public void setCodeMsg(CodeMsg codeMsg) {
         this.code = codeMsg.getCode();
         this.msg = codeMsg.getMsg();

+ 56 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/ip/IPUtils.java

@@ -0,0 +1,56 @@
+package com.ruoyi.common.core.ip;
+
+import com.ruoyi.common.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description IP地址
+ * @Author Liming
+ * @Time 2023/08/01
+ */
+public class IPUtils {
+	private static Logger logger = LoggerFactory.getLogger(IPUtils.class);
+
+	/**
+	 * 获取IP地址
+	 * 
+	 * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
+	 * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
+	 */
+	public static String getIpAddr(HttpServletRequest request) {
+    	String ip = null;
+        try {
+            ip = request.getHeader("x-forwarded-for");
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("Proxy-Client-IP");
+            }
+            if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("WL-Proxy-Client-IP");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_CLIENT_IP");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+            }
+        } catch (Exception e) {
+        	logger.error("IPUtils ERROR ", e);
+        }
+        
+//        //使用代理,则获取第一个IP地址
+//        if(StringUtils.isEmpty(ip) && ip.length() > 15) {
+//			if(ip.indexOf(",") > 0) {
+//				ip = ip.substring(0, ip.indexOf(","));
+//			}
+//		}
+        
+        return ip;
+    }
+	
+}

+ 4 - 6
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java

@@ -1,11 +1,5 @@
 package com.ruoyi.common.core.redis;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.BoundSetOperations;
 import org.springframework.data.redis.core.HashOperations;
@@ -13,6 +7,9 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.ValueOperations;
 import org.springframework.stereotype.Component;
 
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+
 /**
  * spring redis 工具类
  *
@@ -265,4 +262,5 @@ public class RedisCache
     {
         return redisTemplate.keys(pattern);
     }
+
 }

+ 61 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/sms/SendMessage.java

@@ -0,0 +1,61 @@
+package com.ruoyi.common.core.sms;
+
+import com.aliyuncs.DefaultAcsClient;
+import com.aliyuncs.IAcsClient;
+import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
+import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
+import com.aliyuncs.exceptions.ClientException;
+import com.aliyuncs.profile.DefaultProfile;
+import com.aliyuncs.profile.IClientProfile;
+import com.ruoyi.common.config.SMSProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created on 20/5/19.
+ * 短信API产品的DEMO程序,工程中包含了一个SmsDemo类,直接通过
+ * 执行main函数即可体验短信产品API功能(只需要将AK替换成开通了云通信-短信产品功能的AK即可)
+ * <p>
+ * 备注:Demo工程编码采用UTF-8
+ * 国际短信发送请勿参照此DEMO
+ */
+@Component
+public class SendMessage {
+
+    @Autowired
+    private  SMSProperties smsProperties;
+
+    public  SendSmsResponse sendSms(String phone, String code) throws ClientException {
+        //可自助调整超时时间
+        System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
+        System.setProperty("sun.net.client.defaultReadTimeout", "10000");
+
+        //初始化acsClient,暂不支持region化
+        IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", smsProperties.getAccessKeyId(), smsProperties.getAccessKeySecret());
+        DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
+        IAcsClient acsClient = new DefaultAcsClient(profile);
+
+        //组装请求对象-具体描述见控制台-文档部分内容
+        SendSmsRequest request = new SendSmsRequest();
+        //必填:待发送手机号
+        request.setPhoneNumbers(phone);
+        //必填:短信签名-可在短信控制台中找到
+        request.setSignName(smsProperties.getSignName());
+        //必填:短信模板-可在短信控制台中找到
+        request.setTemplateCode(smsProperties.getTemplateCode());
+        //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
+        request.setTemplateParam("{\"code\":\"" + code + "\"}");
+
+        //选填-上行短信扩展码(无特殊需求用户请忽略此字段)
+        //request.setSmsUpExtendCode("90997");
+
+        //可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者
+        request.setOutId("yourOutId");
+
+        //hint 此处可能会抛出异常,注意catch
+        SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
+
+        return sendSmsResponse;
+    }
+
+}

+ 15 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/ConstantUtil.java

@@ -0,0 +1,15 @@
+package com.ruoyi.common.utils;
+
+/**
+ * @Author CHAILEILEI
+ * @Time 2021/11/8 下午3:23
+ * @Version V1.0.0
+ */
+public class ConstantUtil {
+
+   public static final String PICTURE = ".png|.gif|.jpg|.jpeg";
+
+   public static final String APK = ".apk";
+
+   public static final String SDK = ".jar";
+}

+ 39 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisKeys.java

@@ -0,0 +1,39 @@
+package com.ruoyi.common.utils;
+
+/**
+ * Redis所有Keys
+ *
+ * @Author LIMING
+ * @Time 2023-08-03
+ */
+public class RedisKeys {
+    /**
+     * 短信验证码,图形验证码类
+     */
+    public static final String SMS_PHONE_CODE = "SMS_PHONE_CODE:";
+    public static final String SMS_PHONE_TIME = "SMS_PHONE_TIME:";
+    public static final String IMAGE_CODE_NUM = "IMAGE_CODE_NUM:";
+    public static final String INCR_PHONE = "INCR_PHONE:";
+    public static final String INCR_IP = "INCR_IP:";
+
+    /**
+     * 短信
+     * 暂时被锁的手机号和ip
+     */
+    public static final String LOCK_SMS_PHONE = "LOCK_SMS_PHONE:";
+    public static final String LOCK_SMS_IP = "LOCK_SMS_IP:";
+
+
+    /**
+     * 登录次数记录
+     */
+    public static final String INCR_LOGIN_USER = "INCR_LOGIN_USER:";
+    public static final String INCR_LOGIN_IP = "INCR_LOGIN_IP:";
+    /**
+     * 登录
+     * 暂时被锁的手机号和ip
+     */
+    public static final String LOCK_LOGIN_USER = "LOCK_LOGIN_USER:";
+    public static final String LOCK_LOGIN_IP = "LOCK_LOGIN_IP:";
+
+}

+ 42 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/BasicLibrary.java

@@ -40,6 +40,34 @@ public class BasicLibrary   implements Serializable {
     @Excel(name = "引导码发送次数 默认1  校验大于0")
     private Long bootCodeSend;
 
+    /** 引导码启用状态 0启用  1禁用 */
+    @Excel(name = "引导码启用状态  0启用  1禁用")
+    private String bootCodeStatus;
+
+    /** 同步码  500,100  校验size=2 */
+    @Excel(name = "引导码  500,100  校验size=2")
+    private String synchronizeCode;
+
+    /** 同步码发送次数 默认1  校验大于0 */
+    @Excel(name = "引导码发送次数 默认1  校验大于0")
+    private Long synchronizeCodeSend;
+
+    /** 同步码启用状态 0启用  1禁用 */
+    @Excel(name = "同步码启用状态 0启用  1禁用")
+    private String synchronizeCodeStatus;
+
+    /** 重复码 */
+    @Excel(name = "重复码")
+    private String repeatCode;
+
+    /** 地址码 */
+    @Excel(name = "地址码")
+    private String addressCode;
+
+    /** 地址码启用状态 0启用  1禁用 */
+    @Excel(name = "地址码启用状态 0启用  1禁用")
+    private String addressCodeStatus;
+
     /** 数据码 */
     @Excel(name = "数据码")
     private String dateCode;
@@ -48,6 +76,20 @@ public class BasicLibrary   implements Serializable {
     @Excel(name = "结束码")
     private String overCode;
 
+
+    /** 数据反码启用状态  0启用 1禁用 */
+    @Excel(name = "数据反码启用状态  0启用 1禁用")
+    private String dataInverseCodeStatus;
+
+    /** 二进制0   560,565  高电平低电平*/
+    @Excel(name = "二进制0")
+    private String dateBinary0;
+
+    /** 二进制1 */
+    @Excel(name = "二进制1")
+    private String dateBinary1;
+
+
     /** 状态(0使用中 1未使用) */
     @Excel(name = "状态", readConverterExp = "0=使用中,1=未使用")
     private String status;

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/TemplateLibrary.java

@@ -36,6 +36,14 @@ public class TemplateLibrary implements Serializable {
     @Excel(name = "关联组信息")
     private String components;
 
+    /** 图标地址url */
+    @Excel(name = "图标地址Url")
+    private String iconUrl;
+
+    /** 背景图片Url */
+    @Excel(name = "背景图片Url")
+    private String backgroundPictureUrl;
+
     /** 状态(0使用中 1未使用) */
     @Excel(name = "状态", readConverterExp = "0=使用中,1=未使用")
     private String status;

+ 55 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/UserAddress.java

@@ -0,0 +1,55 @@
+package com.ruoyi.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 用户地址信息对象 t_user_address
+ * 
+ * @author ruoyi
+ * @date 2023-08-01
+ */
+@Data
+@TableName("t_user_address")
+public class UserAddress implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 关联用户id */
+    @Excel(name = "关联用户id")
+    private Long userId;
+
+    /** 经度 */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /** 纬度 */
+    @Excel(name = "纬度")
+    private String latitude;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 创建时间 */
+    private Date createTime;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 更新时间 */
+    private Date updateTime;
+
+    /** 用户手机号 */
+    @TableField(exist = false)
+    private String userPhone;
+}

+ 57 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/UserInfo.java

@@ -0,0 +1,57 @@
+package com.ruoyi.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 用户信息对象 t_user_info
+ * 
+ * @author ruoyi
+ * @date 2023-08-01
+ */
+@Data
+@TableName("t_user_info")
+public class UserInfo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 用户手机号 */
+    @Excel(name = "用户手机号")
+    private String userPhone;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 创建时间 */
+    private Date createTime;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 更新时间 */
+    private Date updateTime;
+
+
+    /**
+     * 验证码的key
+     */
+    @TableField(exist = false)
+    private String keyCode;
+
+    /**
+     * 验证码的
+     */
+    @TableField(exist = false)
+    private String code;
+
+}

+ 29 - 16
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/ComponentsAndBasicVo.java

@@ -1,6 +1,5 @@
 package com.ruoyi.system.domain.vo;
 
-import com.ruoyi.common.annotation.Excel;
 import lombok.Data;
 
 /**
@@ -16,64 +15,78 @@ public class ComponentsAndBasicVo {
     private Long id;
 
     /** 组件名称 */
-    @Excel(name = "组件名称")
     private String name;
 
     /** 基础库id */
-    @Excel(name = "基础库id")
     private Long baseId;
 
     /** 组件样式 */
-    @Excel(name = "组件样式")
     private String bntStyle;
 
     /** 组件类型   1开关型  2加减形 */
-    @Excel(name = "组件类型   1开关型  2加减形")
     private String typeNum;
 
     /** 加减型  最大值 */
-    @Excel(name = "加减型  最大值")
     private Long addSubMax;
 
     /** 加减型  最小值 */
-    @Excel(name = "加减型  最小值")
     private Long addSubMin;
 
     /** 命令参数 */
-    @Excel(name = "命令参数")
     private String dictateParameter;
 
     /** 默认值 */
-    @Excel(name = "默认值")
     private String defValue;
 
     /** 重复码 */
-    @Excel(name = "重复码")
     private Long repeatCode;
 
     /** 基本库名 */
-    @Excel(name = "基本库名")
     private String baseName;
 
     /** 波段值  默认38000 */
-    @Excel(name = "波段值  默认38000")
     private Long bandValue;
 
     /** 引导码  500,100  校验size=2 */
-    @Excel(name = "引导码  500,100  校验size=2")
     private String bootCode;
 
     /** 引导码发送次数 默认1  校验大于0 */
-    @Excel(name = "引导码发送次数 默认1  校验大于0")
     private Long bootCodeSend;
 
+    /** 引导码启用状态 0启用  1禁用 */
+    private String bootCodeStatus;
+
+    /** 同步码  500,100  校验size=2 */
+    private String synchronizeCode;
+
+    /** 同步码发送次数 默认1  校验大于0 */
+    private Long synchronizeCodeSend;
+
+    /** 同步码启用状态 0启用  1禁用 */
+    private String synchronizeCodeStatus;
+
+    /** 重复码 */
+    private String baseRepeatCode;
+
+    /** 地址码 */
+    private String addressCode;
+
+    /** 地址码启用状态 0启用  1禁用 */
+    private String addressCodeStatus;
+
     /** 数据码 */
-    @Excel(name = "数据码")
     private String dateCode;
 
     /** 结束码 */
-    @Excel(name = "结束码")
     private String overCode;
 
+    /** 数据反码启用状态  0启用 1禁用 */
+    private String dataInverseCodeStatus;
+
+    /** 二进制0   560,565  高电平低电平*/
+    private String dateBinary0;
+
+    /** 二进制1 */
+    private String dateBinary1;
 
 }

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/GetDeviceInfoVo.java

@@ -28,4 +28,11 @@ public class GetDeviceInfoVo {
      */
     private String componentsString;
 
+    /**
+     * 背景图Url
+     */
+    private String backgroundPictureUrl;
+
+
+
 }

+ 19 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SmsResponseVo.java

@@ -0,0 +1,19 @@
+package com.ruoyi.system.domain.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author: LiMingMing
+ * @Date: 2023/8/1 14:54
+ * @Description: TODO
+ **/
+@Data
+public class SmsResponseVo implements Serializable {
+
+    private String code;
+    private String message;
+    private String keyCode;
+}
+

+ 16 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserAddressMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.system.domain.UserAddress;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 用户地址信息Mapper接口
+ * 
+ * @author liming
+ * @date 2023-08-01
+ */
+public interface UserAddressMapper extends BaseMapper<UserAddress> {
+
+    UserAddress getAddress(@Param("userId") Long userId);
+}

+ 14 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserInfoMapper.java

@@ -0,0 +1,14 @@
+package com.ruoyi.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.system.domain.UserInfo;
+
+/**
+ * 用户信息Mapper接口
+ * 
+ * @author liming
+ * @date 2023-08-01
+ */
+public interface UserInfoMapper extends BaseMapper<UserInfo> {
+
+}

+ 19 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/UserAddressService.java

@@ -0,0 +1,19 @@
+package com.ruoyi.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.system.domain.UserAddress;
+
+/**
+ * 用户地址信息Service接口
+ * 
+ * @author liming
+ * @date 2023-08-01
+ */
+public interface UserAddressService extends IService<UserAddress> {
+    /**
+     * 根据用户id查询最新一条用户的地址信息
+     * @param id
+     * @return
+     */
+    UserAddress getAddress(Long userId);
+}

+ 14 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/UserInfoService.java

@@ -0,0 +1,14 @@
+package com.ruoyi.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.system.domain.UserInfo;
+
+/**
+ * 用户信息Service接口
+ * 
+ * @author liming
+ * @date 2023-08-01
+ */
+public interface UserInfoService  extends IService<UserInfo> {
+
+}

+ 10 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ComponentsLibraryServiceImpl.java

@@ -8,7 +8,6 @@ import com.ruoyi.system.domain.vo.ComponentsAndBasicVo;
 import com.ruoyi.system.mapper.ComponentsLibraryMapper;
 import com.ruoyi.system.service.BasicLibraryService;
 import com.ruoyi.system.service.ComponentsLibraryService;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -43,14 +42,23 @@ public class ComponentsLibraryServiceImpl extends ServiceImpl<ComponentsLibraryM
             componentsAndBasicVo.setDictateParameter(componentsLibrary.getDictateParameter());
             componentsAndBasicVo.setDefValue(componentsLibrary.getDefValue());
             componentsAndBasicVo.setRepeatCode(componentsLibrary.getRepeatCode());
-            BeanUtils.copyProperties(basicLibraryList,componentsAndBasicVo);
             BasicLibrary one = basicLibraryService.getOne(new LambdaQueryWrapper<BasicLibrary>().eq(BasicLibrary::getId, componentsLibrary.getBaseId()), false);
             componentsAndBasicVo.setBaseName(one.getName());
             componentsAndBasicVo.setBandValue(one.getBandValue());
             componentsAndBasicVo.setBootCode(one.getBootCode());
             componentsAndBasicVo.setBootCodeSend(one.getBootCodeSend());
+            componentsAndBasicVo.setBootCodeStatus(one.getBootCodeStatus());
+            componentsAndBasicVo.setSynchronizeCode(one.getSynchronizeCode());
+            componentsAndBasicVo.setSynchronizeCodeSend(one.getSynchronizeCodeSend());
+            componentsAndBasicVo.setSynchronizeCodeStatus(one.getAddressCodeStatus());
+            componentsAndBasicVo.setBaseRepeatCode(one.getRepeatCode());
+            componentsAndBasicVo.setAddressCode(one.getAddressCode());
+            componentsAndBasicVo.setAddressCodeStatus(one.getAddressCodeStatus());
             componentsAndBasicVo.setDateCode(one.getDateCode());
             componentsAndBasicVo.setOverCode(one.getOverCode());
+            componentsAndBasicVo.setDataInverseCodeStatus(one.getDataInverseCodeStatus());
+            componentsAndBasicVo.setDateBinary0(one.getDateBinary0());
+            componentsAndBasicVo.setDateBinary1(one.getDateBinary1());
             voList.add(componentsAndBasicVo);
         }
         return voList;

+ 25 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserAddressServiceImpl.java

@@ -0,0 +1,25 @@
+package com.ruoyi.system.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.system.domain.UserAddress;
+import com.ruoyi.system.mapper.UserAddressMapper;
+import com.ruoyi.system.service.UserAddressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 用户地址信息Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-08-01
+ */
+@Service
+public class UserAddressServiceImpl  extends ServiceImpl<UserAddressMapper, UserAddress> implements UserAddressService {
+    @Autowired
+    private UserAddressMapper userAddressMapper;
+
+    @Override
+    public UserAddress getAddress(Long userId) {
+        return userAddressMapper.getAddress(userId);
+    }
+}

+ 18 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserInfoServiceImpl.java

@@ -0,0 +1,18 @@
+package com.ruoyi.system.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.system.domain.UserInfo;
+import com.ruoyi.system.mapper.UserInfoMapper;
+import com.ruoyi.system.service.UserInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 用户信息Service业务层处理
+ * 
+ * @author liming
+ * @date 2023-08-01
+ */
+@Service
+public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService {
+
+}

+ 33 - 0
ruoyi-system/src/main/resources/mapper/system/platform/UserAddressMapper.xml

@@ -0,0 +1,33 @@
+<?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.system.mapper.UserAddressMapper">
+    
+    <resultMap type="UserAddress" id="UserAddressResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="longitude"    column="longitude"    />
+        <result property="latitude"    column="latitude"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTUserAddressVo">
+        select id, user_id, longitude,latitude, del_flag, create_by, create_time, update_by, update_time from t_user_address
+    </sql>
+
+    <select id="getAddress" resultType="com.ruoyi.system.domain.UserAddress">
+        SELECT user_id,longitude,latitude,create_time
+        FROM t_user_address
+        WHERE
+            del_flag = 0 AND user_id = #{userId}
+        ORDER BY create_time DESC
+            LIMIT 1
+    </select>
+
+
+</mapper>

+ 22 - 0
ruoyi-system/src/main/resources/mapper/system/platform/UserInfoMapper.xml

@@ -0,0 +1,22 @@
+<?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.system.mapper.UserInfoMapper">
+    
+    <resultMap type="UserInfo" id="UserInfoResult">
+        <result property="id"    column="id"    />
+        <result property="userPhone"    column="user_phone"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTUserInfoVo">
+        select id, user_phone, del_flag, create_by, create_time, update_by, update_time from t_user_info
+    </sql>
+
+
+</mapper>