瀏覽代碼

Merge branch 'dev' of yeshijie/patient-co-management into dev

yeshijie 7 年之前
父節點
當前提交
9e8f877742

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp

@ -138,7 +138,7 @@
							<sec:authorize url="/admin/static/pay/initial">
								<li><a href="javascript:locationMenu('staticPay');">支付统计报表</a></li>
							</sec:authorize>
							<sec:authorize url="/admin/static/static/center">
							<sec:authorize url="/admin/static/center">
						</ul>
					</div>
				</div>

文件差異過大導致無法顯示
+ 1 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java


+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml

@ -105,7 +105,7 @@ activemq:
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test
    healtHarticleQueue: healthArticleChannel_devtest
  consumers:
    count: 10 #消费者集群数

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/resources/application-test.yml

@ -110,7 +110,7 @@ activemq:
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送
  consumers:
    count: 10 #消费者集群数

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -175,6 +175,7 @@ public class SwaggerConfig {
                        regex("/wechat/.*"),
                        regex("/nofilter/.*"),
                        regex("/idc10/.*"),
                        regex("/iot/.*"),
                        regex("/im_new/.*"),
                        regex("/dataHandling/.*"),
                        regex("/version/.*"),

+ 82 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/iot/IotDeviceService.java

@ -0,0 +1,82 @@
package com.yihu.wlyy.service.third.iot;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * 物联网设备对接
 * @author yeshijie on 2018/1/3.
 */
@Service
public class IotDeviceService {
//    @Value("${}")
    private String baseUrl = "https://iot.xmtyw.cn/";
    private String grantType = "client_credentials&";
    private String clientId = "Va5yQRHlA4Fq4eR3LT0vuXV4&";
    private String clientSecret = "0rDSjzQ20XUj5itV7WRtznPQSzr5pVw2";
    @Autowired
    private HttpClientUtil httpClientUtil;
    private String accessToken = "";
    public String getAccessToken(){
        String url = baseUrl+"/oauth/2.0/token";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("grant_type",grantType));
        params.add(new BasicNameValuePair("client_id",clientId));
        params.add(new BasicNameValuePair("client_secret",clientSecret));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
    }
    /**
     * 设备注册及绑定
     * @return
     */
    public String registedevice(JSONObject json){
        json.put("access_token",accessToken);
        String url = baseUrl+"/registedevice";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("json",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
    }
    /**
     * 数据上传
     * @param json
     * @return
     */
    public String upload(JSONObject json){
        json.put("access_token",accessToken);
        String url = baseUrl+"/upload";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("json",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
    }
    /**
     * 查询
     * @param json
     * @return
     */
    public String search(JSONObject json){
        json.put("access_token",accessToken);
        String url = baseUrl+"/upload";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("json",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
    }
}

+ 9 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.wlyy.service.app.health.HealthEduArticleLabelService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.web.BaseController;
@ -39,6 +40,8 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    private String esIndex;
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    @Autowired
    private HealthEduArticleLabelService healthEduArticleLabelService;
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加、编辑文章")
@ -137,8 +140,12 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize,sEcho,roleType);
            
            
            if(StringUtils.isNotBlank(articleTitle)){
                //记录搜索记录
                healthEduArticleLabelService.saveOrUpdateLabel(articleTitle,getUID());
            }
            //判断文章列表是否有推送过该居民
            if(StringUtils.isNotBlank(patient)){
                com.alibaba.fastjson.JSONArray pushresponse = jmJkEduArticleService.pushArticleLogs(0,0,patient,"");

+ 112 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/iot/IotDeviceController.java

@ -0,0 +1,112 @@
package com.yihu.wlyy.web.third.iot;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.third.iot.IotDeviceService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author yeshijie on 2018/1/3.
 */
@RestController
@RequestMapping(value = "/iot",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "物联网测试类")
public class IotDeviceController extends BaseController{
    @Autowired
    private IotDeviceService iotDeviceService;
    @RequestMapping(value = "/registedevice",method = RequestMethod.POST)
    @ApiOperation("注册设备")
    public String registedevice(){
        try {
            JSONObject json = new JSONObject();
            JSONObject js = new JSONObject();
            js.put("sn","2638234828");
            js.put("ext_code","1");
            js.put("device_name","血压计-康为A206G");
            js.put("device_model","血压计-康为A206G");
            js.put("idcard","350429198905194016");
            js.put("username","邹林");
            js.put("manufacture_code","");
            js.put("manufacture_name","");
            js.put("owner_org_code","");
            js.put("owner_org_name","");
            js.put("sale_org_code","");
            js.put("sale_org_name","");
            js.put("manufacture_tel","");
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(js);
            json.put("data",jsonArray);
            String re = iotDeviceService.registedevice(json);
            return write(200, "注册设备成功!", "data", re);
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/upload1",method = RequestMethod.POST)
    @ApiOperation("不含居民身份的数据上传协议")
    public String upload1(){
        try {
            JSONObject json = new JSONObject();
            JSONObject js = new JSONObject();
            js.put("measure_time","2018-01-01 01:01:01");
            js.put("systolic","111");
            js.put("diastolic","60");
            js.put("pulse","66");
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(js);
            json.put("data",jsonArray);
            json.put("sn","2638234828");
            json.put("ext_code","1");
            json.put("device_name","血压计-康为A206G");
            json.put("device_model","血压计-康为A206G");
            String re = iotDeviceService.upload(json);
            return write(200, "注册设备成功!", "data", re);
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/upload2",method = RequestMethod.POST)
    @ApiOperation("不含居民身份的数据上传协议")
    public String upload2(){
        try {
            JSONObject json = new JSONObject();
            JSONObject js = new JSONObject();
            js.put("measure_time","2018-01-01 11:01:01");
            js.put("blood_sugar","6.7");
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(js);
            json.put("data",jsonArray);
            json.put("data",jsonArray);
            json.put("sn","2638234828");
            json.put("ext_code","1");
            json.put("device_name","血压计-康为A206G");
            json.put("device_model","血压计-康为A206G");
            json.put("idcard","350429198905194016");
            json.put("username","邹林");
            String re = iotDeviceService.upload(json);
            return write(200, "注册设备成功!", "data", re);
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

+ 3 - 3
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -105,11 +105,11 @@ pushMes:
  redis_prescription_title: redisMessage
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test3
    HealthEduArticlePatient: health_edu_article_patient_test6
    FollowUp: wlyy_followup
    Statistics: wlyy_quota_test
  type:
    HealthEduArticlePatient: health_edu_article_patient_test3
    HealthEduArticlePatient: health_edu_article_patient_test6
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
  host:  http://172.19.103.68:9200
@ -129,7 +129,7 @@ activemq:
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang: