Merge remote-tracking branch 'origin/dev_2307' into dev_2307

# Conflicts:
#	ant-design-vue-jeecg/src/views/modulex/ModulexList.vue
#	jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java
dev
zjh 1 year ago
commit 720a8386b6
  1. 23223
      ant-design-vue-jeecg/package-lock.json
  2. 2
      ant-design-vue-jeecg/public/index.html
  3. 7
      ant-design-vue-jeecg/src/views/modulex/ModulexList.vue
  4. 210
      ant-design-vue-jeecg/src/views/requiremententity/RequirementEntityList.vue
  5. 382
      ant-design-vue-jeecg/src/views/requiremententity/RequirementEntityList1.vue
  6. 133
      ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityForm.vue
  7. 60
      ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal.vue
  8. 84
      ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal__Style#Drawer.vue
  9. 11
      ant-design-vue-jeecg/src/views/requirementitem/RequirementItemList.vue
  10. 66
      ant-design-vue-jeecg/src/views/requirementitem/modules/RequirementItemForm.vue
  11. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/controller/FunctionxController.java
  12. 171
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/controller/RequirementEntityController.java
  13. 79
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/entity/RequirementEntity.java
  14. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/mapper/RequirementEntityMapper.java
  15. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/mapper/xml/RequirementEntityMapper.xml
  16. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/service/IRequirementEntityService.java
  17. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/service/impl/RequirementEntityServiceImpl.java
  18. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementitem/entity/RequirementItem.java
  19. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java
  20. 58
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java
  21. 177
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java
  22. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/mapper/TablexMapper.java
  23. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/mapper/TablexVoMapper.java
  24. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/mapper/xml/TablexMapper.xml
  25. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/mapper/xml/TablexVoMapper.xml
  26. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/service/ITablexVoService.java
  27. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/service/impl/ITablexVoServiceImpl.java
  28. 90
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/vo/TablexVo.java
  29. 2
      package-lock.json

File diff suppressed because it is too large Load Diff

@ -268,7 +268,7 @@
<!-- 全局配置 -->
<script>
window._CONFIG = {};
window._CONFIG['domianURL'] = 'http://localhost:8081/jeecg-boot';
window._CONFIG['domianURL'] = 'http://localhost:18081/jeecg-boot';
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas';
window._CONFIG['imgDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/view';
window._CONFIG['downloadUrl'] = window._CONFIG['domianURL'] + '/sys/common/download';

@ -75,7 +75,9 @@
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="ruleImportExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入规则</a-button>
</a-upload>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="tablexImportExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入实体</a-button>
</a-upload>
<a-button type="primary" icon="import">导入字段</a-button>
<a-button @click="fanhui" type="primary" icon="rollback">返回</a-button>
@ -395,7 +397,7 @@ export default {
deleteBatch: "/modulex/modulex/deleteBatch",
exportXlsUrl: "/modulex/modulex/exportXls",
importExcelUrl: "modulex/modulex/importExcel",
ruleImportExcelUrl: "rulex/rulex/importExcel",
},
dictOptions: {},
superFieldList: [],
@ -417,9 +419,6 @@ export default {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
},
ruleImportExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.ruleImportExcelUrl}`
},
// columnsdataIndex
checkColumn: function () {
return this.columns.map(item => item.title)

@ -0,0 +1,210 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="需求">
<j-dict-select-tag placeholder="请选择需求" v-model="queryParam.requirementId" dictCode="requirement_item,requirement_name,id"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="名称">
<a-input placeholder="请输入名称" v-model="queryParam.entityName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="英文名称">
<a-input placeholder="请输入英文名称" v-model="queryParam.entityEnName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="实体状态">
<j-dict-select-tag placeholder="请选择实体状态" v-model="queryParam.entityStatus" dictCode="entity_status"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('需求实体抽取管理')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">详情</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<requirement-entity-modal ref="modalForm" @ok="modalFormOk"></requirement-entity-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RequirementEntityModal from './modules/RequirementEntityModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'RequirementEntityList',
mixins:[JeecgListMixin, mixinDevice],
components: {
RequirementEntityModal
},
data () {
return {
description: '需求实体抽取管理管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'需求',
align:"center",
dataIndex: 'requirementId_dictText'
},
{
title:'名称',
align:"center",
dataIndex: 'entityName'
},
{
title:'英文名称',
align:"center",
dataIndex: 'entityEnName'
},
{
title:'实体描述',
align:"center",
dataIndex: 'entityDescribe',
scopedSlots: {customRender: 'htmlSlot'}
},
{
title:'实体状态',
align:"center",
dataIndex: 'entityStatus_dictText'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/requiremententity/requirementEntity/list",
delete: "/requiremententity/requirementEntity/delete",
deleteBatch: "/requiremententity/requirementEntity/deleteBatch",
exportXlsUrl: "/requiremententity/requirementEntity/exportXls",
importExcelUrl: "requiremententity/requirementEntity/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'requirementId',text:'需求',dictCode:'requirement_item,requirement_name,id'})
fieldList.push({type:'string',value:'entityName',text:'名称',dictCode:''})
fieldList.push({type:'string',value:'entityEnName',text:'英文名称',dictCode:''})
fieldList.push({type:'string',value:'entityDescribe',text:'实体描述',dictCode:''})
fieldList.push({type:'int',value:'entityStatus',text:'实体状态',dictCode:'entity_status'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,382 @@
<template>
<a-modal
width="96%"
title="抽取对象"
:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
>
<div>
<span style="text-align: center;display:block;font-weight:bold;">需求名称{{tableName}}</span>
<j-vxe-table
ref="xTable"
:columns="columns"
:dataSource="dataSource"
:loading="loading"
height='auto'
toolbar
:toolbarConfig="toolbarConfig"
row-number
row-selection
keep-source
async-remove
:pagination="pagination"
style="margin-top: 8px;"
@pageChange="handlePageChange"
@added="added">
<template v-slot:toolbarSuffix>
<a style="
background: #e6f7ff;
color: red;
position: relative;
border: 1px solid #91d5ff;
padding: 6px 300px 8px 31px;
border-radius: 5px;">
注意: 编辑后请点击保存按钮保存数据</a>
<!-- <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>-->
<!-- <p style="color: red;font-size: 16px"></p>-->
</template>
<template v-slot:action="props">
<a @click="submitForm(props)">保存</a>
<a-divider type="vertical"/>
<!-- <a @click="viewDetail(props.rowId)">详情</a>-->
<!-- <a-divider type="vertical"/>-->
<a-popconfirm title="确定删除吗?" @confirm="handleDelete(props.rowId)">
<a>删除</a>
</a-popconfirm>
</template>
</j-vxe-table>
</div>
</a-modal>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import {JVXETypes} from '@/components/jeecg/JVxeTable'
import {filterObj} from '@/utils/util'
import { httpAction, getAction } from '@/api/manage'
export default {
name: 'FieldxList',
mixins: [JeecgListMixin, mixinDevice],
components: {},
data() {
return {
description: '抽取对象管理页面',
tableid:'',
visible: false,
confirmLoading: false,
//
toolbarConfig: {
// add remove clearSelection
btn: ['add'],
},
//
loading: false,
//
pagination: {
//
current: 1,
//
pageSize: 10,
//
pageSizeOptions: ['10', '20', '30', '100', '200'],
// 0
total: 0,
showQuickJumper: true,
showSizeChanger: true,
id: null
},
// reload
reloadEffect:true,
//
columns: [
/*
如果留行号和可选择行的话 宽度得留给它12% 也就是还省88%的宽度
关于插槽 每个按钮留10%的宽度 如果有两个按钮 宽度就设为20% 按钮一般就两个字
*/
// {
// title: '', width: '100px', fixed: 'left', key: '',
// type: JVXETypes.normal,
// placeholder: '${title}',
// disabled: true,
// },
// {
// key: 'tableId_dictText', title: '', width: '6%',
// type: JVXETypes.normal,
// disabled: true,
// },
{
key: 'entityName', title: '名称', width: '16%',
type: JVXETypes.input,
validateRules: [{required: true, message: '${title}不能为空'},{unique:true,message:'${title}重复'}]
},
{
key: 'entityEnName', title: '英文名称', width: '16%',
type: JVXETypes.input,
validateRules: [{required: true, message: '${title}不能为空'},{unique:true,message:'${title}重复'}]
},
{
key: 'entityStatus', title: '实体状态', width: '16%',
type: JVXETypes.select,
dictCode:'entity_status',
defaultValue:0,
validateRules: [{required: true, message: '${title}不能为空'}]
},
// {
// key: 'verison', title: '', width: '18%',
// type: JVXETypes.input,
// dictCode:'yn',
// },
// {
// title: '',
// dataIndex: 'action',
// align: "center",
// fixed: "right",
// width: 147,
// scopedSlots: {customRender: 'action'}
// }
{
title: '操作',
key: 'action',
type: JVXETypes.slot,
fixed: 'right',
//
align: 'center',
minWidth: '10%',
slotName: 'action',
}
],
url: {
add: "/requiremententity/requirementEntity/add",
edit: "/requiremententity/requirementEntity/edit",
list: "/requiremententity/requirementEntity/list",
delete: "/requiremententity/requirementEntity/delete",
deleteBatch: "/requiremententity/requirementEntity/deleteBatch",
exportXlsUrl: "/requiremententity/requirementEntity/exportXls",
importExcelUrl: "/requiremententity/requirementEntity/importExcel",
},
dictOptions: {},
superFieldList: [],
//
loadRouteType: false,
isorterx: {
column: 'createTime',
order: 'asc',
},
tableName:'',
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
submitForm(props) {
//
this.$refs.xTable.validateTable().then(errMap => {
if (!errMap) {
this.model = Object.assign({}, props);
var str = props.rowId;
let httpurl = '';
let method = '';
if (str.search("row") !== -1) {
props.row.id ='';
console.log("新增")
httpurl += this.url.add;
method = 'post';
} else {
console.log("编辑")
httpurl += this.url.edit;
method = 'put';
}
props.row.requirementId = this.tableid;
console.log(props.row)
httpAction(httpurl, props.row, method).then((res) => {
if (res.success) {
if(method=="post"){
props.row.id =res.result.id;
}
this.$message.success(res.message);
this.$emit('ok');
} else {
this.$message.warning(res.message);
}
})
} else {
// errMap
//console.log(errMap.entityName.rule.message)
this.$message.error(errMap.entityName.rule.message);
}
});
},
//
added(event) {
//ref
// const values = this.$refs.xTable.getTableData()
// console.log(':', { values })
const {type, row, column, value, target} = event
console.log(event,"-------")
target.setValues([{
rowKey: row.id,
values: {tableId_dictText: this.tableName}
}])
},
//
async handleValueChange(event) {
//this.submitForm(event)
// console.log("//", event);
//const str = event.row.id;
let httpUrl = this.url.edit;
let method = 'put';
await httpAction(httpUrl, event.row, method).then((res) => {
if (res.success) {
this.$message.success(res.message);
this.$emit('ok');
} else {
this.$message.warning(res.message);
}
})
},
edit(record) {
this.model = Object.assign({}, record);
console.log(this.model)
//console.log(topicid);
this.queryParam.requirementId = this.model.id;
this.tableid = this.model.id;
this.tableName=this.model.requirementName;
//console.log(this.queryParam.topicid);
this.loadData();
},
showModal() {
this.visible = true;
},
// handleOk(e) {
// this.ModalText = 'The modal will be closed after two seconds';
// this.confirmLoading = true;
// setTimeout(() => {
// this.visible = false;
// this.confirmLoading = false;
// }, 2000);
// },
handleOk(e) {
this.visible = false;
},
handleCancel(e) {
console.log('Clicked cancel button');
this.visible = false;
},
initDictConfig() {
},
//
loadParameter() {
if (this.loadRouteType === false) {
// this.id = this.$route.query.id;
console.log('this.id -----------------', this.id)
//this.styleId = this.id;
//this.biaoTi = this.$route.query.styleNames + "";
//console.log("**********id" + this.id);
this.loadRouteType = true;
}
},
//
loadData(arg) {
// 1
if (arg === 1) {
this.pagination.current = 1;
}
//
this.loadParameter();
var params = this.getQueryParams1();//
this.loading = true;
getAction(this.url.list, params).then(res => {
if (res.success) {
/*// 后台查询回来的 total数据总数量
this.pagination.total = res.result.total*/
// dataSource
this.dataSource = res.result.records || res.result;
console.log(this.dataSource, 'abc')
if (res.result.total) {
this.pagination.total = res.result.total;
} else {
this.pagination.total = 0;
}
//this.dataSource = res.result.records
} else {
this.$error({title: '主表查询失败', content: res.message})
}
}).finally(() => {
// loading
this.loading = false
})
},
//
handlePageChange(event) {
//
this.pagination.current = event.current
this.pagination.pageSize = event.pageSize
//
this.loadData()
},
getQueryParams1() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorterx, this.filters);
param.pageNo = this.pagination.current;
param.pageSize = this.pagination.pageSize;
//param.id = this.id
return filterObj(param);
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'tableId',text:'对应实体',dictCode:'tablex,table_name,id'})
fieldList.push({type:'string',value:'fieldName',text:'中文名称',dictCode:''})
fieldList.push({type:'string',value:'fieldEnName',text:'英文名称',dictCode:''})
fieldList.push({type:'sel_search',value:'type',text:'数据类型',dictTable:'', dictText:'', dictCode:'date_type'})
fieldList.push({type:'int',value:'length',text:'数据长度',dictCode:''})
fieldList.push({type:'int',value:'accuracy',text:'浮点精度',dictCode:''})
fieldList.push({type:'string',value:'format',text:'显示形式',dictCode:''})
fieldList.push({type:'int',value:'isPk',text:'是否主键',dictCode:''})
fieldList.push({type:'int',value:'isFk',text:'是否外键',dictCode:''})
fieldList.push({type:'string',value:'associateTable',text:'关联实体',dictCode:'tablex,table_name,id'})
fieldList.push({type:'string',value:'associateField',text:'关联字段',dictCode:'fieldx,field_name,id'})
fieldList.push({type:'int',value:'isNull',text:'是否为空',dictCode:''})
fieldList.push({type:'int',value:'isUniqueness',text:'是否重复',dictCode:''})
fieldList.push({type:'string',value:'rule',text:'字段规则',dictCode:''})
fieldList.push({type:'int',value:'status',text:'字段状态',dictCode:''})
fieldList.push({type:'int',value:'verisonStatus',text:'版本状态',dictCode:''})
fieldList.push({type:'int',value:'verison',text:'版本号',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,133 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="需求" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requirementId">
<j-dict-select-tag type="list" v-model="model.requirementId" dictCode="requirement_item,requirement_name,id" placeholder="请选择需求" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityName">
<a-input v-model="model.entityName" placeholder="请输入名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityEnName">
<a-input v-model="model.entityEnName" placeholder="请输入英文名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="实体描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityDescribe">
<j-editor v-model="model.entityDescribe" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="实体状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityStatus">
<j-dict-select-tag type="radio" v-model="model.entityStatus" dictCode="entity_status" placeholder="请选择实体状态" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'RequirementEntityForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
requirementId: [
{ required: true, message: '请输入需求!'},
],
entityName: [
{ required: true, message: '请输入名称!'},
],
entityEnName: [
{ required: true, message: '请输入英文名称!'},
],
},
url: {
add: "/requiremententity/requirementEntity/add",
edit: "/requiremententity/requirementEntity/edit",
queryById: "/requiremententity/requirementEntity/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<requirement-entity-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></requirement-entity-form>
</j-modal>
</template>
<script>
import RequirementEntityForm from './RequirementEntityForm'
export default {
name: 'RequirementEntityModal',
components: {
RequirementEntityForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<requirement-entity-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></requirement-entity-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import RequirementEntityForm from './RequirementEntityForm'
export default {
name: 'RequirementEntityModal',
components: {
RequirementEntityForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -119,6 +119,8 @@
<a-divider type="vertical" />
<a @click="handleAddxqlx(0,record)">拆分</a>
<a-divider type="vertical" />
<a @click="cqdx(record)">抽取对象</a>
<a-divider type="vertical" />
<a v-if="record.xqflag==='1'" @click="qrxq(record.id)">确认需求</a>
</span>
@ -129,6 +131,7 @@
<modulex-modal1 ref="modulex" @ok="modalFormOk"></modulex-modal1>
<functionx-modal1 ref="functionxm" @ok="modalFormOk"></functionx-modal1>
<rulex-modal1 ref="rulexmd" @ok="modalFormOk"></rulex-modal1>
<requirement-entity-list1 ref="rel1"></requirement-entity-list1>
</a-card>
</template>
@ -143,12 +146,13 @@
import ModulexModal1 from "../modulex/modules/ModulexModal1";
import FunctionxModal1 from "../functionx/modules/FunctionxModal1";
import RulexModal1 from "../rulex/modules/RulexModal1";
import RequirementEntityList1 from "../requiremententity/RequirementEntityList1";
export default {
name: 'RequirementItemList',
mixins:[JeecgListMixin, mixinDevice],
components: {
RequirementItemModal,ModulexModal1,FunctionxModal1,RulexModal1
RequirementItemModal,ModulexModal1,FunctionxModal1,RulexModal1,RequirementEntityList1
},
data () {
return {
@ -310,6 +314,11 @@
}
});
},
cqdx(record){
this.$refs.rel1.showModal();
this.$refs.rel1.edit(record);
this.$refs.rel1.disableSubmit = false;
},
wdxq(){
this.searchQuerywdxq();
},

@ -8,11 +8,31 @@
<j-dict-select-tag type="list" v-model="model.projectId" dictCode="projectx,project_name,id" placeholder="请选择项目" :disabled="disablecol" @change="getxqbm"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<!-- <a-col :span="24">
<a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeId">
<j-dict-select-tag type="list" v-model="model.typeId" dictCode="requirement_type,type_name,id" placeholder="请选择类型" />
</a-form-model-item>
</a-col> -->
<a-col :span="24">
<a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeName">
<j-popup
v-model="model.typeName"
field="typeName"
org-fields="id,type_name"
dest-fields="typeId,typeName"
code="typename"
:multi="multi"
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
<a-col :span="24" style="display: none;">
<a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requirementCode">
<a-input v-model="model.typeId" placeholder="类型" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="num===0">
<a-form-model-item label="上级需求" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperId">
<j-dict-select-tag type="list" v-model="model.upperId" dictCode="requirement_item,requirement_name,id" placeholder="请选择上级需求" :disabled="disablecol" @change="getxqbm"/>
@ -28,14 +48,19 @@
<a-input v-model="model.requirementName" placeholder="请输入中文名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="需求文件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requirementFile">
<j-upload v-model="model.requirementFile" ></j-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="需求等级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requirementLevel">
<j-dict-select-tag type="list" v-model="model.requirementLevel" dictCode="requirement_level" placeholder="请选择需求等级" />
<j-dict-select-tag type="radio" v-model="model.requirementLevel" dictCode="requirement_level" placeholder="请选择需求等级" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="需求状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requirementStatus">
<j-dict-select-tag type="list" v-model="model.requirementStatus" dictCode="requirement_status" placeholder="请选择需求状态" />
<j-dict-select-tag type="radio" v-model="model.requirementStatus" dictCode="requirement_status" placeholder="请选择需求状态" />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -43,13 +68,11 @@
<j-image-upload isMultiple v-model="model.requirementPic" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="需求文件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requirementFile">
<j-upload v-model="model.requirementFile" ></j-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="需求描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requirementDescribe">
</a-row>
<a-row>
<a-col>
<a-form-model-item label="需求描述" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="requirementDescribe">
<j-editor v-model="model.requirementDescribe" />
</a-form-model-item>
</a-col>
@ -78,25 +101,37 @@
},
data () {
return {
multi: false,
disablecol: false,
num: 0,
model: {
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
xs: { span: 23 },
sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
labelCol1: {
xs: { span: 24 },
sm: { span: 3 },
},
wrapperCol1: {
xs: { span: 24 },
sm: { span: 20 },
},
confirmLoading: false,
validatorRules: {
projectId: [
{ required: true, message: '请输入项目!'},
],
typeId: [
{ required: true, message: '请输入类型!'},
// typeId: [
// { required: true, message: '!'},
// ],
typeName: [
{ required: true, message: '请选择类型!'},
],
/* upperId: [
{ required: true, message: '请输入上级需求!'},
@ -127,6 +162,9 @@
//model
},
methods: {
popupCallback(value,row){
this.model = Object.assign(this.model, row);
},
getxqbm(){
if(this.model.upperId===undefined||this.model.upperId===null){
this.model.upperId = "";

@ -28,6 +28,7 @@ import org.jeecg.modules.demo.requirementfun.entity.RequirementFun;
import org.jeecg.modules.demo.requirementfun.service.IRequirementFunService;
import org.jeecg.modules.demo.requirementitem.entity.RequirementItem;
import org.jeecg.modules.demo.requirementitem.service.IRequirementItemService;
import org.jeecg.modules.demo.rulex.service.IRulexService;
import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -66,6 +67,9 @@ public class FunctionxController extends JeecgController<Functionx, IFunctionxSe
@Autowired
private IRequirementItemService requirementItemService;
@Autowired
private IRulexService iRulexService;
/**
* 分页列表查询
@ -131,6 +135,9 @@ public class FunctionxController extends JeecgController<Functionx, IFunctionxSe
//感觉不符合逻辑,上级模块如果是已发布,然后新增也是已发布状态,那样发布按钮还有什么用??
// functionx.setWorkStatus(one.getWorkStatus());
functionxService.save(functionx);
//功能管理新增规则操作时,如果功能类型是‘新增’和‘修改’,自动根据实体对应的字段,自动生成若干条记录(根据实体的字段生成多条规则)
iRulexService.saveRulex(functionx);
return Result.OK("添加成功!");
}

@ -0,0 +1,171 @@
package org.jeecg.modules.demo.requiremententity.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity;
import org.jeecg.modules.demo.requiremententity.service.IRequirementEntityService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 需求实体抽取管理
* @Author: jeecg-boot
* @Date: 2023-07-10
* @Version: V1.0
*/
@Api(tags="需求实体抽取管理")
@RestController
@RequestMapping("/requiremententity/requirementEntity")
@Slf4j
public class RequirementEntityController extends JeecgController<RequirementEntity, IRequirementEntityService> {
@Autowired
private IRequirementEntityService requirementEntityService;
/**
* 分页列表查询
*
* @param requirementEntity
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "需求实体抽取管理-分页列表查询")
@ApiOperation(value="需求实体抽取管理-分页列表查询", notes="需求实体抽取管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(RequirementEntity requirementEntity,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<RequirementEntity> queryWrapper = QueryGenerator.initQueryWrapper(requirementEntity, req.getParameterMap());
Page<RequirementEntity> page = new Page<RequirementEntity>(pageNo, pageSize);
IPage<RequirementEntity> pageList = requirementEntityService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param requirementEntity
* @return
*/
@AutoLog(value = "需求实体抽取管理-添加")
@ApiOperation(value="需求实体抽取管理-添加", notes="需求实体抽取管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody RequirementEntity requirementEntity) {
requirementEntityService.save(requirementEntity);
return Result.OK(requirementEntity);
}
/**
* 编辑
*
* @param requirementEntity
* @return
*/
@AutoLog(value = "需求实体抽取管理-编辑")
@ApiOperation(value="需求实体抽取管理-编辑", notes="需求实体抽取管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody RequirementEntity requirementEntity) {
requirementEntityService.updateById(requirementEntity);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "需求实体抽取管理-通过id删除")
@ApiOperation(value="需求实体抽取管理-通过id删除", notes="需求实体抽取管理-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
requirementEntityService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "需求实体抽取管理-批量删除")
@ApiOperation(value="需求实体抽取管理-批量删除", notes="需求实体抽取管理-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.requirementEntityService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "需求实体抽取管理-通过id查询")
@ApiOperation(value="需求实体抽取管理-通过id查询", notes="需求实体抽取管理-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
RequirementEntity requirementEntity = requirementEntityService.getById(id);
if(requirementEntity==null) {
return Result.error("未找到对应数据");
}
return Result.OK(requirementEntity);
}
/**
* 导出excel
*
* @param request
* @param requirementEntity
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, RequirementEntity requirementEntity) {
return super.exportXls(request, requirementEntity, RequirementEntity.class, "需求实体抽取管理");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, RequirementEntity.class);
}
}

@ -0,0 +1,79 @@
package org.jeecg.modules.demo.requiremententity.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 需求实体抽取管理
* @Author: jeecg-boot
* @Date: 2023-07-10
* @Version: V1.0
*/
@Data
@TableName("requirement_entity")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="requirement_entity对象", description="需求实体抽取管理")
public class RequirementEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**需求id*/
@Excel(name = "需求id", width = 15, dictTable = "requirement_item", dicText = "requirement_name", dicCode = "id")
@Dict(dictTable = "requirement_item", dicText = "requirement_name", dicCode = "id")
@ApiModelProperty(value = "需求id")
private java.lang.String requirementId;
/**名称*/
@Excel(name = "名称", width = 15)
@ApiModelProperty(value = "名称")
private java.lang.String entityName;
/**英文名称*/
@Excel(name = "英文名称", width = 15)
@ApiModelProperty(value = "英文名称")
private java.lang.String entityEnName;
/**实体描述*/
@Excel(name = "实体描述", width = 15)
@ApiModelProperty(value = "实体描述")
private java.lang.String entityDescribe;
/**实体状态*/
@Excel(name = "实体状态", width = 15, dicCode = "entity_status")
@Dict(dicCode = "entity_status")
@ApiModelProperty(value = "实体状态")
private java.lang.Integer entityStatus;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.requiremententity.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 需求实体抽取管理
* @Author: jeecg-boot
* @Date: 2023-07-10
* @Version: V1.0
*/
public interface RequirementEntityMapper extends BaseMapper<RequirementEntity> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.requiremententity.mapper.RequirementEntityMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.requiremententity.service;
import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 需求实体抽取管理
* @Author: jeecg-boot
* @Date: 2023-07-10
* @Version: V1.0
*/
public interface IRequirementEntityService extends IService<RequirementEntity> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.requiremententity.service.impl;
import org.jeecg.modules.demo.requiremententity.entity.RequirementEntity;
import org.jeecg.modules.demo.requiremententity.mapper.RequirementEntityMapper;
import org.jeecg.modules.demo.requiremententity.service.IRequirementEntityService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 需求实体抽取管理
* @Author: jeecg-boot
* @Date: 2023-07-10
* @Version: V1.0
*/
@Service
public class RequirementEntityServiceImpl extends ServiceImpl<RequirementEntityMapper, RequirementEntity> implements IRequirementEntityService {
}

@ -67,6 +67,10 @@ public class RequirementItem implements Serializable {
@Dict(dictTable = "requirement_type", dicText = "type_name", dicCode = "id")
@ApiModelProperty(value = "类型id")
private java.lang.String typeId;
/**类型*/
@Excel(name = "类型", width = 15)
@ApiModelProperty(value = "类型")
private java.lang.String typeName;
/**上级需求id*/
@Excel(name = "上级需求id", width = 15)
@ApiModelProperty(value = "上级需求id")

@ -20,4 +20,6 @@ public interface IRulexService extends IService<Rulex> {
List<Rulex> queryRuleListByFunctionId(Functionx functionx);
void saveRulex(Functionx functionx);
}

@ -1,16 +1,23 @@
package org.jeecg.modules.demo.rulex.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import org.jeecg.modules.demo.rulex.mapper.RulexMapper;
import org.jeecg.modules.demo.rulex.service.IRulexService;
import org.jeecg.modules.fieldx.entity.Fieldx;
import org.jeecg.modules.fieldx.service.IFieldxService;
import org.jeecg.modules.tablex.entity.Tablex;
import org.jeecg.modules.tablex.service.ITablexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Date;
import java.util.List;
/**
@ -19,12 +26,20 @@ import java.util.List;
* @Date: 2023-04-10
* @Version: V1.0
*/
@Slf4j
@Service
public class RulexServiceImpl extends ServiceImpl<RulexMapper, Rulex> implements IRulexService {
@Autowired
RulexMapper rulexMapper;
@Autowired
private ITablexService iTablexService;
@Autowired
private IFieldxService iFieldxService;
@Override
public Result<?> sort(String id) {
String sort = rulexMapper.sort(id);
@ -54,4 +69,43 @@ public class RulexServiceImpl extends ServiceImpl<RulexMapper, Rulex> implements
ruleWrapper.eq(Rulex::getFunctionId, functionx.getId());
return this.list(ruleWrapper);
}
/**
* 功能管理新增规则操作时如果功能类型是新增修改自动根据实体对应的字段自动生成若干条记录根据实体的字段生成多条规则
*
* @param functionx
*/
@Override
public void saveRulex(Functionx functionx) {
int functionType = functionx.getFunctionType().intValue();
if (1 == functionType || 3 == functionType) {
String moduleId = functionx.getModuleId();
Tablex tablex = iTablexService.getOne(new LambdaQueryWrapper<Tablex>().eq(Tablex::getModuleId, moduleId));
if (!ObjectUtils.isEmpty(tablex)) {
List<Fieldx> fieldxList = iFieldxService.list(new LambdaQueryWrapper<Fieldx>().eq(Fieldx::getTableId, tablex.getId()));
if (!ObjectUtils.isEmpty(fieldxList)) {
fieldxList.stream().forEach(o -> {
//主键字段不创建规则
if (0 == o.getIsPk()) {
Rulex rulex = new Rulex();
rulex.setModuleId(moduleId);
rulex.setTableId(tablex.getId());
rulex.setFunctionId(functionx.getId());
rulex.setFieldId(o.getId());
rulex.setCreateTime(new Date());
Result<?> result = this.sort(functionx.getId());
String roleCodeStr = result.getResult().toString();
log.info("-----------------the roleCodeStr:{}", roleCodeStr);
String ruleNo = roleCodeStr.substring(0, 3);
String ruleCode = roleCodeStr.substring(3) + ruleNo;
rulex.setRuleNo(ruleNo);
rulex.setRuleCode(ruleCode);
rulex.setPmDescribe(JSON.toJSONString(o));
this.save(rulex);
}
});
}
}
}
}
}

@ -8,9 +8,17 @@ import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.models.auth.In;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.fieldx.controller.FieldxController;
import org.jeecg.modules.fieldx.entity.Fieldx;
@ -25,6 +33,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.tablex.service.ITablexVoService;
import org.jeecg.modules.tablex.vo.TablexVo;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -63,6 +73,9 @@ public class TablexController extends JeecgController<Tablex, ITablexService> {
@Autowired
private FieldxController fieldxController;
@Autowired
private ITablexVoService tablexVoService;
/**
* 分页列表查询
*
@ -84,22 +97,7 @@ public class TablexController extends JeecgController<Tablex, ITablexService> {
IPage<Tablex> pageList = tablexService.page(page, queryWrapper);
return Result.OK(pageList);
}
@AutoLog(value = "实体管理-通过模块查询实体")
@ApiOperation(value="实体管理-通过模块查询实体", notes="实体管理-通过模块查询实体")
@GetMapping(value = "/getTableByModuleId")
public Result<?> getTableByModuleId(@RequestParam(name="moduleId",required=true) String moduleId){
if (moduleId!=null){
List<Tablex> tablexList = tablexService.list(new QueryWrapper<Tablex>().eq("module_id", moduleId));
ArrayList<HashMap> hashMaps = new ArrayList<>();
for (Tablex tablex:tablexList){
HashMap<Object, Object> hashMap = new HashMap<>();
hashMap.put("text",tablex.getTableName());
hashMap.put("value",tablex.getId());
hashMaps.add(hashMap);
}
return Result.OK(hashMaps);
}else return Result.error("未找到数据,请重试");
}
/**
* 添加
*
@ -140,12 +138,12 @@ public class TablexController extends JeecgController<Tablex, ITablexService> {
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody Tablex tablex) {
tablex.setVerison(tablex.getVerison() + 1);
// List<Tablex> tablexList = tablexService.list();
// for (Tablex tablex1 : tablexList){
// if (tablex1.getModuleId().equals(tablex.getModuleId())){
// return Result.error("该模块已有实体,编辑失败");
// }
// }
List<Tablex> tablexList = tablexService.list();
for (Tablex tablex1 : tablexList) {
if (tablex1.getModuleId().equals(tablex.getModuleId())) {
return Result.error("该模块已有实体,编辑失败");
}
}
if (tablex.getModuleId() != null) {
Modulex modulex = modulexService.getById(tablex.getModuleId());
tablex.setTableName(modulex.getModuleName());
@ -224,13 +222,140 @@ public class TablexController extends JeecgController<Tablex, ITablexService> {
/**
* 通过excel导入数据
*
* @param request
* @param response
* @param file
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, Tablex.class);
public Result<?> importExcel(MultipartFile file) {
try {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// 判断文件是否是表格
String originalFilename = file.getOriginalFilename();
if (StringUtils.isBlank(originalFilename) ||
(!originalFilename.endsWith("xls") &&
!originalFilename.endsWith("xlsx"))) {
return Result.error("文件格式不正确");
}
//获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);//表格标题行数,默认0
params.setHeadRows(1);//表头行数,默认1
params.setNeedSave(true);//是否需要保存上传的Excel,默认为false
List<TablexVo> list = null;
try {
//读取excel数据
list = ExcelImportUtil.importExcel(file.getInputStream(), TablexVo.class, params);
} catch (Exception e) {
return Result.error("文件读取失败");
}
//判断文件中是否存在数据
if (list == null || list.size() == 0) {
return Result.error("Excel数据为空");
}
for (TablexVo tablexVo : list) {
//判断当前存入行是否为空值
if (tablexVo.getModuleId() == null &&
tablexVo.getTableName() == null &&
tablexVo.getTableEnName() == null &&
tablexVo.getTableStructure() == null &&
tablexVo.getStructuralDiagram() == null &&
tablexVo.getStatus() == null &&
tablexVo.getVerisonStatus() == null &&
tablexVo.getVerison() == null) continue;
//判断版本号长度
String verison = tablexVo.getVerison();
if (verison.length() > 5) {
return Result.error("导入失败,版本号格式错误");
}
//存入临时表中
tablexVoService.save(tablexVo);
}
//从临时表中取出数据
List<TablexVo> voList = tablexVoService.list();
//删除临时表中的数据
tablexVoService.removeAll(voList);
if (voList.size() == 0) {
return Result.error("导入失败,数据为空");
}
Tablex tablex = new Tablex();
for (int i = 0; i < voList.size(); i++) {
String moduleId = voList.get(i).getModuleId();
if (moduleId == null || moduleId.equals("")){
return Result.error("对应模块填写不能为空");
}
LambdaQueryWrapper<Modulex> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Modulex::getId,moduleId);
Modulex modulex = modulexService.getOne(queryWrapper);
if(modulex == null){
return Result.error("对应模块填写错误");
}
String modulexId = modulex.getId();
String status = voList.get(i).getStatus();
String verisonStatus = voList.get(i).getVerisonStatus();
//判断实体状态
int statusInt = status.equals("正常") ? 1 : status.equals("停用") ? 0 : status.equals("废弃") ? 9 : 3;
//判断版本状态
int verisonStatusInt = verisonStatus.equals("当前") ? 1 : verisonStatus.equals("历史") ? 0 : 3;
//判断对应模块
if (modulexId != null && voList.get(i).getModuleId() != null && !voList.get(i).getModuleId().equals("")) {
//判断中文名称
if (voList.get(i).getTableName() != null && !voList.get(i).getTableName().equals("") && !voList.get(i).getTableName().equals(modulex.getModuleName())) {
//判断英文名称
if (voList.get(i).getTableEnName() != null && !voList.get(i).getTableEnName().equals("") && !voList.get(i).getTableEnName().equals(modulex.getModuleEnName())) {
//判断实体状态
if (statusInt == 1 || statusInt == 0 || statusInt == 9) {
//判断版本状态
if (verisonStatusInt == 1 || verisonStatusInt == 0) {
//判断版本号
if (voList.get(i).getVerison() != null && !voList.get(i).getVerison().equals("")) {
tablex.setModuleId(voList.get(i).getModuleId());
tablex.setTableName(voList.get(i).getTableName());
tablex.setTableEnName(voList.get(i).getTableEnName());
tablex.setTableStructure(voList.get(i).getTableStructure());
tablex.setStructuralDiagram(voList.get(i).getStructuralDiagram());
tablex.setCreateBy(loginUser.getRealname());
tablex.setStatus(statusInt);
tablex.setVerisonStatus(verisonStatusInt);
tablex.setVerison(Integer.valueOf(voList.get(i).getVerison()));
//保存到真实表中
tablexService.save(tablex);
} else {
return Result.error("导入失败,第" + i + 1 + "行的版本号填写错误!");
}
} else {
return Result.error("导入失败,第" + i + 1 + "行的版本状态填写错误!");
}
} else {
return Result.error("导入失败,第" + i + 1 + "行的实体状态填写错误!");
}
} else {
return Result.error("导入失败,第" + i + 1 + "行的英文名称填写错误!");
}
} else {
return Result.error("导入失败,第" + i + 1 + "行的中文名称填写错误!");
}
} else {
return Result.error("导入失败,第" + i + 1 + "行的对应模块填写错误!");
}
}
} catch (Exception e) {
return Result.error("文件导入失败");
}
return Result.OK("文件导入成功!");
}
}

@ -2,6 +2,7 @@ package org.jeecg.modules.tablex.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.checkerframework.checker.guieffect.qual.UI;
@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @Date: 2023-04-10
* @Version: V1.0
*/
@Mapper
public interface TablexMapper extends BaseMapper<Tablex> {
@Update("update tablex set table_structure = #{sql} where id = #{tableId}")

@ -0,0 +1,15 @@
package org.jeecg.modules.tablex.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.tablex.vo.TablexVo;
/**
* @author Administrator
* @description 针对表tablex_vo的数据库操作Mapper
* @createDate 2023-07-10 19:52:43
* @Entity generator.domain.TablexVo
*/
@Mapper
public interface TablexVoMapper extends BaseMapper<TablexVo> {
}

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace=".tablex.mapper.TablexMapper">
<mapper namespace="org.jeecg.modules.tablex.mapper.TablexMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.tablex.mapper.TablexVoMapper">
</mapper>

@ -0,0 +1,17 @@
package org.jeecg.modules.tablex.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.tablex.entity.Tablex;
import org.jeecg.modules.tablex.vo.TablexVo;
import java.util.List;
/**
* @Description: 实体表
* @Author: jeecg-boot
* @Date: 2023-04-10
* @Version: V1.0
*/
public interface ITablexVoService extends IService<TablexVo> {
void removeAll(List<TablexVo> voList);
}

@ -0,0 +1,27 @@
package org.jeecg.modules.tablex.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.tablex.entity.Tablex;
import org.jeecg.modules.tablex.mapper.TablexVoMapper;
import org.jeecg.modules.tablex.service.ITablexVoService;
import org.jeecg.modules.tablex.vo.TablexVo;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Administrator
* @description 针对表tablex_vo的数据库操作Service实现
* @createDate 2023-07-10 19:52:43
*/
@Service
public class ITablexVoServiceImpl extends ServiceImpl<TablexVoMapper, TablexVo> implements ITablexVoService{
@Override
public void removeAll(List<TablexVo> voList) {
for (TablexVo tablexVo : voList){
removeById(tablexVo.getId());
}
}
}

@ -0,0 +1,90 @@
package org.jeecg.modules.tablex.vo;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 实体表
* @Author: jeecg-boot
* @Date: 2023-04-10
* @Version: V1.0
*/
@Data
@TableName("tablex_vo")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class TablexVo implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**对应模块id*/
@Excel(name = "对应模块id", width = 15, dictTable = "modulex", dicText = "module_name", dicCode = "id")
@Dict(dictTable = "modulex", dicText = "module_name", dicCode = "id")
@ApiModelProperty(value = "对应模块id")
private java.lang.String moduleId;
/**中文名称*/
@Excel(name = "中文名称", width = 15)
@ApiModelProperty(value = "中文名称")
private java.lang.String tableName;
/**英文名称*/
@Excel(name = "英文名称", width = 15)
@ApiModelProperty(value = "英文名称")
private java.lang.String tableEnName;
/**表结构SQL*/
@Excel(name = "表结构SQL", width = 15)
@ApiModelProperty(value = "表结构SQL")
private java.lang.String tableStructure;
/**结构图*/
@Excel(name = "结构图", width = 15)
@ApiModelProperty(value = "结构图")
private java.lang.String structuralDiagram;
/**创建人*/
@ApiModelProperty(value = "创建人")
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id")
private java.lang.String createBy;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private java.lang.String createTime;
/**修改人*/
@ApiModelProperty(value = "修改人")
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id")
private java.lang.String updateBy;
/**修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private java.lang.String updateTime;
/**实体状态*/
@Excel(name = "实体状态", width = 15,dicCode = "a_status")
@Dict(dicCode = "a_status")
@ApiModelProperty(value = "实体状态")
private java.lang.String status;
/**版本状态*/
@Excel(name = "版本状态", width = 15,dicCode = "verison_status")
@Dict(dicCode = "verison_status")
@ApiModelProperty(value = "版本状态")
private java.lang.String verisonStatus;
/**版本号*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private java.lang.String verison;
}

2
package-lock.json generated

@ -1,5 +1,5 @@
{
"name": "education",
"name": "projectManagement",
"lockfileVersion": 2,
"requires": true,
"packages": {}

Loading…
Cancel
Save