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 5 years ago
parent
commit
a7ac67d812

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

@ -1893,6 +1893,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        outpatientDao.save(outpatientDO);
        //============================下诊断end==============================================================
        //=====================电子病历=================================================start
        prescriptionEmrDao.deleteByPrescriptionId(prescription.getId());
        if (StringUtils.isNotBlank(emrJson)) {
            WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = com.alibaba.fastjson.JSONObject.parseObject(emrJson,WlyyPrescriptionEmrDO.class);
            wlyyPrescriptionEmrDO.setDel(1);
            wlyyPrescriptionEmrDO.setPrescriptionId(prescription.getId());
            prescriptionEmrDao.save(wlyyPrescriptionEmrDO);
        }
        //=====================电子病历=================================================end
        //判断是否有检查检验或药品开方
        if ("1".equals(type)) {
@ -1960,16 +1970,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            //=====================检查检验=======================================================================
            //=====================电子病历=================================================start
            prescriptionEmrDao.deleteByPrescriptionId(prescription.getId());
            if (StringUtils.isNotBlank(emrJson)) {
                WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = com.alibaba.fastjson.JSONObject.parseObject(emrJson,WlyyPrescriptionEmrDO.class);
                wlyyPrescriptionEmrDO.setDel(1);
                wlyyPrescriptionEmrDO.setPrescriptionId(prescription.getId());
                prescriptionEmrDao.save(wlyyPrescriptionEmrDO);
            }
            //=====================电子病历=================================================end
            //保存挂号费用
            prescription.setRegFee(getChargeFee(outpatientDO.getDoctor()));
            //=====================保存日志 start=========================================================
@ -5593,6 +5594,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                age = IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard());
                gender=IdCardUtil.getSexForIdcard(prescriptionDO.getIdcard());
            }
            BasePatientDO patientDO = basePatientDao.findById(prescriptionDO.getPatientCode());
            data.put("name",prescriptionDO.getPatientName());
            data.put("age",age);
            data.put("gender",gender);
@ -5603,6 +5605,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                systemMessageDO.setTitle("审方通过");
                data.put("message","审方通过");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+age+"岁 "+gender+")开具的处方已审核通过。");
                /**
                 *  * @param userName      推送人姓名
                 * @param idCard        推送人身份证
                 * @param phone         推送人手机号
                 * @param title         推送标题
                 * @param url           跳转链接
                 * @param content       内容简介
                 * @param contentString 内容明细串
                 */
               /* String idCard = "";
                String phone = "";
                String title="";
                String url = "https://hlwyy.xmzsh.com/ims-wx/#/returnVisit/record?outpatientId="+prescriptionDO.getOutpatientId();
                String content = "";
                String contentString = "";
                if (patientDO!=null){
                    idCard = patientDO.getIdcard();
                    phone = patientDO.getMobile();
                    title = patientDO.getName()+",您好!医生已为您开具处方,请及时支付";
                }
                entranceService.ehospitalNotice(prescriptionDO.getPatientName())*/
            } else if (status==1) {
                systemMessageDO.setType("8");
                systemMessageDO.setTitle("审方退回");
@ -5768,7 +5791,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        xmlStr+="</HtRequest>";
        String returnValue = "";
        Map<String, String> params = new HashedMap();
        params.put("type","writeOutPatient");
        params.put("type","readOutPatient");
        params.put("xmlStr",xmlStr);
        returnValue = com.yihu.jw.utils.WebserviceUtil.post(url,
                "http://business.htemr.haitaiinc.com",

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

@ -882,7 +882,7 @@ public class XzzxEntranceService{
            condition +="<dept>"+dept+"</dept>";
        }
        if (!StringUtils.isEmpty(sickId)&&!sickId.equalsIgnoreCase("null")){
            condition += "<sickId>"+sickId+"</sickId>";
            condition += "<sickid>"+sickId+"</sickid>";
        }
        if (!StringUtils.isEmpty(clinicclass)&&!clinicclass.equalsIgnoreCase("null")){

+ 29 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -1559,7 +1559,16 @@ public class YkyyEntranceService {
        }
        Integer icd10Flag = 0;
        //诊断删除v_hlwys_mz_jzls
        if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getAdmNo())){
            String deleteSql = "delete from v_hlwys_mz_jzls where jzxh = '"+wlyyPrescriptionVO.getAdmNo()+"'";
            Map<String,Object> params = new HashedMap();
            params.put("sql",deleteSql);
            HttpResponse response = HttpUtils.doGet(updateUrl,params);
            if (response.getStatus()==200){
                logger.info("表v_hlwys_mz_jzls删除成功!");
            }
        }
        List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = prescriptionDiagnosisDao.findByPrescriptionId(code,1);
        if(diagnosisDOs!=null&&diagnosisDOs.size()>0){
            WlyyPrescriptionDiagnosisDO diagnosisDO = diagnosisDOs.get(0);
@ -1616,6 +1625,16 @@ public class YkyyEntranceService {
                logger.info("表hlwYsMzJzLsDO同步成功!");
            }
            //删除疾病诊断表HLWYS_MZ_JBZD
            if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getAdmNo())){
                String deleteSql = "delete from v_hlwys_mz_jbzd where jzxh = '"+wlyyPrescriptionVO.getAdmNo()+"'";
                Map<String,Object> params = new HashedMap();
                params.put("sql",deleteSql);
                HttpResponse response = HttpUtils.doGet(updateUrl,params);
                if (response.getStatus()==200){
                    logger.info("表v_hlwys_mz_jbzd删除成功!");
                }
            }
            //疾病诊断表HLWYS_MZ_JBZD
            HlwYsMzJbzdDO hlwYsMzJbzdDO = new HlwYsMzJbzdDO();
            //hlwYsMzJbzdDO.setJLBH(0);
@ -1754,6 +1773,15 @@ public class YkyyEntranceService {
                if (StringUtils.isEmpty(cfsb)){
                    throw new Exception("添加失败");
                }
                if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getRealOrder())){
                    String deleteSql = "delete from v_ms_dd02 where cfsb = '"+wlyyPrescriptionVO.getRealOrder()+"'";
                    Map<String,Object> params1 = new HashedMap();
                    params1.put("sql",deleteSql);
                    HttpResponse response = HttpUtils.doGet(updateUrl,params1);
                    if (response.getStatus()==200){
                        logger.info("表v_ms_dd02删除成功!");
                    }
                }
                List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS =wlyyPrescriptionVO.getInfoVOs();
                for (WlyyPrescriptionInfoVO wlyyPrescriptionInfoVO:wlyyPrescriptionInfoVOS){
                    try {

+ 0 - 1
business/base-service/src/main/java/com/yihu/jw/utils/hibernate/HibenateUtils.java

@ -186,5 +186,4 @@ public class HibenateUtils {
}

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java

@ -99,6 +99,8 @@ public class WxTemplateService {
    private BaseDoctorDao doctorDao;
    @Autowired
    private PrescriptionLogService prescriptionLogService;
    
    
    /**
@ -195,6 +197,8 @@ public class WxTemplateService {
                            String prescriptionId = pre.get(0).get("ID").toString();
                            String doctorName = pre.get(0).get("DOCTOR_NAME").toString();
                            //判断是否发送过
                            String countSql = "SELECT id from WX_PUSH_LOG w WHERE w.RECEIVER = '"+patientDO.getId()
                                    +"' and w.OPENID = '"+prescriptionId+"' and w.scene = 'djsxxtz' and w.WECHAT_ID='"+wechatId+"'";

+ 3 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/UnSettledHISPrescriptionJob.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.service.channel.UnSettledHISPrescriptionService;
import com.yihu.jw.util.wechat.WeiXinMessageUtils;
import com.yihu.jw.wechat.service.WxTemplateService;
import org.quartz.DisallowConcurrentExecution;
@ -27,13 +28,13 @@ public class UnSettledHISPrescriptionJob implements Job{
    private static final Logger logger = LoggerFactory.getLogger(UnSettledHISPrescriptionJob.class);
    @Autowired
    private WxTemplateService wxTemplateService;
    private UnSettledHISPrescriptionService unSettledHISPrescription;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========UnSettledHISPrescriptionJob========");
        try {
            wxTemplateService.unSettledHISPrescription();
            unSettledHISPrescription.unSettledHISPrescription();
            logger.info("END========UnSettledHISPrescriptionJob 执行结束========");
        }catch (Exception e){

+ 3 - 3
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/UpdateStatusByPayTimeJob.java

@ -1,6 +1,6 @@
package com.yihu.jw.job.ykyy;
import com.yihu.jw.wechat.service.WxTemplateService;
import com.yihu.jw.service.channel.UnSettledHISPrescriptionService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
@ -23,13 +23,13 @@ public class UpdateStatusByPayTimeJob implements Job{
    private static final Logger logger = LoggerFactory.getLogger(UpdateStatusByPayTimeJob.class);
    @Autowired
    private WxTemplateService wxTemplateService;
    private UnSettledHISPrescriptionService unSettledHISPrescriptionService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========UpdateStatusByPayTimeJob========");
        try {
            wxTemplateService.updateStatusByPayTime();
            unSettledHISPrescriptionService.updateStatusByPayTime();
            logger.info("END========UpdateStatusByPayTimeJob 执行结束========");
        }catch (Exception e){

+ 35 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -8,18 +8,24 @@ import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.service.WechatInfoService;
import com.ylzinfo.onepay.sdk.OnepayDefaultClient;
@ -84,6 +90,10 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private OauthYlzConfigDao oauthYlzConfigDao;
    @Autowired
    private HospitalDeptService hospitalDeptService;
    @Autowired
    private BusinessOrderDao businessOrderDao;
    @Autowired
    private PrescriptionDao prescriptionDao;
@ -320,7 +330,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @ResponseBody
    @ApiOperation("微信支付结果通知")
    @RequestMapping(value = "/notify", method = {RequestMethod.GET, RequestMethod.POST})
    public Map<String, String> wxPayNotify(HttpServletRequest request, HttpServletResponse response) throws IOException {
    public Map<String, String> wxPayNotify(HttpServletRequest request, HttpServletResponse response) throws Exception {
        String result = "";
        String inputLine;
        while ((inputLine = request.getReader().readLine()) != null) {
@ -328,6 +338,21 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        }
        request.getReader().close();
        Map<String, String> map = businessOrderService.getWxPayResultNotify(result);
        //im处方发消息
        Map<String,Object> wxrs =  XMLUtil.xmltoMap(result);
        if("SUCCESS".equals(wxrs.get("return_code").toString())){
            // 我方 订单号+时间差
            String seqNo = wxrs.get("out_trade_no")+"";
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(seqNo);
            if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                logger.info("11111参数入参"+object.toJSONString());
                WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                imService.pushPrescriptionImMessage(prescriptionVO);
            }
        }
        return map;
    }
@ -378,6 +403,15 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                    logger.info("param"+params);
                    String traceNo = param.getString("outChargeNo");
                    businessOrderService.updatePayStatus(traceNo);
                    //im处方发消息
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(traceNo);
                    if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
                        JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                        logger.info("11111参数入参"+object.toJSONString());
                        WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                        imService.pushPrescriptionImMessage(prescriptionVO);
                    }
                    response.getWriter().write("SUCCESS");
                }
            }

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

@ -994,13 +994,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                        consult.put("session_id", consult.get("patientId").toString()+"_"+ consult.get("generalDoctor").toString()+"_"+ consult.get("doctorCode").toString()+"_15");
                    }else{}
                }else if("9".equals(type)){//图文复诊
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientid")!=null?consult.get("outpatientid").toString():null+"_9");
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientId")!=null?consult.get("outpatientId").toString():null+"_9");
                    consult.put("type",type);
                }else if("16".equals(type)){//视频复诊
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientid")!=null?consult.get("outpatientid").toString():null+"_16");
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientId")!=null?consult.get("outpatientId").toString():null+"_16");
                    consult.put("type",type);
                }else if("12".equals(type)){//协同门诊
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientid")!=null?consult.get("outpatientid").toString():null+"_12");
                    consult.put("session_id", consult.get("patientId")!=null?consult.get("patientId").toString():null+"_"+consult.get("outpatientId")!=null?consult.get("outpatientId").toString():null+"_12");
                    consult.put("type",type);
                }else{}
                
@ -1304,12 +1304,20 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionService.findPrescriptionDo(prescriptionId);
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(wlyyPrescriptionDO.getOutpatientId());
            com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
            msgObj.put("outpatientid",wlyyPrescriptionDO.getOutpatientId());
            msgObj.put("prescriptionId",prescriptionId);
            msgObj.put("reason",reason);
            String immsg = imService.pushPrescriptionBackMsg(msgObj,operate,operateName,wlyyPrescriptionDO.getOutpatientId(),wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
            System.out.println("发送诊断消息成功:"+immsg);
            if (status==1){
                com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
                msgObj.put("outpatientid",wlyyPrescriptionDO.getOutpatientId());
                msgObj.put("prescriptionId",prescriptionId);
                msgObj.put("reason",reason);
                String immsg = imService.pushPrescriptionBackMsg(msgObj,operate,operateName,wlyyPrescriptionDO.getOutpatientId(),wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
                System.out.println("发送诊断消息成功:"+immsg);
            }else if (status==2){
                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                System.out.println("11111参数入参"+object.toJSONString());
                WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                imService.pushPrescriptionImMessage(prescriptionVO);
            }
        }catch (Exception e){
            System.out.println("发送诊断消息失败:"+e.getMessage());
//            e.printStackTrace();