admin
2023-11-01 50fe2303fef148de18d39f90a8653feda1b21c05
注册接口更新20231101FX
1个文件已删除
13个文件已修改
95 ■■■■■ 已修改文件
wumei-smart-master/111.rar 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-admin/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-common/src/main/java/com/ruoyi/common/core/domain/model/BindRegisterBody.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/JointOperatorController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IJointOperatorService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/JointOperatorServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-system/src/main/resources/mapper/system/SysUserMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/111.rar
Binary files differ
wumei-smart-master/springboot/wumei-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
@@ -113,7 +113,7 @@
        // 用ApiInfoBuilder进行定制
        return new ApiInfoBuilder()
                // 设置标题
                .title("标题:wumei-smart接口文档")
                .title("标题:普悦物联接口文档")
                // 描述
                .description("描述:开源生活物联网平台")
                // 作者信息
@@ -122,4 +122,5 @@
                .version("版本号:" + ruoyiConfig.getVersion())
                .build();
    }
}
wumei-smart-master/springboot/wumei-admin/src/main/resources/application.yml
@@ -124,7 +124,7 @@
  # 是否开启swagger
  enabled: true
  # 请求前缀
  pathMapping: /dev-api
  pathMapping: /prod-api
# 防止XSS攻击
xss:
wumei-smart-master/springboot/wumei-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
@@ -135,6 +135,11 @@
    private String company;
    /**
     * 推荐码
     */
    private String advisecode;
    /**
     * 部门对象
     */
    @Excels({
@@ -388,6 +393,14 @@
        this.superiorName = superiorName;
    }
    public String getAdvisecode() {
        return advisecode;
    }
    public void setAdvisecode(String advisecode) {
        this.advisecode = advisecode;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@@ -417,6 +430,7 @@
                .append("superiorName", getSuperiorName())
                .append("level", getLevel())
                .append("company", getCompany())
                .append("advisecode", getAdvisecode())
                .toString();
    }
}
wumei-smart-master/springboot/wumei-common/src/main/java/com/ruoyi/common/core/domain/model/BindRegisterBody.java
@@ -18,4 +18,5 @@
    public void setBindId(String bindId) {
        this.bindId = bindId;
    }
}
wumei-smart-master/springboot/wumei-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java
@@ -32,6 +32,8 @@
        return username;
    }
    private String address;
    public void setUsername(String username)
    {
        this.username = username;
@@ -66,4 +68,12 @@
    {
        this.uuid = uuid;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
}
wumei-smart-master/springboot/wumei-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java
@@ -8,4 +8,13 @@
public class RegisterBody extends LoginBody
{
    public String advisecode;
    public String getAdvisecode() {
        return advisecode;
    }
    public void setAdvisecode(String advisecode) {
        this.advisecode = advisecode;
    }
}
wumei-smart-master/springboot/wumei-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
@@ -39,7 +39,7 @@
     */
    public String register(RegisterBody registerBody)
    {
        String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
        String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword(),address=registerBody.getAddress(), advisecode=registerBody.getAdvisecode();
        boolean captchaOnOff = configService.selectCaptchaOnOff();
        // 验证码开关
@@ -76,6 +76,8 @@
            sysUser.setUserName(username);
            sysUser.setNickName(username);
            sysUser.setPassword(SecurityUtils.encryptPassword(registerBody.getPassword()));
            sysUser.setAddress(address);
            sysUser.setAdvisecode(advisecode);
            boolean regFlag = userService.registerUser(sysUser);
            if (!regFlag)
            {
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/JointOperatorController.java
@@ -121,4 +121,16 @@
        return toAjax(jointOperatorService.updateDeviceBySN(lines, tenantId));
    }
    @ApiOperation(value = "绑定设备SN为终端用户")
    @PreAuthorize("@ss.hasPermi('*:*:*')")
    @Log(title = "终端用户", businessType = BusinessType.UPDATE)
    @PostMapping("/device/bindUser")
    public AjaxResult bindUser(@RequestParam("serialNumber") String serialNumber,
                                @RequestParam("userId") Long userId) throws Exception {
        List<String> lines = new ArrayList<>();
        lines.add(serialNumber);
        return toAjax(jointOperatorService.updateDeviceUserBySN(lines, userId));
    }
}
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceService.java
@@ -190,6 +190,15 @@
     */
    public int resetDeviceStatus(String deviceNum);
    /**
     * 重置设备状态-出厂分派设备
     * @return 结果
     */
    public int updateDeviceBySN(List<String> snList,Long tenantId);
    int updateDeviceBySN(List<String> snList,Long tenantId);
    /**
     * 重置设备状态-用户绑定设备
     * @return 结果
     */
    public int updateDeviceUserBySN(List<String> snList,Long userId);
}
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IJointOperatorService.java
@@ -53,6 +53,8 @@
     */
    public int updateDeviceBySN(List<String> content, Long tenantId);
    int updateDeviceUserBySN(List<String> snList, Long userId);
    /**
     * 批量删除联营商
     *
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java
@@ -977,6 +977,23 @@
        return i;
    }
    @Override
    public int updateDeviceUserBySN(List<String> snList, Long userId) {
        List<Device> deviceList = snList.stream().map(s -> {
            Device device = new Device();
            device.setUserId(userId);
            device.setSerialNumber(s.trim());
            device.setAssignTime(DateUtils.getNowDate());
            return device;
        }).collect(Collectors.toList());
        int i = 0;
        for (Device device : deviceList) {
            deviceMapper.updateDeviceBySerialNumber(device);
            i++;
        }
        return i;
    }
    /**
     * 删除设备
     *
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/JointOperatorServiceImpl.java
@@ -1,6 +1,5 @@
package com.ruoyi.iot.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -9,7 +8,6 @@
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.iot.mapper.JointOperatorMapper;
@@ -108,6 +106,11 @@
        return deviceService.updateDeviceBySN(snList, tenantId);
    }
    @Override
    public int updateDeviceUserBySN(List<String> snList, Long userId) {
        return deviceService.updateDeviceUserBySN(snList, userId);
    }
    /**
     * 批量删除联营商
     *
wumei-smart-master/springboot/wumei-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -29,6 +29,7 @@
        <result property="superiorId"   column="superior_id"  />
        <result property="superiorName" column="superior_name"  />
        <result property="company"       column="company"      />
        <result property="advisecode"       column="advisecode"      />
        <association property="dept"    column="dept_id" javaType="SysDept" resultMap="deptResult" />
        <collection  property="roles"   javaType="java.util.List"        resultMap="RoleResult" />
    </resultMap>
@@ -172,6 +173,7 @@
            <if test="address != null">address,</if>
            <if test="superiorId != null">superior_id,</if>
            <if test="company != null">company,</if>
            <if test="advisecode != null">advisecode,</if>
             create_time
         )values(
             <if test="userId != null and userId != ''">#{userId},</if>
@@ -191,6 +193,7 @@
            <if test="address != null">address = #{address},</if>
            <if test="superiorId != null">superior_id = #{superiorId},</if>
            <if test="company != null">company = #{company},</if>
            <if test="advisecode != null">advisecode = #{advisecode},</if>
             sysdate()
         )
    </insert>