wangjun преди 4 години
родител
ревизия
51886b8e70

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/DictHospitalDeptDao.java

@ -50,4 +50,7 @@ public interface DictHospitalDeptDao extends PagingAndSortingRepository<DictHosp
    @Query("delete from DictHospitalDeptDO  where orgCode=?1")
    void deleteByOrgCode(String orgCode);
    @Query("from DictHospitalDeptDO  where usualName = ?1")
    List<DictHospitalDeptDO> findByUsuallyName(String usualName);
}

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

@ -3725,7 +3725,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                rs.put("winNo", org.getWinNo());
                rs.put("deptName", hospitalDOs.get(0).getDeptName());
                rs.put("dept", hospitalDOs.get(0).getDeptCode());
                if (StringUtils.isNotBlank(withWork) && "1".equals(withWork)) {
                    List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(doctor, hospitalDOs.get(0).getOrgCode(),"");
                    rs.put("workTime", times);

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

@ -157,6 +157,8 @@ public class YkyyEntranceService {
    private YkyySMSService ykyySMSService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private DictHospitalDeptDao dictHospitalDeptDao;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
@ -406,6 +408,7 @@ public class YkyyEntranceService {
     * @throws Exception
     */
    public List<WlyyOutpatientVO> BS30025(String PAT_NO, String conNo, String startTime, String endTime, boolean demoFlag,String ksdm) throws Exception {
        String fid = "BS30025";
        logger.info("EntranceService " + fid + " PAT_NO :" + PAT_NO + " conNo:" + conNo + " startTime:" + startTime + " endTime:" + endTime);
@ -574,8 +577,30 @@ public class YkyyEntranceService {
     * @throws Exception
     */
    public JSONArray findV_ZKSG_HZCX_HIS(String brid,String conNo,String startTime,String endTime,String ksdm) throws Exception{
        String sql = "SELECT to_char(h.KSSJ ,'yyyy/MM/dd hh24:mi:ss' ) as KSSJ,h.BRID,h.BRXM,h.SJHM,h.JZKH,h.SFZH,h.BRXZ,h.YSDM,h.KDYS" +
                ",h.KSDM,h.KSMC,h.ZDMC,h.JZXH from V_ZKSG_HZCX_HIS h WHERE h.BRID = "+brid+" ";
        String depts ="";
        String deptUsuaName ="";
        if (StringUtils.isNoneBlank(ksdm)){
            DictHospitalDeptDO dictHospitalDeptDO = dictHospitalDeptDao.findByCode(ksdm);
            if (dictHospitalDeptDO!=null){
                deptUsuaName = dictHospitalDeptDO.getUsualName();
            List<DictHospitalDeptDO> deptList =dictHospitalDeptDao.findByUsuallyName(deptUsuaName);
            if (deptList!=null&&deptList.size()>0){
                for (int i =0 ;i<deptList.size();i++){
                    if (i==deptList.size()-1){
                        depts +=deptList.get(i).getCode();
                    }else {
                        depts+=deptList.get(i).getCode()+",";
                    }
                }
            }else {
                depts = dictHospitalDeptDO.getCode();
            }
        }
        }
        if(!StringUtil.isBlank(conNo)){
            sql += " and h.JZXH = " + conNo;
        }
@ -584,14 +609,15 @@ public class YkyyEntranceService {
        }
        if(!StringUtil.isBlank(endTime)){
            sql += " and h.KSSJ <= to_date('"+endTime+"', 'YYYY-MM-DD HH24:MI:SS')";
        }if(!StringUtil.isBlank(ksdm)){
            sql += " and h.KSDM = " + ksdm;
        }if(!StringUtil.isBlank(depts)){
            sql += " and h.KSDM in ("+ depts+")";
        }
        sql += " order by h.KSSJ desc";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("sqlOutpatientList"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);

+ 7 - 2
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -160,7 +160,6 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(wlyyPrescriptionDO.getId());
            if (businessOrderDO==null) {
                businessOrderDO = new BusinessOrderDO();
                businessOrderDO.setCreateTime(new Date());
@ -179,7 +178,13 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                BigDecimal b = new BigDecimal(String.valueOf(wlyyPrescriptionDO.getDrugFee()));
                BigDecimal c = new BigDecimal(String.valueOf(100));
                BigDecimal bc = b.multiply(c);
                businessOrderDO.setPayPrice(bc.doubleValue());
                BigDecimal dc = new BigDecimal(0);
                //判断检查检验项目是否有金额
                if (wlyyPrescriptionDO.getInspectFee()!=null){
                    BigDecimal d = new BigDecimal(String.valueOf(wlyyPrescriptionDO.getInspectFee()));
                    dc= d.multiply(d);
                }
                businessOrderDO.setPayPrice(bc.doubleValue()+dc.doubleValue());
                businessOrderDO.setDescription("处方结算");
                businessOrderDO = businessOrderDao.save(businessOrderDO);
                businessOrderDOS.add(businessOrderDO);

+ 12 - 2
business/base-service/src/main/java/com/yihu/jw/utils/YkyySMSService.java

@ -246,15 +246,25 @@ public class YkyySMSService {
                    }
                    List<WlyyInspectionDO> list = inspectionDao.findByOutpatientId(wlyyOutpatientDO.getId());
                    String createTime = "";
                    String isName = "";
                    for (int i=0;i<list.size();i++){
                        if (i==list.size()-1){
                            isName+=list.get(i).getName()+"。";
                        }else {
                            isName+=list.get(i).getName()+",";
                        }
                    }
                    if (list!=null&&list.size()>0){
                        createTime = DateUtil.dateToStrLong(list.get(0).getCreateTime());
                    }
                    if (StringUtils.isNoneBlank(medicard)){
                        content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",createTime).replace("{{门诊号码}}",mzhm)
                        .replace("{{社保卡号}}","【凭社保卡/就诊卡"+medicard+"到院充值预缴金做检查】").replace("{{性别}}",sex).replace("{{时间}}",createTime);
                        .replace("{{社保卡号}}","【凭社保卡/就诊卡"+medicard+"到院充值预缴金做检查】").replace("{{性别}}",sex).replace("{{时间}}",createTime)
                        .replace("{{检查项目}}",isName);
                    }else {
                        content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",createTime).replace("{{门诊号码}}",mzhm)
                                .replace("{{社保卡号}}","【到收费处,凭此条短信中的门诊号码换卡充值预缴金做检查】").replace("{{性别}}",sex);;
                                .replace("{{社保卡号}}","【到收费处,凭此条短信中的门诊号码换卡充值预缴金做检查】").replace("{{性别}}",sex)
                                .replace("{{检查项目}}",isName);;;
                    }
                    if (wxPushLogDO==null&&"1".equalsIgnoreCase(sendMesControl)){
                        wxPushLogDO = new WxPushLogDO();

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

@ -148,6 +148,7 @@ public class WxTemplateService {
                                "点击消息进入视频诊室接听视频通话,开始视频咨询",
                                "",miniprogramUrl,"wx53f6bb4ac081d840");
                    }else{
                        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId,"template_consult_notice","spthtx",1);
                        BaseDoctorDO doctorDO = doctorDao.findById(sender_id);
                        String titleName = "";
@ -170,6 +171,8 @@ public class WxTemplateService {
                            config.setKeyword2(DateUtil.dateToStrLong(wlyyOutpatientDO.getCreateTime()));
                            config.setKeyword3(wlyyOutpatientDO.getDeptName());
                            config.setKeyword4(wlyyOutpatientDO.getDescription());
                            miniprogramUrl+="&outpatientId="+wlyyOutpatientDO.getId();
                            config.setPagepath(miniprogramUrl);
                        }
                        WxWechatDO wechatDO = wechatDao.findById(wechatId);
                        if (wechatDO!=null){

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictHospitalDeptDO.java

@ -84,6 +84,18 @@ public class DictHospitalDeptDO extends IntegerIdentityEntity {
     * 科室描述
     */
    private String deptDescription;
    /**
     * 科室通用名
     */
    private String usualName;
    @Column(name = "usual_name")
    public String getUsualName() {
        return usualName;
    }
    public void setUsualName(String usualName) {
        this.usualName = usualName;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;