Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan 4 years ago
parent
commit
40d7eecef3

+ 8 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -9330,13 +9330,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public MixEnvelop selectByUrlHsjc(Integer id,String wxId) throws Exception {
    public MixEnvelop selectByUrlHsjc(Integer id,String wxId,String channel) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wxId);
        if (wxWechatDO == null) {
            throw new Exception("微信配置不存在!");
        }
        BaseNatAppointmentDO natAppointmentDO = baseNatAppointmentDao.findOne(id);
        BasePatientDO patientDO = basePatientDao.findById(natAppointmentDO.getPatientId());
        List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, natAppointmentDO.getPatientId());
        if (patientWechatDos == null || patientWechatDos.size() == 0) {
            throw new Exception("openid不存在!");
@ -9350,7 +9351,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (!StringUtils.isNoneBlank(idcard)) {
            throw new Exception("就诊卡不存在!");
        }
        String url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(), patientWechatDo.getOpenid(), idcard, "WX");
        String url = null;
        if (StringUtils.isNoneBlank(channel)&&channel.equalsIgnoreCase("ALI")){
            url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(), patientDO.getAlipayId(), idcard, "ALI");
        }else {
            url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(), patientWechatDo.getOpenid(), idcard, "WX");
        }
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(url);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, object);
    }

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -245,6 +245,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    private String openid;
    private Date openidTime;
    private String cardType;
    private String alipayId;//支付宝id
    public String getCardType() {
        return cardType;
@ -688,4 +689,13 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    public void setOnline(String online) {
        this.online = online;
    }
    @Column(name = "alipay_id")
    public String getAlipayId() {
        return alipayId;
    }
    public void setAlipayId(String alipayId) {
        this.alipayId = alipayId;
    }
}

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -2171,11 +2171,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "oupatientId", value = "oupatientId", required = false)
            @RequestParam(required = false)String oupatientId,
            @ApiParam(name = "flag", value = "flag", required = false)
            @RequestParam(required = false)String flag) throws Exception {
            @RequestParam(required = false)String flag,
            @ApiParam(name = "channel", value = "WX、ALI", required = false)
            @RequestParam(required = false)String channel) throws Exception {
        try {
            if (StringUtils.isNoneBlank(flag)){
                Integer id = Integer.parseInt(oupatientId);
                return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrlHsjc(id,wxId));
                return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrlHsjc(id,wxId,channel));
            }else {
                return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(oupatientId,prescriptionId,wxId));
            }