Merge remote-tracking branch 'origin/master'
| | |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | <script> |
| | | export default { |
| | | name: "formulaEditor", |
| | | props: { |
| | |
| | | package com.vci.ubcs.log.entity; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ludc |
| | | * @date 2023/10/31 15:43 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SystemLog { |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String logType; |
| | | |
| | | /** |
| | | * 日志创建时间 |
| | | */ |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 日志的最后修改时间 |
| | | */ |
| | | private Date lastmodifier; |
| | | |
| | | } |
| | |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.vci.ubcs</groupId> |
| | | <artifactId>ubcs-resource-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | package com.vci.ubcs.core.log.service; |
| | | |
| | | import com.vci.ubcs.log.entity.SystemLog; |
| | | import com.vci.ubcs.resource.bo.FileObjectBO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | |
| | | import java.rmi.ServerException; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 本地系统日志 |
| | |
| | | public interface ILogSystemService { |
| | | |
| | | /** |
| | | * 获取本地日志列表 |
| | | * 查看,本地系统日志列表 |
| | | */ |
| | | List<SystemLog> getSystemLogList(); |
| | | |
| | | /** |
| | | * 下载,根据服务名所在文件名和文件名下载文件 |
| | | * @param condition 查询条件map |
| | | * @return 文件的信息 |
| | | */ |
| | | FileObjectBO downloadLogByServiceNameAndFileName(Map<String,String> condition) throws ServerException; |
| | | |
| | | /** |
| | | * 删除,根据服务所在文件名,和日志文件名称删除 |
| | | * @param condition 主键集合 |
| | | * @return 执行结果 |
| | | */ |
| | | void deleteLogFile(Map<String,String> condition) throws ServerException; |
| | | |
| | | } |
| | |
| | | |
| | | import com.vci.ubcs.core.log.service.ILogSystemService; |
| | | import com.vci.ubcs.log.entity.SystemLog; |
| | | import com.vci.ubcs.resource.bo.FileObjectBO; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.File; |
| | | import java.rmi.ServerException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 本地系统日志 |
| | | * @author ludc |
| | | * @date 2023/10/31 15:39 |
| | | */ |
| | | @Service |
| | | public class LogSystemServiceImpl implements ILogSystemService { |
| | | |
| | | /** |
| | | * 各个服务存放的的父路径 |
| | | */ |
| | | private final String parentPath = "/data1/ubcs/ubcs-server"; |
| | | //@Value("#{'${ip-whitelist.ip}'.split(',')}") |
| | | private List<String> serviceDirNames = new ArrayList<>(Arrays.asList("/ubcs_code/target/log","/ubcs_omd/target/log","/ubcs_system/target/log")); |
| | | |
| | | /** |
| | | * 获取本地日志列表 |
| | | */ |
| | | @Override |
| | | public List<SystemLog> getSystemLogList() { |
| | | serviceDirNames.stream().forEach(serviceDirName->{ |
| | | File file = new File(parentPath+serviceDirName); |
| | | |
| | | if(file.isDirectory()){ |
| | | |
| | | File[] files = file.listFiles(); |
| | | |
| | | for(File f : files){ |
| | | |
| | | if(f.isDirectory()){ |
| | | |
| | | //readAllFiles(f.getAbsolutePath()); |
| | | |
| | | }else{ |
| | | |
| | | System.out.println(f.getName()); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | }else{ |
| | | |
| | | System.out.println(file.getName()); |
| | | |
| | | } |
| | | |
| | | }); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public FileObjectBO downloadLogByServiceNameAndFileName(Map<String, String> condition) throws ServerException { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void deleteLogFile(Map<String, String> condition) throws ServerException { |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private IFileService fileService; |
| | | |
| | | |
| | | /** |
| | | * 根据文件主键下载文件 |
| | | * @param fileOids 文件的主键 |
| | |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | }); |
| | | tree.setOid((String)oidValues.stream().collect(Collectors.joining(wrapperOptions.getOidValueSep()))); |
| | | tree.setName((String) VciBaseUtil.getValueFromField("name", doObject)); |
| | | tree.setCount("【"+(String)VciBaseUtil.getValueFromField("total", doObject)+"】"); |
| | | String total = (String) VciBaseUtil.getValueFromField("total", doObject); |
| | | if(Func.isNotEmpty(total)){ |
| | | tree.setCount("【"+total+"】"); |
| | | } |
| | | if (f != null) { |
| | | tree.setText((String)f.apply(doObject)); |
| | | } else { |
| | |
| | | * |
| | | * @return 数据集合 |
| | | */ |
| | | List<CodeClassify> selectCodeClassifyDOByTree(@Param("id") String id,@Param("lcstatus") String lcstatus,@Param("parentcodeclassifyoid") String parentcodeclassifyoid,@Param("tenantId") String tenantId,@Param("tableName") String tableName); |
| | | List<CodeClassify> selectCodeClassifyDOByTree(@Param("id") String id,@Param("lcstatus") String lcstatus,@Param("parentcodeclassifyoid") String parentcodeclassifyoid,@Param("tenantId") String tenantId/*,@Param("tableName") String tableName*/); |
| | | |
| | | /** |
| | | * 查询数据与PL_CODE_KEYATTRREPEAT、PL_CODE_RESEMBLERULE、PL_CODE_RULE联查 |
| | |
| | | |
| | | String queryCountStringBySql(@Param("inSql") String inSql); |
| | | |
| | | String selectCountByTableName(@Param("tableName") String tableName); |
| | | |
| | | List<Map> selectBySql(@Param("inSql") String inSql); |
| | | |
| | | List<Map<String,String>> queryByOnlySqlForMap(@Param("inSql") String inSql); |
| | |
| | | * @param codeClassifyEntity 主题库分类数据传输对象 |
| | | * @return 执行结果 |
| | | */ |
| | | R addSave(CodeClassify codeClassifyEntity) ; |
| | | R addSave(CodeClassify codeClassifyEntity); |
| | | |
| | | /** |
| | | * 修改主题库分类 |
| | | * @param codeClassifyEntity 主题库分类数据传输对象 |
| | | * @return 执行结果 |
| | | */ |
| | | R editSave(CodeClassify codeClassifyEntity) ; |
| | | R editSave(CodeClassify codeClassifyEntity); |
| | | |
| | | /** |
| | | * 检查 主题库分类是否删除 |
| | | * @param codeClassify 主题库分类数据传输对象,必须要有oid和ts属性 |
| | |
| | | * @return 有错误信息的excel |
| | | */ |
| | | CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid,String classifyAttr, File file) throws Throwable; |
| | | |
| | | /*** |
| | | * 从redis缓存里获取到导入的数据 |
| | | * @param codeClassifyOid |
| | |
| | | lcStatus = treeQueryObject.getConditionMap().getOrDefault("lcStatus",null); |
| | | } |
| | | if(StringUtils.isNotBlank(id) || StringUtils.isNotBlank(lcStatus) ){ |
| | | String tableName = this.getTableName(treeQueryObject.getParentOid(),treeQueryObject.getConditionMap().get("id"), treeQueryObject.getConditionMap().get("lcStatus")); |
| | | //String tableName = this.getTableName(treeQueryObject.getConditionMap().get("btmTypeId"),treeQueryObject.getConditionMap().get("id"), treeQueryObject.getConditionMap().get("lcStatus")); |
| | | doList = codeClassifyMapper |
| | | .selectCodeClassifyDOByTree( |
| | | treeQueryObject.getConditionMap().get("id"), |
| | | treeQueryObject.getConditionMap().get("lcStatus"), |
| | | treeQueryObject.getParentOid(), |
| | | VciBaseUtil.checkAdminTenant() ? null:AuthUtil.getTenantId(), |
| | | tableName |
| | | VciBaseUtil.checkAdminTenant() ? null:AuthUtil.getTenantId() |
| | | /*tableName*/ |
| | | ); |
| | | }else{ |
| | | // 只要前端会传参数过来就不会出现走这句的情况,所以查询总数没在这儿添加 |
| | |
| | | * 分类加载时获取业务类型id,拼接业务类型表名 |
| | | * @return |
| | | */ |
| | | private String getTableName(String parentCodeClassifyOid,String id,String lcStatus){ |
| | | private String getTableName(String btmTypeId,String id,String lcStatus){ |
| | | if(Func.isNotEmpty(btmTypeId)){ |
| | | return VciBaseUtil.getTableName(btmTypeId,true); |
| | | } |
| | | LambdaQueryWrapper<CodeClassify> wrapper = Wrappers.<CodeClassify>query() |
| | | .lambda().select(CodeClassify::getBtmTypeId) |
| | | .eq(CodeClassify::getLcStatus, lcStatus) |
| | | .isNotNull(CodeClassify::getBtmTypeId) |
| | | .last("limit 1"); |
| | | if(Func.isNotBlank(id)){ |
| | | wrapper.eq(CodeClassify::getId,id).isNull(CodeClassify::getParentCodeClassifyOid); |
| | | }else{ |
| | | wrapper.eq(CodeClassify::getParentCodeClassifyOid,parentCodeClassifyOid); |
| | | } |
| | | .last("limit 1") |
| | | .eq(CodeClassify::getId,id).isNull(CodeClassify::getParentCodeClassifyOid); |
| | | |
| | | CodeClassify codeClassify = codeClassifyMapper.selectOne(wrapper); |
| | | if(Func.isEmpty(codeClassify) || Func.isEmpty(codeClassify.getBtmTypeId())){ |
| | | throw new ServiceException("查询主数据总数时,未获取业务类型ID!"); |
| | | throw new ServiceException("查询主数据总数时,未获取到业务类型ID!"); |
| | | } |
| | | return VciBaseUtil.getTableName(codeClassify.getBtmTypeId(),true); |
| | | } |
| | |
| | | // Map<String/**模板的主键**/,String/**分类的主键**/> childHasTemplateMap =baseMapper |
| | | // .selectChildHasReleaseTemplate(FrameWorkDefaultValueConstant.FRAMEWORK_DATA_ENABLED, |
| | | // codeClassifyOid,CodeClassifyTemplateLC.RELEASED.getValue()); |
| | | List<Map<String,String>> childHasTemplateList =baseMapper |
| | | List<Map<String,String>> childHasTemplateList = baseMapper |
| | | .selectChildHasReleaseTemplate(FrameWorkDefaultValueConstant.FRAMEWORK_DATA_ENABLED, |
| | | codeClassifyOid,CodeClassifyTemplateLC.RELEASED.getValue()); |
| | | Map<String/**模板的主键**/,String/**分类的主键**/> childHasTemplateMap = new HashMap<>(); |
| | | if(!CollectionUtils.isEmpty(childHasTemplateList)){ |
| | | childHasTemplateList.stream().forEach(cbo->{ |
| | | childHasTemplateMap.put(cbo.get("OID"),cbo.get("CLSOID")); |
| | | // 有时候查询出来的key是大写,有时候是小写的key |
| | | String oid = Func.isEmpty(cbo.get("OID")) ? cbo.get("oid"):cbo.get("OID"); |
| | | String clsoid = Func.isEmpty(cbo.get("CLSOID")) ? cbo.get("clsoid") : cbo.get("CLSOID"); |
| | | childHasTemplateMap.put(oid,clsoid); |
| | | }); |
| | | } |
| | | |
| | |
| | | for (int j = 0; j < ruleVO.getSecVOList().size(); j++) { |
| | | CodeBasicSecVO secVO = ruleVO.getSecVOList().get(j); |
| | | String length= secValues[j]; |
| | | if(StringUtils.isNotBlank(secVO.getCodeSecLength())&&VciBaseUtil.getInt(length)>VciBaseUtil.getInt(secVO.getCodeSecLength())){ |
| | | if(StringUtils.isNotBlank(secVO.getCodeSecLength())&&VciBaseUtil.getInt(length)>(VciBaseUtil.getInt(secVO.getCodeSecLength())+((secVO.getPrefixCode()+secVO.getSuffixCode()).length()))){ |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";码段宽度与系统中的编码规则不同" ); |
| | | fined = true; |
| | | break; |
| | |
| | | //要看是不是补位的 |
| | | CodeBasicSecVO secVO = secVOMap.get(secOid); |
| | | Double serialDb = null; |
| | | // 截取掉前后缀之后的码段 |
| | | String subSecValue = killPriffixSuffix(secValue, secVO.getPrefixCode(), secVO.getSuffixCode()); |
| | | if(OsCodeFillTypeEnum.NONE.getValue().equalsIgnoreCase(secVO.getCodeFillType())){ |
| | | //不补码 |
| | | //把所有不是数字的去掉,因为可能会是老数据,新规则 |
| | | serialDb = VciBaseUtil.getDouble(killUnNumberChar(secValue)); |
| | | serialDb = VciBaseUtil.getDouble(killUnNumberChar(subSecValue)); |
| | | }else { |
| | | //左右填充的,我们需要 |
| | | serialDb = VciBaseUtil.getDouble(killUnNumberChar(killFillChar(secValue,secVO.getCodeFillSeparator(), |
| | | serialDb = VciBaseUtil.getDouble(killUnNumberChar(killFillChar(subSecValue,secVO.getCodeFillSeparator(), |
| | | OsCodeFillTypeEnum.LEFT.getValue().equalsIgnoreCase(secVO.getCodeFillType())))); |
| | | } |
| | | Map<String, Double> thisUnitMaxMap = maxSerialMap.getOrDefault(serialUnitString, new HashMap<>()); |
| | |
| | | for (int j = 0; j < serialUnitList.size(); j++) { |
| | | String secValue = serialUnitList.get(j); |
| | | if (secValue.equalsIgnoreCase("${attr_" + attrSevVO.getOid() + "}")) { |
| | | serialUnitList.set(j, value); |
| | | serialUnitList.set(j, joinPreffixAndSuffix(attrSevVO,value)); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 去掉前后缀 |
| | | * @param secValue 字符 |
| | | * @param priffix 前缀 |
| | | * @param suffix 后缀 |
| | | * @return 替换后的值 |
| | | */ |
| | | private String killPriffixSuffix(String secValue, String priffix,String suffix){ |
| | | if (priffix != null && secValue.startsWith(priffix)) { |
| | | secValue = secValue.substring(priffix.length()); |
| | | } |
| | | if (suffix != null && secValue.endsWith(suffix)) { |
| | | secValue = secValue.substring(0, secValue.length() - suffix.length()); |
| | | } |
| | | return secValue; |
| | | } |
| | | |
| | | /** |
| | | * 去除补位字符 |
| | | * @param s 字符 |
| | | * @param fillString 补位字符 |
| | |
| | | codeclassify0.TENANT_ID as tenantId , |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName, |
| | | ( |
| | | SELECT |
| | | COUNT(*) |
| | | FROM |
| | | ${tableName} |
| | | WHERE |
| | | CODECLSFID IN ( |
| | | SELECT |
| | | oid |
| | | FROM |
| | | PL_CODE_CLASSIFY |
| | | WHERE |
| | | lcstatus = 'Enabled' |
| | | START WITH |
| | | OID = codeclassify0.OID |
| | | CONNECT BY |
| | | PRIOR OID = parentCodeClassifyOid |
| | | ) |
| | | AND lastr = '1' |
| | | AND lastv = '1' |
| | | ) AS total |
| | | coderesembleruleoid.name as codeResembleRuleOidName |
| | | from pl_code_classify codeclassify0 |
| | | left join pl_code_rule coderuleoid |
| | | on codeclassify0.codeRuleOid = coderuleoid.oid |
| | |
| | | ${inSql} |
| | | </select> |
| | | |
| | | <select id="selectCountByTableName" resultType="java.lang.String"> |
| | | select COUNT(*) FROM ${tableName} |
| | | </select> |
| | | |
| | | <select id="selectBySql" resultType="java.util.Map"> |
| | | ${inSql} |
| | | </select> |
| | |
| | | * @return List<Menu> |
| | | */ |
| | | @Override |
| | | @Cacheable(cacheNames = MENU_CACHE, key = "'auth:menuButton:'+ #btmType +':'+ #userId ") |
| | | //@Cacheable(cacheNames = MENU_CACHE, key = "'auth:menuButton:'+ #btmType +':'+ #userId ") |
| | | public List<Menu> getMenuButtonByType(String btmType,Long userId) { |
| | | List<String> roleIds = null; |
| | | if(!VciBaseUtil.checkAdminTenant()){ |