Переглянути джерело

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 4 роки тому
батько
коміт
e7345b1af2
25 змінених файлів з 364 додано та 34 видалено
  1. 0 2
      common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperator.java
  2. 65 1
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotDeviceDO.java
  3. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/product/IotProductExtendInfoDO.java
  4. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/util/AesEncryptUtils.java
  5. 1 1
      svr/svr-iot/pom.xml
  6. 1 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java
  7. 1 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/product/IotProductController.java
  8. 5 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/analyzer/WlyyIotM.java
  9. 19 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java
  10. 9 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceInventoryService.java
  11. 42 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceOrderService.java
  12. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceQualityInspectionPlanService.java
  13. 14 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java
  14. 12 4
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceSimService.java
  15. 5 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceTransfersService.java
  16. 39 4
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java
  17. 22 5
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/WlyyDeviceService.java
  18. 11 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java
  19. 4 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java
  20. 2 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/gateway/GcClientDetailsService.java
  21. 9 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/message/IotMessageService.java
  22. 13 10
      svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java
  23. 31 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotInterfaceAuditService.java
  24. 24 2
      svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotShareInterfaceService.java
  25. 17 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/workType/IotWorkTypeService.java

+ 0 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperator.java

@ -75,7 +75,6 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
	}
	@Column(name = "create_user_name",updatable = false)
	@Convert(converter = StringFStringEncryptConverter.class)
	public String getCreateUserName() {
		return createUserName;
	}
@ -104,7 +103,6 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
	}
	@Column(name = "update_user_name")
	@Convert(converter = StringFStringEncryptConverter.class)
	public String getUpdateUserName() {
		return updateUserName;
	}

+ 65 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotDeviceDO.java

@ -1,8 +1,12 @@
package com.yihu.jw.entity.iot.device;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -14,7 +18,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "iot_device")
public class IotDeviceDO extends UuidIdentityEntityWithOperator implements Serializable {
public class IotDeviceDO extends UuidIdentityEntity implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
@ -90,6 +94,12 @@ public class IotDeviceDO extends UuidIdentityEntityWithOperator implements Seria
    private String categoryName;//设备类型名称
    @Column(name = "inventory_log_id")
    private String inventoryLogId;//出入库记录id
    private Date createTime;
    private String createUser;
    private String createUserName;
    private Date updateTime;
    private String updateUser;
    private String updateUserName;
    public enum DeviceStatus {
        normal("正常", "1"),
@ -356,4 +366,58 @@ public class IotDeviceDO extends UuidIdentityEntityWithOperator implements Seria
    public void setIsGrant(Integer isGrant) {
        this.isGrant = isGrant;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }
    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/iot/product/IotProductExtendInfoDO.java

@ -45,7 +45,6 @@ public class IotProductExtendInfoDO extends UuidIdentityEntityWithOperator imple
    private String companyName;//生产企业名称
    @Column(name = "ratify_date")
    private Date ratifyDate;//批准日期
    @Column(name = "agency_name")
    private String agencyName;//代理人
    public String getSaasId() {
        return saasId;
@ -143,6 +142,7 @@ public class IotProductExtendInfoDO extends UuidIdentityEntityWithOperator imple
        this.ratifyDate = ratifyDate;
    }
    @Column(name = "agency_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getAgencyName() {
        return agencyName;

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/util/AesEncryptUtils.java

@ -19,6 +19,8 @@ public class AesEncryptUtils {
    //参数分别代表 算法名称/加密模式/数据填充方式
    private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding";
    //AES_DECRYPT(from_base64(d.patient_name),'jkzl2021ZJXL*#%a')
    /**
     * 加密
     * @param content 加密的字符串

+ 1 - 1
svr/svr-iot/pom.xml

@ -153,7 +153,7 @@
                            <addClasspath>true</addClasspath>
                            <!-- 外部依赖jar包的最终位置 -->
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>com.yihu.SvrDoorServiceApplication</mainClass>
                            <mainClass>com.yihu.IOTApplication</mainClass>
                        </manifest>
                    </archive>
                </configuration>

+ 1 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java

@ -9,6 +9,7 @@ import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

+ 1 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/product/IotProductController.java

@ -5,6 +5,7 @@ import com.yihu.iot.service.dict.IotSystemDictService;
import com.yihu.iot.service.product.IotProductBaseInfoService;
import com.yihu.jw.entity.iot.device.IotDeviceInventoryWarningDO;
import com.yihu.jw.entity.iot.product.IotProductBaseInfoDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.IotDeviceInventoryWarningVO;
import com.yihu.jw.restmodel.iot.product.IotMaintenanceUnitVO;
import com.yihu.jw.restmodel.iot.product.IotProductBaseInfoVO;

+ 5 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/analyzer/WlyyIotM.java

@ -1,8 +1,10 @@
package com.yihu.iot.service.analyzer;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -74,6 +76,7 @@ public class WlyyIotM extends UuidIdentityEntity implements Serializable {
        this.deviceModel = deviceModel;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getIdCardNo() {
        return idCardNo;
    }
@ -82,6 +85,7 @@ public class WlyyIotM extends UuidIdentityEntity implements Serializable {
        this.idCardNo = idCardNo;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUserName() {
        return userName;
    }
@ -114,6 +118,7 @@ public class WlyyIotM extends UuidIdentityEntity implements Serializable {
        this.doctorId = doctorId;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }

+ 19 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java

@ -9,6 +9,7 @@ import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.company.*;
import com.yihu.jw.entity.iot.platform.IotCompanyAppInterfaceDO;
import com.yihu.jw.entity.iot.platform.IotInterfaceLogDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.company.IotCompanyAppVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.company.IotCompanyTypeVO;
@ -158,6 +159,12 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        list.forEach(one->{
            IotCompanyVO companyVO = convertToModelVO(one);
            companyVO.setContactsIdcard(AesEncryptUtils.decrypt(companyVO.getContactsIdcard()));
            companyVO.setContactsMobile(AesEncryptUtils.decrypt(companyVO.getContactsMobile()));
            companyVO.setContactsName(AesEncryptUtils.decrypt(companyVO.getContactsName()));
            companyVO.setOfficePhone(AesEncryptUtils.decrypt(companyVO.getOfficePhone()));
            companyVO.setCreateUserName(AesEncryptUtils.decrypt(companyVO.getCreateUserName()));
            companyVO.setUpdateUserName(AesEncryptUtils.decrypt(companyVO.getUpdateUserName()));
            listVO.add(companyVO);
        });
@ -275,10 +282,22 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        if(StringUtils.isBlank(type)){
            //得到list数据
            list.forEach(one->{
                one.setContactsIdcard(AesEncryptUtils.decrypt(one.getContactsIdcard()));
                one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
                one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
                one.setOfficePhone(AesEncryptUtils.decrypt(one.getOfficePhone()));
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
                findAppType(one);
            });
        }else {
            list.forEach(one->{
                one.setContactsIdcard(AesEncryptUtils.decrypt(one.getContactsIdcard()));
                one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
                one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
                one.setOfficePhone(AesEncryptUtils.decrypt(one.getOfficePhone()));
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
                findType(one);
            });
        }

+ 9 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceInventoryService.java

@ -13,6 +13,7 @@ import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.device.IotDeviceDO;
import com.yihu.jw.entity.iot.device.IotDeviceInventoryLogDO;
import com.yihu.jw.entity.iot.device.IotDeviceOrderDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.IotDeviceInventoryLogVO;
import com.yihu.jw.restmodel.iot.device.IotDeviceVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -236,9 +237,17 @@ public class IotDeviceInventoryService extends BaseJpaService<IotDeviceInventory
            Long count = Long.valueOf(jdbcTempalte.queryForList(sql).size());
            sql += "limit " + (page - 1) * pageSize + "," + pageSize;
            List<IotDeviceInventoryLogVO> inventoryLogVOList = jdbcTempalte.query(sql, new BeanPropertyRowMapper<>(IotDeviceInventoryLogVO.class));
            for (int i=0;i<inventoryLogVOList.size();i++){
                inventoryLogVOList.get(i).setCreateUserName(AesEncryptUtils.decrypt(inventoryLogVOList.get(i).getCreateUserName()));
                inventoryLogVOList.get(i).setUpdateUserName(AesEncryptUtils.decrypt(inventoryLogVOList.get(i).getUpdateUserName()));
            }
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, inventoryLogVOList, page, pageSize, count);
        } else {
            List<IotDeviceInventoryLogVO> inventoryLogVOList = jdbcTempalte.query(sql, new BeanPropertyRowMapper<>(IotDeviceInventoryLogVO.class));
            for (int i=0;i<inventoryLogVOList.size();i++){
                inventoryLogVOList.get(i).setCreateUserName(inventoryLogVOList.get(i).getCreateUserName());
                inventoryLogVOList.get(i).setUpdateUserName(inventoryLogVOList.get(i).getUpdateUserName());
            }
            return MixEnvelop.getSuccessList(IotRequestMapping.Common.message_success_find, inventoryLogVOList);
        }
    }

+ 42 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceOrderService.java

@ -14,6 +14,7 @@ import com.yihu.jw.entity.iot.company.IotCompanyTypeDO;
import com.yihu.jw.entity.iot.device.IotDeviceDO;
import com.yihu.jw.entity.iot.device.IotDeviceOrderDO;
import com.yihu.jw.entity.iot.device.IotOrderPurchaseDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.company.IotCompanyTypeVO;
import com.yihu.jw.restmodel.iot.device.IotDeviceOrderVO;
import com.yihu.jw.restmodel.iot.device.IotOrderPurchaseVO;
@ -265,6 +266,16 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceOrderDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceOrderDO.class));
        for (int i=0;i<list.size();i++){
            list.get(i).setPurchaserName(AesEncryptUtils.decrypt(list.get(i).getPurchaserName()));
            list.get(i).setPurchaserPhone(AesEncryptUtils.decrypt(list.get(i).getPurchaserPhone()));
            list.get(i).setSupplierName(AesEncryptUtils.decrypt(list.get(i).getSupplierName()));
            list.get(i).setSupplierLeaderPhone(AesEncryptUtils.decrypt(list.get(i).getSupplierLeaderPhone()));
            list.get(i).setCreateUserName(AesEncryptUtils.decrypt(list.get(i).getCreateUserName()));
            list.get(i).setUpdateUserName(AesEncryptUtils.decrypt(list.get(i).getUpdateUserName()));
        }
        List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
@ -338,6 +349,16 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceOrderDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceOrderDO.class));
        for (int i=0;i<list.size();i++){
            list.get(i).setPurchaserName(AesEncryptUtils.decrypt(list.get(i).getPurchaserName()));
            list.get(i).setPurchaserPhone(AesEncryptUtils.decrypt(list.get(i).getPurchaserPhone()));
            list.get(i).setSupplierLeader(AesEncryptUtils.decrypt(list.get(i).getSupplierLeader()));
            list.get(i).setSupplierLeaderPhone(AesEncryptUtils.decrypt(list.get(i).getSupplierLeaderPhone()));
            list.get(i).setCreateUserName(AesEncryptUtils.decrypt(list.get(i).getCreateUserName()));
            list.get(i).setUpdateUserName(AesEncryptUtils.decrypt(list.get(i).getUpdateUserName()));
        }
        List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
@ -372,6 +393,13 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotOrderPurchaseDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotOrderPurchaseDO.class));
        for (int i=0;i<list.size();i++){
            list.get(i).setCreateUserName(AesEncryptUtils.decrypt(list.get(i).getCreateUserName()));
            list.get(i).setUpdateUserName(AesEncryptUtils.decrypt(list.get(i).getUpdateUserName()));
            list.get(i).setQualityLeader(AesEncryptUtils.decrypt(list.get(i).getQualityLeader()));
        }
        List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
@ -463,6 +491,11 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotOrderPurchaseDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotOrderPurchaseDO.class));
        for (int i=0;i<list.size();i++){
            list.get(i).setCreateUserName(AesEncryptUtils.decrypt(list.get(i).getCreateUserName()));
            list.get(i).setUpdateUserName(AesEncryptUtils.decrypt(list.get(i).getUpdateUserName()));
            list.get(i).setQualityLeader(AesEncryptUtils.decrypt(list.get(i).getQualityLeader()));
        }
        List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
@ -504,6 +537,15 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
        List<IotDeviceOrderDO> listDO = jdbcTempalte.query(sql.toString(),new BeanPropertyRowMapper(IotDeviceOrderDO.class));
        for (int i=0;i<listDO.size();i++){
            listDO.get(i).setPurchaserName(AesEncryptUtils.decrypt(listDO.get(i).getPurchaserName()));
            listDO.get(i).setPurchaserPhone(AesEncryptUtils.decrypt(listDO.get(i).getPurchaserPhone()));
            listDO.get(i).setSupplierName(AesEncryptUtils.decrypt(listDO.get(i).getSupplierName()));
            listDO.get(i).setSupplierLeaderPhone(AesEncryptUtils.decrypt(listDO.get(i).getSupplierLeaderPhone()));
            listDO.get(i).setCreateUserName(AesEncryptUtils.decrypt(listDO.get(i).getCreateUserName()));
            listDO.get(i).setUpdateUserName(AesEncryptUtils.decrypt(listDO.get(i).getUpdateUserName()));
        }
        //DO转VO
        List<IotDeviceOrderVO> iotDeviceOrderVOList = new ArrayList<>();
        convertToModelVOs(listDO,iotDeviceOrderVOList);

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceQualityInspectionPlanService.java

@ -11,6 +11,7 @@ import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.device.IotDeviceQualityInspectionPlanDO;
import com.yihu.jw.entity.iot.device.IotOrderPurchaseDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.IotDeviceQualityInspectionPlanVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -266,6 +267,14 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
        sql1.append(sql).append(") b GROUP BY b.order_no limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceQualityInspectionPlanDO> list = jdbcTempalte.query(sql1.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceQualityInspectionPlanDO.class));
        for (int i=0;i<list.size();i++){
            list.get(i).setQualityLeader(AesEncryptUtils.decrypt(list.get(i).getQualityLeader()));
            list.get(i).setQualityLeaderPhone(AesEncryptUtils.decrypt(list.get(i).getQualityLeaderPhone()));
            list.get(i).setCreateUserName(AesEncryptUtils.decrypt(list.get(i).getCreateUserName()));
            list.get(i).setUpdateUserName(AesEncryptUtils.decrypt(list.get(i).getUpdateUserName()));
        }
        long count = list.size();
        //DO转VO
@ -324,6 +333,12 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
        sql.append("  ORDER BY c.plan_time DESC LIMIT ").append((page-1)*size).append(",").append(size);
        List<IotDeviceQualityInspectionPlanDO> listOrderNo = jdbcTempalte.query(sql.toString(),new BeanPropertyRowMapper(IotDeviceQualityInspectionPlanDO.class));
        for (int i=0;i<listOrderNo.size();i++){
            listOrderNo.get(i).setQualityLeader(AesEncryptUtils.decrypt(listOrderNo.get(i).getQualityLeader()));
            listOrderNo.get(i).setQualityLeaderPhone(AesEncryptUtils.decrypt(listOrderNo.get(i).getQualityLeaderPhone()));
            listOrderNo.get(i).setCreateUserName(AesEncryptUtils.decrypt(listOrderNo.get(i).getCreateUserName()));
            listOrderNo.get(i).setUpdateUserName(AesEncryptUtils.decrypt(listOrderNo.get(i).getUpdateUserName()));
        }
        List<IotDeviceQualityInspectionPlanVO> list = transforList(listOrderNo);
        long count = list.size();
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find_functions,list,page,size,count);

+ 14 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java

@ -12,6 +12,7 @@ import com.yihu.iot.util.excel.AExcelReader;
import com.yihu.iot.util.excel.reader.IotDeviceImportVOReader;
import com.yihu.jw.entity.iot.device.*;
import com.yihu.jw.entity.iot.product.IotProductDataTransmissionDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportRecordVO;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportVO;
import com.yihu.jw.restmodel.iot.device.IotDeviceVO;
@ -39,6 +40,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.sun.tools.corba.se.idl.constExpr.Expression.one;
/**
 * @author yeshijie on 2017/12/8.
 */
@ -295,6 +298,8 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
            }else {
                one.setIsBinding(2);
            }
            one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
        });
        translateDictForList(iotDeviceVOList);
@ -364,6 +369,8 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
        List<IotDeviceVO> iotDeviceVOList = convertToModels(list,new ArrayList<>(list.size()),IotDeviceVO.class);
        iotDeviceVOList.forEach(one->{
            one.setIsBinding(isBinding);
            one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
        });
        translateDictForList(iotDeviceVOList);
@ -386,9 +393,13 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
        sql += " GROUP BY c.`name`";
        List<IotDeviceDO> list = jdbcTempalte.query(sql,new BeanPropertyRowMapper(IotDeviceDO.class));
        for (int i=0;i<list.size();i++){
            list.get(i).setCreateUserName(AesEncryptUtils.decrypt(list.get(i).getCreateUserName()));
            list.get(i).setUpdateUserName(AesEncryptUtils.decrypt(list.get(i).getUpdateUserName()));
        }
        //DO转VO
        List<IotDeviceVO> iotDeviceVOList = convertToModels(list,new ArrayList<>(list.size()),IotDeviceVO.class);
        translateDictForList(iotDeviceVOList);
        long count = list.size();
@ -433,6 +444,8 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
        }
        List<IotDeviceDO> list = jdbcTempalte.query(sql,new BeanPropertyRowMapper(IotDeviceDO.class));
        if(list.size()>0){
            list.get(0).setCreateUserName(AesEncryptUtils.decrypt(list.get(0).getCreateUserName()));
            list.get(0).setUpdateUserName(AesEncryptUtils.decrypt(list.get(0).getUpdateUserName()));
            return list.get(0);
        }
        return null;

+ 12 - 4
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceSimService.java

@ -11,6 +11,7 @@ import com.yihu.jw.entity.iot.device.IotDeviceDO;
import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
import com.yihu.jw.entity.iot.device.IotPatientDeviceDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.IotOrderVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -146,7 +147,7 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
            sqlCount.append(" and (c.device_sn like '%").append(sn).append("%')");
        }
        //数据权限过滤
//        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            sql.append(" and c.hospital in (").append(orgUserService.getUserOrg(orgList)).append(")");
@ -162,10 +163,10 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
        mapList.forEach(one->{
            IotDeviceSimDO iotDeviceSimDO = JSONObject.parseObject(JSONObject.toJSONString(one), IotDeviceSimDO.class);
            if (one.get("patient_name")!=null){
                iotDeviceSimDO.setContactsName(one.get("patient_name").toString());
                iotDeviceSimDO.setContactsName(AesEncryptUtils.decrypt(one.get("patient_name").toString()));
            }
            if (one.get("mobile")!=null){
                iotDeviceSimDO.setContactsMobile(one.get("mobile").toString());
                iotDeviceSimDO.setContactsMobile(AesEncryptUtils.decrypt(one.get("mobile").toString()));
            }
            if (one.get("sn")!=null){
                iotDeviceSimDO.setDeviceSn(one.get("sn").toString());
@ -173,6 +174,8 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
            if (one.get("name")!=null){
                iotDeviceSimDO.setDeviceName(one.get("name").toString());
            }
//            iotDeviceSimDO.setCreateUserName(AesEncryptUtils.decrypt(one.get("create_user_name").toString()));
//            iotDeviceSimDO.setCreateUserName(AesEncryptUtils.decrypt(one.get("update_user_name").toString()));
            //更新表中数据
            iotDeviceSimDao.save(iotDeviceSimDO);
            list.add(iotDeviceSimDO);
@ -200,7 +203,12 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
        sql.append(" limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceSimDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotDeviceSimDO.class));
        list.forEach(one-> {
            one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
            one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
                });
        //获取总数
        long count = list.size();

+ 5 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceTransfersService.java

@ -5,6 +5,7 @@ import com.yihu.iot.dao.device.IotDeviceTransfersDao;
import com.yihu.iot.service.common.OrgUserService;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.device.IotDeviceTransfersDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.mysql.query.BaseJpaService;
@ -65,6 +66,10 @@ public class IotDeviceTransfersService extends BaseJpaService<IotDeviceTransfers
            Long count = Long.valueOf(jdbcTempalte.queryForList(sql).size());
            sql += "limit " + (page - 1) * pageSize + "," + pageSize;
            List<IotDeviceTransfersDO> deviceTransfersDOList = jdbcTempalte.query(sql, new BeanPropertyRowMapper<>(IotDeviceTransfersDO.class));
            deviceTransfersDOList.forEach(one-> {
                one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
                one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
            });
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, deviceTransfersDOList, page, pageSize, count);
        } else {
            List<IotDeviceTransfersDO> deviceTransfersDOList = jdbcTempalte.query(sql, new BeanPropertyRowMapper<>(IotDeviceTransfersDO.class));

+ 39 - 4
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -21,6 +21,7 @@ import com.yihu.jw.entity.iot.device.IotDeviceOverhaulDO;
import com.yihu.jw.entity.iot.device.IotPatientDeviceDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.patient.*;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -29,6 +30,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import io.searchbox.client.JestResult;
import iot.device.LocationDataVO;
import okhttp3.OkHttpClient;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.slf4j.Logger;
@ -42,6 +44,7 @@ import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.management.ObjectName;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -265,7 +268,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
            JSONObject location = JSONObject.parseObject(map.get("location").toString());
            GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
            locationDataVO.setId(map.get("id").toString());
            locationDataVO.setIdCard(map.get("idCard").toString());
            locationDataVO.setIdCard(AesEncryptUtils.decrypt(map.get("idCard").toString()));
            locationDataVO.setCategoryCode(map.get("categoryCode").toString());
            locationDataVO.setDeviceSn(map.get("deviceSn").toString());
            locationDataVO.setLocation(geoPoint);
@ -296,12 +299,15 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        String sql = "select t.code as \"code\",t.name as \"name\" from wlyy.wlyy_patient t where 1=1 ";
        String sqlEqt="select t.device_name as\"device_name\" from device.wlyy_devices t where 1=1";
        if (StringUtils.isNotEmpty(idCard)){
            sql = sql +" and t.idcard = '"+idCard+"'";
            sql = sql +" and t.idcard = '"+AesEncryptUtils.encrypt(idCard)+"'";
        }if (StringUtils.isNotEmpty(snCode)){
            sqlEqt = sqlEqt +" and t.device_code = '"+snCode+"'";
        }
        System.out.println("查询患者name和code开始");
        List<Map<String,Object>> nameList = hibenateUtils.createSQLQuery(sql);
        for (Map<String,Object> tmp:nameList){
            tmp.put("name",AesEncryptUtils.decrypt(tmp.get("name").toString()));
        }
        System.out.println("查询患者name和code结束:"+nameList);
        System.out.println("查询设备名称开始");
        List<Map<String,Object>> deviceList = hibenateUtils.createSQLQuery(sqlEqt);
@ -327,7 +333,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
                List<Map<String,Object>> nameList = new ArrayList<>();
                List<Map<String,Object>> deviceList = new ArrayList<>();
                if (StringUtils.isNotEmpty(idCard)){
                    sql = sql +" and t.idcard = '"+idCard+"'";
                    sql = sql +" and t.idcard = '"+AesEncryptUtils.encrypt(idCard)+"'";
                    nameList = jdbcTempalte.queryForList(sql);
                }if (StringUtils.isNoneBlank(snCoed)){
                    sqlEqt = sqlEqt +" and t.device_code = '"+snCoed+"'";
@ -336,8 +342,9 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
                if(nameList.size()>0){
                    String code = null==nameList.get(0).get("code")?"":nameList.get(0).get("code").toString();
                    String name = null==nameList.get(0).get("name")?"": ConcealUtil.nameOrAddrConceal(nameList.get(0).get("name").toString());
                    locationDataVO.setIdCard(AesEncryptUtils.decrypt(idCard));
                    locationDataVO.setCode(code);
                    locationDataVO.setName(name);
                    locationDataVO.setName(AesEncryptUtils.decrypt(name));
                }
                if (deviceList.size()>0){
                    String equipmentName = null==deviceList.get(0).get("device_name")?"":deviceList.get(0).get("device_name").toString();
@ -348,6 +355,34 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        return list;
    }
    public LocationDataVO addNameAndCodeToLocationVO(LocationDataVO locationDataVO){
        if(null!=locationDataVO){
                String sql = "select t.code as \"code\",t.name as \"name\" from wlyy.wlyy_patient t where 1=1 ";
                String sqlEqt="select t.device_name as\"device_name\" from device.wlyy_devices t where 1=1";
                String idCard = locationDataVO.getIdCard();
                String snCoed = locationDataVO.getDeviceSn();
                List<Map<String,Object>> nameList = new ArrayList<>();
                List<Map<String,Object>> deviceList = new ArrayList<>();
                if (StringUtils.isNotEmpty(idCard)){
                    sql = sql +" and t.idcard = '"+ AesEncryptUtils.encrypt(idCard)+"'";
                    nameList = jdbcTempalte.queryForList(sql);
                }if (StringUtils.isNoneBlank(snCoed)){
                    sqlEqt = sqlEqt +" and t.device_code = '"+snCoed+"'";
                    deviceList = jdbcTempalte.queryForList(sqlEqt);
                }
                if(nameList.size()>0){
                    String code = null==nameList.get(0).get("code")?"":nameList.get(0).get("code").toString();
                    String name = null==nameList.get(0).get("name")?"": ConcealUtil.nameOrAddrConceal(AesEncryptUtils.decrypt(nameList.get(0).get("name").toString()));
                    locationDataVO.setCode(code);
                    locationDataVO.setName(name);
                }
                if (deviceList.size()>0){
                    String equipmentName = null==deviceList.get(0).get("device_name")?"":deviceList.get(0).get("device_name").toString();
                    locationDataVO.setEquimentName(equipmentName);
                }
            }
        return locationDataVO;
    }
    /**
     * 根据设备SN码查询设备地址

+ 22 - 5
svr/svr-iot/src/main/java/com/yihu/iot/service/device/WlyyDeviceService.java

@ -3,6 +3,7 @@ package com.yihu.iot.service.device;
import com.yihu.iot.service.common.OrgUserService;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.DeviceHealthIndexVO;
import com.yihu.jw.restmodel.iot.device.WlyyDeviceVO;
import com.yihu.jw.restmodel.iot.device.WlyyHealthStandardVO;
@ -67,7 +68,7 @@ public class WlyyDeviceService {
            sql +=" and device_name like '%"+deviceName+"%' ";
        }
        if(!StringUtils.isEmpty(linkman)){
            sql +=" and linkmam like '%"+linkman+"%' ";
            sql +=" and AES_DECRYPT(from_base64(linkmam),'jkzl2021ZJXL*#%a') like '%"+linkman+"%' ";//AES_DECRYPT(from_base64(d.patient_name),'jkzl2021ZJXL*#%a')
        }
        //数据权限过滤
@ -80,12 +81,28 @@ public class WlyyDeviceService {
        Long count = Long.valueOf(jdbcTemplate.queryForList(sql).size());
        sql += "limit " + (page - 1) * pageSize + "," + pageSize;
        List<WlyyDeviceVO> deviceVOList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WlyyDeviceVO.class));
        deviceVOList.forEach(one->{
            one.setLinkman(AesEncryptUtils.decrypt(one.getLinkman()));
            one.setTel(AesEncryptUtils.decrypt(one.getTel()));
            one.setRepresentative(AesEncryptUtils.decrypt(one.getRepresentative()));
            one.setApplicantName(AesEncryptUtils.decrypt(one.getApplicantName()));
            one.setApplicantTel(AesEncryptUtils.decrypt(one.getApplicantTel()));
            one.setApplicantIdentity(AesEncryptUtils.decrypt(one.getApplicantIdentity()));
        });
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, deviceVOList, page, pageSize, count);
    }
    public MixEnvelop<WlyyDeviceVO,WlyyDeviceVO> findById(Long id){
        String sql = "select * from device.wlyy_devices where id = "+id;
        List<WlyyDeviceVO> deviceVOList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WlyyDeviceVO.class));
        deviceVOList.forEach(one->{
            one.setLinkman(AesEncryptUtils.decrypt(one.getLinkman()));
            one.setTel(AesEncryptUtils.decrypt(one.getTel()));
            one.setRepresentative(AesEncryptUtils.decrypt(one.getRepresentative()));
            one.setApplicantName(AesEncryptUtils.decrypt(one.getApplicantName()));
            one.setApplicantTel(AesEncryptUtils.decrypt(one.getApplicantTel()));
            one.setApplicantIdentity(AesEncryptUtils.decrypt(one.getApplicantIdentity()));
        });
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,deviceVOList.get(0));
    }
@ -107,14 +124,14 @@ public class WlyyDeviceService {
        //根据患者名称过滤
        if(!StringUtils.isEmpty(userName)){
            filter.append(" AND i.name LIKE '%"+userName+"%' ");
            filter.append(" AND AES_DECRYPT(from_base64(i.name),'jkzl2021ZJXL*#%a') LIKE '%"+userName+"%' ");
        }
        if(!StringUtils.isEmpty(deviceSn)){
            filter.append(" and i.device_sn='"+deviceSn+"' ");
        }
        if(!StringUtils.isEmpty(idcard)){
            filter.append(" and i.idcard='"+idcard+"' ");
            filter.append(" and AES_DECRYPT(from_base64(i.idcard),'jkzl2021ZJXL*#%a')='"+idcard+"' ");
        }
        //体征数据创建时间
        if(!StringUtils.isEmpty(date)){
@ -172,14 +189,14 @@ public class WlyyDeviceService {
                bean.setCzrq(info.get("czrq")!=null?(Date)info.get("czrq"):null);
                bean.setDel(info.get("del")!=null?info.get("del")+"":null);
                bean.setDeviceSn(info.get("device_sn")!=null?info.get("device_sn")+"":null);
                bean.setIdcard(info.get("idcard")!=null?info.get("idcard")+"":null);
                bean.setIdcard(AesEncryptUtils.decrypt(info.get("idcard").toString())!=null?AesEncryptUtils.decrypt(info.get("idcard").toString())+"":null);
                bean.setIntervene(info.get("intervene")!=null?info.get("intervene")+"":null);
                bean.setRecordDate(info.get("record_date")!=null?(Date)info.get("record_date"):null);
                bean.setSortDate(info.get("sort_date")!=null?(Date)info.get("sort_date"):null);
                bean.setStatus(info.get("status")!=null?(Integer)info.get("status"):null);
                bean.setType(info.get("type")!=null?(Integer)info.get("type"):0);
                bean.setUser(info.get("user")!=null?info.get("user")+"":null);
                bean.setUserName(info.get("userName")!=null?info.get("userName")+"":null);
                bean.setUserName(AesEncryptUtils.decrypt(info.get("userName").toString())!=null?AesEncryptUtils.decrypt(info.get("userName").toString())+"":null);
                bean.setValue1(info.get("value1")!=null?info.get("value1")+"":null);
                bean.setValue2(info.get("value2")!=null?info.get("value2")+"":null);
                bean.setValue3(info.get("value3")!=null?info.get("value3")+"":null);

+ 11 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java

@ -4,6 +4,7 @@ import com.yihu.iot.dao.dict.IotHospitalDao;
import com.yihu.iot.service.common.OrgUserService;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.dict.IotHospitalDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.mysql.query.BaseJpaService;
@ -60,9 +61,19 @@ public class IotHospitalService extends BaseJpaService<IotHospitalDO, IotHospita
            Long count = Long.valueOf(jdbcTemplate.queryForList(sql).size());
            sql += "limit " + (page-1)*pageSize + "," + pageSize;
            List<IotHospitalDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(IotHospitalDO.class));
            for (IotHospitalDO one:list){
                if (StringUtils.isNoneBlank(one.getPhone())){
                    one.setPhone(AesEncryptUtils.decrypt(one.getPhone()));
                }
            }
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, list, page, pageSize, count);
        }else {
            List<IotHospitalDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(IotHospitalDO.class));
            for (IotHospitalDO one:list){
                if (StringUtils.isNoneBlank(one.getPhone())){
                    one.setPhone(AesEncryptUtils.decrypt(one.getPhone()));
                }
            }
            return MixEnvelop.getSuccessList(IotRequestMapping.Company.message_success_find, list);
        }
    }

+ 4 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java

@ -165,6 +165,9 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            params.put("city",city);
        }
       List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql.toString(),params);
       for (Map<String,Object> tmp:list){
           tmp.put("phone",AesEncryptUtils.decrypt(tmp.get("phone").toString()));
       }
       return list;
    }
@ -197,7 +200,7 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            locationDataVO.setLabel(null);
            locationDataVO.setDiseaseCondition(5);
            locationDataVO.setCreateTime(jsobj.get("createTime").toString());
            locationDataVO.setName(ConcealUtil.nameOrAddrConceal(jsobj.get("name").toString()));
            locationDataVO.setName(ConcealUtil.nameOrAddrConceal(AesEncryptUtils.decrypt(jsobj.get("name").toString())));
            locationDataVO.setCode(null);
            locationDataVO.setEquimentName(AesEncryptUtils.decrypt(jsobj.get("equimentName").toString()));
            result.add(locationDataVO);

+ 2 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/gateway/GcClientDetailsService.java

@ -3,6 +3,7 @@ package com.yihu.iot.service.gateway;
import com.yihu.iot.dao.gateway.GcClientDetailsDao;
import com.yihu.jw.entity.iot.gateway.GcClientDetails;
import com.yihu.jw.entity.util.AesEncryptUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -29,7 +30,7 @@ public class GcClientDetailsService{
        gcClientDetails.setAppId(getUUID());
        gcClientDetails.setAppSecret(getUUID());
        gcClientDetails.setAppUri(appUri);
        gcClientDetails.setCreateUserName(createUserName);
        gcClientDetails.setCreateUserName(AesEncryptUtils.encrypt(createUserName));
        gcClientDetails.setCreatieUser(creatieUser);
        gcClientDetails.setCreatieTime(new Date());
        gcClientDetails.setDel(1);

+ 9 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/message/IotMessageService.java

@ -6,6 +6,7 @@ import com.yihu.iot.dao.message.IotMessageDao;
import com.yihu.jw.entity.iot.company.IotCompanyDO;
import com.yihu.jw.entity.iot.device.IotDeviceQualityInspectionPlanDO;
import com.yihu.jw.entity.iot.message.IotMessageDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -53,7 +54,14 @@ public class IotMessageService  extends BaseJpaService<IotMessageDO, IotMessageD
        sql.append("  ORDER BY read_msg, create_time DESC LIMIT ").append((page-1)*size).append(",").append(size);
        List<IotMessageDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(IotMessageDO.class));
        for (IotMessageDO one:list){
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        }
        long count = list.size();

+ 13 - 10
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -15,6 +15,7 @@ import com.yihu.iot.util.conceal.ConcealUtil;
import com.yihu.iot.util.excel.HibenateUtils;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.http.HttpClientUtil;
@ -104,7 +105,7 @@ public class MonitorPlatformService  {
                    JSONObject location = JSONObject.parseObject(map.get("location").toString());
                    GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
                    locationDataVO.setId(map.get("id").toString());
                    locationDataVO.setIdCard(map.get("idCard").toString());
                    locationDataVO.setIdCard(AesEncryptUtils.decrypt(map.get("idCard").toString()));
                    locationDataVO.setCategoryCode(map.get("categoryCode").toString());
                    locationDataVO.setDeviceSn(map.get("deviceSn").toString());
                    locationDataVO.setLocation(geoPoint);
@ -115,6 +116,7 @@ public class MonitorPlatformService  {
//                    locationDataVO.setName(ConcealUtil.nameOrAddrConceal(map.get("name").toString()));
                    locationDataVO.setCode(null);
                    locationDataVO.setEquimentName((String) map.get("equimentName"));
                    locationDataVO = iotPatientDeviceService.addNameAndCodeToLocationVO(locationDataVO);
                    locationDataVOList.add(locationDataVO);
                });
//                JSONArray jsonArrayTemp = new JSONArray();
@ -130,8 +132,7 @@ public class MonitorPlatformService  {
//                jsonObject.put("size",size);
//                List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                envelop.getDetailModelList().addAll(list2);
                envelop.getDetailModelList().addAll(locationDataVOList);
            }
            envelop.setTotalCount(total);
            return envelop;
@ -184,7 +185,7 @@ public class MonitorPlatformService  {
                    JSONObject location = JSONObject.parseObject(map.get("location").toString());
                    GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
                    locationDataVO.setId(map.get("id").toString());
                    locationDataVO.setIdCard(map.get("idCard").toString());
                    locationDataVO.setIdCard(AesEncryptUtils.decrypt(map.get("idCard").toString()));
                    locationDataVO.setCategoryCode(map.get("categoryCode").toString());
                    locationDataVO.setDeviceSn(map.get("deviceSn").toString());
                    locationDataVO.setLocation(geoPoint);
@ -195,11 +196,10 @@ public class MonitorPlatformService  {
//                    locationDataVO.setName(ConcealUtil.nameOrAddrConceal(map.get("name").toString()));
                    locationDataVO.setCode(null);
                    locationDataVO.setEquimentName((String) map.get("equimentName"));
                    locationDataVO = iotPatientDeviceService.addNameAndCodeToLocationVO(locationDataVO);
                    locationDataVOList.add(locationDataVO);
                });
                List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                envelop.getDetailModelList().addAll(list2);
                envelop.getDetailModelList().addAll(locationDataVOList);
//                for (String categoryCode:categoryCodes){
//                    JSONObject json = new JSONObject();
//                    JSONArray jsonArray = new JSONArray();
@ -864,7 +864,7 @@ public class MonitorPlatformService  {
            String sql = "SELECT d.device_sn,b.supplier_name supplierName,b.origin_place originPlace,e.product_img productImg" +
                    ",e.description  from iot_device d,iot_product_base_info b,iot_product_extend_info e" +
                    " WHERE d.device_sn = '"+deviceSn+"' and d.product_id = b.id and d.product_id = e.product_id";
            List<JSONObject> list = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
            List<JSONObject> list = myJdbcTemplate.queryJson(sql,new Object[]{});
            if(list!=null&&list.size()>0){
                JSONObject js = list.get(0);
                tmp.put("supplierName",js.getString("supplierName"));
@ -1092,9 +1092,12 @@ public class MonitorPlatformService  {
        sql.append("from wlyy.wlyy_patient_device d,wlyy.wlyy_patient p  ");
        sql.append("WHERE d.`user` = p.`code` and d.del=0  ");
        if(org.apache.commons.lang3.StringUtils.isNotBlank(name)){
            sql.append("and (d.device_sn like '%"+name+"%' or p.`name` = '"+name+"') ");
            sql.append("and (d.device_sn like '%"+name+"%' or p.`name` = '"+ AesEncryptUtils.encrypt(name)+"') ");
        }
        List<JSONObject> jsonArray = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
        for (JSONObject obj:jsonArray){
            obj.put("name",AesEncryptUtils.decrypt(obj.getString("name")));
        }
        if(jsonArray.size()==0){
            sql= new StringBuffer(" select '5' as categoryCode, id,device_code as deviceSn,null as code,null as name,'健康小屋' as deviceName from xmiot.iot_equipmet_detail where device_code like '%"+name+"%'");
            jsonArray = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
@ -1131,9 +1134,9 @@ public class MonitorPlatformService  {
                String sqlLocation = "select idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName\n" +
                        "from device.wlyy_patient_device_location where del=0 and  device_sn='"+deviceSn+"' limit 0,5 ";
                try {
                    List<Map<String,Object>> locationDataVOList = jdbcTemplate.queryForList(sqlLocation);
                    JSONObject location = JSONObject.parseObject(locationDataVOList.get(0).get("location").toString());
                    if(locationDataVOList.size()>0){
                        data.put("locationData",location);

+ 31 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotInterfaceAuditService.java

@ -6,6 +6,7 @@ import com.yihu.iot.dao.platform.*;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.company.IotCompanyDO;
import com.yihu.jw.entity.iot.platform.*;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.platform.IotInterfaceAuditVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -129,6 +130,15 @@ public class IotInterfaceAuditService  extends BaseJpaService<IotInterfaceAuditD
            IotCompanyDO company = iotCompanyDao.findOne(one.getCompanyId());
            one.setContactsName(company.getContactsName());
            one.setContactsMobile(company.getContactsMobile());
            if (StringUtils.isNotBlank(one.getName())){
                one.setName(AesEncryptUtils.decrypt(one.getName()));
            }
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        });
        //获取总数
@ -216,6 +226,15 @@ public class IotInterfaceAuditService  extends BaseJpaService<IotInterfaceAuditD
            IotCompanyDO company = iotCompanyDao.findOne(one.getCompanyId());
            one.setContactsName(company.getContactsName());
            one.setContactsMobile(company.getContactsMobile());
            if (StringUtils.isNotBlank(one.getName())){
                one.setName(AesEncryptUtils.decrypt(one.getName()));
            }
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        });
        //获取总数
@ -236,6 +255,18 @@ public class IotInterfaceAuditService  extends BaseJpaService<IotInterfaceAuditD
        sql.append("WHERE company_id = '").append(account.getId()).append("'");
        sql.append(" order by time desc  limit ").append((page-1)*size).append(",").append(size);
        List<IotInterfaceAuditDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotInterfaceAuditDO.class));
        for (IotInterfaceAuditDO one:list){
            if (StringUtils.isNotBlank(one.getName())){
                one.setName(AesEncryptUtils.decrypt(one.getName()));
            }
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        }
        //获取总数
        long count = list.size();

+ 24 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotShareInterfaceService.java

@ -11,6 +11,7 @@ import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.platform.IotCompanyAppInterfaceDO;
import com.yihu.jw.entity.iot.platform.IotInterfaceAuditDO;
import com.yihu.jw.entity.iot.platform.IotShareInterfaceDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.company.IotCompanyAppVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -145,7 +146,15 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
        }
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotCompanyDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotShareInterfaceDO.class));
        List<IotShareInterfaceDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotShareInterfaceDO.class));
        for (IotShareInterfaceDO one:list){
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        }
        List<Map<String,Object>> countList = jdbcTemplate.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
@ -193,6 +202,14 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
        sql.append(" order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotCompanyAppDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotCompanyAppDO.class));
        for (IotCompanyAppDO one:list){
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        }
        ArrayList<IotCompanyAppVO> resultList = new ArrayList<>();
        
@ -234,7 +251,12 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
        List<IotShareInterfaceDO> interfaceDOS = new ArrayList<>();
        list.forEach(one->{
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
            IotShareInterfaceDO shareInterfaceDO = iotShareInterfaceDao.findById(one.getShareInterfaceId());
            interfaceDOS.add(shareInterfaceDO);
        });

+ 17 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/workType/IotWorkTypeService.java

@ -3,6 +3,7 @@ package com.yihu.iot.service.workType;
import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.dao.workType.IotWorkTypeDao;
import com.yihu.jw.entity.iot.workType.IotWorkTypeDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.mysql.query.BaseJpaService;
@ -105,6 +106,14 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
        sql.append("order by w.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotWorkTypeDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotWorkTypeDO.class));
        for (IotWorkTypeDO tmp:list){
            if (StringUtils.isNotBlank(tmp.getCreateUserName())){
                tmp.setCreateUserName(AesEncryptUtils.decrypt(tmp.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(tmp.getUpdateUserName())){
                tmp.setUpdateUserName(AesEncryptUtils.decrypt(tmp.getUpdateUserName()));
            }
        }
        long count =list.size();
@ -136,6 +145,14 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotWorkTypeDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotWorkTypeDO.class));
        for (IotWorkTypeDO tmp:list){
            if (StringUtils.isNotBlank(tmp.getCreateUserName())){
                tmp.setCreateUserName(AesEncryptUtils.decrypt(tmp.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(tmp.getUpdateUserName())){
                tmp.setUpdateUserName(AesEncryptUtils.decrypt(tmp.getUpdateUserName()));
            }
        }
        List<Map<String,Object>> countList = jdbcTemplate.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());