基础码段增加前缀后缀;主数据历史数据导入,模板下载设置编号列为文本类型
| | |
| | | :title="basicSecDialogTitle" |
| | | :visible.sync="addBasicCodeSettingBox" |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | | class="avue-dialog avue-dialog--top add-basicsec-dialog" |
| | | destroy-on-close |
| | | lock-scroll |
| | | style="height: 100vh" |
| | | style="height: 105vh" |
| | | top="-3%" |
| | | width="900px" |
| | | @close="clearBasicAddForm" |
| | | > |
| | | <!-- 第一层对话框,添加码段信息对话框中的内容 --> |
| | | <div class="add-basicsec-total" style="overflow-y: auto; height: 58vh"> |
| | | <div class="add-basicsec-total"> |
| | | <el-form :model="form" class="add-basicsec-form"> |
| | | <span class="left"> |
| | | <el-form-item |
| | |
| | | |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | | label="码段类型" |
| | | label="码段类型:" |
| | | required |
| | | > |
| | | <el-select |
| | |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | | label="前缀:"> |
| | | <el-input |
| | | v-model="form.prefixCode" |
| | | :readonly="basicSecOnlyRead" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | | label="后缀:"> |
| | | <el-input |
| | | v-model="form.suffixCode" |
| | | :readonly="basicSecOnlyRead"> |
| | | </el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item :label-width="leftFormLabelWidth" label="描述:"> |
| | |
| | | > |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.itemValue" |
| | | :label="item.itemName" |
| | | :value="item.itemValue" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictValue" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </el-form> |
| | | </div> |
| | | <!-- 第一层对话框的按钮和分隔线条 --> |
| | | <el-divider class="horizontal-line" direction="horizontal"></el-divider> |
| | | <!-- <el-divider class="horizontal-line" direction="horizontal"></el-divider> --> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button |
| | | :disabled="!showbtn" |
| | |
| | | serialDependFlag: false, //是否流水依赖 |
| | | serialDependOrder: "", //流水依赖顺序 |
| | | nullableFlag: false, //是否为空 |
| | | prefix: "", //前缀 |
| | | suffix: "", //后缀 |
| | | displayFlag: false, // |
| | | componentCodeFlag: false, //是否参与编码 |
| | | pkCodeRule: "", //所属编码规则 |
| | |
| | | } |
| | | |
| | | /** 新增码段 */ |
| | | .add-basicsec-dialog > .el-dialog > .el-dialog__body { |
| | | padding: 20px 20px 4px; |
| | | margin-bottom: 30px; |
| | | } |
| | | |
| | | .add-basicsec-total { |
| | | width: 100%; |
| | | height: 500px; |
| | | } |
| | | |
| | | .add-basicsec-total .el-input__inner, |
| | |
| | | |
| | | .add-basicsec-form > .el-divider--vertical { |
| | | width: 2px; |
| | | height: 100%; |
| | | margin: 0 auto; |
| | | /* position: fixed; */ |
| | | height: 78%; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | |
| | | .left { |
| | |
| | | width: auto; |
| | | } |
| | | |
| | | .right > .el-form > .el-form-item { |
| | | margin-bottom: 8px; |
| | | .add-basicsec-form > .left > .el-form-item, |
| | | .add-basicsec-form > .right > div > .el-form-item{ |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | /* 对话框底部按钮边框样式 */ |
| | |
| | | */ |
| | | private Boolean isClearValue; |
| | | |
| | | /** |
| | | * 前缀 |
| | | */ |
| | | private String prefixCode; |
| | | |
| | | /** |
| | | * 后缀 |
| | | */ |
| | | private String suffixCode; |
| | | |
| | | public Boolean getIsClearValue() { |
| | | return isClearValue; |
| | | } |
| | |
| | | */ |
| | | private Integer serialDependOrder; |
| | | |
| | | /** |
| | | * 前缀 |
| | | */ |
| | | private String prefixCode; |
| | | |
| | | /** |
| | | * 后缀 |
| | | */ |
| | | private String suffixCode; |
| | | |
| | | } |
| | |
| | | private Integer serialDependOrder; |
| | | |
| | | /** |
| | | * 前缀 |
| | | */ |
| | | private String prefixCode; |
| | | |
| | | /** |
| | | * 后缀 |
| | | */ |
| | | private String suffixCode; |
| | | |
| | | /** |
| | | * 码值申请表单中显示隐藏等状态: 1(可输)、2(只读)、3(隐藏) |
| | | */ |
| | | private Integer codeValueApplyStatus; |
| | |
| | | private int row; |
| | | private int col; |
| | | private Object obj; |
| | | private String objCode; |
| | | private boolean merged = false; |
| | | private int rowTo; |
| | | private int colTo; |
| | |
| | | private String dateFormat; |
| | | private boolean readOnly; |
| | | private Integer width; |
| | | |
| | | public String getObjCode() { |
| | | return objCode; |
| | | } |
| | | |
| | | public void setObjCode(String objCode) { |
| | | this.objCode = objCode; |
| | | } |
| | | |
| | | public String getFontColor() { |
| | | return this.fontColor; |
| | |
| | | this.obj = obj; |
| | | } |
| | | |
| | | public WriteExcelData(int row, int col, Object obj,String objCode) { |
| | | this.row = row; |
| | | this.col = col; |
| | | this.obj = obj; |
| | | this.objCode = objCode; |
| | | } |
| | | |
| | | public WriteExcelData(int row, int col, Object obj,String objCode,boolean copyStyle) { |
| | | this.row = row; |
| | | this.col = col; |
| | | this.obj = obj; |
| | | this.objCode = objCode; |
| | | this.copyStyle = copyStyle; |
| | | } |
| | | |
| | | public void writeFormula(int row, int col, String foumula) { |
| | | this.row = row; |
| | | this.col = col; |
| | |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.hssf.util.HSSFColor; |
| | | import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.CellStyle; |
| | | import org.apache.poi.ss.usermodel.CellType; |
| | | import org.apache.poi.ss.usermodel.CellValue; |
| | | import org.apache.poi.ss.usermodel.DataValidation; |
| | | import org.apache.poi.ss.usermodel.DataValidationConstraint; |
| | | import org.apache.poi.ss.usermodel.DateUtil; |
| | | import org.apache.poi.ss.usermodel.Font; |
| | | import org.apache.poi.ss.usermodel.FormulaEvaluator; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.Name; |
| | | import org.apache.poi.ss.usermodel.RichTextString; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.VerticalAlignment; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.WorkbookFactory; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | import org.apache.poi.ss.util.CellRangeAddressList; |
| | | import org.apache.poi.xssf.usermodel.XSSFDataValidation; |
| | |
| | | Sheet sheet = getSheetByWorkbook(finalWb, sheetName); |
| | | |
| | | try { |
| | | writeDataToCell(sheet, excelDataList); |
| | | writeDataToCell(sheet, excelDataList,workbook); |
| | | } catch (VciBaseException var6) { |
| | | IOUtils.closeQuietly(os); |
| | | throw var6; |
| | |
| | | return cell; |
| | | } |
| | | |
| | | private static void writeDataToCell(Sheet sheet, List<WriteExcelData> excelDataList) throws VciBaseException { |
| | | private static void writeDataToCell(Sheet sheet, List<WriteExcelData> excelDataList,Workbook workbook) throws VciBaseException { |
| | | if (sheet != null && !CollectionUtils.isEmpty(excelDataList)) { |
| | | List<WriteExcelData> mergedDataList = new ArrayList(); |
| | | excelDataList.stream().forEach((ed) -> { |
| | |
| | | if (ed.isMerged() && (ed.getRowTo() > ed.getRow() || ed.getColTo() > ed.getCol())) { |
| | | mergedDataList.add(ed); |
| | | } |
| | | if("id".equalsIgnoreCase(ed.getObjCode())){ |
| | | //CellStyle textStyle = workbook.createCellStyle(); |
| | | HSSFDataFormat format = (HSSFDataFormat)sheet.getWorkbook().createDataFormat(); |
| | | Row copyStyleRow = sheet.getRow(ed.getRow()); |
| | | cell = copyStyleRow.getCell(ed.getCol()); |
| | | cell.getCellStyle().setDataFormat(format.getFormat("@")); |
| | | } |
| | | |
| | | copyStyle(sheet, cell, ed); |
| | | if (ed.isReadOnly() && ed.getObj() != null && !(ed.getObj() instanceof RichTextString) && CollectionUtils.isEmpty(ed.getValidationDataList())) { |
| | |
| | | } |
| | | for (Field declaredField : declaredFields) { |
| | | declaredField.setAccessible(true); |
| | | |
| | | // 获取字段的值 |
| | | boolean isTableField = declaredField.isAnnotationPresent(TableField.class); |
| | | if (isTableField) { |
| | |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | String tenantId = AuthUtil.getTenantId().toString(); |
| | | //String tenantId = AuthUtil.getTenantId().toString(); |
| | | Map<String, String> conditionMap = baseQueryObject.getConditionMap(); |
| | | /*if(Func.isNotEmpty(tenantId)){ |
| | | conditionMap.put("TENANT_ID",tenantId); |
| | |
| | | IPage<CodeClassifyTemplateVO> pages = plCodeClstemplateService.selectPlCodeClstemplatePage(Condition.getPage(query), plCodeClstemplate); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 克隆 |
| | | * @param codeClassifyDTO |
| | |
| | | |
| | | return plCodeClstemplateService.gridCodeClassifyTemplate(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检查 分类模板对象是否删除 |
| | |
| | | * 升版 |
| | | */ |
| | | R Upgrade(CodeClassifyTemplateDTO codeClassifyDTO); |
| | | |
| | | /** |
| | | * 模板克隆 |
| | | */ |
| | |
| | | codeClassifyTemplateDO_old.setCreateTime(new Date()); |
| | | codeClassifyTemplateDO_old.setLastModifyTime(new Date()); |
| | | // 复制的模板生命周期改为编辑中 |
| | | codeClassifyDO_old.setLcStatus(FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING); |
| | | codeClassifyTemplateDO_old.setLcStatus(FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING); |
| | | List<CodeClassifyTemplate> codeClassifyTemplateDOList = new ArrayList<>(); |
| | | codeClassifyTemplateDOList.add(codeClassifyTemplateDO_old); |
| | | |
| | |
| | | List<ProcessTemplate> codeClassifyProcessTempDOList = copyTemplateProcess(oldOid,newOid); |
| | | |
| | | //复制模板阶段,阶段属性 |
| | | Map phase_attrMap = copyTemplatePhase_attr(oldOid,newOid); |
| | | Map phase_attrMap = copyTemplatePhase_attr(oldOid,newOid); |
| | | |
| | | List<CodeTemplatePhase> codeClassifyPhaseDOList = (ArrayList<CodeTemplatePhase>)phase_attrMap.get("phase");//模板阶段 |
| | | List<CodePhaseAttr> codePhaseAttrDOList = (ArrayList<CodePhaseAttr>)phase_attrMap.get("phaseAttr");//阶段属性 |
| | |
| | | * 模板的服务 |
| | | */ |
| | | @Resource |
| | | private CodeClstemplateServiceImpl templateService; |
| | | private ICodeClstemplateService templateService; |
| | | |
| | | /** |
| | | * 生成编码的服务 |
| | |
| | | * 通用查询 |
| | | */ |
| | | @Resource |
| | | CommonsMapper commonsMapper; |
| | | private CommonsMapper commonsMapper; |
| | | |
| | | /** |
| | | * 编码规则的服务 |
| | |
| | | } |
| | | return uiInfoVO; |
| | | } |
| | | |
| | | @Override |
| | | public MdmUIInfoVO getFlowUIInfoByClassifyOid(String codeClassifyOid, String functionId,String templateId,String taskId,String modelKey){ |
| | | // MdmUIInfoVO uiInfoVO = getTableDefineByClassifyOid_v2(codeClassifyOid,templateId,taskId,modelKey); |
| | |
| | | }); |
| | | return commonsMapper.insertByBaseModel(listR.getData().get(0).getTableName(), maps.get(0), maps); |
| | | } |
| | | |
| | | /** |
| | | * 传入业务类型以及ID查询业务表数据是否重复 |
| | | * |
| | |
| | | LinkedList<WriteExcelData> excelDataList = new LinkedList<>(); |
| | | Workbook workbook = new HSSFWorkbook(); |
| | | if(isHistory){ |
| | | excelDataList.add(new WriteExcelData(0,0,"分类路径")); |
| | | excelDataList.add(new WriteExcelData(0,1,"码段宽度")); |
| | | excelDataList.add(new WriteExcelData(0,2,!CollectionUtils.isEmpty(idAttrVOList)?idAttrVOList.get(0).getName():"企业编码")); |
| | | excelDataList.add(new WriteExcelData(0,0,"分类路径","")); |
| | | excelDataList.add(new WriteExcelData(0,1,"码段宽度","")); |
| | | excelDataList.add(new WriteExcelData(0,2,!CollectionUtils.isEmpty(idAttrVOList)?idAttrVOList.get(0).getName():"企业编码",idAttrVOList.get(0).getId())); |
| | | } |
| | | for (int i = 0; i < templateAttrVOS.size(); i++) { |
| | | CodeClassifyTemplateAttrVO attrVO = templateAttrVOS.get(i); |
| | |
| | | Object text = attrVO.getName(); |
| | | text = exportKeyAndRequired(workbook,attrVO,text); |
| | | int colIndex = (isHistory?3:0) + i; |
| | | WriteExcelData excelData = new WriteExcelData(0, colIndex, text); |
| | | WriteExcelData excelData = new WriteExcelData(0, colIndex, text,attrVO.getId()); |
| | | if(StringUtils.isNotBlank(attrVO.getCodeDateFormat()) |
| | | || VciFieldTypeEnum.VTDateTime.name().equalsIgnoreCase(attrVO.getAttributeDataType()) |
| | | || VciFieldTypeEnum.VTDate.name().equalsIgnoreCase(attrVO.getAttributeDataType()) |
| | |
| | | * @param currentTemplateVO |
| | | * @param templateColumnVOMap |
| | | */ |
| | | |
| | | private void createTemplate(CodeClassifyTemplateVO currentTemplateVO,Map<String,List<ColumnVO>>templateColumnVOMap){ |
| | | |
| | | List<CodeClassifyTemplateAttrVO> templateAttrVOS = currentTemplateVO.getAttributes().stream().filter(s -> |
| | |
| | | codeAllCodeService.saveBatch(allCodeDOList); |
| | | // iCodeWupinService.saveBatch(dataCBOList); |
| | | mdmEngineService.insertBatchByType(dataCBOList.get(0).getBtmname(),dataCBOList); |
| | | |
| | | // batchCBO.getCreateCbos().stream().filter(s -> StringUtils.equalsIgnoreCase("codeallcode",s.getBtmName())).forEach(s -> { |
| | | // s.setLcStatus(statusMap.get(s.getOid())); |
| | | // try { |