Kaynağa Gözat

Merge branch 'dev' of liubing/wlyy2.0 into dev

shikejing 4 yıl önce
ebeveyn
işleme
a2b9735beb

+ 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;

+ 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;

+ 36 - 3
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;
@ -296,12 +298,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 +332,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+"'";
@ -335,7 +340,7 @@ 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());
                    String name = null==nameList.get(0).get("name")?"": ConcealUtil.nameOrAddrConceal(AesEncryptUtils.decrypt(nameList.get(0).get("name").toString()));
                    locationDataVO.setCode(code);
                    locationDataVO.setName(name);
                }
@ -348,6 +353,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码查询设备地址

+ 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());