Forráskód Böngészése

康复计划代码提交

liuwenbin 7 éve
szülő
commit
dcf4189079

+ 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, "居民签约已到期,请使用文字回复。");
                }