Browse Source

修改设备(防止重复问题)

Simon 1 year ago
parent
commit
c9056a51da

+ 327 - 283
ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserProfile.java

@@ -1,6 +1,7 @@
 package com.ruoyi.system.domain;
 
 import java.util.List;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -8,662 +9,705 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 用户档案对象 t_user_profile
- * 
+ *
  * @author zhengjie
  * @date 2023-08-25
  */
-public class TUserProfile extends BaseEntity
-{
+public class TUserProfile extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** id */
+    /**
+     * id
+     */
     private Integer id;
 
-    /** 姓名 */
+    /**
+     * 姓名
+     */
     @Excel(name = "姓名")
     private String name;
 
-    /** 性别 */
+    /**
+     * 性别
+     */
     @Excel(name = "性别")
     private Integer gender;
 
-    /** 身份证号 */
+    /**
+     * 身份证号
+     */
     @Excel(name = "身份证号")
     private String sfzid;
 
-    /** 电话1 */
+    /**
+     * 电话1
+     */
     @Excel(name = "电话1")
     private String telOne;
 
-    /** 电话2 */
+    /**
+     * 电话2
+     */
     @Excel(name = "电话2")
     private String telTwo;
 
-    /** 电话3 */
+    /**
+     * 电话3
+     */
     @Excel(name = "电话3")
     private String telThree;
 
-    /** 出生年月 */
+    /**
+     * 出生年月
+     */
     @Excel(name = "出生年月")
     private String birthday;
 
-    /** 年龄 */
+    /**
+     * 年龄
+     */
     @Excel(name = "年龄")
     private Integer age;
 
-    /** 结婚状态 */
+    /**
+     * 结婚状态
+     */
     @Excel(name = "结婚状态")
     private Integer marrStatus;
 
-    /** 民族 */
-    @Excel(name = "民族",comboDictType = "sys_national")
+    /**
+     * 民族
+     */
+    @Excel(name = "民族", comboDictType = "sys_national")
     private Integer national;
 
-    /** 当地户口 */
+    /**
+     * 当地户口
+     */
     @Excel(name = "当地户口")
     private Integer local;
 
-    /** 客户类别 */
+    /**
+     * 客户类别
+     */
     @Excel(name = "客户类别")
     private Integer clientType;
 
-    /** 居住情况 */
+    /**
+     * 居住情况
+     */
     @Excel(name = "居住情况")
     private Integer liveStatus;
 
-    /** 家庭地址 */
+    /**
+     * 家庭地址
+     */
     @Excel(name = "家庭地址")
     private String familyAddress;
 
-    /** 详细地址 */
+    /**
+     * 详细地址
+     */
     @Excel(name = "详细地址")
     private String detailAddress;
 
-    /** 户籍地址 */
+    /**
+     * 户籍地址
+     */
     @Excel(name = "户籍地址")
     private String houseAddress;
 
-    /** 户籍详细地址 */
+    /**
+     * 户籍详细地址
+     */
     @Excel(name = "户籍详细地址")
     private String houseDetailAddress;
 
-    /** 所属服务机构 */
+    /**
+     * 所属服务机构
+     */
     @Excel(name = "所属服务机构")
     private Integer serviceid;
 
-    /** 老人身体特征和状态 */
+    /**
+     * 老人身体特征和状态
+     */
     @Excel(name = "老人身体特征和状态")
     private String oldmenStatus;
 
-    /** 主要改造内容字段 */
+    /**
+     * 主要改造内容字段
+     */
     @Excel(name = "主要改造内容字段")
     private String changeContent;
 
-    /** 失能月数 */
+    /**
+     * 失能月数
+     */
     @Excel(name = "失能月数")
     private String loseMonth;
 
-    /** 治疗月数 */
+    /**
+     * 治疗月数
+     */
     @Excel(name = "治疗月数")
     private String treatMonth;
 
-    /** 是否通过康复治疗 */
+    /**
+     * 是否通过康复治疗
+     */
     @Excel(name = "是否通过康复治疗")
     private Integer isTreat;
 
-    /** 服务状态 */
+    /**
+     * 服务状态
+     */
     @Excel(name = "服务状态")
     private Integer serviceType;
 
-    /** 医疗保障 */
+    /**
+     * 医疗保障
+     */
     @Excel(name = "医疗保障")
     private Integer treateSure;
 
-    /** 经济来源 */
+    /**
+     * 经济来源
+     */
     @Excel(name = "经济来源")
     private Integer moneyCome;
 
-    /** 月收入 */
+    /**
+     * 月收入
+     */
     @Excel(name = "月收入")
     private String moneyMonth;
 
-    /** 社保卡号 */
+    /**
+     * 社保卡号
+     */
     @Excel(name = "社保卡号")
     private String cardCode;
 
-    /** 慢性疾病 */
+    /**
+     * 慢性疾病
+     */
     @Excel(name = "慢性疾病")
     private String slowIllness;
 
-    /** 血型 */
+    /**
+     * 血型
+     */
     @Excel(name = "血型")
     private Integer bloodType;
 
-    /** 失能状态 */
+    /**
+     * 失能状态
+     */
     @Excel(name = "失能状态")
     private Integer shiStatus;
 
-    /** 残疾情况 */
+    /**
+     * 残疾情况
+     */
     @Excel(name = "残疾情况")
     private Integer disablityStatus;
 
-    /** 残疾登记 */
+    /**
+     * 残疾登记
+     */
     @Excel(name = "残疾登记")
     private Integer disablityEntry;
 
-    /** 文化程度 */
+    /**
+     * 文化程度
+     */
     @Excel(name = "文化程度")
     private Integer educaLevel;
 
-    /** 专业 */
+    /**
+     * 专业
+     */
     @Excel(name = "专业")
     private String special;
 
-    /** 职称 */
+    /**
+     * 职称
+     */
     @Excel(name = "职称")
     private String title;
 
-    /** 原单位 */
+    /**
+     * 原单位
+     */
     @Excel(name = "原单位")
     private String unity;
 
-    /** 性格心理 */
+    /**
+     * 性格心理
+     */
     @Excel(name = "性格心理")
     private String natureHeart;
 
-    /** 饮食特点 */
+    /**
+     * 饮食特点
+     */
     @Excel(name = "饮食特点")
     private String eatPoint;
 
-    /** 特长 */
+    /**
+     * 特长
+     */
     @Excel(name = "特长")
     private String speciality;
 
-    /** 爱好 */
+    /**
+     * 爱好
+     */
     @Excel(name = "爱好")
     private String hobby;
 
-    /** 照片 */
+    /**
+     * 照片
+     */
     @Excel(name = "照片")
     private String photo;
 
-    /** 其他照片 */
+    /**
+     * 其他照片
+     */
     @Excel(name = "其他照片")
     private String otherPhoto;
 
-    /** 备注 */
+    /**
+     * 备注
+     */
     @Excel(name = "备注")
     private String remarks;
 
-    /** 紧急联系人信息 */
+    /**
+     * 紧急联系人信息
+     */
     private List<TEmergentPeople> tEmergentPeopleList;
 
-    public void setId(Integer id) 
-    {
+    public void setId(Integer id) {
         this.id = id;
     }
 
-    public Integer getId() 
-    {
+    public Integer getId() {
         return id;
     }
-    public void setName(String name) 
-    {
+
+    public void setName(String name) {
         this.name = name;
     }
 
-    public String getName() 
-    {
+    public String getName() {
         return name;
     }
-    public void setGender(Integer gender) 
-    {
+
+    public void setGender(Integer gender) {
         this.gender = gender;
     }
 
-    public Integer getGender() 
-    {
+    public Integer getGender() {
         return gender;
     }
-    public void setSfzid(String sfzid) 
-    {
+
+    public void setSfzid(String sfzid) {
         this.sfzid = sfzid;
     }
 
-    public String getSfzid() 
-    {
+    public String getSfzid() {
         return sfzid;
     }
-    public void setTelOne(String telOne) 
-    {
+
+    public void setTelOne(String telOne) {
         this.telOne = telOne;
     }
 
-    public String getTelOne() 
-    {
+    public String getTelOne() {
         return telOne;
     }
-    public void setTelTwo(String telTwo) 
-    {
+
+    public void setTelTwo(String telTwo) {
         this.telTwo = telTwo;
     }
 
-    public String getTelTwo() 
-    {
+    public String getTelTwo() {
         return telTwo;
     }
-    public void setTelThree(String telThree) 
-    {
+
+    public void setTelThree(String telThree) {
         this.telThree = telThree;
     }
 
-    public String getTelThree() 
-    {
+    public String getTelThree() {
         return telThree;
     }
-    public void setBirthday(String birthday) 
-    {
+
+    public void setBirthday(String birthday) {
         this.birthday = birthday;
     }
 
-    public String getBirthday() 
-    {
+    public String getBirthday() {
         return birthday;
     }
-    public void setAge(Integer age) 
-    {
+
+    public void setAge(Integer age) {
         this.age = age;
     }
 
-    public Integer getAge() 
-    {
+    public Integer getAge() {
         return age;
     }
-    public void setMarrStatus(Integer marrStatus) 
-    {
+
+    public void setMarrStatus(Integer marrStatus) {
         this.marrStatus = marrStatus;
     }
 
-    public Integer getMarrStatus() 
-    {
+    public Integer getMarrStatus() {
         return marrStatus;
     }
-    public void setNational(Integer national) 
-    {
+
+    public void setNational(Integer national) {
         this.national = national;
     }
 
-    public Integer getNational() 
-    {
+    public Integer getNational() {
         return national;
     }
-    public void setLocal(Integer local) 
-    {
+
+    public void setLocal(Integer local) {
         this.local = local;
     }
 
-    public Integer getLocal() 
-    {
+    public Integer getLocal() {
         return local;
     }
-    public void setClientType(Integer clientType) 
-    {
+
+    public void setClientType(Integer clientType) {
         this.clientType = clientType;
     }
 
-    public Integer getClientType() 
-    {
+    public Integer getClientType() {
         return clientType;
     }
-    public void setLiveStatus(Integer liveStatus) 
-    {
+
+    public void setLiveStatus(Integer liveStatus) {
         this.liveStatus = liveStatus;
     }
 
-    public Integer getLiveStatus() 
-    {
+    public Integer getLiveStatus() {
         return liveStatus;
     }
-    public void setFamilyAddress(String familyAddress) 
-    {
+
+    public void setFamilyAddress(String familyAddress) {
         this.familyAddress = familyAddress;
     }
 
-    public String getFamilyAddress() 
-    {
+    public String getFamilyAddress() {
         return familyAddress;
     }
-    public void setDetailAddress(String detailAddress) 
-    {
+
+    public void setDetailAddress(String detailAddress) {
         this.detailAddress = detailAddress;
     }
 
-    public String getDetailAddress() 
-    {
+    public String getDetailAddress() {
         return detailAddress;
     }
-    public void setHouseAddress(String houseAddress) 
-    {
+
+    public void setHouseAddress(String houseAddress) {
         this.houseAddress = houseAddress;
     }
 
-    public String getHouseAddress() 
-    {
+    public String getHouseAddress() {
         return houseAddress;
     }
-    public void setHouseDetailAddress(String houseDetailAddress) 
-    {
+
+    public void setHouseDetailAddress(String houseDetailAddress) {
         this.houseDetailAddress = houseDetailAddress;
     }
 
-    public String getHouseDetailAddress() 
-    {
+    public String getHouseDetailAddress() {
         return houseDetailAddress;
     }
-    public void setServiceid(Integer serviceid) 
-    {
+
+    public void setServiceid(Integer serviceid) {
         this.serviceid = serviceid;
     }
 
-    public Integer getServiceid() 
-    {
+    public Integer getServiceid() {
         return serviceid;
     }
-    public void setOldmenStatus(String oldmenStatus) 
-    {
+
+    public void setOldmenStatus(String oldmenStatus) {
         this.oldmenStatus = oldmenStatus;
     }
 
-    public String getOldmenStatus() 
-    {
+    public String getOldmenStatus() {
         return oldmenStatus;
     }
-    public void setChangeContent(String changeContent) 
-    {
+
+    public void setChangeContent(String changeContent) {
         this.changeContent = changeContent;
     }
 
-    public String getChangeContent() 
-    {
+    public String getChangeContent() {
         return changeContent;
     }
-    public void setLoseMonth(String loseMonth) 
-    {
+
+    public void setLoseMonth(String loseMonth) {
         this.loseMonth = loseMonth;
     }
 
-    public String getLoseMonth() 
-    {
+    public String getLoseMonth() {
         return loseMonth;
     }
-    public void setTreatMonth(String treatMonth) 
-    {
+
+    public void setTreatMonth(String treatMonth) {
         this.treatMonth = treatMonth;
     }
 
-    public String getTreatMonth() 
-    {
+    public String getTreatMonth() {
         return treatMonth;
     }
-    public void setIsTreat(Integer isTreat) 
-    {
+
+    public void setIsTreat(Integer isTreat) {
         this.isTreat = isTreat;
     }
 
-    public Integer getIsTreat() 
-    {
+    public Integer getIsTreat() {
         return isTreat;
     }
-    public void setServiceType(Integer serviceType) 
-    {
+
+    public void setServiceType(Integer serviceType) {
         this.serviceType = serviceType;
     }
 
-    public Integer getServiceType() 
-    {
+    public Integer getServiceType() {
         return serviceType;
     }
-    public void setTreateSure(Integer treateSure) 
-    {
+
+    public void setTreateSure(Integer treateSure) {
         this.treateSure = treateSure;
     }
 
-    public Integer getTreateSure() 
-    {
+    public Integer getTreateSure() {
         return treateSure;
     }
-    public void setMoneyCome(Integer moneyCome) 
-    {
+
+    public void setMoneyCome(Integer moneyCome) {
         this.moneyCome = moneyCome;
     }
 
-    public Integer getMoneyCome() 
-    {
+    public Integer getMoneyCome() {
         return moneyCome;
     }
-    public void setMoneyMonth(String moneyMonth) 
-    {
+
+    public void setMoneyMonth(String moneyMonth) {
         this.moneyMonth = moneyMonth;
     }
 
-    public String getMoneyMonth() 
-    {
+    public String getMoneyMonth() {
         return moneyMonth;
     }
-    public void setCardCode(String cardCode) 
-    {
+
+    public void setCardCode(String cardCode) {
         this.cardCode = cardCode;
     }
 
-    public String getCardCode() 
-    {
+    public String getCardCode() {
         return cardCode;
     }
-    public void setSlowIllness(String slowIllness) 
-    {
+
+    public void setSlowIllness(String slowIllness) {
         this.slowIllness = slowIllness;
     }
 
-    public String getSlowIllness() 
-    {
+    public String getSlowIllness() {
         return slowIllness;
     }
-    public void setBloodType(Integer bloodType) 
-    {
+
+    public void setBloodType(Integer bloodType) {
         this.bloodType = bloodType;
     }
 
-    public Integer getBloodType() 
-    {
+    public Integer getBloodType() {
         return bloodType;
     }
-    public void setShiStatus(Integer shiStatus) 
-    {
+
+    public void setShiStatus(Integer shiStatus) {
         this.shiStatus = shiStatus;
     }
 
-    public Integer getShiStatus() 
-    {
+    public Integer getShiStatus() {
         return shiStatus;
     }
-    public void setDisablityStatus(Integer disablityStatus) 
-    {
+
+    public void setDisablityStatus(Integer disablityStatus) {
         this.disablityStatus = disablityStatus;
     }
 
-    public Integer getDisablityStatus() 
-    {
+    public Integer getDisablityStatus() {
         return disablityStatus;
     }
-    public void setDisablityEntry(Integer disablityEntry) 
-    {
+
+    public void setDisablityEntry(Integer disablityEntry) {
         this.disablityEntry = disablityEntry;
     }
 
-    public Integer getDisablityEntry() 
-    {
+    public Integer getDisablityEntry() {
         return disablityEntry;
     }
-    public void setEducaLevel(Integer educaLevel) 
-    {
+
+    public void setEducaLevel(Integer educaLevel) {
         this.educaLevel = educaLevel;
     }
 
-    public Integer getEducaLevel() 
-    {
+    public Integer getEducaLevel() {
         return educaLevel;
     }
-    public void setSpecial(String special) 
-    {
+
+    public void setSpecial(String special) {
         this.special = special;
     }
 
-    public String getSpecial() 
-    {
+    public String getSpecial() {
         return special;
     }
-    public void setTitle(String title) 
-    {
+
+    public void setTitle(String title) {
         this.title = title;
     }
 
-    public String getTitle() 
-    {
+    public String getTitle() {
         return title;
     }
-    public void setUnity(String unity) 
-    {
+
+    public void setUnity(String unity) {
         this.unity = unity;
     }
 
-    public String getUnity() 
-    {
+    public String getUnity() {
         return unity;
     }
-    public void setNatureHeart(String natureHeart) 
-    {
+
+    public void setNatureHeart(String natureHeart) {
         this.natureHeart = natureHeart;
     }
 
-    public String getNatureHeart() 
-    {
+    public String getNatureHeart() {
         return natureHeart;
     }
-    public void setEatPoint(String eatPoint) 
-    {
+
+    public void setEatPoint(String eatPoint) {
         this.eatPoint = eatPoint;
     }
 
-    public String getEatPoint() 
-    {
+    public String getEatPoint() {
         return eatPoint;
     }
-    public void setSpeciality(String speciality) 
-    {
+
+    public void setSpeciality(String speciality) {
         this.speciality = speciality;
     }
 
-    public String getSpeciality() 
-    {
+    public String getSpeciality() {
         return speciality;
     }
-    public void setHobby(String hobby) 
-    {
+
+    public void setHobby(String hobby) {
         this.hobby = hobby;
     }
 
-    public String getHobby() 
-    {
+    public String getHobby() {
         return hobby;
     }
-    public void setPhoto(String photo) 
-    {
+
+    public void setPhoto(String photo) {
         this.photo = photo;
     }
 
-    public String getPhoto() 
-    {
+    public String getPhoto() {
         return photo;
     }
-    public void setOtherPhoto(String otherPhoto) 
-    {
+
+    public void setOtherPhoto(String otherPhoto) {
         this.otherPhoto = otherPhoto;
     }
 
-    public String getOtherPhoto() 
-    {
+    public String getOtherPhoto() {
         return otherPhoto;
     }
-    public void setRemarks(String remarks) 
-    {
+
+    public void setRemarks(String remarks) {
         this.remarks = remarks;
     }
 
-    public String getRemarks() 
-    {
+    public String getRemarks() {
         return remarks;
     }
 
-    public List<TEmergentPeople> getTEmergentPeopleList()
-    {
+    public List<TEmergentPeople> getTEmergentPeopleList() {
         return tEmergentPeopleList;
     }
 
-    public void setTEmergentPeopleList(List<TEmergentPeople> tEmergentPeopleList)
-    {
+    public void setTEmergentPeopleList(List<TEmergentPeople> tEmergentPeopleList) {
         this.tEmergentPeopleList = tEmergentPeopleList;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("name", getName())
-            .append("gender", getGender())
-            .append("sfzid", getSfzid())
-            .append("telOne", getTelOne())
-            .append("telTwo", getTelTwo())
-            .append("telThree", getTelThree())
-            .append("birthday", getBirthday())
-            .append("age", getAge())
-            .append("marrStatus", getMarrStatus())
-            .append("national", getNational())
-            .append("local", getLocal())
-            .append("clientType", getClientType())
-            .append("liveStatus", getLiveStatus())
-            .append("familyAddress", getFamilyAddress())
-            .append("detailAddress", getDetailAddress())
-            .append("houseAddress", getHouseAddress())
-            .append("houseDetailAddress", getHouseDetailAddress())
-            .append("serviceid", getServiceid())
-            .append("oldmenStatus", getOldmenStatus())
-            .append("changeContent", getChangeContent())
-            .append("loseMonth", getLoseMonth())
-            .append("treatMonth", getTreatMonth())
-            .append("isTreat", getIsTreat())
-            .append("serviceType", getServiceType())
-            .append("treateSure", getTreateSure())
-            .append("moneyCome", getMoneyCome())
-            .append("moneyMonth", getMoneyMonth())
-            .append("cardCode", getCardCode())
-            .append("slowIllness", getSlowIllness())
-            .append("bloodType", getBloodType())
-            .append("shiStatus", getShiStatus())
-            .append("disablityStatus", getDisablityStatus())
-            .append("disablityEntry", getDisablityEntry())
-            .append("educaLevel", getEducaLevel())
-            .append("special", getSpecial())
-            .append("title", getTitle())
-            .append("unity", getUnity())
-            .append("natureHeart", getNatureHeart())
-            .append("eatPoint", getEatPoint())
-            .append("speciality", getSpeciality())
-            .append("hobby", getHobby())
-            .append("photo", getPhoto())
-            .append("otherPhoto", getOtherPhoto())
-            .append("remarks", getRemarks())
-            .append("createTime", getCreateTime())
-            .append("tEmergentPeopleList", getTEmergentPeopleList())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("name", getName())
+                .append("gender", getGender())
+                .append("sfzid", getSfzid())
+                .append("telOne", getTelOne())
+                .append("telTwo", getTelTwo())
+                .append("telThree", getTelThree())
+                .append("birthday", getBirthday())
+                .append("age", getAge())
+                .append("marrStatus", getMarrStatus())
+                .append("national", getNational())
+                .append("local", getLocal())
+                .append("clientType", getClientType())
+                .append("liveStatus", getLiveStatus())
+                .append("familyAddress", getFamilyAddress())
+                .append("detailAddress", getDetailAddress())
+                .append("houseAddress", getHouseAddress())
+                .append("houseDetailAddress", getHouseDetailAddress())
+                .append("serviceid", getServiceid())
+                .append("oldmenStatus", getOldmenStatus())
+                .append("changeContent", getChangeContent())
+                .append("loseMonth", getLoseMonth())
+                .append("treatMonth", getTreatMonth())
+                .append("isTreat", getIsTreat())
+                .append("serviceType", getServiceType())
+                .append("treateSure", getTreateSure())
+                .append("moneyCome", getMoneyCome())
+                .append("moneyMonth", getMoneyMonth())
+                .append("cardCode", getCardCode())
+                .append("slowIllness", getSlowIllness())
+                .append("bloodType", getBloodType())
+                .append("shiStatus", getShiStatus())
+                .append("disablityStatus", getDisablityStatus())
+                .append("disablityEntry", getDisablityEntry())
+                .append("educaLevel", getEducaLevel())
+                .append("special", getSpecial())
+                .append("title", getTitle())
+                .append("unity", getUnity())
+                .append("natureHeart", getNatureHeart())
+                .append("eatPoint", getEatPoint())
+                .append("speciality", getSpeciality())
+                .append("hobby", getHobby())
+                .append("photo", getPhoto())
+                .append("otherPhoto", getOtherPhoto())
+                .append("remarks", getRemarks())
+                .append("createTime", getCreateTime())
+                .append("tEmergentPeopleList", getTEmergentPeopleList())
+                .toString();
     }
 }

+ 16 - 9
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TFacilityMapper.java

@@ -8,15 +8,14 @@ import com.ruoyi.system.domain.TFacility;
 
 /**
  * 手环设备Mapper接口
- * 
+ *
  * @author zhengjie
  * @date 2023-08-12
  */
-public interface TFacilityMapper 
-{
+public interface TFacilityMapper {
     /**
      * 查询手环设备
-     * 
+     *
      * @param id 手环设备主键
      * @return 手环设备
      */
@@ -38,7 +37,7 @@ public interface TFacilityMapper
 
     /**
      * 查询手环设备列表
-     * 
+     *
      * @param tFacility 手环设备
      * @return 手环设备集合
      */
@@ -46,7 +45,7 @@ public interface TFacilityMapper
 
     /**
      * 新增手环设备
-     * 
+     *
      * @param tFacility 手环设备
      * @return 结果
      */
@@ -54,15 +53,23 @@ public interface TFacilityMapper
 
     /**
      * 修改手环设备
-     * 
+     *
      * @param tFacility 手环设备
      * @return 结果
      */
     public int updateTFacility(TFacility tFacility);
 
+    /**
+     * 修改手环设备
+     *
+     * @param tFacility 手环设备
+     * @return 结果
+     */
+    public int updateTFacilityByDeviceCode(TFacility tFacility);
+
     /**
      * 删除手环设备
-     * 
+     *
      * @param id 手环设备主键
      * @return 结果
      */
@@ -70,7 +77,7 @@ public interface TFacilityMapper
 
     /**
      * 批量删除手环设备
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 73 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDeviceListServiceImpl.java

@@ -183,7 +183,79 @@ public class TDeviceListServiceImpl implements ITDeviceListService {
      */
     @Override
     public int updateTDeviceList(TDeviceList tDeviceList) {
-        return tDeviceListMapper.updateTDeviceList(tDeviceList);
+        /**
+         * TODO 后期在bean中校验字段是否为空
+         */
+        //修改设备
+        if (tDeviceList == null) {
+            throw new ServiceException("修改设备数据不能为空!");
+        }
+        //设备是否绑定用户
+        if (tDeviceList.getUserid() == null) {
+            throw new ServiceException("修改设备未绑定用户!");
+        }
+        //工厂
+        if (tDeviceList.getFactory() == null) {
+            throw new ServiceException("修改设备未选择工厂!");
+        }
+        //设备型号
+        if (tDeviceList.getDeviceModel() == null) {
+            throw new ServiceException("修改设备未选择设备型号!");
+        }
+        //设备标识ID
+        if (tDeviceList.getDeviceId() == null || StringUtils.isEmpty(tDeviceList.getDeviceId())) {
+            throw new ServiceException("修改设备未填写设备标识ID!");
+        }
+        //发放方式
+        if (tDeviceList.getGrantType() == null) {
+            throw new ServiceException("修改设备未选择发放方式!");
+        }
+        //如果是购买方式
+        if (tDeviceList.getGrantType() == 1) {
+            //设备标识ID
+            if (tDeviceList.getPrice() == null || StringUtils.isEmpty(tDeviceList.getPrice())) {
+                throw new ServiceException("修改设备未填写销售价格!");
+            }
+//            //服务费用
+//            if (tDeviceList.getCost() == null || StringUtils.isEmpty(tDeviceList.getCost())) {
+//                throw new ServiceException("修改设备未填写服务费用!");
+//            }
+            //支付方式
+            if (tDeviceList.getPayment() == null) {
+                throw new ServiceException("修改设备未选择支付方式!");
+            }
+        }
+
+        //根据设备表示ID查询数据库中的设备信息
+        TDeviceList deviceListBean = tDeviceListMapper.selectTDeviceListById(tDeviceList.getId());
+        if (deviceListBean == null) {
+            //如果表中没有该设备则提示
+            StringBuilder stringBuilder = new StringBuilder();
+            stringBuilder.append("修改设备信息不存在!");
+            throw new ServiceException(stringBuilder.toString());
+        }
+        //判断用户是否修改设备标识ID
+        if (!StringUtils.equals(deviceListBean.getDeviceId(), tDeviceList.getDeviceId())) {
+            throw new ServiceException("修改设备信息禁止修改设备标识ID!");
+        }
+        //修改时间
+        tDeviceList.setUpdateTime(DateUtils.getNowDate());
+        int rows = tDeviceListMapper.updateTDeviceList(tDeviceList);
+        TFacility tFacility = new TFacility();
+        //设备编号
+        if (tDeviceList.getDeviceId() != null && !StringUtils.isEmpty(tDeviceList.getDeviceId())) {
+            tFacility.setCode(tDeviceList.getDeviceId());
+        }
+        //设备SIM卡号
+        if (tDeviceList.getSimCode() != null && !StringUtils.isEmpty(tDeviceList.getSimCode())) {
+            tFacility.setTelno(tDeviceList.getSimCode());
+        }
+        //设备序列号
+        if (tDeviceList.getSerialNumber() != null && !StringUtils.isEmpty(tDeviceList.getSerialNumber())) {
+            tFacility.setIccid(tDeviceList.getSerialNumber());
+        }
+        tFacilityMapper.updateTFacilityByDeviceCode(tFacility);
+        return rows;
     }
 
     /**

+ 13 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserProfileServiceImpl.java

@@ -6,6 +6,7 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.util.Comparator;
 import java.util.List;
 
 import com.ruoyi.common.exception.ServiceException;
@@ -65,10 +66,19 @@ public class TUserProfileServiceImpl implements ITUserProfileService {
     @Override
     public List<TUserProfile> selectTUserProfileList(TUserProfile tUserProfile) {
         List<TUserProfile> tUserProfileList = tUserProfileMapper.selectTUserProfileList(tUserProfile);
-        for (TUserProfile list : tUserProfileList) {
-            list.setTEmergentPeopleList(tEmergentPeopleMapper.selectTEmergentPeopleByProfileId(list.getId()));
+        List<TUserProfile> userProfiles = new ArrayList<>();
+        if (tUserProfileList != null && !tUserProfileList.isEmpty()) {
+            userProfiles = tUserProfileList.stream().map(
+                    mapper -> {
+                        mapper.setTEmergentPeopleList(tEmergentPeopleMapper.selectTEmergentPeopleByProfileId(mapper.getId()));
+                        return mapper;
+                    }
+            ).sorted(
+                    Comparator.comparing(TUserProfile::getCreateTime)
+                            .reversed()
+            ).collect(Collectors.toList());
         }
-        return tUserProfileList;
+        return userProfiles;
     }
 
     /**

+ 131 - 75
ruoyi-system/src/main/resources/mapper/system/TDeviceListMapper.xml

@@ -1,126 +1,180 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.TDeviceListMapper">
-    
+
     <resultMap type="TDeviceList" id="TDeviceListResult">
-        <result property="id"    column="id"    />
-        <result property="fid"    column="fid"    />
-        <result property="deviceProper"    column="device_proper"    />
-        <result property="userid"    column="userid"    />
-        <result property="sfzid"    column="sfzid"    />
-        <result property="telno"    column="telno"    />
-        <result property="factory"    column="factory"    />
-        <result property="deviceModel"    column="device_model"    />
-        <result property="deviceId"    column="device_id"    />
-        <result property="simCode"    column="sim_code"    />
-        <result property="serialNumber"    column="serial_number"    />
-        <result property="grantType"    column="grant_type"    />
-        <result property="price"    column="price"    />
-        <result property="cost"    column="cost"    />
-        <result property="payment"    column="payment"    />
-        <result property="status"    column="status"    />
-        <result property="name"    column="name"    />
-        <result property="tel_one"    column="tel_one"    />
-        <result property="online_statis"    column="online_statis"    />
-        <result property="electric_quantity"    column="electric_quantity"    />
-        <result property="offlinetime"    column="offlinetime"    />
+        <result property="id" column="id"/>
+        <result property="fid" column="fid"/>
+        <result property="deviceProper" column="device_proper"/>
+        <result property="userid" column="userid"/>
+        <result property="sfzid" column="sfzid"/>
+        <result property="telno" column="telno"/>
+        <result property="factory" column="factory"/>
+        <result property="deviceModel" column="device_model"/>
+        <result property="deviceId" column="device_id"/>
+        <result property="simCode" column="sim_code"/>
+        <result property="serialNumber" column="serial_number"/>
+        <result property="grantType" column="grant_type"/>
+        <result property="price" column="price"/>
+        <result property="cost" column="cost"/>
+        <result property="payment" column="payment"/>
+        <result property="status" column="status"/>
+        <result property="name" column="name"/>
+        <result property="tel_one" column="tel_one"/>
+        <result property="online_statis" column="online_statis"/>
+        <result property="electric_quantity" column="electric_quantity"/>
+        <result property="offlinetime" column="offlinetime"/>
     </resultMap>
 
     <sql id="selectTDeviceListVo">
-        select id, device_proper, userid, sfzid, telno, factory, device_model, device_id, sim_code, serial_number, grant_type, price, cost, payment, createtime from t_device_list
+        select id,
+               device_proper,
+               userid,
+               sfzid,
+               telno,
+               factory,
+               device_model,
+               device_id,
+               sim_code,
+               serial_number,
+               grant_type,
+               price,
+               cost,
+               payment,
+               createtime
+        from t_device_list
     </sql>
 
     <select id="selectTDeviceListList" parameterType="TDeviceList" resultMap="TDeviceListResult">
-        select a.id, a.device_proper, a.userid, a.factory, a.device_model, a.device_id, a.sim_code, a.serial_number, a.grant_type, a.price, a.cost, a.payment, a.createtime, b.status, b.id as fid, c.name,c.sfzid,c.tel_one,d.online_statis,d.electric_quantity,d.offlinetime from t_device_list a
+        select a.id, a.device_proper, a.userid, a.factory, a.device_model, a.device_id, a.sim_code, a.serial_number,
+        a.grant_type, a.price, a.cost, a.payment, a.createtime, b.status, b.id as fid,
+        c.name,c.sfzid,c.tel_one,d.online_statis,d.electric_quantity,d.offlinetime from t_device_list a
         left join t_facility b on a.device_id=b.code
         left join t_user_profile c on a.userid=c.id
         left join t_shouhuan_info d on a.device_id=d.device_id_code
-        <where>  
-            <if test="deviceProper != null "> and a.device_proper = #{deviceProper}</if>
-            <if test="userid != null "> and a.userid = #{userid}</if>
-            <if test="sfzid != null  and sfzid != ''"> and a.sfzid = #{sfzid}</if>
-            <if test="telno != null  and telno != ''"> and a.telno = #{telno}</if>
-            <if test="factory != null "> and a.factory = #{factory}</if>
-            <if test="deviceModel != null "> and a.device_model = #{deviceModel}</if>
-            <if test="deviceId != null  and deviceId != ''"> and a.device_id = #{deviceId}</if>
-            <if test="simCode != null  and simCode != ''"> and a.sim_code = #{simCode}</if>
-            <if test="serialNumber != null  and serialNumber != ''"> and a.serial_number = #{serialNumber}</if>
-            <if test="grantType != null "> and a.grant_type = #{grantType}</if>
-            <if test="price != null  and price != ''"> and a.price = #{price}</if>
-            <if test="cost != null  and cost != ''"> and a.cost = #{cost}</if>
-            <if test="payment != null "> and a.payment = #{payment}</if>
-            <if test="createTime != null "> and a.createtime = #{createTime}</if>
+        <where>
+            <if test="deviceProper != null ">and a.device_proper = #{deviceProper}</if>
+            <if test="userid != null ">and a.userid = #{userid}</if>
+            <if test="sfzid != null  and sfzid != ''">and a.sfzid = #{sfzid}</if>
+            <if test="telno != null  and telno != ''">and a.telno = #{telno}</if>
+            <if test="factory != null ">and a.factory = #{factory}</if>
+            <if test="deviceModel != null ">and a.device_model = #{deviceModel}</if>
+            <if test="deviceId != null  and deviceId != ''">and a.device_id = #{deviceId}</if>
+            <if test="simCode != null  and simCode != ''">and a.sim_code = #{simCode}</if>
+            <if test="serialNumber != null  and serialNumber != ''">and a.serial_number = #{serialNumber}</if>
+            <if test="grantType != null ">and a.grant_type = #{grantType}</if>
+            <if test="price != null  and price != ''">and a.price = #{price}</if>
+            <if test="cost != null  and cost != ''">and a.cost = #{cost}</if>
+            <if test="payment != null ">and a.payment = #{payment}</if>
+            <if test="createTime != null ">and a.createtime = #{createTime}</if>
         </where>
     </select>
-    
+
     <select id="selectTDeviceListById" parameterType="Integer" resultMap="TDeviceListResult">
         <include refid="selectTDeviceListVo"/>
         where id = #{id}
     </select>
     <select id="selectTDeviceByDeviceId" resultType="com.ruoyi.system.domain.dto.RateDto">
-        select b.content,b.createtime from t_device_list a
-        left join t_shouhuan_receive_redocde b on a.device_id=b.device_id_code
-        where b.command='heart' and device_id_code = #{device_id_code}
+        select b.content, b.createtime
+        from t_device_list a
+                 left join t_shouhuan_receive_redocde b on a.device_id = b.device_id_code
+        where b.command = 'heart'
+          and device_id_code = #{device_id_code}
     </select>
     <select id="selectTDeviceByBlood" resultType="com.ruoyi.system.domain.dto.RateDto">
-        select b.content,b.createtime from t_device_list a
-        left join t_shouhuan_receive_redocde b on a.device_id=b.device_id_code
-        where b.command='blood' and device_id_code = #{device_id_code}
+        select b.content, b.createtime
+        from t_device_list a
+                 left join t_shouhuan_receive_redocde b on a.device_id = b.device_id_code
+        where b.command = 'blood'
+          and device_id_code = #{device_id_code}
     </select>
     <select id="selectTDeviceByOxygen" resultType="com.ruoyi.system.domain.dto.RateDto">
-        select b.content,b.createtime from t_device_list a
-        left join t_shouhuan_receive_redocde b on a.device_id=b.device_id_code
-        where b.command='oxygen' and device_id_code = #{device_id_code}
+        select b.content, b.createtime
+        from t_device_list a
+                 left join t_shouhuan_receive_redocde b on a.device_id = b.device_id_code
+        where b.command = 'oxygen'
+          and device_id_code = #{device_id_code}
     </select>
     <select id="selectTDeviceByTemp" resultType="com.ruoyi.system.domain.dto.RateDto">
-        select b.content,b.createtime from t_device_list a
-        left join t_shouhuan_receive_redocde b on a.device_id=b.device_id_code
-        where b.command='temp' and device_id_code = #{device_id_code}
+        select b.content, b.createtime
+        from t_device_list a
+                 left join t_shouhuan_receive_redocde b on a.device_id = b.device_id_code
+        where b.command = 'temp'
+          and device_id_code = #{device_id_code}
     </select>
     <select id="selectTDeviceByStep" resultType="com.ruoyi.system.domain.dto.RateDto">
-        select b.content,b.createtime from t_device_list a
-        left join t_shouhuan_receive_redocde b on a.device_id=b.device_id_code
-        where b.command='KA' and device_id_code = #{device_id_code}
+        select b.content, b.createtime
+        from t_device_list a
+                 left join t_shouhuan_receive_redocde b on a.device_id = b.device_id_code
+        where b.command = 'KA'
+          and device_id_code = #{device_id_code}
     </select>
     <select id="selectTDeviceByMessage" resultType="com.ruoyi.system.domain.dto.MessageDto">
-        select alarm_type,createtime from t_shouhuan_alarm_list
+        select alarm_type, createtime
+        from t_shouhuan_alarm_list
         where device_id_code = #{device_id_code}
     </select>
     <select id="selectTDeviceByMessageLog" resultType="com.ruoyi.system.domain.dto.MessageLogDto">
         SELECT a.device_id,c.name,b.alarm_type,b.createtime FROM t_device_list a
-       left join t_shouhuan_alarm_list b on a.device_id=b.device_id_code
-       left join t_user_profile c on a.userid=c.id
+        left join t_shouhuan_alarm_list b on a.device_id=b.device_id_code
+        left join t_user_profile c on a.userid=c.id
         <where>
-            <if test="device_id != null "> and a.device_id = #{device_id}</if>
-            <if test="alarm_type != null "> and b.alarm_type = #{alarm_type}</if>
+            <if test="device_id != null ">and a.device_id = #{device_id}</if>
+            <if test="alarm_type != null ">and b.alarm_type = #{alarm_type}</if>
         </where>
     </select>
     <select id="selectshouhuan" resultType="java.lang.String">
-        select use_value from t_setting
+        select use_value
+        from t_setting
         where use_key = #{use_key}
     </select>
     <select id="selectDeviceListDto" resultType="com.ruoyi.system.domain.dto.DeviceTypeDto">
-        select device_model,count(device_model) as count from t_device_list
+        select device_model, count(device_model) as count
+        from t_device_list
         group by device_model
     </select>
     <select id="selectDeviceListCount" resultType="java.lang.Integer">
-        select IFNULL(count(*),0) from t_device_list
+        select IFNULL(count(*), 0)
+        from t_device_list
     </select>
     <select id="selectAddDevice" resultType="com.ruoyi.system.domain.dto.AddDeviceDto">
-        SELECT DATE_FORMAT(createtime, '%Y-%m') AS month, COUNT(*) AS count FROM t_device_list
+        SELECT DATE_FORMAT(createtime, '%Y-%m') AS month, COUNT(*) AS count
+        FROM t_device_list
         WHERE createtime > DATE_SUB(NOW(), INTERVAL 3 MONTH)
         GROUP BY month;
     </select>
     <select id="selectTDeviceListBandUser" resultType="java.lang.Integer">
-        select count(distinct userid) from t_device_list
+        select count(distinct userid)
+        from t_device_list
     </select>
     <select id="selectTDeviceListListByDeviceId" resultMap="TDeviceListResult">
-        select a.id, a.device_proper, a.userid, a.factory, a.device_model, a.device_id, a.sim_code, a.serial_number, a.grant_type, a.price, a.cost, a.payment, a.createtime, b.status, b.id as fid, c.name,c.sfzid,c.tel_one,d.online_statis,d.electric_quantity,d.offlinetime from t_device_list a
-        left join t_facility b on a.device_id=b.code
-        left join t_user_profile c on a.userid=c.id
-        left join t_shouhuan_info d on a.device_id=d.device_id_code
+        select a.id,
+               a.device_proper,
+               a.userid,
+               a.factory,
+               a.device_model,
+               a.device_id,
+               a.sim_code,
+               a.serial_number,
+               a.grant_type,
+               a.price,
+               a.cost,
+               a.payment,
+               a.createtime,
+               b.status,
+               b.id as fid,
+               c.name,
+               c.sfzid,
+               c.tel_one,
+               d.online_statis,
+               d.electric_quantity,
+               d.offlinetime
+        from t_device_list a
+                 left join t_facility b on a.device_id = b.code
+                 left join t_user_profile c on a.userid = c.id
+                 left join t_shouhuan_info d on a.device_id = d.device_id_code
         where a.device_id = #{deviceId}
     </select>
     <select id="selectTDeviceList" parameterType="TDeviceList" resultMap="TDeviceListResult">
@@ -145,7 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cost != null">cost,</if>
             <if test="payment != null">payment,</if>
             <if test="createTime != null">createtime,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="deviceProper != null">#{deviceProper},</if>
             <if test="userid != null">#{userid},</if>
@@ -161,7 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cost != null">#{cost},</if>
             <if test="payment != null">#{payment},</if>
             <if test="createTime != null">#{createTime},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateTDeviceList" parameterType="TDeviceList">
@@ -256,11 +310,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteTDeviceListById" parameterType="Integer">
-        delete from t_device_list where id = #{id}
+        delete
+        from t_device_list
+        where id = #{id}
     </delete>
 
     <delete id="deleteTDeviceListByIds" parameterType="String">
-        delete from t_device_list where id in 
+        delete from t_device_list where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 13 - 0
ruoyi-system/src/main/resources/mapper/system/TFacilityMapper.xml

@@ -85,6 +85,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
         where id = #{id}
     </update>
+    <update id="updateTFacilityByDeviceCode" parameterType="TFacility">
+        update t_facility
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="kind != null">kind = #{kind},</if>
+            <if test="telno != null">telno = #{telno},</if>
+            <if test="comCode != null">com_code = #{comCode},</if>
+            <if test="createTime != null">createtime = #{createTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="iccid != null">iccid = #{iccid},</if>
+            <if test="puk != null">puk = #{puk},</if>
+        </trim>
+        where code = #{code}
+    </update>
 
     <delete id="deleteTFacilityById" parameterType="Long">
         delete from t_facility where id = #{id}