Преглед на файлове

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 години
родител
ревизия
863d897331

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -18,6 +18,9 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    List<WlyyOutpatientDO> findByDoctorAndStatus(String doctor,String status);
    @Query("from WlyyOutpatientDO a where a.doctor = ?1 and a.status in(2,3)")
    List<WlyyOutpatientDO> findByDoctorList(String doctor);
    Integer countByDoctorAndStatusAndOutpatientType(String doctor,String status,String outpatientType);
    List<WlyyOutpatientDO> findByDoctor(String doctor);

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

@ -3014,12 +3014,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                rs.put("registerCount",0);
            }
            //医生问诊量
//            List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctorAndStatus(doctor,"2");
//            if(wlyyOutpatientDOs!=null&&wlyyOutpatientDOs.size()>0){
//                rs.put("outpatientCount",wlyyOutpatientDOs.size());
//            }else{
//                rs.put("outpatientCount",0);
//            }
            List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctorList(doctor);
            if(wlyyOutpatientDOs!=null&&wlyyOutpatientDOs.size()>0){
                rs.put("outpatientCount",wlyyOutpatientDOs.size());
            }else{
                rs.put("outpatientCount",0);
            }
//
//            //协同门诊量
//            Integer coordinationCout = outpatientDao.countByDoctorAndStatusAndOutpatientType(doctor,"2","2");
@ -5780,6 +5780,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10());
                    }
                    Map<String,Object> map = sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
                    //同步电子病历
                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId);
                    if (prescriptionEmrDO!=null){
                        writeOutPatient(outpatientDO.getRegisterNo(),prescriptionEmrDO.getComplaint(),prescriptionEmrDO.getMedicalHistory(),prescriptionEmrDO.getPastHistory(),prescriptionEmrDO.getPhysicalExamination(),prescriptionEmrDO.getAssistExamination());
                    }
                    if (map.get("code").toString().equalsIgnoreCase("0")){
                        //  * @param applyDepaName @param applyDoctorName
                        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
@ -5801,8 +5806,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        if (patientMappingDO!=null){
                            userNo = patientMappingDO.getMappingCode();
                        }
                        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patientCode,"1");
                        ylzPayService.msgPush("01",patientMedicareCardDO.getCode(),"01",patientDO.getMobile(),"03",userNo,userName,idcard,realerOrder,applyDepaName,applyDoctorName,recipeTime,free,"1");
                        String cardNo = null;
                        if (!StringUtils.isNoneBlank(outpatientDO.getCardNo())){
                            cardNo = outpatientDO.getCardNo();
                        }
                        ylzPayService.msgPush("01",cardNo,"01",patientDO.getMobile(),"03",userNo,userName,idcard,realerOrder,applyDepaName,applyDoctorName,recipeTime,free,"1");
                    }
                    //sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
@ -6172,7 +6180,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @return
     * @throws Exception
     */
    public String readOutPatientXml(String registerSn) throws Exception {
    public WlyyPrescriptionEmrDO readOutPatientXml(String registerSn) throws Exception {
        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = new WlyyPrescriptionEmrDO();
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("HAI_TAI_URL");
        if (wlyyHospitalSysDictDO!=null){
@ -6182,7 +6191,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "<HtRequest>\n";
        xmlStr+="<REGISTER_SN>"+registerSn+"</REGISTER_SN>";
        xmlStr+="<SEARCH_IDS>CHIEF_COMPLAINT,HPI,ELAPSEMHIS,BODYCHECK,ASSISTANTCHECK</SEARCH_IDS>";
        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmssSSS");
        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmss");
        xmlStr+="<REQ_TIME>"+reqTime+"</REQ_TIME>";
        xmlStr+="</HtRequest>";
        String returnValue = "";
@ -6198,8 +6207,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        XMLSerializer xmlSerializer = new XMLSerializer();
        net.sf.json.JSON json = xmlSerializer.read(returnValue);
        logger.info("返回json"+json);
        return json.toString();
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(json.toString());
        wlyyPrescriptionEmrDO.setComplaint(object.getString("CHIEF_COMPLAINT"));
        wlyyPrescriptionEmrDO.setMedicalHistory(object.getString("HPI"));
        wlyyPrescriptionEmrDO.setPastHistory(object.getString("ELAPSEMHIS"));
        wlyyPrescriptionEmrDO.setPhysicalExamination(object.getString("BODYCHECK"));
        wlyyPrescriptionEmrDO.setAssistExamination(object.getString("ASSISTANTCHECK"));
        return wlyyPrescriptionEmrDO;
    }
    public String writeOutPatient(String registerSn,String chiefComplaint,String hpi,String elapsemhis,String bodycheck,String assistanTcheck) throws Exception {
@ -6211,7 +6225,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        String xmlStr = "<?xml version=\"1.0\" encoding=\"GBK\"?>\n" +
                "<HtRequest>\n";
        xmlStr+="<REGISTER_SN>"+registerSn+"</REGISTER_SN>";
        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmssSSS");
        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmss");
        xmlStr+="<REQ_TIME>"+reqTime+"</REQ_TIME>";
        xmlStr+="<OUTPATIENT_INFO>";
        xmlStr+="<CHIEF_COMPLAINT>"+chiefComplaint+"</CHIEF_COMPLAINT>";
@ -6517,7 +6531,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public MixEnvelop selectByUrl(String prescriptionId,String wxId) throws Exception {
    public MixEnvelop selectByUrl(String oupatientId,String prescriptionId,String wxId) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wxId);
        if (wxWechatDO==null){
            throw new Exception("微信配置不存在!");
@ -6531,11 +6545,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            throw new Exception("openid不存在!");
        }
        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",prescriptionDO.getPatientCode(),"1");
        if (patientMedicareCardDO==null){
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(oupatientId);
        String idcard=null;
        if (wlyyOutpatientDO!=null){
            idcard=wlyyOutpatientDO.getCardNo();
        }
        if (!StringUtils.isNoneBlank(idcard)){
            throw new Exception("就诊卡不存在!");
        }
        String url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(),patientWechatDo.getOpenid(),patientMedicareCardDO.getCode(),"WX");
        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);
    }

+ 1 - 1
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1429,7 +1429,7 @@ public class ImService {
		if(cons.getRelationCode() != null){
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(cons.getRelationCode());
			if(wlyyOutpatientDO != null && wlyyOutpatientDO.getId() != null){
				wlyyOutpatientDO.setStatus("2");
				wlyyOutpatientDO.setStatus("3");
			}
			
			List<WlyyHospitalWaitingRoomDO> wlyyHospitalWaitingRoomDOS = hospitalWaitingRoomDao.findByOutpatientId(cons.getRelationCode());

+ 3 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,7 +25,9 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
  /*  @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
/*
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -399,6 +399,8 @@ public class BaseHospitalRequestMapping {
        public static final String selectOrderByRelationCode = "/selectOrderByRelationCode";
        public static final String ylzRechargeJson="ylzRechargeJson";
        public static final String ylzRefund = "/ylzRefund";

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

@ -467,7 +467,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
        String loginType = getLogintype();
        List<WlyyUserSimple> users = null;
        logger.info("login:登录进入5");
        //1或默认查找user表,为平台管理员账号
        if (StringUtils.isBlank(loginType) || "1".equals(loginType)) {
            //更新登录时间
@ -488,6 +488,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
            this.getJdbcTemplate().update("update base_patient p set p.login_failure_count = 0, p.login_date = ? where p.mobile = ? or p.idcard = ?", new Date(), username, getIdcard());
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_IDCARD_STATEMENT, new BeanPropertyRowMapper(WlyyUserSimple.class), getIdcard());
        }
        logger.info("login:登录进入6");
        return users;
    }

+ 5 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -160,6 +160,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @RequestMapping(value = "/oauth/login", method = RequestMethod.POST)
    public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> login(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
        logger.info("login:登录进入1");
        //图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
@ -168,6 +169,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                throw new ImgCaptchaException("img_captcha error");
            }
        }
        logger.info("login:登录进入2");
        String username = parameters.get("username");
        if (StringUtils.isEmpty(username)) {
@ -191,11 +193,13 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        } else {
            parameters.put("grant_type", "captcha");
        }
        logger.info("login:登录进入3");
        ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
        if (null == authenticatedClient) {
            throw new InvalidRequestException("client_id");
        }
        logger.info("login:登录进入4");
        TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
        oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
        OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
@ -224,6 +228,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        String loginType = parameters.get("login_type");
        String openid = parameters.get("openid");
        String wechatId = parameters.get("wechatId");
        logger.info("login:登录进入7");
        //更新患者openId
        BaseLoginLogDO baseLoginLogDO = new BaseLoginLogDO();
        logger.info("gengxin开始");

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

@ -158,8 +158,8 @@ public class OauthYlzConfigService {
            String rs = com.alibaba.fastjson.JSONObject.toJSONString(re);
            logger.info("TransResponse:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS")+" "+rs);
            com.alibaba.fastjson.JSONObject json = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.parse(rs);
            com.alibaba.fastjson.JSONObject biz = json.getJSONObject("biz_content");
            JSONObject json =JSONObject.parseObject(rs);
            JSONObject biz = json.getJSONObject("biz_content");
            InputStream qrcode = QrcodeUtil.createQrcode(biz.getString("ehealth_authurl"),300,"jpg");
            ByteToInputStream byteToInputStream = new ByteToInputStream();

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -564,8 +564,8 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "patientCode", value = "居民COEE")
			@RequestParam(value = "patientCode",required = false) String patientCode
			) throws Exception {
		int resutl = imService.finish(consult,patientCode,1);
		
		BasePatientDO basePatientDO = basePatientService.findByIdAndDel(patientCode);
		JSONObject msgObj = new JSONObject();
		msgObj.put("msg",basePatientDO.getName()+"结束了咨询");

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

@ -1197,6 +1197,30 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 易联众统一支付
     * @param relationCode
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.ylzRechargeJson)
    @ApiOperation("统一支付--预交金支付")
    public ObjEnvelop ylzRechargeJson(
            @ApiParam(name = "relationCode", value = "relationCode", required = true)
            @RequestParam(required = true)String relationCode,
            @ApiParam(name = "depositType", value = "depositType", required = true)
            @RequestParam(required = true)String depositType,
            @ApiParam(name = "cardType", value = "cardType", required = true)
            @RequestParam(required = true)String cardType,
            @ApiParam(name = "cardNo", value = "cardNo", required = true)
            @RequestParam(required = true)String cardNo) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.ylzRechargeJson(relationCode,depositType,wxId,cardType,cardNo));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    
    /**
@ -1722,9 +1746,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation("获取诊间支付url")
    public ObjEnvelop selectByUrl(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
            @RequestParam(required = true)String prescriptionId,
            @ApiParam(name = "oupatientId", value = "oupatientId", required = true)
            @RequestParam(required = true)String oupatientId) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(prescriptionId,wxId));
            return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(oupatientId,prescriptionId,wxId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }