Forráskód Böngészése

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

huangwenjie 7 éve
szülő
commit
aa201a5220

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDao.java

@ -52,6 +52,11 @@ public interface PatientDao extends PagingAndSortingRepository<Patient, Long> {
    @Modifying
    @Query("update Patient p set p.openid = null where p.code <> ?1 and p.openid = ?2 and p.status=1")
    int clearOpenid(String patient, String openid);
    
    //清空openid
    @Modifying
    @Query("update Patient p set p.openid = null where p.openid = ?1 and p.status=1")
    int clearOpenidByOpenid(String openid);
    @Query(" select p from Patient p,SignFamily s where p.code=s.patient and s.status > 0 ")
    List<Patient> findAllSignPatient();

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java

@ -193,10 +193,12 @@ public class SFExpressService extends BaseService {
        Hospital hospital = hospitalDao.findByCode(prescription.getHospital());
        String xml = SFUtils.postSFOrderService(sfexpress_obj,hospital,sf_code);
        logger.info("顺丰快递下订单:xml"+xml);
        String re = this.SFExpressPost(xml);
//        String re = "<Response service=\"OrderService\"><Head>OK</Head><Body><OrderResponse filter_result=\"2\" destcode=\"592\" mailno=\"444844978335\" origincode=\"592\" orderid=\"6daa6baec5fd4b65a1b023a8b60e2e91\"/></Body></Response>";
        //xml验证
        logger.info("顺丰快递下订单:re"+re);
        verificationResponXml(re,"向顺丰快递下订单失败!");
        Document doc = DocumentHelper.parseText(re);

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

@ -1126,4 +1126,15 @@ public class PatientService extends TokenService {
        }
        return true;
    }
    
    /**
     * 根据Openid清除openid
     * @param openid
     * @return
     */
    @Transactional
    public String clearOpenidByOpenid (String openid)  throws Exception{
        patientDao.clearOpenidByOpenid(openid);
        return "";
    }
}

+ 26 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.wechat.process;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.wechat.util.WeiXinMessageReplyUtils;
@ -41,6 +42,9 @@ public class WeiXinEventProcess {
    @Autowired
    private SystemDictDao systemDictDao;
    
    @Autowired
    private PatientService patientService;
    /**
     * 微信推送事件处理
@ -64,6 +68,9 @@ public class WeiXinEventProcess {
                    result = subscribeEventProcess(message);
                }
                break;
            case WeiXinMessageUtils.EVENT_TYPE_UNSUBSCRIBE: // 取消订阅事件
                 result = unsubscribeEventProcess(message);
                break;
            case WeiXinMessageUtils.EVENT_TYPE_CLICK: //菜单点击
                result = this.clickProcess(message);
            default:
@ -342,6 +349,25 @@ public class WeiXinEventProcess {
        return result;
    }
    
    /**
     * 取消关注事件
     * @param message
     * @return
     * @throws Exception
     */
    private String unsubscribeEventProcess(Map<String, String> message)throws Exception{
        String result = "";
    
        //居民openid
        String patient_openid = message.get("FromUserName");
        
        //如果居民取消关注,则清空该openid相关联的所有账号的Openid
        if(StringUtils.isNotBlank(patient_openid)){
            patientService.clearOpenidByOpenid(patient_openid);
        }
        return result;
    }
    /**