浏览代码

图文消息连接添加

8 年之前
父节点
当前提交
67d5381fd5
共有 29 个文件被更改,包括 729 次插入129 次删除
  1. 1 2
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java
  2. 1 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/UnPaySignJob.java
  3. 0 1
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/WechatCountJob.java
  4. 118 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/feedback/Appeal.java
  5. 106 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/feedback/Feedback.java
  6. 22 18
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java
  7. 11 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/feedback/AppealDao.java
  8. 11 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/feedback/FeedbackDao.java
  9. 19 17
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java
  10. 30 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/AppealService.java
  11. 31 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/FeedbackService.java
  12. 5 5
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java
  13. 1 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java
  14. 2 2
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  15. 9 7
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/PatientRemindService.java
  16. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java
  17. 1 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  18. 1 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/WeixinBaseController.java
  19. 8 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/im/imController.java
  20. 18 4
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java
  21. 113 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorFeedbackController.java
  22. 3 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java
  23. 45 13
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java
  24. 2 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  25. 112 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/feedback/PatientFeedbackController.java
  26. 16 17
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java
  27. 2 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinTempMsgSendUtils.java
  28. 33 33
      patient-co-wlyy/src/main/resources/application.properties
  29. 5 5
      patient-co-wlyy/src/main/resources/weixin_menu.txt

+ 1 - 2
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -459,7 +459,6 @@ public class CurrentDayAllQuotaJob implements Job {
                    "   p.idcard = sf.idcard " +
                    " AND sf.type = 2 " +
                    " AND sf. STATUS IN (1, 2) " +
                    " and sf.expenses_status=1 "+
                    " AND p.openid is not null  " +
                    " AND p.openid_time <'" +tomorrow+"' ";
            //抽取數據
@ -927,7 +926,7 @@ public class CurrentDayAllQuotaJob implements Job {
        String quotaId="26";
        try{
            //找出今天统计未缴费签约总数
            String sql="select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and  a.apply_date< '"+tomorrow+"' and a.expenses_status=0 ";
            String sql="select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and  a.status>0  and  a.apply_date< '"+tomorrow+"' and a.expenses_status=0 ";
            //抽取數據
            List<SignFamily> signFamilies= SpringUtil.getBean(DBExtract.class).extract(SignFamily.class,sql);
            //清洗數據

+ 1 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/UnPaySignJob.java

@ -85,7 +85,7 @@ public class UnPaySignJob implements Job {
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            //找出今天未缴费签约信息
            String sql="select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and  a.apply_date< '"+yesterday+ Constant.quota_date_last+"' and a.expenses_status=0 ";
            String sql="select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and  a.status>0  and a.apply_date< '"+yesterday+ Constant.quota_date_last+"' and a.expenses_status=0 ";
            //抽取數據
            List<SignFamily> signFamilies= dbExtract.extract(SignFamily.class,sql);
            //清洗數據

+ 0 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/WechatCountJob.java

@ -96,7 +96,6 @@ public class WechatCountJob implements Job {
                    "   p.idcard = sf.idcard " +
                    " AND sf.type = 2 " +
                    " AND sf. STATUS IN (1, 2) " +
                    " and sf.expenses_status=1 "+
                    " AND p.openid is not null  " +
                    " AND p.openid_time <'" +yesterday+ Constant.quota_date_last+"' ";

+ 118 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/feedback/Appeal.java

@ -0,0 +1,118 @@
package com.yihu.wlyy.entity.feedback;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Reece on 2017/5/6.
 */
@Entity
@Table(name = "wlyy_appeal")
public class Appeal extends IdEntity {
    //   '账号申诉编码'
    private String code;
    //    申诉人编码
    private String creater;
    //    '问题描述'
    private String description;
    //    申诉类别:1、手机号变更、2、重置密码、3、其他
    private int type;
    //    图片路径,逗号分隔
    private String images;
    //    联系手机号
    private String phone;
    //    状态 0、未读 1、待处理  2、已处理
    private int status;
    //    '处理结果'
    private String result;
    //    申诉人身份:1、患者  2、医生
    private int identity;
    public Appeal() {
    }
    public Appeal(String code, String creater, String description, int type, String images, String phone, int status, String result, int identity) {
        this.code = code;
        this.creater = creater;
        this.description = description;
        this.type = type;
        this.images = images;
        this.phone = phone;
        this.status = status;
        this.result = result;
        this.identity = identity;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getCreater() {
        return creater;
    }
    public void setCreater(String creater) {
        this.creater = creater;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
    public String getImages() {
        return images;
    }
    public void setImages(String images) {
        this.images = images;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
    public String getResult() {
        return result;
    }
    public void setResult(String result) {
        this.result = result;
    }
    public int getIdentity() {
        return identity;
    }
    public void setIdentity(int identity) {
        this.identity = identity;
    }
}

+ 106 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/feedback/Feedback.java

@ -0,0 +1,106 @@
package com.yihu.wlyy.entity.feedback;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Reece on 2017/5/6.
 */
@Entity
@Table(name = "wlyy_feedback")
public class Feedback extends IdEntity{
//    意见反馈编码
    private String code;
//    反馈人编码
    private String creater;
//    反馈人身份 1、患者  2、医生
    private  int identity;
//    问题描述
    private String description;
//    反馈类别:1、优化建议、2、提交bug、3、新功能建议、4、其他
    private int type;
//    图片路径,逗号分隔
    private String images;
//    联系方式: qq号或者邮箱
    private String contact;
//    状态 0、未读 1、已读
    private int status;
    public Feedback(String code, String creater, int identity, String description, int type, String images, String contact, int status) {
        this.code = code;
        this.creater = creater;
        this.identity = identity;
        this.description = description;
        this.type = type;
        this.images = images;
        this.contact = contact;
        this.status = status;
    }
    public Feedback() {
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getCreater() {
        return creater;
    }
    public void setCreater(String creater) {
        this.creater = creater;
    }
    public int getIdentity() {
        return identity;
    }
    public void setIdentity(int identity) {
        this.identity = identity;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
    public String getImages() {
        return images;
    }
    public void setImages(String images) {
        this.images = images;
    }
    public String getContact() {
        return contact;
    }
    public void setContact(String contact) {
        this.contact = contact;
    }
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
}

+ 22 - 18
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java

@ -9,28 +9,32 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.consult.Consult;
public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, JpaSpecificationExecutor<Consult> {
	
	Consult findByCode(String code);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
	Page<Object> findByPatient(String patient,String title, Pageable pageRequest);
    Consult findByCode(String code);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
	Page<Object> findByPatient(String patient,String title, long id, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatient(String patient, String title, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
	Page<Object> findByPatient(String patient, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatient(String patient, String title, long id, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
	Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
    Page<Object> findByPatient(String patient, Pageable pageRequest);
	@Query("select count(a) from Consult a,ConsultTeamDoctor b  where a.code = b.consult and a.patient=?1 and b.to=?2 and b.from is null")
	Integer findByPatient(String patientCode,String doctorCode);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
    Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.adminTeamId,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and b.adminTeamId = ?2 and a.del = '1' order by a.czrq desc")
	Page<Object> findByPatientAndTeam(String patient,Long team, Pageable pageRequest);
    @Query("select count(a) from Consult a,ConsultTeamDoctor b  where a.code = b.consult and a.patient=?1 and b.to=?2 and b.from is null")
    Integer findByPatient(String patientCode, String doctorCode);
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.adminTeamId,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and b.adminTeamId = ?2 and a.del = '1' order by a.czrq desc")
    Page<Object> findByPatientAndTeam(String patient, Long team, Pageable pageRequest);
    //获取咨询的状态
    @Query("select a from Consult a,ConsultTeam b where a.code = b.consult and a.code = ?1 ")
    Consult findTypeByCode(String code);
}

+ 11 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/feedback/AppealDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.repository.feedback;
import com.yihu.wlyy.entity.feedback.Appeal;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Reece on 2017/5/6.
 */
public interface AppealDao extends PagingAndSortingRepository<Appeal, Long>,JpaSpecificationExecutor<Appeal> {
}

+ 11 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/feedback/FeedbackDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.repository.feedback;
import com.yihu.wlyy.entity.feedback.Feedback;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Reece on 2017/5/6.
 */
public interface FeedbackDao extends PagingAndSortingRepository<Feedback, Long>,JpaSpecificationExecutor<Feedback> {
}

+ 19 - 17
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -819,26 +819,17 @@ public class FamilyMemberService extends BaseService {
        if (m == null) {
            return -2;
        }
        JSONObject json = new JSONObject();
        json.put("first", m.getName() + ",您好!" + p.getName() + "向您发起添加家人申请,添加成功后,对方可使用您的账号,为您处理各类健康服务。");
        json.put("keyword1", "添加家人申请");
        json.put("keyword2", DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
//        json.put("keyword3", p.getName());
//        json.put("keyword4", relations.get(relation));
        json.put("remark", "申请人:"+p.getName()+"\n"+
                 "家庭关系:"+relations.get(relation)+"\n"+
                 "点击立即处理。");
        json.put("member", member);
        //此消息为定向推送,无需家人代收
        PushMsgTask.getInstance().putWxMsg(access_token, 12, m.getOpenid(), p.getName(), json);
        List<PatientFamilyTemp> temps =  patientFamilyTempDao.findByDealerAndPatient(member,patient);
        if(temps!=null&&temps.size()>0){
            for(PatientFamilyTemp temp : temps){
                temp.setUpdateTime(new Date());
                patientFamilyTempDao.save(temp);
            }
            return -3;
//            for(PatientFamilyTemp temp : temps){
//                temp.setUpdateTime(new Date());
//                temp.setState("0");
//                patientFamilyTempDao.save(temp);
//            }
        }else{
            PatientFamilyTemp temp = new PatientFamilyTemp();
            temp.setState("0");
@ -852,7 +843,18 @@ public class FamilyMemberService extends BaseService {
            patientFamilyTempDao.save(temp);
        }
        JSONObject json = new JSONObject();
        json.put("first", m.getName() + ",您好!" + p.getName() + "向您发起添加家人申请,添加成功后,对方可使用您的账号,为您处理各类健康服务。");
        json.put("keyword1", "添加家人申请");
        json.put("keyword2", DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
//        json.put("keyword3", p.getName());
//        json.put("keyword4", relations.get(relation));
        json.put("remark", "申请人:"+p.getName()+"\n"+
                "家庭关系:"+relations.get(relation)+"\n"+
                "点击立即处理。");
        json.put("member", member);
        //此消息为定向推送,无需家人代收
        PushMsgTask.getInstance().putWxMsg(access_token, 12, m.getOpenid(), p.getName(), json);
        return 1;
    }

+ 30 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/AppealService.java

@ -0,0 +1,30 @@
package com.yihu.wlyy.service.app.feedback;
import com.yihu.wlyy.entity.feedback.Appeal;
import com.yihu.wlyy.repository.feedback.AppealDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * Created by Reece on 2017/5/6.
 */
@Service
@Transactional
public class AppealService extends BaseService {
    @Autowired
    private AppealDao appealDao;
    public void saveAppeal(String doctor,String description,int type,String images,String phone,int identity) {
        Appeal appeal = new Appeal();
        appeal.setCode(getCode());
        appeal.setPhone(phone);
        appeal.setCreater(doctor);
        appeal.setDescription(description);
        appeal.setIdentity(identity);
        appeal.setImages(images);
        appeal.setType(type);
        appealDao.save(appeal);
    }
}

+ 31 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/FeedbackService.java

@ -0,0 +1,31 @@
package com.yihu.wlyy.service.app.feedback;
import com.yihu.wlyy.entity.feedback.Feedback;
import com.yihu.wlyy.repository.feedback.FeedbackDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * Created by Reece on 2017/5/6.
 */
@Service
@Transactional
public class FeedbackService extends BaseService {
    @Autowired
    private FeedbackDao feedbackDao;
    public void saveFeedback(String doctor,String description,int type,String images,String contact,int idetity) {
        Feedback feedback = new Feedback();
        feedback.setCode(getCode());
        feedback.setContact(contact);
        feedback.setCreater(doctor);
        feedback.setDescription(description);
        feedback.setIdentity(idetity);
        feedback.setImages(images);
        feedback.setType(type);
        feedbackDao.save(feedback);
    }
}

+ 5 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java

@ -114,21 +114,21 @@ public class PatientHealthGuidanceService extends BaseService {
		guidance = patientHealthGuidanceDao.save(guidance);
		String openId = null;
		String name = null;
//		String name = null;
		JSONObject json = new JSONObject();
		//判定openId是否为空空,如果为空,查找他家人的openId
		if(StringUtils.isNotBlank(patient.getOpenid())){
			json.put("first", "健康指导提醒");
			name = patient.getName();
			//name = patient.getName();
			openId = patient.getOpenid();
		}else{
			JSONObject j = weiXinOpenIdUtils.getFamilyOpenId(patient.getCode());
			Patient member = (Patient)j.get("member");
			openId = member.getOpenid();
			name = member.getName();
			//name = member.getName();
			if (StringUtils.isNotEmpty(openId)) {
				json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.getInt("relation"), member.getName()) + "健康指导提醒");
				json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.getInt("relation"), patient.getName()) + "健康指导提醒");
			}
		}
		if (guidance != null && StringUtils.isNotEmpty(openId)) {
@ -141,7 +141,7 @@ public class PatientHealthGuidanceService extends BaseService {
			json.put("content", "您好!医生给您发来了一份新的健康指导。");
			json.put("remark", "请点击查看");
			// 推送消息到微信端
			PushMsgTask.getInstance().putWxMsg(accessToken, 4, openId, name, json);
			PushMsgTask.getInstance().putWxMsg(accessToken, 4, openId, patient.getName(), json);
		}
		return guidance;
	}

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -1277,7 +1277,7 @@ public class SignPatientLabelInfoService extends BaseService {
                " AND ( sf.doctor_health is null or sf.doctor_health ='' ) " +
                "  AND (p.name like ? or p.address like ? or p.idcard like ? ) " +
                " ORDER BY  p.name DESC,p.address DESC, p.idcard DESC " +
                " limit "+(page-1)+","+pagesize;
                " limit "+(page-1)*pagesize+","+pagesize;
        List<Map<String, Object>> datas = jdbcTemplate.queryForList(sql, teamCode, "%" + filter + "%", "%" + filter + "%", "%" + filter + "%");
        if (datas != null && datas.size() > 0) {

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

@ -2658,7 +2658,7 @@ public class FamilyContractService extends BaseService {
                    " and sf.admin_team_code = ? " +
                    " AND (p.name like ? or p.address like ? or p.idcard like ? ) " +
                    " ORDER BY  p.name DESC,p.address DESC, p.idcard DESC " +
                    " limit "+(page-1)+","+pagesize;
                    " limit "+(page-1)*pagesize+","+pagesize;
            //查找居民
            datas = jdbcTemplate.queryForList(sql, doctorCode, team,"%"+filter+"%","%"+filter+"%","%"+filter+"%");
@ -2682,7 +2682,7 @@ public class FamilyContractService extends BaseService {
                    " and sf.admin_team_code = ? " +
                    " AND (p.name like ? or p.address like ? or p.idcard like ? ) " +
                    " ORDER BY  p.name DESC,p.address DESC, p.idcard DESC " +
                    " limit "+(page-1)+","+pagesize;
                    " limit "+(page-1)*pagesize+","+pagesize;
            //查找居民
            datas = jdbcTemplate.queryForList(sql, doctorCode, team,"%"+filter+"%","%"+filter+"%","%"+filter+"%");

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

@ -211,37 +211,39 @@ public class PatientRemindService extends BaseService {
                    mDesc = result.getString("description");
                }
            }
            if (StringUtils.isNotEmpty(p.getOpenid())) {
                isOpenIdExist = true;
//            if (StringUtils.isNotEmpty(p.getOpenid())) {
                // 微信提醒
                JSONObject json = new JSONObject();
                json.put("first", "缴费提醒");
                json.put("toUser", p.getCode());
                json.put("name", p.getName());
                json.put("doctor", doc.getCode());
                json.put("doctorName", doc.getName());
                json.put("doctorName", "提醒医生:  "+doc.getName());
                json.put("date", DateUtil.dateToStrShort(new Date()));
                json.put("content", p.getName() + ",您好!为完成家庭医生签约,尽早为您提供家庭医生服务,请尽快到" + hos.getName() + "(地址:" + hos.getAddress() + ")缴费");
                json.put("remark", "");
                //判断是否判定openId,有没有发则查找家人发送
                if(StringUtils.isNotBlank(p.getOpenid())){
                    isOpenIdExist = true;
                    // 添加到发送队列
                    PushMsgTask.getInstance().putWxMsg(tokenUtils.getAccessToken(), 8, p.getOpenid(), p.getName(), json);
                }else{
                    JSONObject j  = weiXinOpenIdUtils.getFamilyOpenId(p.getCode());
                    Patient member = (Patient) j.get("member");
                    if(StringUtils.isNotBlank(member.getOpenid())){
                        String first = (String) json.get("first");
                        json.remove("first");
                        json.put("first",weiXinOpenIdUtils.getTitleMes(p,j.getInt("relation"),member.getName())+first);
                        isOpenIdExist = true;
                        String first = (String) json.get("doctorName");
                        json.remove("doctorName");
                        json.put("doctorName",weiXinOpenIdUtils.getTitleMes(p,j.getInt("relation"),member.getName())+"\n"+first);
                        PushMsgTask.getInstance().putWxMsg(tokenUtils.getAccessToken(), 8, member.getOpenid(), member.getName(), json);
                    }
                }
                wFlag = true;
            }
//            }
            //发送IM
            consultService.sendMucMessageBySingnType(doc.getCode(), doc.getName(), p.getCode(), doc.getName() + "医生提醒您:为完成家庭医生签约," +
                    "尽早为您提供家庭医生服务,请尽快到" + hos.getName() + "(地址:" + hos.getAddress() + ")缴费", "1",p.getName());

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -163,12 +163,15 @@ public class GuahaoXMService implements IGuahaoService {
            String used = e.attributeValue("used");
            // 1正常、2满号、3已过期
            String status = e.attributeValue("status");
            // 诊查费
            String fee = e.attributeValue("fee");
            Map<String, Object> map = new HashMap<>();
            map.put("date", date);
            map.put("time", time);
            map.put("max", max);
            map.put("used", used);
            map.put("status", status);
            map.put("fee", fee);
            // 排班信息
            List<?> sections = e.elements();
            List<Map<String, String>> arrangeList = new ArrayList<>();

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

@ -382,7 +382,7 @@ public class PushMsgTask {
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue("提醒医生:" + json.getString("doctorName"));
                keyword1.setValue(json.getString("doctorName"));
                m.put("first", keyword1);
                WechatTemplateData keyword2 = new WechatTemplateData();
                keyword2.setColor("#000000");

+ 1 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/WeixinBaseController.java

@ -43,6 +43,7 @@ public class WeixinBaseController extends BaseController {
			String token_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
			String params = "appid=" + SystemConf.getInstance().getAppId() + "&secret=" + SystemConf.getInstance().getAppSecret() + "&code=" + code + "&grant_type=authorization_code";
			String result = HttpUtil.sendGet(token_url, params);
			System.out.println("getOpenidByCode:"+result);
			JSONObject json = new JSONObject(result);
			if (json.has("openid")) {
				return json.get("openid").toString();

+ 8 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/im/imController.java

@ -1,7 +1,9 @@
package com.yihu.wlyy.web.common.im;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.repository.consult.ConsultDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.util.ImUtill;
@ -31,6 +33,8 @@ public class imController extends BaseController {
    private SignFamilyDao signFamilyDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private ConsultDao consultDao;
    /**
     * 获取单个咨询
@ -84,6 +88,7 @@ public class imController extends BaseController {
                String sex = ob.get("sex").toString();
                String startId = ob.get("start_message_id").toString();
                String endId = ob.get("end_message_id").toString();
                Consult con = consultDao.findTypeByCode(id);
                if (StringUtils.isNotEmpty(createTime)){
                    Date date = sdf.parse(createTime);
                    map.put("create_time",sdf.format(date));
@ -93,10 +98,13 @@ public class imController extends BaseController {
                map.put("session_id", session_id);
                map.put("photo", avatar);
                map.put("patientName", name);
                map.put("patient", con.getPatient());
                map.put("sex", sex);
                map.put("description", description);
                map.put("start_message_id", startId);
                map.put("end_message_id", endId);
//                咨询类型:1三师咨询,2家庭医生咨询,3图文咨询,4公共咨询,5病友圈
                map.put("type", con.getType());
                list.add(map);
            }

+ 18 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -1806,20 +1806,20 @@ public class DoctorController extends BaseController {
            @RequestParam(required = false) String patients,
            @RequestParam(required = false) String group,
            @RequestParam(required = false) Integer sendCount,
            @RequestParam(required = false) String teamId,
            @RequestParam String teamId,
            @RequestParam(required = false) String typeId) {
        try {
            Long teamCode = Long.parseLong(teamId);
//            patients不为空是由团队中搜索居民 否则是分组分配健管师
            if (StringUtils.isNotEmpty(patients)) {
                String result = updateTeamHealthDoctors(newDoctorCode, oldDoctorCode, patients, null);
                return result;
            } else {
            } else if(StringUtils.isNotEmpty(group)){
//            按条件获取居民
                patients = "";
                if (StringUtils.isEmpty(group)||StringUtils.isEmpty(teamId)||StringUtils.isEmpty(typeId)||sendCount==null){
                if (StringUtils.isEmpty(teamId)||StringUtils.isEmpty(typeId)||sendCount==null){
                    return write(-1, "参数不能为空!");
                }
                Long teamCode = Long.parseLong(teamId);
                JSONObject list = familyContractService.findNoHealthSignFamilyHealth(null, typeId, null, teamCode);
                List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(typeId, 1, teamCode);
                for (SignPatientLabel label :s) {
@ -1846,6 +1846,19 @@ public class DoctorController extends BaseController {
                patients =  patients.substring(0,patients.length()-1);
                String result = updateTeamHealthDoctors(newDoctorCode, oldDoctorCode, patients, null);
                return result;
            }else {
                List<SignFamily> signFamily = familyContractService.findNoHealthSignFamilyNum(teamCode);
                patients = "";
                if (StringUtils.isEmpty(teamId)||StringUtils.isEmpty(typeId)||sendCount==null){
                    return write(-1, "参数不能为空!");
                }
                for (SignFamily patient:signFamily) {
                    String code = patient.getPatient();
                    patients+=(code+",");
                }
                patients =  patients.substring(0,patients.length()-1);
                String result = updateTeamHealthDoctors(newDoctorCode, oldDoctorCode, patients, null);
                return result;
            }
        } catch (Exception e) {
            error(e);
@ -1853,3 +1866,4 @@ public class DoctorController extends BaseController {
        }
    }
}

+ 113 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorFeedbackController.java

@ -0,0 +1,113 @@
package com.yihu.wlyy.web.doctor.feedback;
import com.yihu.wlyy.service.app.feedback.AppealService;
import com.yihu.wlyy.service.app.feedback.FeedbackService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.regex.Pattern;
/**
 * Created by Reece on 2017/5/6.
 */
@Controller
@RequestMapping(value = "/doctor/feedback")
@Api(description = "医生端意见反馈与账号申诉")
public class DoctorFeedbackController extends BaseController {
    @Autowired
    private FeedbackService feedbackService;
    @Autowired
    private AppealService appealService;
    /**
     * 医生端保存意见反馈
     *
     * @param description 问题描述
     * @param type        选择类型
     * @param images      图片,多图逗号分隔
     * @param contact     联系方式
     * @return
     */
    @RequestMapping(value = "/saveFeedback", method = RequestMethod.GET)
    @ApiOperation(value = "医生端保存反馈")
    @ResponseBody
    public String saveFeedback(
            @RequestParam String description,
            @RequestParam int type,
            @RequestParam(required = false) String images,
            @RequestParam(required = false) String contact) {
        try {
            String email = null;
            if (StringUtils.isNotEmpty(contact)) {
                //        邮箱正则|QQ号正则
                String regexEmail = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$";
                String regexQQ = "^[1-9][0-9]{4,}$";
                Boolean emailFlag = Pattern.matches(regexEmail, contact);
                Boolean qqFlag = Pattern.matches(regexQQ, contact);
                if (emailFlag || qqFlag) {
                    return write(-1, "QQ/邮箱格式错误!");
                }
                email = contact;
            }
//        图片上传
            if (StringUtils.isNotEmpty(images)) {
                images = CommonUtil.copyTempImage(images);
            }
//        保存到数据库
            feedbackService.saveFeedback(getUID(),description,type,images,contact,2);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存失败!");
        }
    }
    /**
     * 医生端保存账号申诉
     *
     * @param description 问题描述
     * @param type        选择类型
     * @param images      图片,多图逗号分隔
     * @param phone       手机号码
     * @return
     */
    @RequestMapping(value = "/saveAppeal", method = RequestMethod.GET)
    @ApiOperation(value = "医生端保存申诉")
    @ResponseBody
    public String saveAppeal(
            @RequestParam String description,
            @RequestParam int type,
            @RequestParam(required = false) String images,
            @RequestParam String phone) {
        try {
//        手机号正则
            String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$";
            if (Pattern.matches(regex, phone)) {
//        图片上传
                if (StringUtils.isNotEmpty(images)) {
                    images = CommonUtil.copyTempImage(images);
                }
//             保存到数据库
                appealService.saveAppeal(getUID(),description,type,images,phone,2);
                return write(200, "保存成功!");
            } else {
                return write(-1, "手机号码有误!");
            }
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存失败!");
        }
    }
}

+ 3 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -355,6 +355,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
            }
            // 查询医生信息
            Doctor doctor = doctorService.findDoctorByCode(getUID());
            //Doctor doctor = doctorService.findDoctorByCode("test00000000005");
            String msgHead = doctor.getName() + "医生给您发来了一篇患教文章";
            String endMsg = "为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
            JSONArray messages = new JSONArray();
@ -407,6 +408,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                    heap.setCzrq(createTime);
                    list.add(heap);
                    consultService.sendMucMessageBySingnType(doctor.getCode(), doctor.getName(), p, "{\"title\":\"" + temp.getTitle()+ "\",\"type\":0,\"id\":\"" + temp.getCode() + "\",\"img\":\"" + temp.getUrl() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patientTemp.getName());
                    //if (StringUtils.isNotEmpty(patientTemp.getOpenid())) {
                    if(StringUtils.isNotBlank(attachedContent)){
                        //发送备注
                        consultService.sendMucMessageBySingnType(doctor.getCode(), doctor.getName(), p, attachedContent, ImUtill.CONTENT_TYPE_TEXT, patientTemp.getName());
@ -427,7 +429,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                        content.put("json", json);
                        content.put("code",patientTemp.getCode());
                        msgs.put(patientTemp.getCode(), content);
                    }
                    //}
                }
            }
            // 保存到数据库

+ 45 - 13
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -225,11 +225,13 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            List listNum = new ArrayList();
            JSONObject list = familyContractService.getPatientByLable(oldDoctorCode, labelType, level, teamCode);
            List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
            int count = 0;
            for (SignPatientLabel label : s) {
                Map map = new HashMap();
                String labelName = label.getLabelName();
                JSONArray jsonArray = list.getJSONArray(label.getLabelName());
                List codes = new ArrayList();
                for (int i = 0 ;i<jsonArray.length();i++){
                    JSONObject json = jsonArray.getJSONObject(i);
                    Map info = new HashMap();
@ -239,11 +241,17 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    info.put("name",name);
                    codes.add(info);
                }
                int length = codes.size();
                map.put("label", labelName);
                map.put("codes", codes);
                map.put("number", length);
                listNum.add(map);
                count+=length;
            }
            return write(200, "查询成功", "data", listNum);
            Map map = new HashMap();
            map.put("count",count);
            map.put("patients",listNum);
            return write(200, "查询成功", "data", map);
        } catch (Exception e) {
            return error(-1, "查询失败");
        }
@ -968,25 +976,49 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            Long teamCode) {
        try {
            List listNum = new ArrayList();
            Map patients = new HashMap();
            JSONObject list = familyContractService.findNoHealthSignFamilyHealth(getUID(), labelType, patientName, teamCode);
            List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
            for (SignPatientLabel label : s) {
                Map map = new HashMap();
                String labelName = label.getLabelName();
                JSONArray jsonArray = list.getJSONArray(label.getLabelName());
                List codes = new ArrayList();
            List<SignFamily> signFamily = familyContractService.findNoHealthSignFamilyNum(teamCode);
            if (!"4".equals(labelType)){
                List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
                for (SignPatientLabel label : s) {
                    Map map = new HashMap();
                    String labelName = label.getLabelName();
                    JSONArray jsonArray = list.getJSONArray(label.getLabelName());
               /* List codes = new ArrayList();
                for (Object patient:jsonArray) {
                    JSONObject jsonObject = new JSONObject(patient.toString());
                    String code = jsonObject.get("code").toString();
                    codes.add(code);
                }*/
                    int length = jsonArray.length();
                    map.put("label", labelName);
                    map.put("number", length);
//                map.put("codes", codes);
                    listNum.add(map);
                }
                int length = jsonArray.length();
                map.put("label", labelName);
                map.put("number", length);
                map.put("codes", codes);
            }else {
                JSONArray jsonArray = list.getJSONArray("孕产妇");
                Map map = new HashMap();
                map.put("label", "孕产妇");
                map.put("number", jsonArray.length());
                listNum.add(map);
            }
            return write(200, "查询成功!", "data", listNum);
                JSONArray jsonArray1 = list.getJSONArray("未标注");
                Map map1 = new HashMap();
                map1.put("label", "未标注");
                map1.put("number", jsonArray1.length());
                listNum.add(map1);
                JSONArray jsonArray2 = list.getJSONArray("儿童");
                Map map2 = new HashMap();
                map2.put("label", "儿童");
                map2.put("number", jsonArray2.length());
                listNum.add(map2);
            }
            patients.put("count",list.length());
            patients.put("count",signFamily.size());
            patients.put("patients",listNum);
            return write(200, "查询成功!", "data", patients);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "查询失败");

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java

@ -327,6 +327,8 @@ public class FamilyMemberController extends WeixinBaseController {
                return error(-1, "居民信息查询失败");
            }else if(result==-2){
                return error(-1, "该成员未注册");
            }else if(result ==-3){
                return error(-1, "申请已经提交");
            }else {
                return write(200, "发送成功");
            }

+ 112 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/feedback/PatientFeedbackController.java

@ -0,0 +1,112 @@
package com.yihu.wlyy.web.patient.feedback;
import com.yihu.wlyy.service.app.feedback.AppealService;
import com.yihu.wlyy.service.app.feedback.FeedbackService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.regex.Pattern;
/**
 * Created by Reece on 2017/5/6.
 */
@Controller
@RequestMapping(value = "/patient/feedback")
@Api(description = "居民端意见反馈与账号申诉")
public class PatientFeedbackController extends BaseController {
    @Autowired
    private FeedbackService feedbackService;
    @Autowired
    private AppealService appealService;
    /**
     * 居民端保存意见反馈
     *
     * @param description 问题描述
     * @param type        选择类型
     * @param images      图片,多图逗号分隔
     * @param contact     联系方式
     * @return
     */
    @RequestMapping(value = "/saveFeedback", method = RequestMethod.GET)
    @ApiOperation(value = "居民端保存反馈")
    @ResponseBody
    public String saveFeedback(
            @RequestParam String description,
            @RequestParam int type,
            @RequestParam(required = false) String images,
            @RequestParam(required = false) String contact) {
        try {
            String email = null;
            if (StringUtils.isNotEmpty(contact)) {
                //        邮箱正则|QQ号正则
                String regexEmail = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$";
                String regexQQ = "^[1-9][0-9]{4,}$";
                Boolean emailFlag = Pattern.matches(regexEmail, contact);
                Boolean qqFlag = Pattern.matches(regexQQ, contact);
                if (emailFlag || qqFlag) {
                    return write(-1, "QQ/邮箱格式错误!");
                }
                email = contact;
            }
//        图片上传
            if (StringUtils.isNotEmpty(images)) {
                images = CommonUtil.copyTempImage(images);
            }
//        保存到数据库
            feedbackService.saveFeedback(getUID(),description,type,images,contact,1);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存失败!");
        }
    }
    /**
     * 居民端保存账号申诉
     *
     * @param description 问题描述
     * @param type        选择类型
     * @param images      图片,多图逗号分隔
     * @param phone       手机号码
     * @return
     */
    @RequestMapping(value = "/saveAppeal", method = RequestMethod.GET)
    @ApiOperation(value = "居民端保存申诉")
    @ResponseBody
    public String saveAppeal(
            @RequestParam String description,
            @RequestParam int type,
            @RequestParam(required = false) String images,
            @RequestParam String phone) {
        try {
//        手机号正则
            String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$";
            if (Pattern.matches(regex, phone)) {
//        图片上传
                if (StringUtils.isNotEmpty(images)) {
                    images = CommonUtil.copyTempImage(images);
                }
//             保存到数据库
                appealService.saveAppeal(getUID(),description,type,images,phone,1);
                return write(200, "保存成功!");
            } else {
                return write(-1, "手机号码有误!");
            }
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存失败!");
        }
    }
}

+ 16 - 17
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

@ -296,21 +296,20 @@ public class BookingController extends WeixinBaseController {
            if (obj != null) {
                Patient p = patientService.findByCode(obj.getPatient());
                String msg = "您成功预约了 " + obj.getOrgName() + " " + obj.getDoctorName() + " " + obj.getStartTime() + " 的号源!";
                if (StringUtils.isNotEmpty(p.getOpenid())) {
                    // 推送消息给微信端
                    JSONObject json = new JSONObject();
                    json.put("first", "");
                    json.put("toUser", p.getCode());
                    json.put("id", obj.getCode());
                    json.put("date", obj.getStartTime());
                    json.put("orgCode", obj.getOrgCode());
                    json.put("orgName", obj.getOrgName());
                    json.put("doctorName", obj.getDoctorName());
                    json.put("deptName", obj.getDeptName());
                    json.put("remark", p.getName() + ",您好!" + msg);
                    //判断是否判定openId,有没有发则查找家人发送
                    if(StringUtils.isNotBlank(p.getOpenid())){
                // 推送消息给微信端
                JSONObject json = new JSONObject();
                json.put("first", "");
                json.put("toUser", p.getCode());
                json.put("id", obj.getCode());
                json.put("date", obj.getStartTime());
                json.put("orgCode", obj.getOrgCode());
                json.put("orgName", obj.getOrgName());
                json.put("doctorName", obj.getDoctorName());
                json.put("deptName", obj.getDeptName());
                json.put("remark", p.getName() + ",您好!" + msg);
                //判断是否判定openId,有没有发则查找家人发送
                if(StringUtils.isNotBlank(p.getOpenid())){
                        // 添加到发送队列
                        PushMsgTask.getInstance().putWxMsg(getAccessToken(), 6, p.getOpenid(), p.getName(), json);
                    }else{
@ -322,10 +321,10 @@ public class BookingController extends WeixinBaseController {
                            json.put("first",weiXinOpenIdUtils.getTitleMes(p,j.getInt("relation"),member.getName())+first);
                            PushMsgTask.getInstance().putWxMsg(getAccessToken(), 6, member.getOpenid(), member.getName(), json);
                        }
                    }
                }
                }
                //发送短信小时
                // 调用总部发送信息的接口
                //String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, p.getMobile()), "GBK");

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinTempMsgSendUtils.java

@ -16,7 +16,8 @@ public class WeiXinTempMsgSendUtils {
    WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    // 模板消息发送接口URL
    private static String TEMP_MSG_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
    private static String TEMP_MSG_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/template" +
            "/send?access_token=";
    /**
     * 模板消息发送

+ 33 - 33
patient-co-wlyy/src/main/resources/application.properties

@ -53,45 +53,45 @@
##------------------------------------�����������ݿ�����------------------------------------#
#### mysql database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
jdbc.username=root
jdbc.password=123456
#### health index
health.jdbc.driver=com.mysql.jdbc.Driver
health.jdbc.url=jdbc:mysql://172.19.103.77/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
health.jdbc.username=root
health.jdbc.password=123456
#### suifang
fv.jdbc.driver=com.mysql.jdbc.Driver
fv.jdbc.url=jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
fv.jdbc.username=root
fv.jdbc.password=123456
#jdbc.driver=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#jdbc.username=root
#jdbc.password=123456
#
##### health index
#health.jdbc.driver=com.mysql.jdbc.Driver
#health.jdbc.url=jdbc:mysql://172.19.103.77/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#health.jdbc.username=root
#health.jdbc.password=123456
#
##### suifang
#fv.jdbc.driver=com.mysql.jdbc.Driver
#fv.jdbc.url=jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#fv.jdbc.username=root
#fv.jdbc.password=123456
#### redis
redis.host=172.19.103.47
redis.port=6379
redis.password=
#---------------------------------���Ի������ݿ�����---------------------------------------#
###### mysql database setting
#jdbc.driver=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#jdbc.username=luofaqiang
#jdbc.password=luofaqiang
#
###### health index
#health.jdbc.driver=com.mysql.jdbc.Driver
#health.jdbc.url=jdbc:mysql://172.19.103.85/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#health.jdbc.username=luofaqiang
#health.jdbc.password=luofaqiang
#
###### suifang
#fv.jdbc.driver=com.mysql.jdbc.Driver
#fv.jdbc.url=jdbc:mysql://172.19.103.85/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#fv.jdbc.username=luofaqiang
#fv.jdbc.password=luofaqiang
##### mysql database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
jdbc.username=linzhou
jdbc.password=linzhou
##### health index
health.jdbc.driver=com.mysql.jdbc.Driver
health.jdbc.url=jdbc:mysql://172.19.103.85/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
health.jdbc.username=linzhou
health.jdbc.password=linzhou
##### suifang
fv.jdbc.driver=com.mysql.jdbc.Driver
fv.jdbc.url=jdbc:mysql://172.19.103.85/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
fv.jdbc.username=linzhou
fv.jdbc.password=linzhou
#
###### redis
#redis.host=172.19.103.88

+ 5 - 5
patient-co-wlyy/src/main/resources/weixin_menu.txt

@ -74,15 +74,15 @@
		   "name":"我的设备",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdsb%2fhtml%2fmy-equipments.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		},
		{
		   "type":"view",
		   "name":"我的预约",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fmy-appointment.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		},
        {
         	"type":"click",
         	"name":"操作说明",
         	"key":"caozuoshuoming"
        },
        {
        	 "type":"view",
        	 "name":"意见反馈",
        	 "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fmy-appointment.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        }
	 ]
  }