| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 主题库分类显示对象 |
| | |
| | | * @author weidy |
| | | * @date 2022-01-20 |
| | | */ |
| | | @Data |
| | | public class CodeClassifyVO extends BaseModel { |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 属性排序号 |
| | | */ |
| | | private Integer ordernum; |
| | | |
| | | private Integer orderNum; |
| | | |
| | | /** |
| | | * 所属业务类型 |
| | | */ |
| | | private String btmtypeid; |
| | | |
| | | private String btmTypeId; |
| | | |
| | | /** |
| | | * 所属业务类型名称 |
| | | */ |
| | | private String btmtypename; |
| | | |
| | | private String btmTypeName; |
| | | |
| | | /** |
| | | * 编码规则的主键 |
| | | */ |
| | | private String coderuleoid; |
| | | private String codeRuleOid; |
| | | |
| | | /** |
| | | * 编码规则的主键显示文本 |
| | | */ |
| | | private String coderuleoidName; |
| | | private String codeRuleOidName; |
| | | |
| | | /** |
| | | * 关键属性查询的规则 |
| | | */ |
| | | private String codekeyattrrepeatoid; |
| | | private String codeKeyAttrRepeatOid; |
| | | |
| | | /** |
| | | * 关键属性查询的规则显示文本 |
| | | */ |
| | | private String codekeyattrrepeatoidName; |
| | | private String codeKeyAttrRepeatOidName; |
| | | |
| | | /** |
| | | * 上级数据的主键 |
| | | */ |
| | | private String parentcodeclassifyoid; |
| | | private String parentCodeClassifyOid; |
| | | |
| | | /** |
| | | * 数据所在的层级 |
| | |
| | | */ |
| | | private String codeResembleRuleOidName; |
| | | |
| | | public String getCodeResembleRuleOid() { |
| | | return codeResembleRuleOid; |
| | | } |
| | | |
| | | public void setCodeResembleRuleOid(String codeResembleRuleOid) { |
| | | this.codeResembleRuleOid = codeResembleRuleOid; |
| | | } |
| | | |
| | | public String getCodeResembleRuleOidName() { |
| | | return codeResembleRuleOidName; |
| | | } |
| | | |
| | | public void setCodeResembleRuleOidName(String codeResembleRuleOidName) { |
| | | this.codeResembleRuleOidName = codeResembleRuleOidName; |
| | | } |
| | | |
| | | /** |
| | | * 获取 属性排序号 |
| | | */ |
| | | public Integer getOrdernum (){ |
| | | return ordernum; |
| | | } |
| | | |
| | | /** |
| | | * 设置 属性排序号 |
| | | */ |
| | | public void setOrdernum (Integer ordernum){ |
| | | this.ordernum = ordernum; |
| | | } |
| | | /** |
| | | * 获取 所属业务类型 |
| | | */ |
| | | public String getBtmtypeid (){ |
| | | return btmtypeid; |
| | | } |
| | | |
| | | /** |
| | | * 设置 所属业务类型 |
| | | */ |
| | | public void setBtmtypeid (String btmtypeid){ |
| | | this.btmtypeid = btmtypeid; |
| | | } |
| | | /** |
| | | * 获取 所属业务类型名称 |
| | | */ |
| | | public String getBtmtypename (){ |
| | | return btmtypename; |
| | | } |
| | | |
| | | /** |
| | | * 设置 所属业务类型名称 |
| | | */ |
| | | public void setBtmtypename (String btmtypename){ |
| | | this.btmtypename = btmtypename; |
| | | } |
| | | /** |
| | | * 获取 编码规则的主键 |
| | | */ |
| | | public String getCoderuleoid (){ |
| | | return coderuleoid; |
| | | } |
| | | |
| | | /** |
| | | * 设置 编码规则的主键 |
| | | */ |
| | | public void setCoderuleoid (String coderuleoid){ |
| | | this.coderuleoid = coderuleoid; |
| | | } |
| | | /** |
| | | * 获取编码规则的主键显示文本 |
| | | */ |
| | | public String getCoderuleoidName (){ |
| | | return coderuleoidName; |
| | | } |
| | | |
| | | /** |
| | | * 设置编码规则的主键显示文本 |
| | | */ |
| | | public void setCoderuleoidName (String coderuleoidName){ |
| | | this.coderuleoidName = coderuleoidName; |
| | | } |
| | | /** |
| | | * 获取 关键属性查询的规则 |
| | | */ |
| | | public String getCodekeyattrrepeatoid (){ |
| | | return codekeyattrrepeatoid; |
| | | } |
| | | |
| | | /** |
| | | * 设置 关键属性查询的规则 |
| | | */ |
| | | public void setCodekeyattrrepeatoid (String codekeyattrrepeatoid){ |
| | | this.codekeyattrrepeatoid = codekeyattrrepeatoid; |
| | | } |
| | | /** |
| | | * 获取关键属性查询的规则显示文本 |
| | | */ |
| | | public String getCodekeyattrrepeatoidName (){ |
| | | return codekeyattrrepeatoidName; |
| | | } |
| | | |
| | | /** |
| | | * 设置关键属性查询的规则显示文本 |
| | | */ |
| | | public void setCodekeyattrrepeatoidName (String codekeyattrrepeatoidName){ |
| | | this.codekeyattrrepeatoidName = codekeyattrrepeatoidName; |
| | | } |
| | | /** |
| | | * 获取 上级数据的主键 |
| | | */ |
| | | public String getParentcodeclassifyoid (){ |
| | | return parentcodeclassifyoid; |
| | | } |
| | | |
| | | /** |
| | | * 设置 上级数据的主键 |
| | | */ |
| | | public void setParentcodeclassifyoid (String parentcodeclassifyoid){ |
| | | this.parentcodeclassifyoid = parentcodeclassifyoid; |
| | | } |
| | | |
| | | public Integer getDataLevel() { |
| | | return dataLevel; |
| | | } |
| | | |
| | | public void setDataLevel(Integer dataLevel) { |
| | | this.dataLevel = dataLevel; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public String getNamePath() { |
| | | return namePath; |
| | | } |
| | | |
| | | public void setNamePath(String namePath) { |
| | | this.namePath = namePath; |
| | | } |
| | | |
| | | public String getIdPath() { |
| | | return idPath; |
| | | } |
| | | |
| | | public void setIdPath(String idPath) { |
| | | this.idPath = idPath; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CodeClassifyVO{" + |
| | | "ordernum=" + ordernum + |
| | | ", btmtypeid='" + btmtypeid + '\'' + |
| | | ", btmtypename='" + btmtypename + '\'' + |
| | | ", coderuleoid='" + coderuleoid + '\'' + |
| | | ", coderuleoidName='" + coderuleoidName + '\'' + |
| | | ", codekeyattrrepeatoid='" + codekeyattrrepeatoid + '\'' + |
| | | ", codekeyattrrepeatoidName='" + codekeyattrrepeatoidName + '\'' + |
| | | ", parentcodeclassifyoid='" + parentcodeclassifyoid + '\'' + |
| | | ", dataLevel=" + dataLevel + |
| | | ", path='" + path + '\'' + |
| | | ", namePath='" + namePath + '\'' + |
| | | ", idPath='" + idPath + '\'' + |
| | | ", codeResembleRuleOid='" + codeResembleRuleOid + '\'' + |
| | | ", codeResembleRuleOidName='" + codeResembleRuleOidName + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | ) |
| | | private Date ts; |
| | | |
| | | /** |
| | | * 所有着 |
| | | */ |
| | | private String owner; |
| | | |
| | | private String copyFromVersion; |
| | |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | |
| | | baseModel.setLastR("1"); |
| | | baseModel.setLastV("1"); |
| | | baseModel.setRevisionSeq(1); |
| | | baseModel.setOwner("1"); |
| | | if(Func.isBlank(baseModel.getOwner())){ |
| | | // 设置所有者 |
| | | baseModel.setOwner(AuthUtil.getUserId().toString()); |
| | | } |
| | | baseModel.setVersionSeq(1); |
| | | baseModel.setVersionRule("0"); |
| | | baseModel.setVersionValue("1"); |
| | |
| | | return R.data(codeClassifyTemplateAttrVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 主键批量获取主题库分类的模板属性 |
| | | * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个 |
| | |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | codeClassifyVOS.add(codeClassifyVO); |
| | | |
| | | //查询一下规则的编号,和关键属性重复规则 |
| | | List<String> codeRuleOids = codeClassifyVOS.stream().filter(s -> StringUtils.isNotBlank(s.getCoderuleoid())).map(CodeClassifyVO::getCoderuleoid).collect(Collectors.toList()); |
| | | List<String> codeRuleOids = codeClassifyVOS.stream().filter(s -> StringUtils.isNotBlank(s.getCodeRuleOid())).map(CodeClassifyVO::getCodeRuleOid).collect(Collectors.toList()); |
| | | Map<String, CodeRuleVO> ruleVOMap = new HashMap<>(); |
| | | if(!CollectionUtils.isEmpty(codeRuleOids)){ |
| | | VciBaseUtil.switchCollectionForOracleIn(codeRuleOids).stream().forEach(ruleOids->{ |
| | |
| | | }); |
| | | } |
| | | //找关键属性规则 |
| | | List<String> keyRuleOids = codeClassifyVOS.stream().filter(s -> StringUtils.isNotBlank(s.getCodekeyattrrepeatoid())).map(CodeClassifyVO::getCodekeyattrrepeatoid).collect(Collectors.toList()); |
| | | List<String> keyRuleOids = codeClassifyVOS.stream().filter(s -> StringUtils.isNotBlank(s.getCodeKeyAttrRepeatOid())).map(CodeClassifyVO::getCodeKeyAttrRepeatOid).collect(Collectors.toList()); |
| | | Map<String, CodeKeyAttrRepeatRuleVO> keyRuleVOMap = new HashMap<>(); |
| | | if(!CollectionUtils.isEmpty(keyRuleOids)){ |
| | | VciBaseUtil.switchCollectionForOracleIn(keyRuleOids).stream().forEach(ruleOids->{ |
| | |
| | | CodeClassifyVO vo = codeClassifyVOS.get(i); |
| | | excelDataList.add(new WriteExcelData(i+1,0,vo.getId())); |
| | | excelDataList.add(new WriteExcelData(i+1,1,vo.getName())); |
| | | excelDataList.add(new WriteExcelData(i+1,2,vo.getBtmtypeid())); |
| | | excelDataList.add(new WriteExcelData(i+1,3,vo.getBtmtypename())); |
| | | excelDataList.add(new WriteExcelData(i+1,4, StringUtils.isNotBlank(vo.getCoderuleoid())?ruleVOMap.getOrDefault(vo.getCoderuleoid(),new CodeRuleVO()).getId():"")); |
| | | excelDataList.add(new WriteExcelData(i+1,5, StringUtils.isNotBlank(vo.getCoderuleoid())?ruleVOMap.getOrDefault(vo.getCoderuleoid(),new CodeRuleVO()).getName():"")); |
| | | excelDataList.add(new WriteExcelData(i+1,6, StringUtils.isNotBlank(vo.getCodekeyattrrepeatoid())?keyRuleVOMap.getOrDefault(vo.getCodekeyattrrepeatoid(),new CodeKeyAttrRepeatRuleVO()).getId():"")); |
| | | excelDataList.add(new WriteExcelData(i+1,7, StringUtils.isNotBlank(vo.getCodekeyattrrepeatoid())?keyRuleVOMap.getOrDefault(vo.getCodekeyattrrepeatoid(),new CodeKeyAttrRepeatRuleVO()).getName():"")); |
| | | excelDataList.add(new WriteExcelData(i+1,2,vo.getBtmTypeId())); |
| | | excelDataList.add(new WriteExcelData(i+1,3,vo.getBtmTypeName())); |
| | | excelDataList.add(new WriteExcelData(i+1,4, StringUtils.isNotBlank(vo.getCodeRuleOid())?ruleVOMap.getOrDefault(vo.getCodeRuleOid(),new CodeRuleVO()).getId():"")); |
| | | excelDataList.add(new WriteExcelData(i+1,5, StringUtils.isNotBlank(vo.getCodeRuleOid())?ruleVOMap.getOrDefault(vo.getCodeRuleOid(),new CodeRuleVO()).getName():"")); |
| | | excelDataList.add(new WriteExcelData(i+1,6, StringUtils.isNotBlank(vo.getCodeKeyAttrRepeatOid())?keyRuleVOMap.getOrDefault(vo.getCodeKeyAttrRepeatOid(),new CodeKeyAttrRepeatRuleVO()).getId():"")); |
| | | excelDataList.add(new WriteExcelData(i+1,7, StringUtils.isNotBlank(vo.getCodeKeyAttrRepeatOid())?keyRuleVOMap.getOrDefault(vo.getCodeKeyAttrRepeatOid(),new CodeKeyAttrRepeatRuleVO()).getName():"")); |
| | | excelDataList.add(new WriteExcelData(i+1,8,vo.getOid().equalsIgnoreCase(codeClassify.getOid())?vo.getPath():codeClassify.getPath() + vo.getPath())); |
| | | excelDataList.add(new WriteExcelData(i+1,9,FrameworkDataLCStatus.getTextByValue(vo.getLcStatus()))); |
| | | excelDataList.add(new WriteExcelData(i+1,10,vo.getDataLevel())); |
| | |
| | | return new DataGrid<>(); |
| | | } |
| | | CodeClassifyVO topClassifyVO = getTopClassifyVO(classifyOid); |
| | | if(topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmtypeid())){ |
| | | if(topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmTypeId())){ |
| | | return new DataGrid<>(); |
| | | } |
| | | |
| | | Map<String,Object> condition = new HashMap<>(1); |
| | | condition.put("pkbtmtype",topClassifyVO.getBtmtypeid()); |
| | | condition.put("pkbtmtype",topClassifyVO.getBtmTypeId()); |
| | | R<BtmTypeVO> btmTypeDetail = btmTypeClient.getDetail(btmTypeOid); |
| | | if(btmTypeDetail.getCode() != 200){ |
| | | throw new ServiceException("业务类型feign接口调用出错"); |
| | |
| | | } |
| | | }); |
| | | } |
| | | R<BtmTypeVO> btmTypeVOR = btmTypeClient.getDefaultAttrByBtmId(topClassifyVO.getBtmtypeid()); |
| | | R<BtmTypeVO> btmTypeVOR = btmTypeClient.getDefaultAttrByBtmId(topClassifyVO.getBtmTypeId()); |
| | | if(btmTypeVOR.getCode() != 200){ |
| | | throw new ServiceException("业务类型feign接口调用出错"); |
| | | } |
| | |
| | | |
| | | fullInfo.setParentClassifyVOs(codeClassifyDO2VOs(codeClassifyList)); |
| | | if(!CollectionUtils.isEmpty(fullInfo.getParentClassifyVOs())){ |
| | | fullInfo.setTopClassifyVO(fullInfo.getParentClassifyVOs().stream().filter(s->StringUtils.isBlank(s.getParentcodeclassifyoid())).findFirst().orElseGet(()->null)); |
| | | fullInfo.setTopClassifyVO(fullInfo.getParentClassifyVOs().stream().filter(s->StringUtils.isBlank(s.getParentCodeClassifyOid())).findFirst().orElseGet(()->null)); |
| | | } |
| | | return fullInfo; |
| | | } |
| | |
| | | @Override |
| | | public CodeKeyAttrRepeatVO getRuleByClassifyFullInfo(CodeClassifyFullInfoBO classifyFullInfo) { |
| | | VciBaseUtil.alertNotNull(classifyFullInfo,"主题库分类的信息"); |
| | | String keyAttrRuleOid = classifyFullInfo.getCurrentClassifyVO().getCodekeyattrrepeatoid(); |
| | | String keyAttrRuleOid = classifyFullInfo.getCurrentClassifyVO().getCodeKeyAttrRepeatOid(); |
| | | if(StringUtils.isBlank(keyAttrRuleOid)){ |
| | | //我们根据上级的分类,按照层级倒序排列 |
| | | if(!CollectionUtils.isEmpty(classifyFullInfo.getParentClassifyVOs())){ |
| | |
| | | for(int i = sortedClassifyVO.size() -1;i>=0;i--){ |
| | | CodeClassifyVO record = sortedClassifyVO.get(i); |
| | | |
| | | if(StringUtils.isNotBlank(record.getCodekeyattrrepeatoid())){ |
| | | keyAttrRuleOid = record.getCodekeyattrrepeatoid(); |
| | | if(StringUtils.isNotBlank(record.getCodeKeyAttrRepeatOid())){ |
| | | keyAttrRuleOid = record.getCodeKeyAttrRepeatOid(); |
| | | break; |
| | | } |
| | | } |
| | |
| | | import com.vci.ubcs.starter.web.util.WebUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Resource |
| | | private RevisionModelUtil revisionModelUtil; |
| | | |
| | | @Value("${user-info.tenant-id}") |
| | | private String tenantId; |
| | | @Value("${user-info.id}") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | |
| | | */ |
| | | @Override |
| | | public IPage<CodeRuleVO> gridCodeRule(Query query, Map<String,Object> conidtionMap) { |
| | | //如果等于自己配置的管理组租户id和管理组超管账号,就不需要按照规则所有者来进行查询 |
| | | if(!(AuthUtil.getTenantId().equals(this.tenantId) && AuthUtil.getUserId().toString().equals(this.userId))){ |
| | | // 按照规则所有者来查询 |
| | | conidtionMap.put("owner",AuthUtil.getUserId()); |
| | | } |
| | | IPage<CodeRule> codeRuleIPage = this.codeRuleMapper.selectPage(Condition.getPage(query), UBCSCondition.getQueryWrapper(conidtionMap, CodeRule.class)); |
| | | //do转vo同时setLcStatusText生命周期值,并包装成分页对象返回 |
| | | return CodeRuleWrapper.build().pageVO(codeRuleIPage); |
| | |
| | | String codeClassifyOid = dockingSystemConfig.getClassifyOid(); |
| | | CodeClassifyTemplateVO templateVO = engineService.getUsedTemplateByClassifyOid(codeClassifyOid); |
| | | CodeClassifyVO topClassifyVO = classifyService.getTopClassifyVO(codeClassifyOid); |
| | | String btmTypeId = topClassifyVO.getBtmtypeid(); |
| | | String btmTypeId = topClassifyVO.getBtmTypeId(); |
| | | if (StringUtils.isBlank(btmTypeId)) { |
| | | return R.fail("这个分类所属顶层分类没有添加业务类型"); |
| | | } |
| | |
| | | String btmoid = map.get("oid".toUpperCase(Locale.ROOT)) == null ? "" : map.get("oid".toUpperCase(Locale.ROOT)).toString();//数据oid |
| | | String sendtype = map.get("lcstatus".toUpperCase(Locale.ROOT)) == null ? "" : map.get("lcstatus".toUpperCase(Locale.ROOT)).toString();//数据推送类型 |
| | | String id = map.get("id".toUpperCase(Locale.ROOT)) == null ? "" : map.get("id".toUpperCase(Locale.ROOT)).toString();//编码 |
| | | String btmid = topClassifyVO.getBtmtypeid();//数据业务类型 |
| | | String btmid = topClassifyVO.getBtmTypeId();//数据业务类型 |
| | | String classifyoid = map.get("codeclsfid".toUpperCase(Locale.ROOT)) == null ? "" : map.get("codeclsfid".toUpperCase(Locale.ROOT)).toString();//数据所在的分类id |
| | | String date2Str = VciDateUtil.date2Str(new Date(), VciDateUtil.DateTimeFormatStr); |
| | | DockingTask dockingTaskDO = new DockingTask(); |
| | |
| | | switchDateAttrOnOrder(templateVO, orderDTO); |
| | | //9.生成编码的信息 |
| | | // ClientBusinessObject cbo = boService.createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | // //默认的属性都不用从前端拷贝 |
| | | // //设置编码需要的默认属性的内容 |
| | | copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, false); |
| | |
| | | |
| | | if (!CollectionUtils.isEmpty(conditionMap)) { |
| | | // final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "}; |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmtypeid())); |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmTypeId())); |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | |
| | | conditionMap.putAll(andConditionMap); |
| | | PageHelper pageHelper = new PageHelper(-1); |
| | | pageHelper.addDefaultDesc("id"); |
| | | return queryGrid(fullInfoBO.getTopClassifyVO().getBtmtypeid(), templateVO, conditionMap, pageHelper); |
| | | return queryGrid(fullInfoBO.getTopClassifyVO().getBtmTypeId(), templateVO, conditionMap, pageHelper); |
| | | } |
| | | return new DataGrid<>(); |
| | | } |
| | |
| | | //说明已经存在 |
| | | return resembleRuleService.getObjectByOid(currentClassifyVO.getCodeResembleRuleOid()); |
| | | } |
| | | if (StringUtils.isBlank(currentClassifyVO.getParentcodeclassifyoid())) { |
| | | if (StringUtils.isBlank(currentClassifyVO.getParentCodeClassifyOid())) { |
| | | return null; |
| | | } |
| | | Map<String, CodeClassifyVO> classifyVOMap = fullInfoBO.getParentClassifyVOs().stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); |
| | | return getUseResembleRule(fullInfoBO, classifyVOMap.getOrDefault(currentClassifyVO.getParentcodeclassifyoid(), null)); |
| | | return getUseResembleRule(fullInfoBO, classifyVOMap.getOrDefault(currentClassifyVO.getParentCodeClassifyOid(), null)); |
| | | } |
| | | |
| | | /** |
| | |
| | | // CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | //找业务类型,然后使用主键去获取数据库里的数据 |
| | | List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), orderDTO.getOid()); |
| | | List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), orderDTO.getOid()); |
| | | |
| | | if (CollectionUtils.isEmpty(cbos)) { |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | |
| | | // cbo.getData().putAll(orderDTO.getData()); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), Collections.singletonList(cbo)); |
| | | updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo)); |
| | | batchSaveSelectChar(templateVO, Collections.singletonList(cbo)); |
| | | } |
| | | |
| | |
| | | oidCollection.stream().forEach(oids -> { |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | // conditionMap.put("oid", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), oids); |
| | | List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), oids); |
| | | // boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), conditionMap); |
| | | cboList.addAll(cbos); |
| | | }); |
| | |
| | | // batchCBO.getDeleteCbos().addAll(cboList); |
| | | // WebUtil.setPersistence(false); |
| | | // batchCBO.copyFromOther( |
| | | productCodeService.recycleCode(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid(), deleteBatchDTO.getOidList()); |
| | | productCodeService.recycleCode(classifyFullInfo.getCurrentClassifyVO().getBtmTypeId(), deleteBatchDTO.getOidList()); |
| | | // baseMapper.deleteBatchIds(cboList); |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid())); |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmTypeId())); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | |
| | | //4. 查询的时候,直接使用codeclsfpath来查询 |
| | | CodeClassifyVO topClassifyVO = classifyService.getTopClassifyVO(codeClassifyOid); |
| | | CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(templateOid); |
| | | if (topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmtypeid())) { |
| | | if (topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmTypeId())) { |
| | | throw new VciBaseException("当前主题库分类没有顶层分类,或者顶层分类没有设置业务类型"); |
| | | } |
| | | String btmTypeId = topClassifyVO.getBtmtypeid(); |
| | | String btmTypeId = topClassifyVO.getBtmTypeId(); |
| | | if (StringUtils.isBlank(btmTypeId)) { |
| | | return new DataGrid<>("这个分类所属顶层分类没有添加业务类型"); |
| | | } |
| | |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | |
| | | List<BaseModel> cboList = selectByTypeAndOid(topClassifyFullInfo.getTopClassifyVO().getBtmtypeid(), VciBaseUtil.array2String(orderDTOMap.keySet().toArray(new String[0]))); |
| | | List<BaseModel> cboList = selectByTypeAndOid(topClassifyFullInfo.getTopClassifyVO().getBtmTypeId(), VciBaseUtil.array2String(orderDTOMap.keySet().toArray(new String[0]))); |
| | | // cboOidMap.put("oid",QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(orderDTOMap.keySet().toArray(new String[0])) + ")"); |
| | | // List<ClientBusinessObject> cboList = boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), cboOidMap); |
| | | if (CollectionUtils.isEmpty(cboList)) { |
| | |
| | | batchSaveSelectChar(firstTemplateVO, cboList); |
| | | }); |
| | | // boService.persistenceBatch(batchCBO); |
| | | updateBatchByBaseModel(topClassifyFullInfo.getTopClassifyVO().getBtmtypeid(), updateList); |
| | | updateBatchByBaseModel(topClassifyFullInfo.getTopClassifyVO().getBtmTypeId(), updateList); |
| | | return R.success("操作成功!"); |
| | | } |
| | | |
| | |
| | | public CodeRuleVO getCodeRuleByClassifyOid(String codeClassifyOid) { |
| | | VciBaseUtil.alertNotNull(codeClassifyOid, "分类的主键"); |
| | | CodeClassifyVO classifyVO = classifyService.getObjectByOid(codeClassifyOid); |
| | | String codeRuleOid = classifyVO.getCoderuleoid(); |
| | | String codeRuleOid = classifyVO.getCodeRuleOid(); |
| | | if (StringUtils.isBlank(codeRuleOid)) { |
| | | //往上找 |
| | | CodeClassifyFullInfoBO fullInfo = classifyService.getClassifyFullInfo(codeClassifyOid); |
| | |
| | | public CodeRuleVO getCodeRuleByClassifyFullInfo(CodeClassifyFullInfoBO fullInfoBO) { |
| | | //往上找 |
| | | String codeRuleOid = ""; |
| | | if (StringUtils.isNotBlank(fullInfoBO.getCurrentClassifyVO().getCoderuleoid())) { |
| | | codeRuleOid = fullInfoBO.getCurrentClassifyVO().getCoderuleoid(); |
| | | if (StringUtils.isNotBlank(fullInfoBO.getCurrentClassifyVO().getCodeRuleOid())) { |
| | | codeRuleOid = fullInfoBO.getCurrentClassifyVO().getCodeRuleOid(); |
| | | } else { |
| | | if (CollectionUtils.isEmpty(fullInfoBO.getParentClassifyVOs())) { |
| | | //说明已经是最高层级, |
| | |
| | | //从最高的level开始获取 |
| | | for (int i = 0; i < parentClassifyVOList.size(); i++) { |
| | | CodeClassifyVO record = parentClassifyVOList.get(i); |
| | | if (StringUtils.isNotBlank(record.getCoderuleoid())) { |
| | | codeRuleOid = record.getCoderuleoid(); |
| | | if (StringUtils.isNotBlank(record.getCodeRuleOid())) { |
| | | codeRuleOid = record.getCodeRuleOid(); |
| | | break; |
| | | } |
| | | } |
| | |
| | | CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(templateOid); |
| | | //为了防止模板上的业务类型与分类上不对应 |
| | | CodeClassifyVO topClassifyVO = classifyService.getTopClassifyVO(templateVO.getCodeclassifyoid()); |
| | | String btmId = topClassifyVO.getBtmtypeid(); |
| | | String btmId = topClassifyVO.getBtmTypeId(); |
| | | //查询数据 |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("t.oid", oid); |
| | |
| | | //相似校验 |
| | | Map<String,String>resembleMap=new HashMap<>(); |
| | | List<DataResembleVO> dataResembleVOS=new ArrayList<>(); |
| | | String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmtypeid(); |
| | | String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmTypeId(); |
| | | bathcResembleQuery(codeClassifyOid,templateVO,needSaveCboList,resembleMap,btmtypeid,dataResembleVOS); |
| | | if(resembleMap.size()>0) { |
| | | if(!CollectionUtils.isEmpty(dataResembleVOS)) { |
| | |
| | | //相似校验 |
| | | Map<String, String> resembleMap = new HashMap<>(); |
| | | List<DataResembleVO> dataResembleVOS = new ArrayList<>(); |
| | | String btmtypeid = classifyFullInfo.getTopClassifyVO().getBtmtypeid(); |
| | | String btmtypeid = classifyFullInfo.getTopClassifyVO().getBtmTypeId(); |
| | | bathcResembleQuery(templateVO.getCodeclassifyoid(), templateVO, needSaveCboList, resembleMap, btmtypeid, dataResembleVOS); |
| | | if (resembleMap.size() > 0) { |
| | | if (!CollectionUtils.isEmpty(dataResembleVOS)) { |
| | |
| | | //相似校验 |
| | | Map<String,String>resembleMap=new HashMap<>(); |
| | | List<DataResembleVO> dataResembleVOS=new ArrayList<>(); |
| | | String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmtypeid(); |
| | | String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmTypeId(); |
| | | bathcResembleQuery(orderDTO.getCodeClassifyOid(),templateVO,needSaveCboList,resembleMap,btmtypeid,dataResembleVOS); |
| | | if(resembleMap.size()>0) { |
| | | isCreateUUid=true; |
| | |
| | | }); |
| | | //关键熟悉更改 |
| | | if (!CollectionUtils.isEmpty(editBoList)) { |
| | | engineService.updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmtypeid(),editBoList);//保存数据 |
| | | engineService.updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(),editBoList);//保存数据 |
| | | } |
| | | errorMap.putAll(errorKeyMap); |
| | | } |
| | |
| | | }else { |
| | | //存储数据 |
| | | try { |
| | | engineService.updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmtypeid(),updateList); |
| | | engineService.updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(),updateList); |
| | | codeAllCodeService.saveBatch(codeAllCodeList); |
| | | if(deleteList.size()>0) { |
| | | commonsMapper.deleteByTaleAndOid(tableName, VciBaseUtil.array2String(deleteList.toArray(new String[]{}))); |
| | |
| | | //没有限制分类,但是一个模板只可能在一个业务类型里面,所以直接查询这个业务类型即可 |
| | | |
| | | if (!CollectionUtils.isEmpty(conditionMap)) { |
| | | final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " where 1 = 1 "}; |
| | | final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmTypeId()) + " where 1 = 1 "}; |
| | | conditionMap.forEach((key, value) -> { |
| | | sql[0] += " and " + key + " = " + value; |
| | | }); |
| | |
| | | String oid=rowData.getOid(); |
| | | String rowNumber=rowData.getRowIndex(); |
| | | ClientBusinessObject cbo = new ClientBusinessObject(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | rowData.getData().forEach((index,value)->{ |
| | | String field = fieldIndexMap.get(index); |
| | | if(StringUtils.isBlank(field)){ |
| | |
| | | String fullPath = getFullPath(classifyFullInfo); |
| | | codeImprotDataVO.getDatas().stream().forEach(rowData -> { |
| | | ClientBusinessObject cbo=new ClientBusinessObject(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | rowData.forEach((field,value)->{ |
| | | try { |
| | | cbo.setAttributeValueWithNoCheck(field,value); |
| | |
| | | String fullPath,boolean newCode){ |
| | | rowDataList.stream().forEach(rowData -> { |
| | | ClientBusinessObject cbo=new ClientBusinessObject(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | rowData.getData().forEach((index,value)->{ |
| | | String field = fieldIndexMap.get(index); |
| | | if (StringUtils.isBlank(field)) { |
| | |
| | | engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap); |
| | | }); |
| | | if (!CollectionUtils.isEmpty(ketAttrMap)) { |
| | | CodeTemplateAttrSqlBO sqlBO = engineService.getSqlByTemplateVO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), templateVO, conditionMap, null); |
| | | CodeTemplateAttrSqlBO sqlBO = engineService.getSqlByTemplateVO(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), templateVO, conditionMap, null); |
| | | boolean isKeyCheck= commonsMapper.queryCountBySql(sqlBO.getSqlCount()) > 0; |
| | | if(isKeyCheck){ |
| | | List<Map<String,String>> newDataList= commonsMapper.queryByOnlySqlForMap(sqlBO.getSqlUnPage()); |
| | |
| | | List<String> unExistRuleClassifyOidList ){ |
| | | if(!CollectionUtils.isEmpty(classifyVOMap)){ |
| | | classifyVOMap.values().parallelStream().forEach(classifyVO->{ |
| | | if(StringUtils.isNotBlank(classifyVO.getCoderuleoid())){ |
| | | ruleOidMap.put(classifyVO.getOid(),classifyVO.getCoderuleoid()); |
| | | if(StringUtils.isNotBlank(classifyVO.getCodeRuleOid())){ |
| | | ruleOidMap.put(classifyVO.getOid(),classifyVO.getCodeRuleOid()); |
| | | }else{ |
| | | //递归找上级 |
| | | List<String> ruleOidList = new ArrayList<>(); |
| | | recursionRule(classifyVOMap,classifyVO.getParentcodeclassifyoid(),ruleOidList); |
| | | recursionRule(classifyVOMap,classifyVO.getParentCodeClassifyOid(),ruleOidList); |
| | | if(!CollectionUtils.isEmpty(ruleOidList)){ |
| | | ruleOidMap.put(classifyVO.getOid(),ruleOidList.get(0)); |
| | | }else{ |
| | |
| | | private void recursionRule(Map<String, CodeClassifyVO> classifyVOMap,String classifyOid,List<String> ruleOidList){ |
| | | if(classifyVOMap.containsKey(classifyOid)){ |
| | | CodeClassifyVO classifyVO = classifyVOMap.get(classifyOid); |
| | | if(StringUtils.isNotBlank(classifyVO.getCoderuleoid())){ |
| | | ruleOidList.add(classifyVO.getCoderuleoid()); |
| | | if(StringUtils.isNotBlank(classifyVO.getCodeRuleOid())){ |
| | | ruleOidList.add(classifyVO.getCodeRuleOid()); |
| | | return; |
| | | }else{ |
| | | recursionRule(classifyVOMap,classifyVO.getParentcodeclassifyoid(),ruleOidList); |
| | | recursionRule(classifyVOMap,classifyVO.getParentCodeClassifyOid(),ruleOidList); |
| | | } |
| | | }else{ |
| | | Map<String, CodeClassifyVO> parentClassifyVOMap=new HashMap<>(); |
| | |
| | | classifyVO.setClassCode(codeClassifyDO.getId()); |
| | | classifyVO.setDescription(codeClassifyDO.getDescription()); |
| | | classifyVO.setName(codeClassifyDO.getName()); |
| | | classifyVO.setPid(codeClassifyDO.getParentcodeclassifyoid()); |
| | | classifyVO.setPid(codeClassifyDO.getParentCodeClassifyOid()); |
| | | classifyVO.setFullPathName(codeClassifyDO.getPath()); |
| | | classifyVOList.add(classifyVO); |
| | | }); |
| | |
| | | classifyVO.setClassCode(StringUtils.isBlank(codeClassifyDO.getId())?"":codeClassifyDO.getId()); |
| | | classifyVO.setDescription(StringUtils.isBlank(codeClassifyDO.getDescription())?"":codeClassifyDO.getDescription()); |
| | | classifyVO.setName(StringUtils.isBlank(codeClassifyDO.getName())?"":codeClassifyDO.getName()); |
| | | classifyVO.setPid(StringUtils.isBlank(codeClassifyDO.getParentcodeclassifyoid())?"":codeClassifyDO.getParentcodeclassifyoid()); |
| | | classifyVO.setPid(StringUtils.isBlank(codeClassifyDO.getParentCodeClassifyOid())?"":codeClassifyDO.getParentCodeClassifyOid()); |
| | | classifyVO.setFullPathName(StringUtils.isBlank(codeClassifyDO.getPath())?"":codeClassifyDO.getPath()); |
| | | classifyVO.setCodeRule(resultCodeRuleVO); |
| | | classifyVOList.add(classifyVO); |
| | |
| | | map-underscore-to-camel-case: false |
| | | |
| | | |
| | | #顶层批量申请配置 |
| | | batchadd: |
| | | exportattr: |
| | | type: 基本信息 |
| | | redis: |
| | | time: 6000000 |
| | | #统一接口属性映射文件配置 |
| | | attrconfig: |
| | | #系统集成 |
| | | system_attrmap: {RLM: D:\RLM.xml,PDM: D:\pdm.xml,DMS: D:\DMS.xml} |
| | | #数据定时推送配置 |
| | | dataSyncPush: |
| | | isStart: false |
| | | cronTime: "0 0/1 * * * ?" |
| | | dataParamName: dataString |
| | | dataTranTemp: D:\desktop |
| | | #分类定时推送配置 |
| | | clsfSyncPush: |
| | | isStart: false |
| | | cronTime: "0 0/1 * * * ?" |
| | | dataParamName: dataString |
| | | dataTranTemp: D:\desktop |
| | | |
| | | #mybatis-plus-join: |
| | | # table-alias: t |
| | | |
| | |
| | | FROM PL_SYS_PWDSTRATEGY PSS |
| | | LEFT JOIN PL_SYS_USER_PWDSTRATEGY PSUP ON PSS.ID=PSUP.PWDSTRATEGY_ID |
| | | LEFT JOIN PL_ORG_USER POU ON POU.ID=PSUP.USER_ID |
| | | WHERE POU.TENANT_ID = #{tenantId} AND POU.NAME=#{name}; |
| | | WHERE POU.TENANT_ID = #{tenantId} AND POU.ACCOUNT=#{name} AND POU.IS_DELETED = 0; |
| | | </select> |
| | | |
| | | <select id="queryByUserId" resultMap="StrategyMap"> |
| | |
| | | //拿到配置的超管id |
| | | @Value("${user-info.id}") |
| | | private String adminUserId; |
| | | |
| | | @Value("${user-info.tenant-id}") |
| | | private String tenantId; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean submit(User user) { |
| | | if (StringUtil.isBlank(user.getTenantId())) { |
| | | user.setTenantId(BladeConstant.ADMIN_TENANT_ID); |
| | | // user.setTenantId(BladeConstant.ADMIN_TENANT_ID); |
| | | // 默认设置为管理组下的用户 |
| | | user.setTenantId(this.tenantId); |
| | | } |
| | | String tenantId = user.getTenantId(); |
| | | //Tenant tenant = SysCache.getTenant(tenantId); |
| | |
| | | #集团提供的接口地址 |
| | | jtInterUrl: http://116.205.176.185:8099 |
| | | #系统厂家单位代码 |
| | | unitCode: 131460 |
| | | unitCode: 41000 |
| | | #系统标识 |
| | | sysName: 410-MDM |
| | | |