ソースを参照

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 年 前
コミット
a0fb30762f

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

@ -9328,6 +9328,32 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, object);
    }
    public MixEnvelop selectByUrlHsjc(Integer id,String wxId) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wxId);
        if (wxWechatDO == null) {
            throw new Exception("微信配置不存在!");
        }
        BaseNatAppointmentDO natAppointmentDO = baseNatAppointmentDao.findOne(id);
        List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, natAppointmentDO.getPatientId());
        if (patientWechatDos == null || patientWechatDos.size() == 0) {
            throw new Exception("openid不存在!");
        }
        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
        String idcard = null;
        if (natAppointmentDO != null) {
            idcard = natAppointmentDO.getCardNo();
        }
        if (!StringUtils.isNoneBlank(idcard)) {
            throw new Exception("就诊卡不存在!");
        }
        String 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);
    }
    /**
     * 获取居民openId
     *
@ -10481,7 +10507,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            return map;
                        }
                    }else {
                        rs = entranceService.BS10111(cardNo, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
                        rs = entranceService.BS10111(mediaCard, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
                        net.sf.json.JSONObject res = rs.getJSONObject("resquest");
                        logger.info("挂号结果 res: " + res.toString());
                        String rsCode = res.getString("@RESULT");

+ 9 - 3
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -57,8 +57,8 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    private static final String DEFAULT_PATIENT_INSERT_STATEMENT =
            "INSERT into base_patient (id,photo,idcard,password,salt,name,birthday,sex,mobile," +
                    "province_code,province_name,city_code,city_name,town_code,town_name,street_code,street_name,address," +
                    "del,locked,enabled,login_failure_count,login_date) " +
                    " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
                    "del,locked,enabled,login_failure_count,login_date,card_type) " +
                    " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
    private static final String PATIENT_INSERT_WEHCAT = "insert into base_patient_wechat (id,wechat_id,patient_id,openid,create_time) values(?,?,?,?,?)";
@ -298,10 +298,12 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                    }
                    JSONObject object1 = JSONObject.parseObject(res);
                    logger.info("object1"+object1.toJSONString());
                    if (null != object1&&null!=object1.get("status") && "200".equals(object1.get("status").toString())) {
                        JSONObject patient = object1.getJSONObject("userinfo");
                        String salt = randomString(5);
                        idcard = patient.getString("idcard");
                        String idtype = patient.getString("idtype");
                        String mobile = patient.getString("mobile");
                        String pw = mobile.substring(mobile.length()-6);
                        try {
@ -328,7 +330,8 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                                            0,
                                            1,
                                            0,
                                            new Date()
                                            new Date(),
                                            idtype
                                    }
                            );
                        }catch (Exception e){
@ -350,6 +353,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                        user.setEnabled(true);
                        user.setLocked(false);
                        user.setLockedDate(null);
                        user.setCardType(idcard);
                        users.add(user);
                    }else{
@ -672,6 +676,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                JSONObject patient = object1.getJSONObject("userinfo");
                logger.info("开始同步患者数据");
                String idcard = patient.getString("idcard");
                String idtype = patient.getString("idtype");
                BasePatientDO patientDO2 = patientDao.findByIdcardAndDel(idcard,"1");
                BasePatientDO patient1 = new BasePatientDO();
                String salt = UUID.randomUUID().toString().substring(0,5);
@ -689,6 +694,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                    patient1.setSalt(salt);
                }
                patient1.setIdcard(idcard);
                patient1.setCardType(idtype);
                patient1.setName(patient.getString("name"));
                patient1.setSex(StringUtils.isNotBlank(idcard)?Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)):null);
                patient1.setMobile(mobile);

+ 13 - 3
server/svr-authentication/src/main/java/com/yihu/jw/security/model/WlyyUserDetails.java

@ -1,8 +1,5 @@
package com.yihu.jw.security.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;
@ -114,6 +111,11 @@ public class WlyyUserDetails implements Serializable {
     */
    private String address;
    /**
     *
     */
    private String cardType;
    public Date getBirthday() {
@ -371,4 +373,12 @@ public class WlyyUserDetails implements Serializable {
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
}

+ 4 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthYlzConfigService.java

@ -211,6 +211,7 @@ public class OauthYlzConfigService {
                String  auth_status = biz.getString("auth_status");
                if("succ".equals(auth_status)){
                    String idcard = biz.getString("id_no");
                    String cardType = biz.getString("card_type");
                    BasePatientDO patientDO =  basePatientDao.findByIdcardAndDel(idcard,"1");
                    if(StringUtils.isNotBlank(idcard)&&patientDO == null){
                        BasePatientDO patient = new BasePatientDO();
@ -236,6 +237,7 @@ public class OauthYlzConfigService {
                        patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
                        patient.setCreateTime(new Date());
                        patient.setUpdateTime(new Date());
                        patient.setCardType(cardType);
                        patient.setBirthday(DateUtil.strToDate(biz.getString("birthday"),"yyyyMMdd"));
                        patientDO = basePatientDao.save(patient);
                        WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patientDO.getId(),"7");
@ -258,6 +260,8 @@ public class OauthYlzConfigService {
                        rsMap.put("patient",patient);
                        return rsMap;
                    }else{
                        patientDO.setCardType(cardType);
                        basePatientDao.save(patientDO);
                        WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patientDO.getId(),"7");
                        if (basePatientFamilyMemberDO==null){
                            basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();

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

@ -2160,12 +2160,19 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.selectByUrl)
    @ApiOperation("获取诊间支付url")
    public ObjEnvelop selectByUrl(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId,
            @ApiParam(name = "oupatientId", value = "oupatientId", required = true)
            @RequestParam(required = true)String oupatientId) throws Exception {
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = false)
            @RequestParam(required = false)String prescriptionId,
            @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 {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(oupatientId,prescriptionId,wxId));
            if (StringUtils.isNoneBlank(flag)){
                Integer id = Integer.parseInt(oupatientId);
                return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrlHsjc(id,wxId));
            }else {
                return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(oupatientId,prescriptionId,wxId));
            }
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }