浏览代码

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

# Conflicts:
#	svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/label/PatientLableService.java
yeshijie 3 年之前
父节点
当前提交
52b6710546

+ 65 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceHealthIndex.java

@ -0,0 +1,65 @@
package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created with IntelliJ IDEA.
 * base_device_health_index
 * 烟感气感实时数据
 * @Author: yeshijie
 * @Date: 2021/8/23
 * @Description:
 */
@Entity
@Table(name = "base_device_health_index")
public class DeviceHealthIndex extends UuidIdentityEntityWithCreateTime{
    private String deviceSn;//设备sn
    private String deviceType;//设备类型 1气感 2烟感
    private String value;//测量值
    private String unit;//单位
    private String recordTime;//记录时间
    public String getDeviceSn() {
        return deviceSn;
    }
    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }
    public String getDeviceType() {
        return deviceType;
    }
    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    public String getRecordTime() {
        return recordTime;
    }
    public void setRecordTime(String recordTime) {
        this.recordTime = recordTime;
    }
}

+ 37 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/HvDeviceRecord.java

@ -0,0 +1,37 @@
package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created with IntelliJ IDEA.
 * '海康烟感气感设备记录表'
 * @Author: yeshijie
 * @Date: 2021/8/23
 * @Description:
 */
@Entity
@Table(name = "base_hvdevice_record")
public class HvDeviceRecord extends UuidIdentityEntity {
    private String deviceId;//海康平台设备id
    private String deviceSn;//设备sn
    public String getDeviceId() {
        return deviceId;
    }
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
    public String getDeviceSn() {
        return deviceSn;
    }
    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }
}

+ 130 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/HvDeviceSosLog.java

@ -0,0 +1,130 @@
package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created with IntelliJ IDEA.
 * 烟感气感设备报警日志记录表
 * @Author: yeshijie
 * @Date: 2021/8/23
 * @Description:
 */
@Entity
@Table(name = "base_hvdevice_sos_log")
public class HvDeviceSosLog extends UuidIdentityEntityWithCreateTime{
    private String resourceID;
    private String resourceSerial;
    private String resourceName;
    private Integer alarmNum;
    private String alarmTime;
    private String monitorValue;
    private String alarmType;
    private String systemType;
    private String alarmID;
    private String resourceType;
    private String location;
    @Column(name = "resourceID")
    public String getResourceID() {
        return resourceID;
    }
    public void setResourceID(String resourceID) {
        this.resourceID = resourceID;
    }
    @Column(name = "resourceSerial")
    public String getResourceSerial() {
        return resourceSerial;
    }
    public void setResourceSerial(String resourceSerial) {
        this.resourceSerial = resourceSerial;
    }
    @Column(name = "resourceName")
    public String getResourceName() {
        return resourceName;
    }
    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }
    @Column(name = "alarmNum")
    public Integer getAlarmNum() {
        return alarmNum;
    }
    public void setAlarmNum(Integer alarmNum) {
        this.alarmNum = alarmNum;
    }
    @Column(name = "alarmTime")
    public String getAlarmTime() {
        return alarmTime;
    }
    public void setAlarmTime(String alarmTime) {
        this.alarmTime = alarmTime;
    }
    @Column(name = "monitorValue")
    public String getMonitorValue() {
        return monitorValue;
    }
    public void setMonitorValue(String monitorValue) {
        this.monitorValue = monitorValue;
    }
    @Column(name = "alarmType")
    public String getAlarmType() {
        return alarmType;
    }
    public void setAlarmType(String alarmType) {
        this.alarmType = alarmType;
    }
    @Column(name = "systemType")
    public String getSystemType() {
        return systemType;
    }
    public void setSystemType(String systemType) {
        this.systemType = systemType;
    }
    @Column(name = "alarmID")
    public String getAlarmID() {
        return alarmID;
    }
    public void setAlarmID(String alarmID) {
        this.alarmID = alarmID;
    }
    @Column(name = "resourceType")
    public String getResourceType() {
        return resourceType;
    }
    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }
    @Column(name = "location")
    public String getLocation() {
        return location;
    }
    public void setLocation(String location) {
        this.location = location;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/care/securitymonitoring/SecurityMonitoringOrderDO.java

@ -318,7 +318,7 @@ public class SecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator {
    private String serviceStatus;//服务类型 1-预约项目 2-即时项目
    private String orderInfo;//工单详情 0-未推送 1-未确认 2-已确认
    private String doctorConfirmFinishImg;
    private Integer orderSource;//工单发起来源状态 1APP 2手环 3居家报警 4监控器发起 5睡眠带
    private Integer orderSource;//工单发起来源状态 1APP 2手环 3居家报警 4监控器发起 5睡眠带 6气感报警器 7 烟感报警器
    private Integer emergencyCancel;// 紧急预警工单误报警原因 字典emergency_cancel
    private String topicItem;//安防工单所属专题 base_system_dict_entry表service_item
    private String sceneImg;//现场照片

+ 16 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/dao/device/DeviceHealthIndexDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.care.dao.device;
import com.yihu.jw.entity.care.device.DeviceHealthIndex;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/8/23
 * @Description:
 */
public interface DeviceHealthIndexDao extends PagingAndSortingRepository<DeviceHealthIndex, String>, JpaSpecificationExecutor<DeviceHealthIndex> {
}

+ 15 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/dao/device/HvDeviceRecordDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.care.dao.device;
import com.yihu.jw.entity.care.device.HvDeviceRecord;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/8/23
 * @Description:
 */
public interface HvDeviceRecordDao extends PagingAndSortingRepository<HvDeviceRecord, String>, JpaSpecificationExecutor<HvDeviceRecord> {
}

+ 16 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/dao/device/HvDeviceSosLogDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.care.dao.device;
import com.yihu.jw.entity.care.device.HvDeviceSosLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/8/23
 * @Description:
 */
public interface HvDeviceSosLogDao extends PagingAndSortingRepository<HvDeviceSosLog, String>, JpaSpecificationExecutor<HvDeviceSosLog> {
}

+ 30 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/HvDeviceController.java

@ -1,10 +1,16 @@
package com.yihu.jw.care.endpoint;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.service.HvDeviceService;
import com.yihu.jw.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@ -29,6 +35,8 @@ public class HvDeviceController {
    private static Logger logger = LoggerFactory.getLogger(HvDeviceController.class);
    @Autowired
    private HvDeviceService hvDeviceService;
    /**
     * 消息订阅
@ -48,6 +56,15 @@ public class HvDeviceController {
            HttpServletRequest request) {
        try {
            String str = getRequestBodyData(request);
            if(!StringUtil.isBlank(str)){
                JSONObject json = JSON.parseObject(str);
                JSONObject fps = json.getJSONObject("fps");
                JSONArray msgList = fps.getJSONArray("msgList");
                for(int i=0;i<msgList.size();i++){
                    JSONObject jsonObject = msgList.getJSONObject(i);
                    hvDeviceService.messageNotification(jsonObject);
                }
            }
            logger.info("======================:"+str);
            return success();
        } catch (Exception e) {
@ -56,6 +73,19 @@ public class HvDeviceController {
        }
    }
    @ApiOperation("同步设备")
    @RequestMapping(value = "synDevice",method = {RequestMethod.POST})
    public String synDevice() {
        try {
            hvDeviceService.synDevice();
            return success();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"Device data incoming failure");
        }
    }
    /**
     * 获取request中body数据
     */

+ 175 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/HvDeviceService.java

@ -0,0 +1,175 @@
package com.yihu.jw.care.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.device.DeviceHealthIndexDao;
import com.yihu.jw.care.dao.device.HvDeviceRecordDao;
import com.yihu.jw.care.dao.device.HvDeviceSosLogDao;
import com.yihu.jw.care.util.ArtemisPostTest;
import com.yihu.jw.entity.care.device.DeviceHealthIndex;
import com.yihu.jw.entity.care.device.HvDeviceRecord;
import com.yihu.jw.entity.care.device.HvDeviceSosLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/8/23
 * @Description:
 */
@Service
public class HvDeviceService {
    private static Logger logger = LoggerFactory.getLogger(HvDeviceService.class);
    @Autowired
    private DeviceHealthIndexDao deviceHealthIndexDao;
    @Autowired
    private YsDeviceService ysDeviceService;
    @Autowired
    private HvDeviceSosLogDao hvdeviceSosLogDao;
    @Autowired
    private HvDeviceRecordDao hvdeviceRecordDao;
    /**
     * 消息通知接收
     * @param json
     */
    public void messageNotification(JSONObject json){
        String msgType = json.getString("msgType");
        JSONObject body = json.getJSONObject("body");
        if("980008".equals(msgType)){
            message980008(body);
            return;
        }
        if ("980002".equals(msgType)){
            message980002(body);
            return;
        }
    }
    /**
     * 报警实时信息
     * @param json
     */
    public void message980002(JSONObject json){
        JSONArray data = json.getJSONArray("data");
        List<HvDeviceSosLog> list = new ArrayList<>();
        for (int i=0;i<data.size();i++){
            JSONObject jsonObject = data.getJSONObject(i);
            String resourceSerial = jsonObject.getString("resourceSerial");
            String deviceType = jsonObject.getString("deviceType");
            Integer alarmNum = jsonObject.getInteger("alarmNum");
            String resourceID = jsonObject.getString("resourceID");
            String location = jsonObject.getString("location");
            String resourceType = jsonObject.getString("resourceType");
            String alarmID = jsonObject.getString("alarmID");
            String systemType = jsonObject.getString("systemType");
            String alarmType = jsonObject.getString("alarmType");
            String monitorValue = jsonObject.getString("monitorValue");
            String resourceName = jsonObject.getString("resourceName");
            String alarmTime = jsonObject.getString("alarmTime");
            HvDeviceSosLog log = new HvDeviceSosLog();
            log.setAlarmID(alarmID);
            log.setAlarmNum(alarmNum);
            log.setAlarmTime(alarmTime);
            log.setAlarmType(alarmType);
            log.setLocation(location);
            log.setMonitorValue(monitorValue);
            log.setResourceID(resourceID);
            log.setResourceName(resourceName);
            log.setResourceSerial(resourceSerial);
            log.setResourceType(resourceType);
            log.setSystemType(systemType);
            list.add(log);
            if(alarmNum>1){
                continue;
            }
            if("600006".equals(deviceType)){
                //独立式可燃气体探测器(NB)
                ysDeviceService.createOrder(resourceSerial,null,new JSONObject(),6,"11");
            }
            if("600002".equals(deviceType)){
                //独立式光电感烟探测器(NB)
                ysDeviceService.createOrder(resourceSerial,null,new JSONObject(),7,"10");
            }
        }
        if(list.size()>0){
            hvdeviceSosLogDao.save(list);
        }
    }
    /**
     * 监测实时信息
     */
    public void message980008(JSONObject json){
        JSONArray data = json.getJSONArray("data");
        List<DeviceHealthIndex> list = new ArrayList<>();
        for (int i=0;i<data.size();i++){
            JSONObject jsonObject = data.getJSONObject(i);
            String resourceSerial = jsonObject.getString("resourceSerial");
            String monitorType = jsonObject.getString("monitorType");
            String resourceType = jsonObject.getString("resourceType");
            String monitorUnit = jsonObject.getString("monitorUnit");
            String monitorValue = jsonObject.getString("monitorValue");
            String happenTime = jsonObject.getString("happenTime");
            DeviceHealthIndex index = new DeviceHealthIndex();
            index.setDeviceSn(resourceSerial);
            index.setUnit(monitorUnit);
            index.setValue(monitorValue);
            index.setRecordTime(happenTime);
            if("600006".equals(resourceType)&&"400003".equals(monitorType)){
                //独立式可燃气体探测器(NB)
                index.setDeviceType("1");
                list.add(index);
            }
            if("600002".equals(resourceType)&&"400013".equals(monitorType)){
                //独立式光电感烟探测器(NB)
                index.setDeviceType("2");
                list.add(index);
            }
        }
        if(list.size()>0){
            deviceHealthIndexDao.save(list);
        }
    }
    /**
     * 同步设备
     */
    public void synDevice(){
        String res = ArtemisPostTest.getDevice();
        JSONObject jsonObject = JSON.parseObject(res);
        if("0".equals(jsonObject.getString("code"))){
            List<HvDeviceRecord> deviceRecordList = new ArrayList<>();
            JSONArray list = jsonObject.getJSONObject("data").getJSONArray("list");
            for (int i=0;i<list.size();i++){
                JSONObject json = list.getJSONObject(i);
                String deviceID = json.getString("deviceID");
                String deviceSerial = json.getString("deviceSerial");
                HvDeviceRecord record = new HvDeviceRecord();
                record.setDeviceSn(deviceSerial);
                record.setDeviceId(deviceID);
                deviceRecordList.add(record);
            }
            if(deviceRecordList.size()>0){
                hvdeviceRecordDao.deleteAll();;
                hvdeviceRecordDao.save(deviceRecordList);
            }
        }
    }
}

+ 68 - 60
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/YsDeviceService.java

@ -1,9 +1,7 @@
package com.yihu.jw.care.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.fastdfs.FastDFSUtil;
import com.yihu.jw.care.config.YsConfig;
@ -17,16 +15,8 @@ import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.encode.Base64;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.csource.common.MyException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -44,7 +34,6 @@ import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.Charset;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.util.HashMap;
@ -148,66 +137,85 @@ public class YsDeviceService {
                }
            }
            if (fallFlag){//发起安防工单
                String lat = "";
                String lon = "";
                List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByDeviceSn(deviceSN);
                if (devicePatientDeviceDos.size()>0){
                    DevicePatientDevice deviceDO = devicePatientDeviceDos.get(0);
                    Map<String, String> json = null;
                    if (org.apache.commons.lang.StringUtils.isNotBlank(deviceDO.getSosAddress())) {
                        json = LatitudeUtils.getGeocoderLatitude(deviceDO.getSosAddress().replace("G.", "").replace("(糖友网)", "").replace("(高友网)", ""));
                    }
                    if (json != null) {
                        lat = json.get("lat").toString();
                        lon = json.get("lng").toString();
                    }
                result = createOrder(deviceSN,sceneUrl,result,4,"2");
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
        //https://www.yuque.com/u1400669/kb/mlqrm2
        //https://www.yuque.com/u1400669/kb/div5py
    }
                    BasePatientDO patientDO = patientDao.findById(deviceDO.getUser());
                    String  url = cloudCareUrl+"/cloudCare/noLogin/security/createOrder";
                    Map map = new HashMap<String, String>();
                    map = new HashMap();
                    String sql ="select DISTINCT item.org_code,item.org_name\n" +
                            " from base_service_package_sign_record sr,base_service_package_record pr,base_service_package_item item ,base_service_package pack\n" +
                            "where pr.patient = '"+patientDO.getId()+"' and sr.id = pr.sign_id and pr.service_package_id = item.service_package_id \tand  item.`code`='preventFall'  and item.service_package_id = pack.id \n" +
                            "  and pack.del=1";
                    List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql);
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("patient",patientDO.getId());
                    jsonObject.put("patientName",patientDO.getName());
                    jsonObject.put("patientPhone",patientDO.getMobile());
                    jsonObject.put("serveDesc","疑似跌倒");
                    jsonObject.put("hospital",sqlResult.get(0).get("org_code"));
                    jsonObject.put("serveAddress",deviceDO.getSosAddress());
                    jsonObject.put("serveLat",lat);
                    jsonObject.put("serveLon",lon);
                    jsonObject.put("topicItem","preventFall");
                    jsonObject.put("deviceSn",deviceSN);
                    if (StringUtils.isNotBlank(sceneUrl)){
                        jsonObject.put("sceneImg",sceneUrl);
                    }
                    JSONObject jsonObjectParam = new JSONObject();
                    jsonObjectParam.put("order", jsonObject);
                    map.put("jsonData", jsonObjectParam.toJSONString());
                    map.put("orderSource", 4);
                    map.put("warnStr", "疑似跌倒");
    public JSONObject createOrder(String deviceSN,String sceneUrl,JSONObject result,Integer orderSource,String dictCode){
        try {
            String lat = "";
            String lon = "";
            List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByDeviceSn(deviceSN);
            if (devicePatientDeviceDos.size()>0){
                DevicePatientDevice deviceDO = devicePatientDeviceDos.get(0);
                Map<String, String> json = null;
                if (org.apache.commons.lang.StringUtils.isNotBlank(deviceDO.getSosAddress())) {
                    json = LatitudeUtils.getGeocoderLatitude(deviceDO.getSosAddress().replace("G.", "").replace("(糖友网)", "").replace("(高友网)", ""));
                }
                if (json != null) {
                    lat = json.get("lat").toString();
                    lon = json.get("lng").toString();
                }
                BasePatientDO patientDO = patientDao.findById(deviceDO.getUser());
                String  url = cloudCareUrl+"/cloudCare/noLogin/security/createOrder";
                Map map = new HashMap<String, String>();
                map = new HashMap();
                String sql ="select DISTINCT item.org_code,item.org_name\n" +
                        " from base_service_package_sign_record sr,base_service_package_record pr,base_service_package_item item ,base_service_package pack\n" +
                        "where pr.patient = '"+patientDO.getId()+"' and sr.id = pr.sign_id and pr.service_package_id = item.service_package_id \tand  item.`code`='preventFall'  and item.service_package_id = pack.id \n" +
                        "  and pack.del=1";
                List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql);
                String serveDesc = "";
                String sqlDesc = "SELECT dict_value from wlyy_hospital_sys_dict WHERE dict_code = '2' and dict_name = 'security_server_dict'";
                List<Map<String,Object>> listTmp = jdbcTemplate.queryForList(sqlDesc);
                if (listTmp!=null&&listTmp.size()>0){
                    serveDesc = listTmp.get(0).get("dict_value")+"";
                }
                    String content = com.alibaba.fastjson.JSONObject.toJSONString(map);
                    String postParams = AesEncryptUtils.agEncrypt(content);
                    String response = httpClientUtil.postBodyRawForm(url,postParams);
                    result = com.alibaba.fastjson.JSONObject.parseObject(response);
                    JSONObject jsonObjectData =JSONObject.parseObject(AesEncryptUtils.agDecrypt(result.getString("data")));
                    System.out.println(jsonObjectData.toJSONString());
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("patient",patientDO.getId());
                jsonObject.put("patientName",patientDO.getName());
                jsonObject.put("patientPhone",patientDO.getMobile());
                jsonObject.put("serveDesc",serveDesc);
                jsonObject.put("hospital",sqlResult.get(0).get("org_code"));
                jsonObject.put("serveAddress",deviceDO.getSosAddress());
                jsonObject.put("serveLat",lat);
                jsonObject.put("serveLon",lon);
                jsonObject.put("topicItem","preventFall");
                jsonObject.put("deviceSn",deviceSN);
                if (StringUtils.isNotBlank(sceneUrl)){
                    jsonObject.put("sceneImg",sceneUrl);
                }
                JSONObject jsonObjectParam = new JSONObject();
                jsonObjectParam.put("order", jsonObject);
                map.put("jsonData", jsonObjectParam.toJSONString());
                map.put("orderSource", orderSource);
                map.put("warnStr", serveDesc);
                String content = com.alibaba.fastjson.JSONObject.toJSONString(map);
                String postParams = AesEncryptUtils.agEncrypt(content);
                String response = httpClientUtil.postBodyRawForm(url,postParams);
                result = com.alibaba.fastjson.JSONObject.parseObject(response);
                JSONObject jsonObjectData =JSONObject.parseObject(AesEncryptUtils.agDecrypt(result.getString("data")));
                System.out.println(jsonObjectData.toJSONString());
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
        //https://www.yuque.com/u1400669/kb/mlqrm2
        //https://www.yuque.com/u1400669/kb/div5py
    }
    /**
     * 消息解密
     * @param sSrc

+ 45 - 2
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/util/ArtemisPostTest.java

@ -158,7 +158,7 @@ public class ArtemisPostTest {
	/**
	 * 设备监测信息查询
     */
	 */
	public static void getMonitor(){
		String url = "/api/firepro/v1/getMonitor";
		JSONObject jsonBody = new JSONObject();
@ -171,6 +171,48 @@ public class ArtemisPostTest {
		System.out.println("StringeResult结果示例: "+StringeResult);
	}
	/**
	 * 获取消防设备信息
	 */
	public static String getDevice(){
		String url = "/api/firepro/v1/getDevice";
		JSONObject jsonBody = new JSONObject();
		jsonBody.put("pageNo", 1);
		jsonBody.put("pageSize", 500);
		jsonBody.put("flagId", "");
		jsonBody.put("offset", 0);
		String body = jsonBody.toJSONString();
		String StringeResult = callPostStringApi(url,body);
		return StringeResult;
	}
	/**
	 * 消防设备添加
	 *
	 * 设备名称	deviceName	String	true	设备名称
	 设备序列号	deviceSerial	String	true	设备序列号
	 设备型号	deviceModel	String	true	设备型号,详见字典表
	 800022	NP-FY200-N 烟
	 800056 JT-HK400-N 气
	 设备类型	deviceType	Number	true	设备类型,详见字典表
	 600002	独立式光电感烟探测器(NB)
	 600006	独立式可燃气体探测器(NB)
	 通讯类型	communicationType	Number	true	通讯类型,详见字典表
	 900004	NB移动
	 */
	public static void addDevice(String deviceName,String deviceSerial,String deviceModel,String deviceType){
		String url = "/api/bws/device/v1/add";
		JSONObject jsonBody = new JSONObject();
		jsonBody.put("deviceName", deviceName);
		jsonBody.put("deviceSerial", deviceSerial);
		jsonBody.put("deviceModel", deviceModel);
		jsonBody.put("deviceType", deviceType);
		jsonBody.put("communicationType", "900004");
		String body = jsonBody.toJSONString();
		String StringeResult = callPostStringApi(url,body);
		System.out.println("StringeResult结果示例: "+StringeResult);
	}
	/**
	 * 查询订阅
	 */
@ -194,7 +236,8 @@ public class ArtemisPostTest {
//		System.out.println("StringeResult结果示例: "+StringeResult);
//		callPostImgStringApi();
		getMonitor();
		getDevice();
//		getMonitor();
//		subscription_info("980001");
//		subscription_info("980002");
//		subscription_info("980003");