Переглянути джерело

添加工具类判断节假日

wangzhinan 2 роки тому
батько
коміт
1003f49a58

+ 47 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/HcyyPrescriptionService.java

@ -46,6 +46,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.security.PublicKey;
import java.text.DecimalFormat;
import java.util.*;
@ -105,6 +106,8 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    public BusinessOrderDao businessOrderDao;
    @Autowired
    public PrescriptionLogDao prescriptionLogDao;
    @Autowired
    public PrescriptionService prescriptionService;
@ -1821,6 +1824,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            System.out.println("response=="+response.getContent());
            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(ylzMedicalRelationDO.getRelationCode());
            /*String */
            String realOrder = "";
            for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOS){
                if (prescriptionDO.getStatus()==20){
                    WlyyPrescriptionLogDO prescriptionLogDO = new WlyyPrescriptionLogDO();
@ -1837,14 +1841,57 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                    prescriptionDO.setPayTime(new Date());
                    prescriptionDao.save(prescriptionDO);
                    logger.info("变更处方结算状态成功");
                    realOrder = prescriptionDO.getRealOrder();
                }
                try {
                    sfToHis(outpatientId, realOrder);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
            return "结算成功!";
        }catch (Exception e){
            e.printStackTrace();
            return "结算失败";
        }
    }
    /**
     * 顺丰下订单后同步his
     * @param outpatientId
     * @param realorder
     * @return
     * @throws Exception
     */
    public String sfToHis(String outpatientId,String realorder) throws Exception {
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        String registerNo = outpatientDO.getRegisterNo();
        List<WlyyPrescriptionExpressageDO> prescriptionExpressageDOS = prescriptionExpressageDao.findByOutpatientId(outpatientId);
        WlyyPrescriptionExpressageDO expressageDO = new WlyyPrescriptionExpressageDO();
        if (prescriptionExpressageDOS!=null&&prescriptionExpressageDOS.size()!=0){
            expressageDO = prescriptionExpressageDOS.get(0);
        }
        if (expressageDO!=null){
            if (expressageDO.getOneselfPickupFlg()==0){
                Object result=prescriptionService.getSFExpressInfoNew(registerNo,realorder,"");
                String re = result.toString();
                if (re!=null){
                    JSONObject object = JSONObject.parseObject(re);
                    String sfOrder = object.getString("mainMailNo");
                    String address = expressageDO.getProvinceName()+expressageDO.getCityName()+expressageDO.getTownName()+expressageDO.getStreetName()+expressageDO.getAddress();
                    String phone = expressageDO.getMobile();
                    String remark = expressageDO.getRemark();
                    String cardNo = outpatientDO.getCardNo();
                    return  hcyyEntranceService.updateSftoHis(registerNo,cardNo,sfOrder,address,phone,remark);
                }else {
                    return null;
                }
            }else {
                return null;
            }
        }
        return null;
    }
}

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

@ -2712,6 +2712,55 @@ public class HcyyEntranceService {
        return json;
    }
    /**
     * 互联网医院传入快递单号通知院内摆药
     * @param registerNo
     * @param cardNo
     * @param sfOrder
     * @param address
     * @param phone
     * @param remark
     * @return
     * @throws Exception
     */
    public String updateSftoHis(String registerNo,String cardNo,String sfOrder,String address,String phone,String remark) throws Exception {
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>sendDispensingToHis</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+checkKey+"</certificate> " +
                "</root>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
              "<root>\n" +
                "    <HISTradeNo>"+registerNo+"</HISTradeNo>\n" +
                "    <payCardNo>"+cardNo+"</payCardNo>\n" +
                "    <isExpress>1</isExpress>\n" +
                "<expressBillNo>"+sfOrder+"</expressBillNo>\n" +
                "<expressAddress>"+address+"</expressAddress>\n" +
                "<expressPhone>"+phone+"</expressPhone>\n" +
                "    <remark>"+remark+"</remark>\n" +
                "</root>";
        Map<String,String> params = new HashedMap();
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("sendDispensingToHis params:"+params.toString());
        String xml = getHcyyCAWebServiceInfo("CallInterface",params,getYYCheckUrl());
        wlyyHttpLogDO.setResponse(xml);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setCode("sendDispensingToHis");
        wlyyHttpLogDO.setName("互联网医院传入快递单号通知院内摆药");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info("互联网医院传入快递单号通知院内摆药 json:"+xml);
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        return json;
    }
    //处方保存前,进行合理用药审查
    public String checkPrescriptions(String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,String outpatientId) throws Exception {
@ -3090,5 +3139,7 @@ public class HcyyEntranceService {
        return content;
    }
    //===========================结算==================================
}

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

@ -851,4 +851,13 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
        }
        return success(hcyyEntranceService.doubleSign(outpatient,prescriptionOnly,payType,patient,doctor,wlyyPrescriptionInfoDOS,wlyyPrescriptionDiagnosisDOS));
    }
    @GetMapping(value = "/sfToHis")
    @ApiOperation(value = "顺丰下订单后同步his", notes = "顺丰下订单后同步his")
    public ObjEnvelop findHistoryEmrRecord(@ApiParam(name = "outpatientId", value = "门诊id", required = false)
                                           @RequestParam(value = "outpatientId",required = false)String outpatientId,
                                           @ApiParam(name = "realorder", value = "处方号", required = false)
                                           @RequestParam(value = "realorder",required = false)String realorder)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyPrescriptionService.sfToHis(outpatientId,realorder));
    }
}