Explorar el Código

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

huangwenjie hace 7 años
padre
commit
41203391a0

+ 6 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java

@ -105,6 +105,10 @@ public class RehabilitationManageService extends BaseService {
                patientCode = json.getJSONObject(i).get("patientCode")+"";
                patient = patientDao.findByCode(patientCode);
                json.getJSONObject(i).put("photo",patient!=null?patient.getPhoto():"");
                Integer age = IdCardUtil.getAgeForIdcard(patient.getIdcard());
                String sex = IdCardUtil.getSexForIdcard_new(patient.getIdcard());
                json.getJSONObject(i).put("age",age);
                json.getJSONObject(i).put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
            }
            return result;
        }
@ -249,7 +253,7 @@ public class RehabilitationManageService extends BaseService {
     * @return
     * @throws Exception
     */
    public void saveGuidanceMessage(String messageId,String doctorCode,String content,String planDetailId) throws Exception{
    public void saveGuidanceMessage(String messageId,String doctorCode,String content,String planDetailId,Integer contentType) throws Exception{
        Doctor doctor = doctorDao.findByCode(doctorCode);
        Integer doctorType = doctor.getLevel();
        Map<String, Object> param = new HashedMap();
@ -259,6 +263,7 @@ public class RehabilitationManageService extends BaseService {
        param.put("doctorType", doctorType);
        param.put("content", content);
        param.put("planDetailId", planDetailId);
        param.put("contentType", contentType);
        HttpResponse response = HttpUtils.doPost(specialistUrl + saveGuidanceMessage, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")!=200){

+ 5 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -470,7 +470,7 @@ public class DoctorTeamGuidanceService extends BaseService {
     * @param images
     * @throws Exception
     */
    public void sendTeamGuidance(String accessToken, String dc, String patient, String content, String guidanceCode, String images, int teamId,String tzCode) throws Exception {
    public PatientHealthGuidance sendTeamGuidance(String accessToken, String dc, String patient, String content, String guidanceCode, String images, int teamId,String tzCode) throws Exception {
        String image = "";
        if (StringUtils.isNotEmpty(images)) {
            image = validateImages(images);
@ -484,7 +484,8 @@ public class DoctorTeamGuidanceService extends BaseService {
        guidance.setImages(image);
        // 保存
        if (patientHealthGuidanceService.add(guidance, accessToken,tzCode) != null) {
        PatientHealthGuidance guidance1 = patientHealthGuidanceService.add(guidance, accessToken, tzCode);
        if (guidance1 != null) {
            String sendImgs = "";
            if (StringUtils.isNotBlank(image)) {
                sendImgs = image;
@ -495,8 +496,9 @@ public class DoctorTeamGuidanceService extends BaseService {
            BusinessLogs.info(BusinessLogs.BusinessType.guidance, dc, patient, new JSONObject(guidance));
            //发送成功记录模板发送次数
            doctorTeamGuidanceTemplateDao.countSend(teamId, guidanceCode);
            return guidance1;
        }
        return null;
    }
    /**

+ 13 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthGuidanceController.java

@ -29,6 +29,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
/**
 * 医生端:健康指导控制类
 *
@ -187,13 +190,15 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
                guidance.setImages(images);
                // 保存到居民端健康指导
                if (patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) != null) {
                PatientHealthGuidance pp = patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) ;
                if (pp != null) {
                    Patient p = patientService.findByCode(patient);
                    String imcotent = "{\"title\":\"健康指导\",\"type\":2,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\"" + CommonUtil.getSubString(guidance.getContent(), 0, 30) + "\"}";
                    consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, imcotent, "4", p.getName());
                    BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
                    return success("保存成功!");
                    JSONObject resultMap = new JSONObject();
                    resultMap.put("id",pp.getId());
                    return write(200,"保存成功!","data",resultMap);
                } else {
                    return error(-1, "居民签约已到期,请使用文字回复。");
                }
@ -235,7 +240,8 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
                guidance.setImages(images);
                // 保存
                if (patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) != null) {
                PatientHealthGuidance pp = patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) ;
                if (pp != null) {
                    String sendImgs = "";
                    if (StringUtils.isNotBlank(images)) {
                        sendImgs = images;
@ -246,7 +252,9 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
                    BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
                    //发送成功记录模板发送次数
                    doctorGuidanceTempService.countSend(modelCode);
                    return success("保存成功!");
                    JSONObject resultMap = new JSONObject();
                    resultMap.put("id",pp.getId());
                    return write(200,"保存成功!","data",resultMap);
                } else {
                    return error(-1, "居民签约已到期,请使用文字回复。");
                }

+ 10 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/rehabilitation/DoctorRehabilitationManageController.java

@ -174,18 +174,23 @@ public class DoctorRehabilitationManageController extends BaseController {
    public String saveGuidanceMessage(@ApiParam(name = "messageId", value = "消息id", required = true)
                                      @RequestParam(value = "messageId", required = true)String messageId,
//                                      @ApiParam(name = "patientCode", value = "居民code", required = true)
//                                      @RequestParam(value = "patientCode", required = true)String patientCode,
//                                      @ApiParam(name = "doctorCode", value = "医生code", required = true)
//                                      @RequestParam(value = "doctorCode", required = true)String doctorCode,
//                                      @RequestParam(value = "patientCode", required = false)String patientCode,
                                      @ApiParam(name = "doctorCode", value = "医生code", required = false)
                                      @RequestParam(value = "doctorCode", required = false)String doctorCode,
//                                      @ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
//                                      @RequestParam(value = "doctorType", required = true)Integer doctorType,
                                      @ApiParam(name = "content", value = "聊天内容", required = true)
                                      @RequestParam(value = "content", required = true)String content,
                                      @ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                      @RequestParam(value = "planDetailId", required = true)String planDetailId){
                                      @RequestParam(value = "planDetailId", required = true)String planDetailId,
                                      @ApiParam(name = "contentType", value = "内容类型(1,6,8 - 文本, 2,9- 图片, 3 - 语音, 4-文章, 5,7系统消息。12-语音 18-居民名片, 19-聊天记录)", required = true)
                                      @RequestParam(value = "contentType", required = true)Integer contentType){
        try {
            rehabilitationManageService.saveGuidanceMessage(messageId,getRepUID(),content,planDetailId);
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            rehabilitationManageService.saveGuidanceMessage(messageId,doctorCode,content,planDetailId,contentType);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);

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

@ -37,8 +37,8 @@ im:
#专病配置
specialist:
  url: http://172.19.103.33:9797/svr-wlyy-specialist/
#  url: http://localhost:10051/
#  url: http://172.19.103.33:9797/svr-wlyy-specialist/
  url: http://localhost:10051/
#物联网配置
iot:
#  url: http://192.168.131.24:8088/svr-iot/
@ -49,7 +49,7 @@ healthBank:
#康复计划配置
rehabilitation:
  url: http://localhost:10055/svr-rehabilitation/
  url: http://localhost:10055/svr-wlyy-rehabilitation/
#小程序
applets: