Ver código fonte

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

huangwenjie 7 anos atrás
pai
commit
2b989208a0

+ 29 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -23,6 +23,7 @@ import com.yihu.wlyy.repository.specialist.SpecialDiseaseDao;
import com.yihu.wlyy.repository.specialist.TeamDiseaseRelationDao;
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.service.app.label.SignPatientLabelService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
@ -546,11 +547,18 @@ public class SpecialistService extends BaseService {
        return mes;
    }
    public String agreeSpecialistTeam(String token, String state, String relationCode, String remark, Long mesId) throws Exception {
    public String agreeSpecialistTeam(String token, String state, String relationCode, String remark, Long mesId, String labelcode, String doctorcode) throws Exception {
        Map<String, Object> param = new HashedMap();
        param.put("state", state);
        param.put("relationCode", relationCode);
        param.put("remark", remark);
        
        if(StringUtils.isNotBlank(doctorcode)){
            Doctor doctor = doctorDao.findByCode(doctorcode);
            param.put("health_assistant", doctorcode);//计管医生
            param.put("health_assistant_name", doctor.getName());//计管医生名称
        }
        HttpResponse response = HttpUtils.doPost(specialistUrl + "svr-specialist/agreeSpecialistTeam", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
@ -577,6 +585,26 @@ public class SpecialistService extends BaseService {
                //推送给居民模板消息
                pushWeiTemp(token, "0", remark, p, d);
            } else {
    
                //保存居民健康情况标签
                if(StringUtils.isNotBlank(labelcode)){
                    SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(labelcode,"8");
                    //先删除已有健康情况标签
                    signPatientLabelInfoDao.deleteByPatientAndLabelTypeAndStatus(p.getCode(),"8",1);
                    SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo();
                    signPatientLabelInfo.setLabel(signPatientLabel.getLabelCode());
                    signPatientLabelInfo.setLabelType(signPatientLabel.getLabelType());
                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName());
                    signPatientLabelInfo.setCzrq(new Date());
                    signPatientLabelInfo.setPatient(p.getCode());
                    signPatientLabelInfo.setPname(p.getName());
                    signPatientLabelInfo.setStatus(1);
                    //添加新的健康情况标签
                    signPatientLabelInfoDao.save(signPatientLabelInfo);
                    
                }
                
                
                //推送给居民模板消息
                pushWeiTemp(token, "1", "", p, d);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistController.java

@ -226,7 +226,7 @@ public class SpecialistController extends WeixinBaseController {
                                      @ApiParam(name = "doctorcode", value = "协管医生") @RequestParam(required = false) String doctorcode
                                      ) throws Exception {
        try {
            return write(200, "获取成功", "data", specialistService.agreeSpecialistTeam(getAccessToken(),state, relationCode, remark, mesId));
            return write(200, "获取成功", "data", specialistService.agreeSpecialistTeam(getAccessToken(),state, relationCode, remark, mesId,labelcode,doctorcode));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/PatientSpecialistController.java

@ -76,7 +76,7 @@ public class PatientSpecialistController extends WeixinBaseController{
    @ApiOperation(value = "医生审核")
    public String agreeSpecialistTeam(String state,String relationCode,String remark,Long mesId)throws Exception {
        try {
            return write(200, "获取成功", "data", specialistService.agreeSpecialistTeam(getAccessToken(),state, relationCode, remark, mesId));
            return write(200, "获取成功", "data", specialistService.agreeSpecialistTeam(getAccessToken(),state, relationCode, remark, mesId, labelcode, doctorcode));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");