xiejun
2023-06-20 eb3000389c4b9bdc5d836dc356932d551ff7c073
历史导入展现页面接口测试完善
已修改6个文件
49 ■■■■ 文件已修改
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/VciBaseUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CodeClassifyMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmIOService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/VciBaseUtil.java
@@ -869,7 +869,7 @@
    }
    public static String getTableName(String btmname) {
        return (VciQueryWrapperForDO.USER_TABLE_COMPATIBILITY ? "pl_code_" : "vcibt_") + btmname.trim().toLowerCase();
        return (VciQueryWrapperForDO.USER_TABLE_COMPATIBILITY ? "vcibt_" : "pl_code_") + btmname.trim().toLowerCase();
    }
    public static Field getTsField(Class c) {
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CodeClassifyMapper.java
@@ -90,7 +90,7 @@
     * @param oid 分类的主键
     * @return 数据集合
     */
    List<CodeClassify> selectAllLevelChildHasPath(@Param("oid") String oid);
    List<CodeClassify> selectAllLevelChildHasPath(@Param("oid") String oid,@Param("fieldInPath")String fieldInPath);
    @MapKey("OID")
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmIOService.java
@@ -58,7 +58,7 @@
     * @param file excel文件的信息
     * @return 有错误信息的excel
     */
    CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid,String classifyAttr, File file);
    CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid,String classifyAttr, File file) throws Throwable;
    /***
     * 从redis缓存里获取到导入的数据
     * @param codeClassifyOid
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -662,7 +662,7 @@
    @Override
    public List<CodeClassifyVO> listChildrenClassify(String codeClassifyOid, boolean allLevel, String fieldInPath, boolean enable) {
        if(allLevel){
            List<CodeClassify> classifyDOS = codeClassifyMapper.selectAllLevelChildHasPath(codeClassifyOid);
            List<CodeClassify> classifyDOS = codeClassifyMapper.selectAllLevelChildHasPath(codeClassifyOid,fieldInPath);
            if(!CollectionUtils.isEmpty(classifyDOS)){
                classifyDOS = classifyDOS.stream().filter(s->FRAMEWORK_DATA_ENABLED.equalsIgnoreCase(s.getLcStatus())).collect(Collectors.toList());
            }
@@ -782,7 +782,7 @@
        Map<String/**路径**/,String/**主键**/> oidPathMap = new HashMap<>();
        //我们需要查询所有已经存在的分类,主要是路径,用来判断分类的数据
        List<CodeClassify> existClassifyDOs = codeClassifyMapper.selectAllLevelChildHasPath("");
        List<CodeClassify> existClassifyDOs = codeClassifyMapper.selectAllLevelChildHasPath("",null);
        Map<String/**路径**/, CodeClassify/**已经存在的数据**/> pathDOMap = Optional.ofNullable(existClassifyDOs).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(s -> {
            String path = s.getPath();
            if(StringUtils.isNotBlank(path) && path.startsWith("#")){
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -759,7 +759,7 @@
     * @return 有错误信息的excel
     */
    @Override
    public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) {
    public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) throws  Throwable{
        VciBaseUtil.alertNotNull(codeClassifyOid,"分类的主键");
        ReadExcelOption reo = new ReadExcelOption();
        reo.setReadAllSheet(true);
@@ -2978,21 +2978,35 @@
     * @param cboList 数据的列表
     * @param errorMap 错误的信息
     */
    private void batchCheckIdExistOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String ,String> errorMap){
    private void batchCheckIdExistOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String ,String> errorMap) throws Throwable{
        List<String> existIds = new ArrayList<>();
        String tableName ="";
        try {
            R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId());
            if(r.getCode()!=200) {
                throw new Throwable(r.getMsg());
            }
            BtmTypeVO btmTypeVO = r.getData();
            if (btmTypeVO == null) {
                throw new Throwable("根据业务类型未查询到业务类型对象!");
            }
            tableName = btmTypeVO.getTableName();
            if (StringUtils.isBlank(tableName)) {
                throw new Throwable("根据业务类型未查询到业务类型相关联的表");
            }
        }catch (Throwable e){
            throw e;
        }
        String finalTableName = tableName;
        VciBaseUtil.switchCollectionForOracleIn(cboList).stream().forEach(cbos -> {
            Map<String, String> conditionMap = new HashMap<>();
            conditionMap.put("id", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])) + ")");
            R<BtmTypeVO>  r= btmTypeClient.getDetail(templateVO.getBtmTypeId());
            BtmTypeVO btmTypeVO =r.getData();
            String tableName=btmTypeVO.getTableName();
            StringBuffer sb=new StringBuffer();
            sb.append(" select id from ");
            sb.append(tableName);
            sb.append(finalTableName);
            sb.append(" where 1=1 ");
            sb.append(" id in (");
            sb.append(" and id in (");
            sb.append(VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])));
            sb.append(")");
            List<String> idList= commonsMapper.selectById(sb.toString());
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -122,7 +122,14 @@
               codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
               coderesembleruleoid.name as codeResembleRuleOidName,
               level as datalevel,
               SYS_CONNECT_BY_PATH(codeclassify0.id, '#') as path
                <choose>
                    <when test='fieldInPath=="name"'>
                        SYS_CONNECT_BY_PATH(codeclassify0.name, '#')   as path
                    </when>
                    <otherwise>
                        SYS_CONNECT_BY_PATH(codeclassify0.id, '#')   as path
                    </otherwise>
                </choose>
        from pl_code_classify codeclassify0
                 left join pl_code_rule coderuleoid
                           on codeclassify0.codeRuleOid = coderuleoid.oid