Trick пре 5 година
родитељ
комит
3343a1dca0

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

@ -1082,6 +1082,80 @@ public class EntranceService {
        return hospitalDeptMappingDOS;
    }
    /**
     * 科室字典更新同步
     *
     * @return
     * @throws Exception
     */
//    @org.springframework.transaction.annotation.Transactional(rollbackFor = Exception.class)
    public List<DictHospitalDeptDO> updateMS02001(boolean demoFlag) throws Exception {
        String fid = MS02001;
        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>1000</endNum><Msg></Msg>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
        JSONArray jsonArray = ConvertUtil.convertListEnvelopInBody(resp);
        List<DictHospitalDeptDO> hospitalDeptMappingDOS = new ArrayList<>();
        DictHospitalDeptDO hdmDo;
        String orgCode = "350211A1002";
        Map<String, String> orgCodeMap = new HashMap<>();
        //6总部7金榜8夏禾
        orgCodeMap.put("6", orgCode);
        orgCodeMap.put("7", "");
        orgCodeMap.put("8", "");
        List<DictHospitalDeptDO> oriDict = dictHospitalDeptDao.findByOrgCode(orgCode);
        for (Object object : jsonArray) {
            hdmDo = new DictHospitalDeptDO();
            net.sf.json.JSONObject jsonObjectBody = (net.sf.json.JSONObject) object;
            String deptCode = null == jsonObjectBody.get("Dept_Code") ? "" : jsonObjectBody.get("Dept_Code").toString();
            if(!checkDeptExist(oriDict,deptCode)){
                String deptTypeCode = null == jsonObjectBody.get("Dept_Type_Code") ? "" : jsonObjectBody.get("Dept_Type_Code").toString();
                if (StringUtils.isNotBlank(orgCodeMap.get(deptTypeCode))) {
                    hdmDo.setOrgCode(orgCode);
                    hdmDo.setCode(null == jsonObjectBody.get("Dept_Code") ? "" : jsonObjectBody.get("Dept_Code").toString());
                    hdmDo.setName(null == jsonObjectBody.get("Dept_Name") ? "" : jsonObjectBody.get("Dept_Name").toString());
                    hdmDo.setDeptTypeCode(deptTypeCode);
                    hdmDo.setFatherDeptCode(null == jsonObjectBody.get("Father_Dept_Code") ? "" : jsonObjectBody.get("Father_Dept_Code").toString());
                    hdmDo.setFatherDeptName(null == jsonObjectBody.get("Father_Dept_Name") ? "" : jsonObjectBody.get("Father_Dept_Name").toString());
                    hdmDo.setCreateTime(new Date());
                    hdmDo.setDeptType(null == jsonObjectBody.get("Dept_Type") ? "" : jsonObjectBody.get("Dept_Type").toString());
                    hdmDo.setDeptPosition(null == jsonObjectBody.get("Dept_Position") ? "" : jsonObjectBody.get("Dept_Position").toString());
                    hdmDo.setConsultDeptFlag("0");
                    hospitalDeptMappingDOS.add(hdmDo);
                }
            }
        }
        if(hospitalDeptMappingDOS!=null&&hospitalDeptMappingDOS.size()>0){
            logger.info("dept:"+hospitalDeptMappingDOS.size());
        }
        dictHospitalDeptDao.save(hospitalDeptMappingDOS);
        return hospitalDeptMappingDOS;
    }
    public Boolean checkDeptExist(List<DictHospitalDeptDO> oriDict,String code){
        for(DictHospitalDeptDO dept:oriDict){
            if(code.equals(dept.getCode())){
                return true;
            }
        }
        return false;
    }
    /**
     * 号别字典
     *

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

@ -64,6 +64,11 @@ public class DictHospitalDeptDO extends IntegerIdentityEntity {
     */
    private String deptPosition;
    /**
     * 是否会诊科室
     */
    private String consultDeptFlag;
	@Column(name = "org_code")
    public String getOrgCode() {
@ -137,4 +142,12 @@ public class DictHospitalDeptDO extends IntegerIdentityEntity {
    public void setDeptPosition(String deptPosition) {
        this.deptPosition = deptPosition;
    }
    public String getConsultDeptFlag() {
        return consultDeptFlag;
    }
    public void setConsultDeptFlag(String consultDeptFlag) {
        this.consultDeptFlag = consultDeptFlag;
    }
}

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyInspectionDO.java

@ -53,6 +53,7 @@ public class WlyyInspectionDO extends UuidIdentityEntity {
    private String mzpg;//麻醉评估 0否,1有
    private String sfzg;//是否做过 0 否 和 1是
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date createTime;//,
@ -287,4 +288,5 @@ public class WlyyInspectionDO extends UuidIdentityEntity {
    public void setChargeAmount(String chargeAmount) {
        this.chargeAmount = chargeAmount;
    }
}