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/file_upload/FileUploadService.java
#	common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
wangzhinan 3 years ago
parent
commit
d549267051

+ 37 - 22
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java

@ -27,6 +27,7 @@ import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionExpressageDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionExpressageDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.common.LatitudeUtils;
@ -90,6 +91,8 @@ public class HealthCareService {
    private YlzMedicailMxDao ylzMedicailMxDao;
    private YlzMedicailMxDao ylzMedicailMxDao;
    @Autowired
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    private XzzxEntranceService xzzxEntranceService;
    @Autowired
    private EntranceService entranceService;
    private String ylzConfigUrl;
    private String ylzConfigUrl;
    private String ylzConfigAppid;
    private String ylzConfigAppid;
@ -395,30 +398,42 @@ public class HealthCareService {
        String his_serial = outpatientDO.getRegisterNo();
        String his_serial = outpatientDO.getRegisterNo();
        String org_code = hospitalSysDictDO.getDictCode();
        String org_code = hospitalSysDictDO.getDictCode();
        JSONObject data;
        JSONObject data = new JSONObject();
        if (StringUtils.isNoneBlank(wxId)){
        if (StringUtils.isNoneBlank(wxId)){
            if (wxId.equalsIgnoreCase("xm_xzzx_wx")){}
        }
        //获取his处方信息
        JSONObject infoObject= xzzxEntranceService.presUploadToEntrance(icCardNo,his_serial,org_code);
       /* if (infoObject!=null){
            if (wxId.equalsIgnoreCase("xm_xzzx_wx")){
                //获取his处方信息
                JSONObject infoObject= xzzxEntranceService.presUploadToEntrance(icCardNo,his_serial,org_code);
                JSONObject info = infoObject.getJSONArray("data").getJSONObject(0);
                if("0".equals(info.getString("ret_code"))){
                    data = info;
                }else {
                    throw new Exception("获取his处方信息失败:"+infoObject.getString("ret_mess"));
                }
        }*/
       JSONObject info = infoObject.getJSONArray("data").getJSONObject(0);
        if("0".equals(info.getString("ret_code"))){
            data = info;
        }else {
            throw new Exception("获取his处方信息失败:"+infoObject.getString("ret_mess"));
                data.remove("ret_code");
                data.remove("ret_mess");
                data.remove("log_no");
                data.put("order_id",prescriptionId);
            }else if(wxId.equalsIgnoreCase("xm_zsyy_wx")){
                String result = entranceService.BS15036(null,null,null,null,null,null,his_serial,false);
                if (StringUtils.isNoneBlank(result)){
                    JSONObject resultJSON = JSONObject.parseObject(result);
                    if (resultJSON!=null){
                        JSONObject msgInfoJson = resultJSON.getJSONObject("msgInfo");
                        if (msgInfoJson!=null){
                            JSONArray resultResult = msgInfoJson.getJSONArray("receipt");
                            if (resultResult!=null&&resultResult.size()!=0){
                                JSONObject receipt = resultResult.getJSONObject(0);
                                data.put("name",receipt.getString("xming0"));
                                data.put("cert_type",receipt.getString("01"));
                                data.put("region_code",receipt.getString("3502"));
                            }
                        }
                    }
                }
            }
        }
        }
        data.remove("ret_code");
        data.remove("ret_mess");
        data.remove("log_no");
        data.put("order_id",prescriptionId);
        YlzMedicalPrescriptionUploadDO uploadDO = new YlzMedicalPrescriptionUploadDO();
        YlzMedicalPrescriptionUploadDO uploadDO = new YlzMedicalPrescriptionUploadDO();
        uploadDO.setOrgCode(org_code);
        uploadDO.setOrgCode(org_code);
        uploadDO.setIcCardNo(icCardNo);
        uploadDO.setIcCardNo(icCardNo);
@ -427,7 +442,7 @@ public class HealthCareService {
        uploadDO.setPrescriptionId(prescriptionId);
        uploadDO.setPrescriptionId(prescriptionId);
        uploadDO.setRegionCode(data.getString("region_code"));
        uploadDO.setRegionCode(data.getString("region_code"));
        uploadDO.setName(data.getString("name"));
        uploadDO.setName(data.getString("name"));
        uploadDO.setIdcard(data.getString("idcard"));
        uploadDO.setIdcard(outpatientDO.getIdcard());
        uploadDO.setCertType(data.getString("cert_type"));
        uploadDO.setCertType(data.getString("cert_type"));
        uploadDO.setDataSource("53");//53移动支付
        uploadDO.setDataSource("53");//53移动支付
        uploadDO.setInsuranceSerial(data.getString("insurance_serial"));
        uploadDO.setInsuranceSerial(data.getString("insurance_serial"));

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

@ -12543,26 +12543,35 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if(StringUtils.isNoneBlank(itemPrice)){
            if(StringUtils.isNoneBlank(itemPrice)){
                natFee= Double.parseDouble(itemPrice)*100;
                natFee= Double.parseDouble(itemPrice)*100;
            }
            }
            //先预约号源
            Date format2 = null;
            format2 = new SimpleDateFormat("yyyy-MM-dd").parse(natTime);
            String shortDate = new SimpleDateFormat("yyyyMMdd").format(format2);
            System.out.println("yyyy-MM-dd转yyyyMMdd:"+shortDate);
            String regRes=tasyNatService.saveRegOrder(regDept,shortDate,pm,preNo,cardNo,mobile,name,"3");
            com.alibaba.fastjson.JSONObject regObj = com.alibaba.fastjson.JSONObject.parseObject(regRes);
            String HisSeqNo="";
            String HisSeqNo="";
            String orderNum="";
            String orderNum="";
            if (regObj!=null){
                if ("true".equalsIgnoreCase(regObj.getString("success"))){
                    com.alibaba.fastjson.JSONObject dataObj = com.alibaba.fastjson.JSONObject.parseObject(regObj.getString("data"));
                    HisSeqNo=dataObj.getString("HisSeqNo").trim();
                    orderNum=dataObj.getString("OrderNumber").trim();
                }else {
                    returnMap.put("msg",regObj.getString("data"));
                    returnMap.put("status","-1");
                    return  returnMap;
            WlyyHospitalSysDictDO tasyTime = wlyyHospitalSysDictDao.findById("natTime");
            if (tasyTime!=null){
                String natTimeC   = tasyTime.getDictValue();
                if (natTimeC.equalsIgnoreCase("1")){
                    //先预约号源
                    Date format2 = null;
                    format2 = new SimpleDateFormat("yyyy-MM-dd").parse(natTime);
                    String shortDate = new SimpleDateFormat("yyyyMMdd").format(format2);
                    System.out.println("yyyy-MM-dd转yyyyMMdd:"+shortDate);
                    String regRes=tasyNatService.saveRegOrder(regDept,shortDate,pm,preNo,cardNo,mobile,name,"3");
                    com.alibaba.fastjson.JSONObject regObj = com.alibaba.fastjson.JSONObject.parseObject(regRes);
                    if (regObj!=null){
                        if ("true".equalsIgnoreCase(regObj.getString("success"))){
                            com.alibaba.fastjson.JSONObject dataObj = com.alibaba.fastjson.JSONObject.parseObject(regObj.getString("data"));
                            HisSeqNo=dataObj.getString("HisSeqNo").trim();
                            orderNum=dataObj.getString("OrderNumber").trim();
                        }else {
                            returnMap.put("msg",regObj.getString("data"));
                            returnMap.put("status","-1");
                            return  returnMap;
                        }
                    }
                }
                }
            }
            }
            //先进行核算检测预约
            //先进行核算检测预约
            String realOrder="";
            String realOrder="";
            String addressNow=provinceName+cityName+townName+streetName+address;
            String addressNow=provinceName+cityName+townName+streetName+address;
@ -12577,7 +12586,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    if ("0".equalsIgnoreCase(returnCode)){
                    if ("0".equalsIgnoreCase(returnCode)){
                        returnMap.put("msg",object.getString("data"));
                        returnMap.put("msg",object.getString("data"));
                        returnMap.put("status","-1");
                        returnMap.put("status","-1");
                        tasyNatService.cancleOrder(cardNo,HisSeqNo,orderNum);
                        if (tasyTime.getDictValue().equalsIgnoreCase("1")){
                            tasyNatService.cancleOrder(cardNo,HisSeqNo,orderNum);
                        }
                        return  returnMap;
                        return  returnMap;
                    }else {
                    }else {
                        flag = true;
                        flag = true;
@ -12600,7 +12611,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                baseNatAppointmentDO.setCardType(cardType);
                baseNatAppointmentDO.setCardType(cardType);
                baseNatAppointmentDO.setIdnoType(idnoType);
                baseNatAppointmentDO.setIdnoType(idnoType);
                baseNatAppointmentDO.setAddress(address);
                baseNatAppointmentDO.setAddress(address);
                baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
                if (tasyTime.getDictValue().equalsIgnoreCase("1")){
                    baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
                }else {
                    baseNatAppointmentDO.setAppointmentTime(new Date());
                }
                baseNatAppointmentDO.setOderNum(orderNum);
                baseNatAppointmentDO.setOderNum(orderNum);
                baseNatAppointmentDO.setCityName(cityName);
                baseNatAppointmentDO.setCityName(cityName);
                baseNatAppointmentDO.setFirstJobCode(firstJobCode);
                baseNatAppointmentDO.setFirstJobCode(firstJobCode);
@ -13153,10 +13168,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }else if("xm_tasy_wx".equalsIgnoreCase(wechatId)){
                    }else if("xm_tasy_wx".equalsIgnoreCase(wechatId)){
                        if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                        if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                            logger.info("同步his订单状态"+baseNatAppointmentDO.getRealOrder());
                            logger.info("同步his订单状态"+baseNatAppointmentDO.getRealOrder());
                            //取消号源
                            String registerCancel =tasyNatService.cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
                            com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(registerCancel);
                            String isSuccess=jsonObject.getString("success");
                            WlyyHospitalSysDictDO tasyTime = wlyyHospitalSysDictDao.findById("natTime");
                            if (tasyTime!=null){
                                if (tasyTime.getDictValue().equalsIgnoreCase("1")){
                                    //取消号源
                                    String registerCancel =tasyNatService.cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
                                    com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(registerCancel);
                                    String isSuccess=jsonObject.getString("success");
                                }
                            }
                            String natCancel=tasyNatService.cancelNat(baseNatAppointmentDO.getRealOrder(),baseNatAppointmentDO.getMedicare().trim(),baseNatAppointmentDO.getName());
                            String natCancel=tasyNatService.cancelNat(baseNatAppointmentDO.getRealOrder(),baseNatAppointmentDO.getMedicare().trim(),baseNatAppointmentDO.getName());
                            com.alibaba.fastjson.JSONObject jsonObject1 = JSON.parseObject(natCancel);
                            com.alibaba.fastjson.JSONObject jsonObject1 = JSON.parseObject(natCancel);
                            String returnCode=jsonObject1.getString("ReturnCode");
                            String returnCode=jsonObject1.getString("ReturnCode");

+ 59 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -101,6 +101,9 @@ public class EntranceService {
    //his退费接口
    //his退费接口
    private static String BS15021 = "BS15021";
    private static String BS15021 = "BS15021";
    //查询待扣费处方信息
    private static String BS15036 = "BS15036";
    private String orgCode = "350211A1002";
    private String orgCode = "350211A1002";
    private String orgName = "350211A1002";
    private String orgName = "350211A1002";
    @Value("${hospital.mqUser}")
    @Value("${hospital.mqUser}")
@ -2736,6 +2739,61 @@ public class EntranceService {
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    }
    /**
     *
     * 查询待扣费处方信息
     *
     * @param cardno 患者卡号
     * @param sfzh00 身份证
     * @param isMedicalNewInterface 是否是新医保
     * @param fwqd00 服务渠道商
     * @param extra 扩展参数
     * @param notes 备注信息
     * @param ghh000 挂号号
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public String BS15036(String cardno,String sfzh00,String isMedicalNewInterface,String fwqd00,String extra,String notes,String ghh000,boolean demoFlag) throws Exception {
        int i = 0;
        String fid = BS15036;
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>" + mqUser + "</UserName><Password>" + mqPwd + "</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>" + sourceSysCode + "</SourceSysCode><TargetSysCode>" + targetSysCode + "</TargetSysCode></MessageHeader>");
            sbs.append("<MsgInfo><endNum>500</endNum><Msg></Msg>");
            if (StringUtils.isNotBlank(cardno)) {
                sbs.append("<query compy=\"=\" item=\"cardno\" splice=\"and\" value=\"" + cardno + "\"/>");
            }
            if (StringUtils.isNotBlank(sfzh00)) {
                sbs.append("<query compy=\"=\" item=\"sfzh00\" splice=\"and\" value=\"" + sfzh00 + "\"/>");
            }
            if (StringUtils.isNotBlank(isMedicalNewInterface)) {
                sbs.append("<query compy=\"=\" item=\"isMedicalNewInterface\" splice=\"and\" value=\"" + isMedicalNewInterface + "\"/>");
            }
            if (StringUtils.isNotBlank(fwqd00)) {
                sbs.append("<query compy=\"=\" item=\"fwqd00\" splice=\"and\" value=\"" + fwqd00 + "\"/>");
            }
            if (StringUtils.isNotBlank(extra)) {
                sbs.append("<query compy=\"=\" item=\"extra\" splice=\"and\" value=\"" + extra + "\"/>");
            }
            if (StringUtils.isNotBlank(notes)) {
                sbs.append("<query compy=\"=\" item=\"notes\" splice=\"and\" value=\"" + notes + "\"/>");
            }
            if (StringUtils.isNotBlank(ghh000)) {
                sbs.append("<query compy=\"=\" item=\"ghh000\" splice=\"and\" value=\"" + ghh000 + "\"/>");
            }
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            logger.info("resp=" + resp);
        }
        return MqSdkUtil.xml2jsonArrayRootRowBS10144(resp);
    }
    /**
    /**
     * 同步医生信息
     * 同步医生信息
     *
     *
@ -3238,4 +3296,5 @@ public class EntranceService {
    }
    }
}
}

+ 4 - 1
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/healthCare/HealthCareEndPoint.java

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
/**
/**
@ -26,6 +27,8 @@ public class HealthCareEndPoint extends EnvelopRestEndpoint {
    @Autowired
    @Autowired
    private HealthCareService healthCareService;
    private HealthCareService healthCareService;
    @Value("${wechat.id}")
    private String wechatId;
    @GetMapping(value = "doctorAuthentication")
    @GetMapping(value = "doctorAuthentication")
@ -67,7 +70,7 @@ public class HealthCareEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "医师开方上传", notes = "医师开方上传")
    @ApiOperation(value = "医师开方上传", notes = "医师开方上传")
    public ObjEnvelop doctorPrescriptionUpload(@ApiParam(name = "prescriptionId", value = "处方id", required = true)
    public ObjEnvelop doctorPrescriptionUpload(@ApiParam(name = "prescriptionId", value = "处方id", required = true)
                                               @RequestParam(value = "prescriptionId",required = true) String prescriptionId)throws Exception{
                                               @RequestParam(value = "prescriptionId",required = true) String prescriptionId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.doctorPrescriptionUpload(prescriptionId));
        return ObjEnvelop.getSuccess("ok",healthCareService.doctorPrescriptionUpload(prescriptionId,wechatId));
    }
    }
    @GetMapping(value = "doctorPrescriptionUploadCancle")
    @GetMapping(value = "doctorPrescriptionUploadCancle")