Pārlūkot izejas kodu

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

trick9191 7 gadi atpakaļ
vecāks
revīzija
b661c237a9

+ 14 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java

@ -74,6 +74,8 @@ public class Doctor extends IdEntity {
    //=====================非hibernate字段=========================
    private String concernCode;//关注code
    private String activityPath;//活动路径
    public Double getEvaluateScore() {
        return evaluateScore;
    }
@ -449,4 +451,16 @@ public class Doctor extends IdEntity {
    public void setConcernCode(String concernCode) {
        this.concernCode = concernCode;
    }
    public static long getSerialVersionUID() {
        return serialVersionUID;
    }
    public String getActivityPath() {
        return activityPath;
    }
    public void setActivityPath(String activityPath) {
        this.activityPath = activityPath;
    }
}

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorDao.java

@ -30,6 +30,8 @@ public interface DoctorDao extends PagingAndSortingRepository<Doctor, Long>, Jpa
    @Query("select p from Doctor p where p.code = ?1")
    Doctor findByCode(String code);
    Doctor findByCodeAndDel(String code,String del);
    @Query("select d from Doctor d where d.del = 1")
    List<Doctor> findAllDoctors();

+ 8 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -38,6 +38,7 @@ import com.yihu.wlyy.task.SignUploadTask;
import com.yihu.wlyy.util.*;
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.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
@ -3954,8 +3955,8 @@ public class FamilyContractService extends BaseService {
    }
    public JSONArray getSignDoctorMessageOverDue(String patientCode) {
        JSONArray jsonArray = new JSONArray();
    public JSONObject getSignDoctorMessageOverDue(String patientCode) {
        JSONObject obj = new JSONObject();
        //找出患者的三师签约信息
        Patient patient = patientDao.findByCode(patientCode);
@ -3967,8 +3968,8 @@ public class FamilyContractService extends BaseService {
        if (jtSignFamily != null) {
            //家庭签约只找全科医生
            Doctor doctor = doctorDao.findByCode(jtSignFamily.getDoctor());
            Doctor doctorHealth = doctorDao.findByCode(jtSignFamily.getDoctorHealth());
            Doctor doctor = doctorDao.findByCodeAndDel(jtSignFamily.getDoctor(),"1");
            Doctor doctorHealth = doctorDao.findByCodeAndDel(jtSignFamily.getDoctorHealth(),"1");
            if (doctor != null) {
                JSONObject jo = new JSONObject();
                jo.put("code", doctor.getCode());
@ -3987,7 +3988,7 @@ public class FamilyContractService extends BaseService {
                    jo.put("qyDate", DateUtil.dateToStrShort(jtSignFamily.getBegin()));//签约时间
                    jo.put("endDate", DateUtil.dateToStrShort(jtSignFamily.getEnd()));//结束时间
                }
                jsonArray.put(jo);
                obj.put("doctor",jo);
            }
            if (doctorHealth != null) {
                JSONObject jo = new JSONObject();
@ -4007,10 +4008,10 @@ public class FamilyContractService extends BaseService {
                    jo.put("qyDate", DateUtil.dateToStrShort(jtSignFamily.getBegin()));//签约时间
                    jo.put("endDate", DateUtil.dateToStrShort(jtSignFamily.getEnd()));//结束时间
                }
                jsonArray.put(jo);
                obj.put("doctorHealth",jo);
            }
        }
        return jsonArray;
        return obj;
    }
    /**

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -1142,6 +1142,9 @@ public class PatientService extends TokenService {
            patientRecordLog.setPatientName(patient.getName());
            patientRecordLog.setSsc(patient.getSsc());
            patientRecordLogDao.save(patientRecordLog);
            //清登录缓存
            SystemData.patientTokens.remove(patient.getCode());
        }
        patientDao.clearOpenidByOpenid(openid);
        return "";

+ 3 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -568,6 +568,9 @@ public class SpecialistService extends BaseService {
                //推送给居民模板消息
                pushWeiTemp(token, "0", remark, p, d);
            } else {
                //推送给居民模板消息
                pushWeiTemp(token, "1", "", p, d);
                //医生同意,推送全科医生消息
                SignFamily sign = signFamilyDao.findByPatient(josn.getString("patient"));
                //判断是否有家庭医生,有家庭医生则通知家庭医生
@ -599,11 +602,7 @@ public class SpecialistService extends BaseService {
                    dataJson.put("dept", d.getDept());
                    dataJson.put("deptName", d.getDeptName());
                    message.setReason(dataJson.toString());
                    messageDao.save(message);
                    //推送给居民模板消息
                    pushWeiTemp(token, "1", "", p, d);
                }
            }
            return "1";

+ 2 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java

@ -96,13 +96,11 @@ public class FamilyContractController extends BaseController {
    @RequestMapping(value = "getSignMessageOverdue")
    @ResponseBody
    @ApiOperation("")
    @ApiOperation("获取签约过期全科医生过期信息")
    public String getSignDoctorMessageOverDue(String patientCode) {
        try {
            JSONArray array = familyContractService.getSignDoctorMessageOverDue(patientCode);
            return write(200, "获取列表成功!", "list", array);
            return write(200, "获取列表成功!", "list", familyContractService.getSignDoctorMessageOverDue(patientCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取列表失败!");

+ 35 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -1,7 +1,9 @@
package com.yihu.wlyy.wechat.process;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.SystemConf;
@ -22,7 +24,7 @@ import java.util.*;
/**
 * 微信事件处理
 * <p>
 * Created by lyr on 2016/08/11.
 * Created by lyr on 2016/08/11
 */
@Component
public class WeiXinEventProcess {
@ -45,6 +47,8 @@ public class WeiXinEventProcess {
    
    @Autowired
    private PatientService patientService;
    @Autowired
    private DoctorDao doctorDao;
    /**
     * 微信推送事件处理
@ -691,6 +695,8 @@ public class WeiXinEventProcess {
            articles.add(article);
            //设置医生活动二维码
            setDoctorActivity(keys[0],articles,systemConf);
            //设置通用链接
            setUrlItems(articles, systemConf);
            //加入续签图文
@ -851,6 +857,13 @@ public class WeiXinEventProcess {
        return result;
    }
    /**
     * 设置专科医生二维码
     * @param articles
     * @param doctor
     * @param teamId
     * @param systemConf
     */
    public void setSpDisease(List<Map<String, String>> articles,String doctor,String teamId,Properties systemConf){
        String url = systemDictDao.findByDictName("SP_DISEASE").get(0).getCode();
@ -872,6 +885,11 @@ public class WeiXinEventProcess {
        articles.add(articleConsult);
    }
    /**
     * 设置通用二维码
     * @param articles
     * @param systemConf
     */
    public void setCurrency(List<Map<String, String>> articles,Properties systemConf){
        String url = systemDictDao.findByDictName("WX_CURRENCY_QR_PATH").get(0).getCode();
@ -894,6 +912,22 @@ public class WeiXinEventProcess {
        articles.add(articleConsult);
    }
    public void setDoctorActivity(String doctor,List<Map<String, String>> articles,Properties systemConf){
        Doctor d = doctorDao.findByCode(doctor);
        if(d!=null&&StringUtils.isNotBlank(d.getActivityPath())){
            logger.info("setDoctorActivity:"+d.getActivityPath());
            // 图文消息图片URL
            String activityPath = systemConf.getProperty("doctor_activity_url");
            activityPath = activityPath.replace("{server}", serverUrl);
            Map<String, String> articleConsult = new HashMap<>();
            articleConsult.put("Url", d.getActivityPath());
            articleConsult.put("Title", "家庭医生线上签约指引");
            articleConsult.put("Description", "贴心家庭医生为居民提供健康指导、随访等服务\n");
            articleConsult.put("PicUrl", activityPath);
            articles.add(articleConsult);
        }
    }
    /**
     * 构建单个图文消息工具类
     *

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/system.properties

@ -38,6 +38,8 @@ patient_wifi_pic_url = {server}/images/wifi.png
patient_draw_pic_url = {server}/images/banner02.png
#专科医生签约图片地址
specialist_sign_url = {server}/images/SpBanner.png
#专科医生签约图片地址
doctor_activity_url = {server}/images/activity.png
#通用活动图片地址
currency_url = {server}/images/currency.png
#居民wifi链接

BIN
patient-co/patient-co-wlyy/src/main/webapp/images/activity.png