Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs
| | |
| | | JavaType type = writer.getType(); |
| | | Class<?> clazz = type.getRawClass(); |
| | | if (type.isTypeOrSubTypeOf(Number.class)) { |
| | | writer.assignNullSerializer(NullJsonSerializers.NUMBER_JSON_SERIALIZER); |
| | | // writer.assignNullSerializer(NullJsonSerializers.NUMBER_JSON_SERIALIZER); |
| | | } else if (type.isTypeOrSubTypeOf(Boolean.class)) { |
| | | writer.assignNullSerializer(NullJsonSerializers.BOOLEAN_JSON_SERIALIZER); |
| | | } else if (type.isTypeOrSubTypeOf(Character.class)) { |
| | |
| | | <template> |
| | | <div> |
| | | <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag"> |
| | | <el-button-group> |
| | | <!--新增--> |
| | | <el-button v-if="attrEditVisible == false && attrFlagChiledren==false" size="small" type="primary" |
| | | @click="busineHandle">+ 添加 {{ msg }} |
| | | </el-button> |
| | | <el-button v-if="attrEditVisible == false && attrFlagChiledren==false" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">添加 {{ msg }}</el-button> |
| | | <!-- 全屏编辑--> |
| | | <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false" size="small" @click="fullscreenHandle"> |
| | | 全屏编辑 |
| | | </el-button> |
| | | <!-- 组合规则--> |
| | | <el-button size="small" @click="isShowHandler">组合规则</el-button> |
| | | <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">全屏编辑</el-button> |
| | | <!-- 验证规则--> |
| | | <el-button icon="el-icon-info" size="small" @click="rulesVisible=true">验证规则</el-button> |
| | | <!-- 属性分组--> |
| | | <el-button icon="el-icon-menu" size="small" @click="attrVisibleHandle">属性分组</el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!-- 分类注入--> |
| | | <el-button icon="el-icon-magic-stick" size="small" @click="injectBtn">分类注入</el-button> |
| | | <!-- 组合规则--> |
| | | <el-button size="small" @click="isShowHandler">组合规则</el-button> |
| | | <!-- 枚举注入--> |
| | | <el-button size="small" @click="enmuVisHandle">枚举注入</el-button> |
| | | <!-- 级联属性--> |
| | | <el-button size="small" @click="CascadeHandle">级联属性</el-button> |
| | | <!-- 预览排序--> |
| | | <el-button size="small">预览排序</el-button> |
| | | <el-button size="small" icon="el-icon-arrow-down">预览排序</el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!-- 保存--> |
| | | <el-button size="small" @click="addsHandler">保存</el-button> |
| | | <el-button size="small" @click="addsHandler" icon="el-icon-check">保存</el-button> |
| | | <!-- 删除--> |
| | | <el-button size="small" @click="CrudRemove">删除</el-button> |
| | | <el-button size="small" @click="CrudRemove" icon="el-icon-delete">删除</el-button> |
| | | <!-- 重置--> |
| | | <el-button size="small" @click="reset">重置</el-button> |
| | | <el-button size="small" @click="reset" icon="el-icon-refresh-right">重置</el-button> |
| | | <!-- 同步到其他模板--> |
| | | <el-button size="small"@click="syncHandle">同步到其他模板</el-button> |
| | | <el-button size="small"@click="syncHandle" icon="el-icon-share">同步到其他模板</el-button> |
| | | </el-button-group> |
| | | <!-- 编码申请预览--> |
| | | <el-button size="small" @click="applicationHandle" style="">编码申请预览</el-button> |
| | | <!-- 验证规则--> |
| | |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" @click.native.prevent="enumDeleteRow(scope.$index, tableData)"> |
| | | <el-button size="small" type="text" plain @click="enumDeleteRow"> |
| | | 移除 |
| | | </el-button> |
| | | </template> |
| | |
| | | </avue-crud> |
| | | <div style="display: flex;justify-content: flex-end;margin-top: 15px"> |
| | | <el-button size="small" type="primary" @click="busineAddHandle">保存</el-button> |
| | | <el-button size="small" type="primary">取消</el-button> |
| | | <el-button size="small" type="primary" @click="addVisible=false">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | style="width: 100%" |
| | | @cell-click="handleCellClicks" |
| | | @select="selectHandle" |
| | | @selection-change="selectionChange" |
| | | v-if="this.crudArrayFlag" |
| | | > |
| | | <el-table-column |
| | |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :formatter="formAttr" |
| | | :width="item.label.length >=4 ?'150':item.label.length==3 ?'120':'90'" |
| | | :width="item.width||(item.label.length >=4 ?'150':item.label.length==3 ?'120':'90')" |
| | | :show-overflow-tooltip="true" |
| | | align="center" |
| | | > |
| | |
| | | }, |
| | | { |
| | | label: "数据类型", |
| | | prop: "attrDataType" |
| | | prop: "attrDataType", |
| | | formatter:function(row,column){ |
| | | let vciFieldTypeMap = { |
| | | VTBoolean: "布尔型", |
| | | VTClob: "长文本", |
| | | VTDate: "日期", |
| | | VTDateTime: "日期时间", |
| | | VTTime: "时间", |
| | | VTLong: "长整型", |
| | | VTDouble: "金额/双精度", |
| | | VTInteger: "整形", |
| | | VTFilePath: "文件", |
| | | VTString: "字符串" |
| | | } |
| | | return vciFieldTypeMap[row.attrDataType]; |
| | | } |
| | | }, |
| | | { |
| | | label: "可空", |
| | | prop: "nullableFlag" |
| | | prop: "nullableFlag", |
| | | formatter:function(row,column){return row.nullableFlag=='true' || row.nullableFlag=='1'?'是':'否'} |
| | | }, |
| | | { |
| | | label: "默认值", |
| | |
| | | }, |
| | | { |
| | | label: "参照", |
| | | prop: "referFlag" |
| | | prop: "referFlag", |
| | | formatter: function (d) { |
| | | if (!d.referFlag) { |
| | | return ''; |
| | | } else { |
| | | return d.referBtmTypeId |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | label: "枚举", |
| | | prop: "enumFlag" |
| | | prop: "enumFlag", |
| | | formatter: function (d) { |
| | | if (!d.enumFlag) { |
| | | return ''; |
| | | } else { |
| | | return d.enumId |
| | | } |
| | | } |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | label: '排序号', |
| | | sortable: true, |
| | | edit: 'number', |
| | | width: 60, |
| | | width: 70, |
| | | fixed: true |
| | | }, { |
| | | label: "属性英文编号", |
| | |
| | | { |
| | | label: "高级查询属性", |
| | | prop: "seniorQueryAttrFlag", |
| | | width: 95, |
| | | width: 110, |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "相似查重属性", |
| | | prop: "sameRepeatAttrFlag", |
| | | width: 95, |
| | | width: 110, |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | |
| | | this.$message.warning('请选择属性集'); |
| | | return false; |
| | | } |
| | | debugger; |
| | | let ordernum = this.ProData.length; |
| | | this.busineSelectList.forEach((citem) => { |
| | | let isCopy = false; |
| | |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | | } |
| | | }) |
| | | |
| | | |
| | | this.addVisible = false; |
| | | |
| | | }, |
| | |
| | | }, |
| | | //枚举注入删除 |
| | | enumDeleteRow(row) { |
| | | this.tableData.splice(row, 1) |
| | | this.tableData.splice(row.$index, 1) |
| | | }, |
| | | //枚举注入按钮 |
| | | enmuVisHandle() { |
| | |
| | | }, |
| | | //表格删除 |
| | | CrudRemove() { |
| | | this.ProData.splice(this.attrRow.$index, 1) |
| | | this.attrSelectList.forEach((item)=>{ |
| | | this.ProData.splice(item.$index, 1) |
| | | }) |
| | | |
| | | }, |
| | | //表格重置 |
| | | reset() { |
| | |
| | | item = { oid, id, name, attributeGroup, ...{ checked: false } } |
| | | if (dataRight.length !== 0) { |
| | | dataRight.forEach(element => { if (item.id === element.attrId) item.checked = true }); |
| | | return item |
| | | } |
| | | return item |
| | | }) |
| | | console.log(datas) |
| | | let dataValue = datas.map(item => item.checked ? item.oid : undefined) |
| | | this.attributeValue = dataValue.filter(item => item) |
| | | this.attributeData = datas |
| | |
| | | handleMaintenance(row) { |
| | | console.log(row) |
| | | this.dialogNode = true |
| | | this.modelKey = row.modelKey |
| | | this.saveParam.modelKey = row.modelKey |
| | | this.getStagelist() |
| | | }, |
| | | // 维护 |
| | | handleMaintenanceTransfer(row) { |
| | | this.saveParam.taskId = row.taskId |
| | | this.saveParam.taskName = row.taskName |
| | |
| | | submitAttribute() { |
| | | const that = this; |
| | | if (that.referInitFlag && that.referEditFlag){ |
| | | this.$delete(this.attribute,'dictCode'); |
| | | this.$delete(this.attribute,'dictKey'); |
| | | this.$delete(this.attribute,'dictValue'); |
| | | this.$delete(this.attribute,'usingDict'); |
| | | this.$set(this.attribute,'dictCode',''); |
| | | this.$set(this.attribute,'dictKey',''); |
| | | this.$set(this.attribute,'dictValue',''); |
| | | this.$set(this.attribute,'usingDict',''); |
| | | } |
| | | if (that.enumInitFlag && that.enumEditFlag){ |
| | | this.$delete(this.attribute,'referTypeCode'); |
| | | this.$delete(this.attribute,'referTypeKey'); |
| | | this.$delete(this.attribute,'referTypeValue'); |
| | | this.$delete(this.attribute,'referToId'); |
| | | this.$delete(this.attribute,'referToName'); |
| | | this.$set(this.attribute,'referTypeCode',''); |
| | | this.$set(this.attribute,'referTypeKey',''); |
| | | this.$set(this.attribute,'referTypeValue',''); |
| | | this.$set(this.attribute,'referToId',''); |
| | | this.$set(this.attribute,'referToName',''); |
| | | } |
| | | this.$refs.form.validate(function (pass, field) { |
| | | if (pass) { |
| | |
| | | public static final String LIFE_CYCLE_EVENT = "lifeCycleEvent"; |
| | | |
| | | /** |
| | | * 生命周期的节点 |
| | | */ |
| | | public static final String LIFE_CYCLE_NODE = "lifeCycleNode"; |
| | | |
| | | /** |
| | | * 生命周期的连接线信息 |
| | | */ |
| | | public static final String LIFE_CYCLE_EDGE = "lifeCycleEdge"; |
| | | |
| | | /** |
| | | * 生命周期连接线的业务类型名称 |
| | | */ |
| | | public static final String LIFE_CYCLE_LINE = "lifeCycleLine"; |
| | |
| | | |
| | | import com.alibaba.fastjson.annotation.JSONField; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | |
| | | this.limit = limit; |
| | | } |
| | | |
| | | /** |
| | | * 从以前的项目拷贝过来的分页 |
| | | * @return |
| | | */ |
| | | @JSONField( |
| | | serialize = false, |
| | | deserialize = false |
| | | ) |
| | | @Deprecated |
| | | public PageHelper getPageHelper() { |
| | | PageHelper pageHelper = new PageHelper(this.limit); |
| | | pageHelper.setPage(this.getPage()); |
| | |
| | | return pageHelper; |
| | | } |
| | | |
| | | |
| | | public BaseQueryObject addSort(String sort, String order) { |
| | | this.setSort(StringUtils.isBlank(this.getSort()) ? sort : this.getSort() + "," + sort); |
| | | this.setOrder(StringUtils.isBlank(this.getOrder()) ? order : this.getOrder() + "," + order); |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import com.vci.ubcs.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | |
| | | // 回收需要业务数据删除 |
| | | if (CodeDefaultLC.TASK_BACK.getValue().equals(baseModelDTO.getLcStatus())) { |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(baseModelDTO.getBtmname())); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(), VciBaseUtil.toInSql(baseModelDTO.getOid())); |
| | | } else { |
| | | for (BaseModel baseModel : baseModels) { |
| | |
| | | // 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())); |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | final String[] sql = {"select count(*) from " + listR.getData().get(0).getTableName() + " t where 1 = 1 "}; |
| | | conditionMap.forEach((key, value) -> { |
| | | sql[0] += " and " + key + " = " + value; |
| | |
| | | fieldVO.setTemplet(attrVO.getTableDisplayJs()); |
| | | } |
| | | if (StringUtils.isBlank(fieldVO.getTemplet()) && VciFieldTypeEnum.VTBoolean.name().equalsIgnoreCase(attrVO.getAttributeDataType())) { |
| | | fieldVO.setTemplet("function(d){return $webUtil.formateBoolean(d." + fieldVO.getField() + ");}"); |
| | | fieldVO.setTemplet("function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'是':'否'}"); |
| | | // fieldVO.setTemplet("function(d){return $webUtil.formateBoolean(d." + fieldVO.getField() + ");}"); |
| | | } |
| | | fieldVO.setOptionJsMap(eventJsMap); |
| | | fieldVO.setStyle(attrVO.getTableDisplayStyle()); |
| | |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referVO.getReferType())); |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | String referTable = listR.getData().get(0).getTableName(); |
| | | // String referTable = "pl_code_classify"; |
| | | String referTableNick = attrVO.getId() + "0"; |
| | |
| | | } |
| | | // String tableName = VciBaseUtil.getTableName(btmType); |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | String tableName = listR.getData().get(0).getTableName(); |
| | | String sql = "select " + selectFieldList.stream().map(s -> (s.contains(".") ? s : ("t." + s))).collect(Collectors.joining(",")) |
| | |
| | | // baseMapper.deleteBatchIds(cboList); |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid())); |
| | | if (listR.getData().size() == 0) { |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(), |
| | |
| | | public Integer insertBatchByType(String btmType, List<BaseModel> baseModels) { |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (listR.getData().size() == 0) { |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //将bean转为map,mybatis统一处理 |
| | |
| | | |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (listR.getData().size() == 0) { |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //查询数据 |
| | |
| | | */ |
| | | public BaseModel createBaseModel(String boName) { |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(boName)); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | String userName = String.valueOf(AuthUtil.getUser().getUserId()); |
| | | BaseModel bo = new BaseModel(); |
| | | // bo.setOid(VciBaseUtil.getPk()); |
| | |
| | | public R updateBatchByBaseModel(String btmType, List<BaseModel> baseModels) { |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (listR.getData().size() == 0) { |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //将bean转为map,mybatis统一处理 |
| | |
| | | toBo.setVersionRule(fromBo.getVersionRule()); |
| | | // RevisionValueObject rvObj = this.getNextRevision(fromBo.getBtmName(), fromBo.getNameoid(), item.revRuleName, item.revInput, revisionVal); |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(fromBo.getBtmname())); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | Map<String, Object> nextRevision = commonsMapper.getNextRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid()); |
| | | toBo.setRevisionSeq(Integer.parseInt(nextRevision.get("REVISIONSEQ").toString())); |
| | | toBo.setRevisionValue(nextRevision.get("REVISIONVAL").toString()); |
| | |
| | | * @return 默认字段属性 |
| | | */ |
| | | @Override |
| | | @GetMapping(GET_DEFAULT_ATTR_BY_BTM_ID) |
| | | public R<BtmTypeVO> getDefaultAttrByBtmId(String btmTypeId) { |
| | | return R.data(Optional.ofNullable(btmTypeService.getDefaultAttrByBtmId(btmTypeId)).orElseGet(BtmTypeVO::new)); |
| | | } |
| | |
| | | * @return 所有字段 |
| | | */ |
| | | @Override |
| | | @GetMapping(GET_ALL_ATTR_BY_BTM_ID) |
| | | public R<BtmTypeVO> getAllAttributeByBtmId(String btmTypeId) { |
| | | return R.data(Optional.ofNullable(btmTypeService.getAllAttributeByBtmId(btmTypeId)).orElseGet(BtmTypeVO::new)); |
| | | } |
| | |
| | | * @return 所有字段 |
| | | */ |
| | | @Override |
| | | @GetMapping(GET_ALL_ATTR_BY_BTM_OID) |
| | | public R<BtmTypeVO> getAllAttributeByBtmOid(String btmTypeOid) { |
| | | return R.data(Optional.ofNullable(btmTypeService.getAllAttributeByBtmOid(btmTypeOid)).orElseGet(BtmTypeVO::new)); |
| | | } |
| | |
| | | * @param lifeCycleDTO 数据传输对象 |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public void delete(LifeCycleDTO lifeCycleDTO) { |
| | | VciBaseUtil.alertNotNull(lifeCycleDTO,"数据传输对象",lifeCycleDTO.getOid(),"主键"); |
| | | LifeCycleRule rule = null; |
| | |
| | | //检查被引用不能删除 |
| | | Integer count = btmTypeService.countByLifeId(lifeCycleDTO.getOid()); |
| | | if(count !=null && count>0){ |
| | | throw new VciBaseException("生命周期被使用,不能被删除"); |
| | | } |
| | | //我们查询全部node和edge,然后一起删除 |
| | | |
| | | } |
| | | |
| | | |
| | | private List<LifeCycleNode> selectNodeByLifeOid(String lifeOid){ |
| | | if(!StringUtils.hasLength(lifeOid)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | LambdaQueryWrapper<LifeCycleNode> query = new LambdaQueryWrapper<LifeCycleNode>(); |
| | | query.eq(LifeCycleNode::getLifeCycleOid,lifeOid); |
| | | return nodeMapper.selectList(query); |
| | | } |
| | | |
| | | /** |