Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/jiwei/jw2.0 into dev

Conflicts:
	svr/svr-iot/src/main/resources/application.yml
yeshijie 7 years ago
parent
commit
75e96c6542

+ 3 - 1
app/app-iot-server/src/main/java/com/yihu/ehr/iot/service/third/wlyy/MonitoringHealthService.java

@ -84,7 +84,9 @@ public class MonitoringHealthService extends BaseService{
        params.put("jsonData", jsonObject.toString());
        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.PatientDevice.findLocationByIdCard, params);
        envelop = objectMapper.readValue(response.getBody(),Envelop.class);
        envelop.setTotalCount(total);
        if(envelop.getTotalCount()==0){
            envelop.setTotalCount(total);
        }
        return envelop;
    }

+ 9 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/Envelop.java

@ -113,6 +113,15 @@ public class Envelop<T> extends BaseEnvelop implements Serializable {
        return envelop;
    }
    public static Envelop getSuccess(String message, Object obj,Integer total) {
        Envelop envelop = new Envelop();
        envelop.setSuccessMsg(message);
        envelop.setObj(obj);
        envelop.setTotalCount(total);
        envelop.setStatus(200);
        return envelop;
    }
    public static Envelop getSuccessListWithPage(String message, List detailModelList, int page, int size, Long count) {
        Envelop envelop = new Envelop();
        envelop.setSuccessMsg(message);

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/device/IotPatientDeviceVO.java

@ -37,6 +37,8 @@ public class IotPatientDeviceVO extends BaseVO implements Serializable {
    private String categoryCode;
    @ApiModelProperty("地址")
    private String address;
    @ApiModelProperty("社区地址")
    private String hospitalName;
    @ApiModelProperty("病情:0绿标,1黄标,2红标")
    private Integer diseaseCondition;
@ -135,4 +137,12 @@ public class IotPatientDeviceVO extends BaseVO implements Serializable {
    public void setDiseaseCondition(Integer diseaseCondition) {
        this.diseaseCondition = diseaseCondition;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotPatientDeviceController.java

@ -201,7 +201,7 @@ public class IotPatientDeviceController extends EnvelopRestController{
                                                                     @RequestParam(value = "jsonData",required = true) String jsonData) {
        try {
            List<LocationDataVO> list = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonData);
            return Envelop.getSuccess(IotRequestMapping.Device.message_success_create,list);
            return Envelop.getSuccess(IotRequestMapping.Device.message_success_create,list,iotPatientDeviceService.getESCount(jsonData));
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());

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

@ -57,6 +57,7 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
        return iotOrderPurchaseDao.findById(id);
    }
    /**
     * 新增
     * @param iotOrderVO

+ 8 - 3
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -22,8 +22,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.naming.directory.SearchResult;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -79,7 +77,14 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,I
            Map<String, String> json = LatitudeUtils.getGeocoderLatitude(deviceVO.getAddress().replace("G.", "").replace("(糖友网)", "").replace("(高友网)", ""));
            if (json == null) {
                return;
                if(!StringUtils.isEmpty(deviceVO.getHospitalName())){
                    json = LatitudeUtils.getGeocoderLatitude(deviceVO.getHospitalName().replace("G.", "").replace("(糖友网)", "").replace("(高友网)", ""));
                    if(json==null){
                        return;
                    }
                }else {
                    return;
                }
            }
            logger.info("地址:," + deviceVO.getAddress() + "坐标" + json.toString());
            dataDTO.setLocation(Double.valueOf(json.get("lat")), Double.valueOf(json.get("lng")));