Explorar el Código

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

trick9191 hace 7 años
padre
commit
099681160b

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -423,4 +423,8 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
    // 查询团队已签约的总数
    @Query("select count(1) from SignFamily a where  a.adminTeamId = ?1 and (a.status = 1 or a.status = 2) and a.type = 2")
    int countAmountSignedByAdminTeam(Long id);
    // 查询已签约未缴费居民
    @Query("select a from SignFamily a where  a.patient = ?1 and a.type = 2 and a.expensesStatus = '0' and a.status >0")
    SignFamily findUnpay(String patient);
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java

@ -1604,7 +1604,7 @@ public class PatientPrescriptionPayService extends BaseService {
    }
    /**
     * 查询居民支付弹窗设置
     * 查询缴费居民手机绑定情况
     *
     * @param user 需要缴费的患者code(共济支付为被代理人)
     * @return

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

@ -3,6 +3,7 @@ package com.yihu.wlyy.service.app.sign;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.patient.PatientDao;
@ -202,6 +203,15 @@ public class PatientRemindService extends BaseService {
            boolean isMobileExist = false;
            boolean isOpenIdExist = false;
            //过滤只提醒已签约未扣费居民 by wujunjie 2017.11.29
            SignFamily signFamily = signFamilyDao.findUnpay(p.getCode());
            if (signFamily == null){
                JSONObject response = new JSONObject();
                response.put("status", -1);
                response.put("msg", "未找到该居民已签约未缴费信息!");
                return response;
            }
            if (StringUtils.isNotEmpty(p.getMobile())) {
                isMobileExist = true;
                JSONObject result = smsService.sendMsg(p.getMobile(), doc.getName() + "医生提醒您:为完成家庭医生签约," +
@ -213,7 +223,6 @@ public class PatientRemindService extends BaseService {
                    mDesc = result.getString("description");
                }
            }
//            if (StringUtils.isNotEmpty(p.getOpenid())) {
            // 微信提醒
            JSONObject json = new JSONObject();
@ -234,17 +243,6 @@ public class PatientRemindService extends BaseService {
                pushMsgTask.putWxMsg(tokenUtils.getAccessToken(), 8, p.getOpenid(), p.getName(), json);
                wFlag = true;
            }
//                else{
//                    JSONObject j  = weiXinOpenIdUtils.getFamilyOpenId(p.getCode());
//                    Patient member = (Patient) j.get("member");
//                    if(StringUtils.isNotBlank(member.getOpenid())){
//                        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);
//                    }
//                }
            //发送代理人
            JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(p.getCode(),p.getOpenid());
            if(jsonArray!=null&&jsonArray.length()>0){
@ -264,7 +262,6 @@ public class PatientRemindService extends BaseService {
            }
//            }
            //发送IM
            consultService.sendMucMessageBySingnType(doc.getCode(), doc.getName(), p.getCode(), doc.getName() + "医生提醒您:为完成家庭医生签约," +
                    "尽早为您提供家庭医生服务,请尽快到" + hos.getName() + "(地址:" + hos.getAddress() + ")缴费", "1",p.getName());