Explorar el Código

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

yeshijie hace 7 años
padre
commit
2670125e36

+ 66 - 8
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/ArchivesController.java

@ -8,16 +8,14 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
/**
 * 智业服务接口
 * */
@Controller
@RestController
@RequestMapping(value = "/third/archives/")
@Api(description = "智业档案服务接口")
public class ArchivesController {
@ -28,7 +26,6 @@ public class ArchivesController {
	/********************************* 居民档案相关接口 ****************************************************************/
	@RequestMapping(value = "getEhrSickMedicalList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("查询居民健康体检列表信息接口")
	public Result getEhrSickMedicalList(
			@ApiParam(name="idcard",value="患者身份证",defaultValue = "350821201112240026")
@ -49,7 +46,6 @@ public class ArchivesController {
	}
	@RequestMapping(value = "getEhrSickMedicalRecord",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("查询居民健康体检详情接口")
	public Result getEhrSickMedicalRecord(
			@ApiParam(name="medicalNo",value="体检ID",defaultValue = "")
@ -70,7 +66,6 @@ public class ArchivesController {
	}
	@RequestMapping(value = "uploadFollowup",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("上传随访记录接口")
	public Result uploadFollowup(@ApiParam(name="id",value="随访记录id",defaultValue = "4")
								  @RequestParam(value="id",required = true) Long id){
@ -90,7 +85,6 @@ public class ArchivesController {
	}
	@RequestMapping(value = "uploadHealthIndex",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("上传体征指标接口")
	public Result uploadHealthIndex(@ApiParam(name="id",value="体征记录id",defaultValue = "5226")
									 @RequestParam(value="id",required = true) Long id){
@ -108,4 +102,68 @@ public class ArchivesController {
			}
		}
	}
	/*****************************************自助建档***************************************************/
	@RequestMapping(value = "getSickArchiveFlag",method = RequestMethod.POST)
	@ApiOperation("查询居民是否有建立健康档案接口")
	public Result getSickArchiveFlag(
			@ApiParam(name="idcard",value="身份证号",defaultValue = "")
			@RequestParam(value="idcard",required = true) String idcard){
		try {
			String response = archivesService.getSickArchiveFlag(idcard);
			return Result.success("查询居民是否有建立健康档案接口成功!",response);
		} catch (Exception ex) {
			if(ex instanceof ApiException)
			{
				ApiException apiEx = (ApiException) ex;
				return Result.error(apiEx.errorCode(),ex.getMessage());
			}
			else{
				return Result.error(ex.getMessage());
			}
		}
	}
	@RequestMapping(value = "getSickArchiveRecord",method = RequestMethod.POST)
	@ApiOperation("查询居民健康档案信息接口")
	public Result getSickArchiveRecord(
			@ApiParam(name="idcard",value="身份证号",defaultValue = "")
			@RequestParam(value="idcard",required = true) String idcard){
		try {
			String response = archivesService.getSickArchiveRecord(idcard);
			return Result.success("查询居民健康档案信息接口!",response);
		} catch (Exception ex) {
			if(ex instanceof ApiException)
			{
				ApiException apiEx = (ApiException) ex;
				return Result.error(apiEx.errorCode(),ex.getMessage());
			}
			else{
				return Result.error(ex.getMessage());
			}
		}
	}
	@RequestMapping(value = "saveSickArchiveRecord",method = RequestMethod.POST)
	@ApiOperation("上传居民档案建档信息接口")
	public Result saveSickArchiveRecord(@ApiParam(name="json",value="居民建档信息",defaultValue = "")
										@RequestParam(value="json",required = true) String json,
										@ApiParam(name="doctor",value="医生code",defaultValue = "")
										@RequestParam(value="doctor",required = true) String doctor){
		try {
			String response = archivesService.saveSickArchiveRecord(json,doctor);
			return Result.success("上传居民档案建档信息接口!",response);
		} catch (Exception ex) {
			if(ex instanceof ApiException)
			{
				ApiException apiEx = (ApiException) ex;
				return Result.error(apiEx.errorCode(),ex.getMessage());
			}
			else{
				return Result.error(ex.getMessage());
			}
		}
	}
}

+ 18 - 1
patient-co-service/wlyy_service/src/main/resources/application.yml

@ -75,10 +75,27 @@ im:
  data_base_name: im_new
---
spring:
  profiles: test
  profiles: devtest
  datasource:
#    url: jdbc:mysql://172.17.110.160:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    url: jdbc:mysql://172.19.103.85:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    username: linzhou
    password: linzhou
    driverClassName: com.mysql.jdbc.Driver
    maxTotal: 500
    maxIdle: 30
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
im:
  data_base_name: im_new
---
spring:
  profiles: test
  datasource:
    url: jdbc:mysql://172.17.110.160:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    username: ssgg
    password: ssgg
    driverClassName: com.mysql.jdbc.Driver

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -788,6 +788,10 @@ public class ConsultTeamService extends ConsultService {
    public int addTeamConsult(ConsultTeam ct, String patient,String agent) throws Exception {
        synchronized (patient.intern()){//新增同步块,防止居民网络不好时多次点击,或者im服务器响应慢导致同时发起多个咨询
            if (exist(patient, ct.getType())) {//判断是否有未结束的咨询移到同步方法中
                return -3;
            }
            JSONObject users = new JSONObject();
            if(patient.equals(agent)){

+ 63 - 33
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/fzzb/HealthEducationArticleService.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.service.third.fzzb;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.repository.doctor.DoctorDao;
@ -81,9 +82,9 @@ public class HealthEducationArticleService extends BaseService{
     * @param userId 是    当前用户ID
     * @return
     */
    public String getDoctorArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize,String userId){
        String response = "";
    public JSONArray getDoctorArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize,String userId) throws Exception{
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("articleTitle",articleTitle);
@ -92,13 +93,18 @@ public class HealthEducationArticleService extends BaseService{
            param.put("pageIndex",pageIndex);
            param.put("pageSize",pageSize);
            param.put("userId",userId);
            response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalList,param.toString(),"1"));
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalList,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            return re;
        }
        if("10000".equals(json.getString("Code"))){
            return json.getJSONArray("Result");
        }else {
            throw new Exception(json.getString("Message"));
        }
        return response;
    }
    /**
@ -106,18 +112,24 @@ public class HealthEducationArticleService extends BaseService{
     * @param articleId 文章id
     * @return
     */
    public String getArticalById(String articleId){
        String response = "";
    public JSONObject getArticalById(String articleId) throws Exception{
        JSONObject re = new JSONObject();
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("articleId",articleId);
            response = httpClientUtil.httpPost(baseUrl,getParamsMap(getArticalById,param.toString(),"1"));
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getArticalById,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            return re;
        }
        if("10000".equals(json.getString("Code"))){
            return json.getJSONObject("Result");
        }else {
            throw new Exception(json.getString("Message"));
        }
        return response;
    }
    /**
@ -131,8 +143,10 @@ public class HealthEducationArticleService extends BaseService{
     * @param userType 是    1 医生 2 居民
     * @return
     */
    public String getCollectionArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize,String userId,Integer userType){
        String response = "";
    public JSONArray getCollectionArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId,
                                              Integer pageIndex, Integer pageSize,String userId,Integer userType) throws Exception{
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("articleTitle",articleTitle);
@ -143,12 +157,18 @@ public class HealthEducationArticleService extends BaseService{
            param.put("userId",userId);
            param.put("userType",userType);
            response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCollectionArticalList,param.toString(),"1"));
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCollectionArticalList,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            return re;
        }
        if("10000".equals(json.getString("Code"))){
            return json.getJSONObject("Result").getJSONArray("result");
        }else {
            throw new Exception(json.getString("Message"));
        }
        return response;
    }
@ -157,22 +177,25 @@ public class HealthEducationArticleService extends BaseService{
     * @param categoryLevel 是    获取类别:1、一级类别 2、二级类别
     * @return
     */
    public String getCategoryList(String categoryLevel) throws Exception{
        String response = "";
    public JSONArray getCategoryList(String categoryLevel) throws Exception{
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("categoryLevel",categoryLevel);
            response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCategoryList,param.toString(),"1"));
            JSONObject json = JSON.parseObject(response);
            if("10000".equals(json.getString(""))){
            }
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCategoryList,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            return re;
        }
        if("10000".equals(json.getString("Code"))){
            return json.getJSONObject("Result").getJSONArray("result");
        }else {
            throw new Exception(json.getString("Message"));
        }
        return response;
    }
    /**
@ -242,9 +265,10 @@ public class HealthEducationArticleService extends BaseService{
     * @param userId 是    当前用户ID
     * @return
     */
    public String getDoctorArticalByUserId(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize,String userId){
        String response = "";
    public JSONArray getDoctorArticalByUserId(String articleTitle, Integer articleState, String firstLevelCategoryId,
                                              Integer pageIndex, Integer pageSize,String userId) throws Exception{
        JSONArray re = new JSONArray();
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("articleTitle",articleTitle);
@ -254,12 +278,18 @@ public class HealthEducationArticleService extends BaseService{
            param.put("pageSize",pageSize);
            param.put("userId",userId);
            response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalByUserId,param.toString(),"1"));
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalByUserId,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            return re;
        }
        if("10000".equals(json.getString("Code"))){
            return json.getJSONObject("Result").getJSONArray("result");
        }else {
            throw new Exception(json.getString("Message"));
        }
        return response;
    }
}

+ 0 - 21
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java

@ -193,27 +193,6 @@ public class ImUtill {
        return response;
    }
    /**
     * 发送消息给IM(发送给医生的,医生会多发送医生助手微信模板消息)
     *
     * @param from        来自
     * @param contentType 1文字 2图片消息
     * @param content     内容
     */
    public String sendDoctorImMsg(String from, String fromName, String sessionId, String contentType, String content, String businessType,String sendJson) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/messages";
        JSONObject params = new JSONObject();
        params.put("sender_id", from);
        params.put("sender_name", fromName);
        params.put("content_type", contentType);
        params.put("content", content);
        params.put("session_id", sessionId);
        params.put("business_type", businessType);
        params.put("sendJson", sendJson);
        String response = HttpClientUtil.postBody(imAddr, params);
        return response;
    }
    /**
     * 更新会话状态
     *

+ 0 - 44
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/im/imController.java

@ -337,50 +337,6 @@ public class imController extends BaseController {
        }
    }
    @RequestMapping(value = "/testwx", method = RequestMethod.POST)
    @ResponseBody
    public String testwx(@ApiParam(name="doctor",value="医生code",defaultValue = "xy201703150222")
                         @RequestParam(value="doctor",required = true) String doctor){
        try {
            Doctor d = doctorDao.findByCode(doctor);
            String sessionId = "ec7572875d27446cb4f067b13a85d72a_0ee64daec62746279517ca70d307a52f_8";
            JSONObject json = new JSONObject();
            json.put("openid", "o7NFZwyjo7Wvhv2Wh0eOUoUtlUT4");
            json.put("template_id", "-dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18");
            json.put("url", "wap.baidu.com");
            JSONObject data = new JSONObject();
            JSONObject first = new JSONObject();
            first.put("value","first");
            first.put("color","#000000");
            JSONObject remark = new JSONObject();
            remark.put("value","");
            remark.put("color","#000000");
            JSONObject keyword1 = new JSONObject();
            keyword1.put("value","description");
            keyword1.put("color","#000000");
            JSONObject keyword2 = new JSONObject();
            keyword2.put("value","replyContent");
            keyword2.put("color","#000000");
            JSONObject keyword3 = new JSONObject();
            keyword3.put("value","senderName");
            keyword3.put("color","#000000");
            data.put("first",first);
            data.put("remark",remark);
            data.put("keyword1",keyword1);
            data.put("keyword2",keyword2);
            data.put("keyword3",keyword3);
            json.put("data",data);
            ImUtill.sendDoctorImMsg(doctor, d.getName(), sessionId, "1", "test", "REMAIN",json.toString());
            return success("发送成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "发送失败!");
        }
    }
    public List getMemberByDoctor(String doctor) {
        String sql = "SELECT d.photo,d.`name`,d.sex,d.`code`,d.level " +
                " from wlyy_admin_team t,wlyy_admin_team_member m,wlyy_doctor d " +

+ 8 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -616,8 +616,8 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                                       @ApiParam(name = "pageSize", value = "每页显示数 ,默认5")
                                       @RequestParam(value = "pageSize", required = false) Integer pageSize){
        try {
            String response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
//            String response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
//            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
@ -630,7 +630,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    public String getCategoryList(@ApiParam(name = "categoryLevel", value = "获取类别:1、一级类别 2、二级类别",defaultValue = "1")
                                       @RequestParam(value = "categoryLevel", required = true) String categoryLevel){
        try {
            String response = healthEducationArticleService.getCategoryList(categoryLevel);
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getCategoryList(categoryLevel);
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
@ -651,8 +651,8 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                                       @ApiParam(name = "pageSize", value = "每页显示数 ,默认5")
                                       @RequestParam(value = "pageSize", required = false) Integer pageSize){
        try {
            String response = healthEducationArticleService.getCollectionArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID(),1);
//            String response = healthEducationArticleService.getCollectionArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56",1);
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getCollectionArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID(),1);
//            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getCollectionArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56",1);
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
@ -665,7 +665,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                  @RequestParam(value = "articleId", required = true) String articleId){
        try {
            String response = healthEducationArticleService.getArticalById(articleId);
            com.alibaba.fastjson.JSONObject response = healthEducationArticleService.getArticalById(articleId);
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
@ -721,8 +721,8 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                                       @ApiParam(name = "pageSize", value = "每页显示数 ,默认5")
                                       @RequestParam(value = "pageSize", required = false) Integer pageSize){
        try {
//            String response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
            String response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
//            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();

+ 3 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -320,14 +320,7 @@ public class ConsultController extends WeixinBaseController {
            if (type != 1 && type != 2) {
                return error(-1, "无效请求!");
            }
            try {
                if (consultTeamService.exist(getRepUID(), type)) {
                    return error(-1, "还有咨询未结束,不允许再次提交咨询!");
                }
            } catch (Exception e) {
                error(e);
                return error(-1, e.getMessage());
            }
            if (StringUtils.isEmpty(images)) {
                images = fetchWxImages();
            }
@ -364,6 +357,8 @@ public class ConsultController extends WeixinBaseController {
                return error(-1, "家庭签约信息不存在或已过期,无法进行家庭医生咨询!");
            } else if (res == -2) {
                return error(-1, "家庭签约信息不存在或已过期,无法进行三师医生咨询!");
            }else if (res == -3) {
                return error(-1, "还有咨询未结束,不允许再次提交咨询!");
            }
            Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor());