Przeglądaj źródła

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

Conflicts:
	svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java
yeshijie 4 lat temu
rodzic
commit
31f00e3126

+ 44 - 4
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -13,19 +13,16 @@ import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import iot.device.LocationDataVO;
import jxl.demo.Write;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -620,6 +617,49 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
        }
    }
    /**
     * 根据患者标志获取健康指标
     * @param idcard 患者指标
     * @param type 健康指标类型(1血糖,2血压,3体重,4腰围)
     * @return 操作结果
     */
    @RequestMapping(value = "health_index/listByIdcard",method = RequestMethod.POST)
    @ApiOperation("根据患者标志获取健康指标")
    public String getHealthIndexByIdcard(@ApiParam(name="idcard",value="居民身份证",defaultValue = "P20160901001")
                                         @RequestParam(value="idcard",required = true) String idcard,
                                         @ApiParam(name="type",value="指标类型",defaultValue = "1")
                                         @RequestParam(value="type",required = true) int type,
                                         @ApiParam(name="begin",value="开始时间",defaultValue = "2016-07-23 00:00:00")
                                         @RequestParam(value="begin",required = true) String begin,
                                         @ApiParam(name="end",value="开始时间",defaultValue = "2016-08-23 00:00:00")
                                         @RequestParam(value="end",required = true) String end,
                                         @ApiParam(name="page",value="第几页",defaultValue = "1")
                                         @RequestParam(value="page",required = true) int page,
                                         @ApiParam(name="pagesize",value="每页几行",defaultValue = "10")
                                         @RequestParam(value="pagesize",required = true) int pagesize,HttpServletRequest request) {
        try {
            return monitorPlatformService.getHealthIndexByIdcard(idcard, type, begin, end, page, pagesize,request);
        } catch (Exception ex) {
            ex.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    /**
     * 获取居民信息
     */
    @RequestMapping(value = "patientInfo",method = RequestMethod.GET)
    @ApiOperation("获取居民信息")
    public String patientInfo(@ApiParam(name="idcard",value="居民身份证",defaultValue = "P20160901001")
                              @RequestParam(value="idcard",required = true) String idcard) {
        try {
            return monitorPlatformService.patientInfo(idcard);
        } catch (Exception ex) {
            ex.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    /**
     * 返回接口处理结果
     *

+ 45 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -9,6 +9,7 @@ import com.yihu.iot.service.common.MyJdbcTemplate;
import com.yihu.iot.service.device.IotPatientDeviceService;
import com.yihu.iot.service.equipment.IotEqtDetailService;
import com.yihu.iot.service.label.FigureLabelSerachService;
import com.yihu.iot.service.platform.IotInterfaceLogService;
import com.yihu.iot.util.excel.HibenateUtils;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
@ -26,6 +27,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.*;
@ -64,6 +66,8 @@ public class MonitorPlatformService  {
    private HibenateUtils hibenateUtils;
    @Autowired
    private IotSystemDictDao iotSystemDictDao;
    @Autowired
    private IotInterfaceLogService iotInterfaceLogService;
    /**
     * 获取位置信息
@ -398,6 +402,47 @@ public class MonitorPlatformService  {
        return sendGet(url,params);
    }
    /**
     * 根据患者标志获取健康指标
     * @param idcard
     * @param type
     * @param begin
     * @param end
     * @param page
     * @param pagesize
     * @return
     */
    public String getHealthIndexByIdcard(String idcard,int type, String begin,String end, int page,int pagesize,HttpServletRequest request) {
        String url = "/wlyygc/iot_monitoring/health_index/listByIdcard";
        Map<String, Object> params = new HashMap<>();
        params.put("idcard",idcard);
        params.put("begin",begin);
        params.put("end",end);
        params.put("type",type);
        params.put("page",page);
        params.put("pagesize",pagesize);
        try{
            //记录log
            iotInterfaceLogService.saveLog("zy808081724b116c017254d437fe000b",JSONObject.toJSONString(params),null, request,200,"getHealthIndexByIdcard");
        }catch (Exception e){
            e.printStackTrace();
        }
        return sendGet(url,params);
    }
    /**
     * 获取居民信息
     * @param idcard
     * @return
     */
    public String patientInfo(String idcard) {
        String url = "/wlyygc/iot_monitoring/patientInfo";
        Map<String, Object> params = new HashMap<>();
        params.put("idcard",idcard);
        return sendGet(url,params);
    }
    /**
     * 质控情况