Browse Source

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

wangjun 4 years ago
parent
commit
ad09a0ea25

+ 30 - 25
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TnPrescriptionService.java

@ -131,12 +131,15 @@ public class TnPrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pr
     * @return
     * @throws Exception
     */
    public  List<WlyyOutpatientVO> findOutpatientList(String patient, String cardNo, String startTime, String endTime, boolean demoFlag, String ksdm)throws Exception{
    public  List<WlyyOutpatientVO> findOutpatientList(String patient, String cardNo, String startTime, String endTime, boolean demoFlag, String ksdm,String flag)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo ="";
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        if(StringUtils.isNotBlank(cardNo)){
            BasePatientDO patientDO = basePatientDao.findByIdAndDel(patient,"1");
        if (StringUtils.isNoneBlank(flag)&&flag.equalsIgnoreCase("his")){
            patNo = patient;
        }else {
            PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
            if(StringUtils.isNotBlank(cardNo)){
                BasePatientDO patientDO = basePatientDao.findByIdAndDel(patient,"1");
            /*JSONArray res = ykyyEntranceService.findPatientCodeByCardNo(cardNo,false);
            if(res !=null&&res.size()>0){
                JSONObject object = (JSONObject) res.get(0);
@ -144,31 +147,33 @@ public class TnPrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pr
                    patNo = object.get("brid").toString();
                }
            }*/
            JSONArray res = tnyyEntranceService.selectPatientMappingCode(patientDO.getIdcard());
            if (res!=null&&res.size()!=0){
                JSONObject object = res.getJSONObject(0);
                patNo = object.getString("BRID");
            }
            if(!StringUtils.isBlank(patNo)){
                if (patientMappingDO!=null){
                    patientMappingDO.setMappingCode(patNo);
                }else {
                    patientMappingDO = new PatientMappingDO();
                    patientMappingDO.setMappingCode(patNo);
                    patientMappingDO.setCreateTime(new Date());
                    patientMappingDO.setSource("1");
                    patientMappingDO.setPatient(patient);
                    patientMappingDO.setIdcard(patientDO.getIdcard());
                    patientMappingDO.setPatientName(patientDO.getName());
                JSONArray res = tnyyEntranceService.selectPatientMappingCode(patientDO.getIdcard());
                if (res!=null&&res.size()!=0){
                    JSONObject object = res.getJSONObject(0);
                    patNo = object.getString("BRID");
                }
                if(!StringUtils.isBlank(patNo)){
                    if (patientMappingDO!=null){
                        patientMappingDO.setMappingCode(patNo);
                    }else {
                        patientMappingDO = new PatientMappingDO();
                        patientMappingDO.setMappingCode(patNo);
                        patientMappingDO.setCreateTime(new Date());
                        patientMappingDO.setSource("1");
                        patientMappingDO.setPatient(patient);
                        patientMappingDO.setIdcard(patientDO.getIdcard());
                        patientMappingDO.setPatientName(patientDO.getName());
                    }
                    patientMappingDao.save(patientMappingDO);
                }
                patientMappingDao.save(patientMappingDO);
            }
        }else {
            if (patientMappingDO!=null){
                patNo = patientMappingDO.getMappingCode();
            }else {
                if (patientMappingDO!=null){
                    patNo = patientMappingDO.getMappingCode();
                }
            }
        }
        if(StringUtils.isBlank(patNo)){
            return null;
        }

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

@ -140,14 +140,16 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @ApiParam(name = "ksdm", value = "科室代码")
                                              @RequestParam(value = "ksdm",required = false) String ksdm,
                                          @ApiParam(name = "cardNo", value = "就诊卡", required = false)
                                              @RequestParam(value = "cardNo",required = false)String cardNo) throws Exception {
                                              @RequestParam(value = "cardNo",required = false)String cardNo,
                                          @ApiParam(name = "flag", value = "标识", required = false)
                                              @RequestParam(value = "flag",required = false)String flag) throws Exception {
        startTime = startTime+" 00:00:00";
        endTime =endTime+" 23:59:59";
        List<WlyyOutpatientVO> vos = new ArrayList<>();
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm,cardNo);
        }else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")){
            vos = tnPrescriptionService.findOutpatientList(patient, cardNo,startTime, endTime, demoFlag,ksdm);
            vos = tnPrescriptionService.findOutpatientList(patient, cardNo,startTime, endTime, demoFlag,ksdm,flag);
        }else {
            return ListEnvelop.getError("尚未开发!");
        }