xiejun
2023-07-19 76d804e37ed8d966387c2fa065015bdc12460c7c
集成获取分类接口(包含编码规则码段码值信息)
已修改2个文件
88 ■■■■ 文件已修改
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/webserviceModel/coderule/CoderefersecSearchVO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/webserviceModel/coderule/CoderefersecSearchVO.java
@@ -25,7 +25,13 @@
    private boolean isPersistence;// false,
    private int limit;// 15,
    private String sortField;// ,
    private String sortType;// ""
    private String sortType;//private String "
    private String parentFieldName;// private String PARENTCODECLASSIFYOIDprivate String ,
    private String parentUsedField;// private String oidprivate String ,
    private String parentValue;// private String \\IN(SELECT oid from PLATFORMBTM_CODECLASSIFY where id ='hesuanfenlei')private String ,
    private String loadType;// private String allprivate String ,
    private boolean onlyLeaf;// false,
    @Override
    public String toString() {
@@ -50,6 +56,11 @@
            ", limit=" + limit +
            ", sortField='" + sortField + '\'' +
            ", sortType='" + sortType + '\'' +
            ", parentFieldName='" + parentFieldName + '\'' +
            ", parentUsedField='" + parentUsedField + '\'' +
            ", parentValue='" + parentValue + '\'' +
            ", loadType='" + loadType + '\'' +
            ", onlyLeaf=" + onlyLeaf +
            '}';
    }
}
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
@@ -40,6 +40,7 @@
import com.vci.ubcs.starter.revision.model.TreeQueryObject;
import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil;
import com.vci.ubcs.starter.util.UBCSSqlKeyword;
import com.vci.ubcs.starter.web.constant.QueryOptionConstant;
import com.vci.ubcs.starter.web.pagemodel.SessionInfo;
import com.vci.ubcs.starter.web.util.BeanUtilForVCI;
import com.vci.ubcs.starter.web.util.VciBaseUtil;
@@ -1013,29 +1014,75 @@
                                                });
                                            }
                                        } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.TREE.getValue())) {//树形
                                            Map<String, Object> condtionMap = new HashMap<>();
                                            String parentFieldName=coderefersecSearchVO.getParentFieldName();
                                        /*    Map<String, Object> condtionMap = new HashMap<>();
                                            List<CodeSrchCondConfigVO> codeSrchCondConfigVOList = coderefersecSearchVO.getCodeSrchCondConfigVOS();
                                            List<CodeShowFieldConfigVO> codeShowFieldConfigVOS=coderefersecSearchVO.getCodeShowFieldConfigVOS();
                                            if (!CollectionUtils.isEmpty(codeSrchCondConfigVOList)) {
                                                codeSrchCondConfigVOList.stream().forEach(codeSrchCondConfigVO -> {
                                                    condtionMap.put(codeSrchCondConfigVO.getFilterField() + codeSrchCondConfigVO.getFilterType(), codeSrchCondConfigVO.getFilterValue());
                                                });
                                                buildSqlwhere = UBCSSqlKeyword.buildSqlwhere(condtionMap);
                                            }
                                            //使用传入的业务类型查询表
                                            R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referBtmId));
                                            if (!listR.isSuccess() || listR.getData().size() == 0) {
                                                throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
                                            }
                                            String referTable = listR.getData().get(0).getTableName();
                                            String oidFieldName = StringUtils.isNotBlank(coderefersecSearchVO.getParentUsedField())?coderefersecSearchVO.getParentUsedField():coderefersecSearchVO.getValueField();
                                            String parentValue =coderefersecSearchVO.getParentValue();
                                            List<CodeSrchCondConfigVO> codeSrchCondConfigVOList = coderefersecSearchVO.getCodeSrchCondConfigVOS();
                                            List<CodeShowFieldConfigVO> codeShowFieldConfigVOS=coderefersecSearchVO.getCodeShowFieldConfigVOS();
                                            if (!CollectionUtils.isEmpty(codeSrchCondConfigVOList)) {
                                                codeSrchCondConfigVOList.stream().forEach(codeSrchCondConfigVO -> {
                                                    condtionMap.put(codeSrchCondConfigVO.getFilterField() + codeSrchCondConfigVO.getFilterType(), codeSrchCondConfigVO.getFilterValue());
                                                });
                                                buildSqlwhere = UBCSSqlKeyword.buildSqlwhere(condtionMap);
                                            }
                                            //if("all".equals(coderefersecSearchVO.getLoadType())) {
                                            String parentOidSql = "";
                                            if(StringUtils.isNotBlank(parentValue)){
                                                String temp=parentValue;
                                                if(temp.startsWith(QueryOptionConstant.IN)){
                                                    temp = temp.substring((QueryOptionConstant.IN).length()).trim();
                                                    parentOidSql = " in " + ((temp.startsWith("(")  && temp.endsWith(")"))?temp:"(" + temp + ")");
                                                }else if(temp.startsWith(QueryOptionConstant.NOTIN)){
                                                    parentOidSql = " not in " + ((temp.startsWith("(")  && temp.endsWith(")"))?temp:"(" + temp + ")");
                                                }else if(temp.startsWith(QueryOptionConstant.NOTEQUAL)){
                                                    temp = temp.substring((QueryOptionConstant.NOTEQUAL).length()).trim();
                                                    parentOidSql = QueryOptionConstant.NOTEQUAL +  " " + ((temp.startsWith("'")  && temp.endsWith("'"))?temp:"'" + temp + "'");
                                                }else if(temp.startsWith(QueryOptionConstant.MORETHAN)){
                                                    temp = temp.substring((QueryOptionConstant.MORETHAN).length()).trim();
                                                    parentOidSql = QueryOptionConstant.MORETHAN + " " +  ((temp.startsWith("'")  && temp.endsWith("'"))?temp:"'" + temp + "'");
                                                }else if(temp.startsWith(QueryOptionConstant.MORE)){
                                                    temp = temp.substring((QueryOptionConstant.MORE).length()).trim();
                                                    parentOidSql = QueryOptionConstant.MORE + " " +  ((temp.startsWith("'")  && temp.endsWith("'"))?temp:"'" + temp + "'");
                                                }else if(temp.startsWith(QueryOptionConstant.LESSTHAN)){
                                                    temp = temp.substring((QueryOptionConstant.LESSTHAN).length()).trim();
                                                    parentOidSql = QueryOptionConstant.LESSTHAN + " " +  ((temp.startsWith("'")  && temp.endsWith("'"))?temp:"'" + temp + "'");
                                                }else if(temp.startsWith(QueryOptionConstant.LESS)){
                                                    temp = temp.substring((QueryOptionConstant.LESS).length()).trim();
                                                    parentOidSql = QueryOptionConstant.LESS +  " " + ((temp.startsWith("'")  && temp.endsWith("'"))?temp:"'" + temp + "'");
                                                }else if (temp.startsWith(QueryOptionConstant.ISNOTNULL)) {
                                                    parentOidSql = " is not null";
                                                } else if (temp.startsWith(QueryOptionConstant.ISNULL)) {
                                                    parentOidSql = " is  null";
                                                } else if(temp.contains("*")){
                                                    parentOidSql = " like " + ((temp.startsWith("'")  && temp.endsWith("'"))?temp:"'" + temp + "'").replace("*","%");
                                                }else {
                                                    parentOidSql = " = " + ((temp.startsWith("'")  && temp.endsWith("'"))?temp:"'" + temp + "'");
                                                }
                                            }
                                            //查询全部的信息
                                            buildSqlwhere+= " and oid  in (select oid from " +referTable + " START WITH " + coderefersecSearchVO.getParentFieldName() + " "+
                                            parentOidSql +
                                            " CONNECT BY PRIOR " + oidFieldName + " = " + coderefersecSearchVO.getParentFieldName() + ")";
                                            /*}else{
                                                if(StringUtils.isNotBlank(coderefersecSearchVO.getParentFieldName()) && StringUtils.isNotBlank(parentValue)){
                                                    buildSqlwhere+=" and "+coderefersecSearchVO.getParentFieldName()+"= '"+parentValue+"'";
                                                }
                                            }*/
                                            StringBuffer sb = new StringBuffer();
                                            sb.append(" select * from  ");
                                            sb.append(referTable);
                                            sb.append(" where 1=1  ");
                                            if (StringUtils.isNotBlank(buildSqlwhere)) {
                                                sb.append(buildSqlwhere);
@@ -1055,7 +1102,7 @@
                                                    codeSectionValueVOList.add(sectionValueVO);
                                                });
                                            }
*/
                                        } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.ORGDEPARTMENTGRIDREFERS.getValue()) ||////部门列表
                                            coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.ORGDEPARTMENTREFER.getValue())//部门树