Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

# Conflicts:
#	patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/HopsitalServiceItemController.java
#	patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/SpecialistHospitalItemService.java
wangzhinan 7 năm trước cách đây
mục cha
commit
9449f11263

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/SpecialistHospitalItemService.java

@ -73,13 +73,13 @@ public class SpecialistHospitalItemService extends BaseService {
     */
    public List<Hospital> selectHospital(String hospitalName,Integer grade){
        List<Hospital> hospitals = new ArrayList<>();
        if (StringUtils.isNoneBlank(hospitalName) &&  grade != 0){
        if (StringUtils.isNoneBlank(hospitalName) &&  grade != null){
            String sql = "select * from dm_hospital where name like '%"+hospitalName+"%' AND grade = "+grade;
            hospitals = jdbcTemplate.query(sql,new BeanPropertyRowMapper(Hospital.class));
        } else if (StringUtils.isNoneBlank(hospitalName)){
            String sql = "select * from dm_hospital where name like '%"+hospitalName+"%'";
            hospitals = jdbcTemplate.query(sql,new BeanPropertyRowMapper(Hospital.class));
        }else if (grade != 0){
        }else if (grade != null){
            String sql = "select * from dm_hospital where grade = "+grade+"";
            hospitals = jdbcTemplate.query(sql,new BeanPropertyRowMapper(Hospital.class));
        }else {

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java

@ -154,6 +154,7 @@ public class SpecialistEvaluateSevice extends BaseService {
            message.setState(1);
            message.setCzrq(new Date());
            message.setReceiverName(receiverDoctor.getName());
            message.setReason(patientCode);
            messageDao.save(message);
        }catch (Exception e){
            e.printStackTrace();

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

@ -4,15 +4,21 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +27,8 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -42,6 +50,14 @@ public class RehabilitationManageService extends BaseService {
    private PatientDao patientDao;
    @Autowired
    private SpecialistEvaluateSevice specialistEvaluateSevice;
    @Autowired
    private WechatTemplateConfigDao templateConfigDao;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private WeiXinOpenIdUtils weiXinOpenIdUtils;
    @Autowired
    private WeiXinAccessTokenUtils accessTokenUtils;
    /************************************************************* start ************************************************************************/
    private String findRehabilitationPlanList = "/svr-specialist/findRehabilitationPlanList";//康复管理-康复计划列表
@ -484,6 +500,53 @@ public class RehabilitationManageService extends BaseService {
        //specialistUrl= "http://localhost:10051";
        HttpResponse response = HttpUtils.doPost(specialistUrl + updateNoteAndImageRehabilitationOperate, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getString("status").equals("200")){
            JSONArray array = result.getJSONArray("detailModelList");
            JSONObject object = array.getJSONObject(0);
            int evaluation = object.getInt("evaluation");
            if (evaluation == 1){
                String serviceItemId = object.getString("serviceItemId");
                String doctor = object.getString("doctorCode");
                String patient = object.getString("patientCode");
                String title = object.getString("title");
                Patient p = patientDao.findByCode(patient);
                String patientName = p.getName();
                String openId = p.getOpenid();
                WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey","fwxmpj");
                String first = templateConfig.getFirst();
                first = first.replace("key1",(patientName==null?"":patientName));
                String keyword1 = templateConfig.getKeyword1();
                JSONObject json = new JSONObject();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                json.put("keyword1", keyword1);
                json.put("keyword2", sdf.format(new Date()));
                json.put("toUser", p.getCode());
                json.put("represented",p.getCode());//被代理人
                json.put("remark", "");
                json.put("doctor",doctor);
                json.put("serviceItemId", serviceItemId);
                first = first.replace("key2",title);
                json.put("first", first);
                if(StringUtils.isNotBlank(p.getOpenid())){
                    pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 25, openId, p.getName(), json);
                }else {
                    //发送代理人
                    JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(p.getCode(), p.getOpenid());
                    if (jsonArray != null && jsonArray.length() > 0) {
                        for (int i = 0; i < jsonArray.length(); i++) {
                            JSONObject j = jsonArray.getJSONObject(i);
                            Patient member = (Patient) j.get("member");
                            JSONObject data = json;
                            data.remove("toUser");
                            data.put("toUser", member.getCode());
                            data.remove("first");
                            data.put("first", weiXinOpenIdUtils.getTitleMes(p, j.getInt("relation"), p.getName()) + first);
                            pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 25, member.getOpenid(), p.getName(), data);
                        }
                    }
                }
            }
        }
        return  result;
    }

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -850,6 +850,17 @@ public class PushMsgTask {
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }else if (type==25){
                temp.setUrl(url + "yszx/html/manyidu.html?openid=" + openid + "&serviceItemId=" + json.getString("serviceItemId") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented")+"&doctor="+json.getString("doctor"));
                temp.setTemplate_id(template_doctor_survey);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
                WechatTemplateData keyword2 = new WechatTemplateData();
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }
            temp.setData(m);