转化合并

dev
Gitea 1 year ago
parent 633258b417
commit 0b25429b72
  1. 48
      ant-design-vue-jeecg/src/views/requiremententity/RequirementEntityList.vue
  2. 4
      ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityForm.vue
  3. 132
      ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityForm1.vue
  4. 61
      ant-design-vue-jeecg/src/views/requiremententity/modules/RequirementEntityModal1.vue
  5. 165
      ant-design-vue-jeecg/src/views/tablex/modules/TablexForm1.vue
  6. 60
      ant-design-vue-jeecg/src/views/tablex/modules/TablexModal1.vue
  7. 60
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requiremententity/controller/RequirementEntityController.java
  8. 42
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java

@ -44,7 +44,12 @@
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="hb(selectedRowKeys)"><a-icon type="plus"/>合并</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 合并操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
@ -96,6 +101,8 @@
<a-divider type="vertical" />
<a @click="fq(record.id)">废弃</a>
<a-divider type="vertical" />
<a @click="zh(record)">转化</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
@ -105,6 +112,8 @@
</div>
<requirement-entity-modal ref="modalForm" @ok="modalFormOk"></requirement-entity-modal>
<requirement-entity-modal1 ref="modalForm1" @ok="modalFormOk"></requirement-entity-modal1>
<tablex-modal1 ref="modalForm2" @ok="modalFormOk"></tablex-modal1>
</a-card>
</template>
@ -114,14 +123,16 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RequirementEntityModal from './modules/RequirementEntityModal'
import RequirementEntityModal1 from './modules/RequirementEntityModal1'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { httpAction, getAction } from '@/api/manage'
import TablexModal1 from '../tablex/modules/TablexModal1'
export default {
name: 'RequirementEntityList',
mixins:[JeecgListMixin, mixinDevice],
components: {
RequirementEntityModal
RequirementEntityModal,RequirementEntityModal1,TablexModal1
},
data () {
return {
@ -180,6 +191,7 @@
exportXlsUrl: "/requiremententity/requirementEntity/exportXls",
importExcelUrl: "requiremententity/requirementEntity/importExcel",
fq:"/requiremententity/requirementEntity/fq",
hb:"/requiremententity/requirementEntity/hb",
},
dictOptions:{},
@ -195,6 +207,27 @@
},
},
methods: {
hb(hbsj){
console.log(hbsj)
if(hbsj.length<2){
this.$message.warning("请选择两条以上记录进行合并");
}else{
var ids = "";
for (var a = 0; a < hbsj.length; a++) {
ids += hbsj[a] + ",";
}
console.log(ids)
this.$refs.modalForm1.add(ids);
this.$refs.modalForm1.title = "合并";
this.$refs.modalForm1.disableSubmit = false;
}
/* deleteAction(this.url.hb,{ids:ids}).then((res)=>{
if (res.success) {
}else{
this.$message.warning(res.message);
}
});*/
},
fq(id){
getAction(this.url.fq,{id:id}).then((res)=>{
if (res.success) {
@ -205,6 +238,17 @@
}
});
},
zh(record){
if(record.entityStatus===3){
this.$message.warning("已转化,不可再次转化");
}else if(record.entityStatus===9){
this.$message.warning("已废弃,不可转化");
}else {
this.$refs.modalForm2.add(record.id);
this.$refs.modalForm2.title = "转化";
this.$refs.modalForm2.disableSubmit = false;
}
},
initDictConfig(){
},
getSuperFieldList(){

@ -18,11 +18,11 @@
<a-input v-model="model.entityEnName" placeholder="请输入英文名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<!-- <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-col>-->
<a-col :span="24">
<a-form-model-item label="实体描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entityDescribe">
<j-editor v-model="model.entityDescribe" />

@ -0,0 +1,132 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
</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,type:'radio'}"
class="j-table-force-nowrap"
@change="handleTableChange">
</a-table>
</div>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { httpAction, getAction,deleteAction } from '@/api/manage'
export default {
name: 'RequirementEntityList',
mixins:[JeecgListMixin, mixinDevice],
components: {
},
data () {
return {
ids:"",
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'
},
],
url: {
list: "/requiremententity/requirementEntity/list1?id="+"",
hb:"/requiremententity/requirementEntity/hb",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
add(ids){
this.url.list = "/requiremententity/requirementEntity/list1?id="+ids;
this.ids = ids;
this.loadData();
//this.ids = ids;
},
submitForm () {
deleteAction(this.url.hb,{ids:this.ids,id:this.selectedRowKeys[0]}).then((res)=>{
if (res.success) {
this.$message.success(res.message);
this.$emit('ok');
}else{
this.$message.warning(res.message);
}
});
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,61 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭"
okText="保留">
<requirement-entity-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></requirement-entity-form1>
</j-modal>
</template>
<script>
import RequirementEntityForm1 from './RequirementEntityForm1'
export default {
name: 'RequirementEntityModal1',
components: {
RequirementEntityForm1
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add (ids) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(ids);
})
},
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,165 @@
<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="moduleId">
<j-search-select-tag v-model="model.moduleId" dict="modulex,module_name,id" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">-->
<!-- <a-input v-model="model.tableName" placeholder="请输入中文名称" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableEnName">-->
<!-- <a-input v-model="model.tableEnName" placeholder="请输入英文名称" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="表结构SQL" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableStructure">-->
<!-- <a-input v-model="model.tableStructure" placeholder="请输入表结构SQL" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="结构图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="structuralDiagram">
<j-image-upload v-model="model.structuralDiagram" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="实体状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-search-select-tag v-model="model.status" dict="a_status" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="版本状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verisonStatus">
<j-search-select-tag v-model="model.verisonStatus" dict="verison_status" style="width: 100%" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="版本号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verison">-->
<!-- <a-input-number v-model="model.verison" placeholder="请输入版本号" style="width: 100%" />-->
<!-- </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: 'TablexForm1',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
reid:"",
model:{
status:1,
verisonStatus:1,
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
moduleId: [
{ required: true, message: '请选择对应模块!'},
],
tableName: [
{ required: true, message: '请输入中文名称!'},
],
tableEnName: [
{ required: true, message: '请输入英文名称!'},
],
status: [
{ required: true, message: '请选择实体状态!'},
],
verisonStatus: [
{ required: true, message: '请选择版本状态!'},
],
verison: [
{ required: true, message: '请输入版本号!'},
],
},
url: {
add: "/tablex/tablex/zh",
edit: "/tablex/tablex/edit",
queryById: "/tablex/tablex/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add (id) {
this.reid = id;
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';
this.model.id = this.reid;
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
this.model.id = "";
that.$message.success(res.message);
that.$emit('ok');
}else{
this.model.id = "";
that.$message.warning(res.message);
}
}).finally(() => {
this.model.id = "";
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="关闭">
<tablex-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tablex-form1>
</j-modal>
</template>
<script>
import TablexForm1 from './TablexForm1'
export default {
name: 'TablexModal1',
components: {
TablexForm1
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add (id) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(id);
})
},
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>

@ -72,6 +72,42 @@ public class RequirementEntityController extends JeecgController<RequirementEnti
return Result.OK(pageList);
}
/**
* 分页列表查询
*
* @param requirementEntity
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "需求实体抽取管理-分页列表查询")
@ApiOperation(value="需求实体抽取管理-分页列表查询", notes="需求实体抽取管理-分页列表查询")
@GetMapping(value = "/list1")
public Result<?> queryPageList1(RequirementEntity requirementEntity,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,@RequestParam(name="id",required=true) String id,
HttpServletRequest req) {
if(!id.equals("")){
QueryWrapper<RequirementEntity> queryWrapper = QueryGenerator.initQueryWrapper(requirementEntity, req.getParameterMap());
queryWrapper.clear();
List<String> listids =Arrays.asList(id.split(","));
queryWrapper.in("id",listids);
Page<RequirementEntity> page = new Page<RequirementEntity>(pageNo, pageSize);
IPage<RequirementEntity> pageList = requirementEntityService.page(page, queryWrapper);
return Result.OK(pageList);
}else{
QueryWrapper<RequirementEntity> queryWrapper = QueryGenerator.initQueryWrapper(requirementEntity, req.getParameterMap());
queryWrapper.clear();
queryWrapper.eq("id",id);
Page<RequirementEntity> page = new Page<RequirementEntity>(pageNo, pageSize);
IPage<RequirementEntity> pageList = requirementEntityService.page(page, queryWrapper);
return Result.OK(pageList);
}
}
/**
* 添加
*
@ -164,6 +200,30 @@ public class RequirementEntityController extends JeecgController<RequirementEnti
return Result.OK("已废弃");
}
/**
* 合并
*
* @param ids
* @return
*/
@AutoLog(value = "合并")
@ApiOperation(value="合并", notes="合并")
@DeleteMapping(value = "/hb")
public Result<?> hb(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="id",required=true) String id) {
List<String> listids = Arrays.asList(ids.split(","));
for (int i = 0 ; i < listids.size(); i++){
if(!id.equals(listids.get(i))){
RequirementEntity requirementEntity = requirementEntityService.getById(listids.get(i));
requirementEntity.setEntityStatus(9);
requirementEntityService.updateById(requirementEntity);
}
}
RequirementEntity requirementEntity1 = requirementEntityService.getById(id);
requirementEntity1.setEntityStatus(2);
requirementEntityService.updateById(requirementEntity1);
return Result.OK("成功");
}
/**
* 导出excel
*

@ -20,6 +20,8 @@ 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.demo.requiremententity.entity.RequirementEntity;
import org.jeecg.modules.demo.requiremententity.service.IRequirementEntityService;
import org.jeecg.modules.fieldx.controller.FieldxController;
import org.jeecg.modules.fieldx.entity.Fieldx;
import org.jeecg.modules.fieldx.service.IFieldxService;
@ -76,6 +78,9 @@ public class TablexController extends JeecgController<Tablex, ITablexService> {
@Autowired
private ITablexVoService tablexVoService;
@Autowired
private IRequirementEntityService requirementEntityService;
/**
* 分页列表查询
*
@ -127,6 +132,43 @@ public class TablexController extends JeecgController<Tablex, ITablexService> {
return Result.OK("添加成功!");
}
/**
* 转化
*
* @param tablex
* @return
*/
@AutoLog(value = "转化")
@ApiOperation(value = "转化", notes = "转化")
@PostMapping(value = "/zh")
public Result<?> zh(@RequestBody Tablex tablex,HttpServletRequest req) {
String reid = tablex.getId();
tablex.setId(null);
List<Tablex> tablexList = tablexService.list();
for (Tablex tablex1 : tablexList) {
if (tablex1.getModuleId().equals(tablex.getModuleId())) {
return Result.error("该模块已有实体,转化失败");
}
}
RequirementEntity requirementEntity = requirementEntityService.getById(reid);
tablex.setTableName(requirementEntity.getEntityName());
tablex.setTableEnName(requirementEntity.getEntityEnName());
tablex.setVerison(1);
tablex.setTableStructure("CREATE TABLE '" + tablex.getTableEnName() + "' ();");
QueryWrapper<Tablex> queryWrapper = QueryGenerator.initQueryWrapper(tablex, req.getParameterMap());
queryWrapper.eq("table_name",tablex.getTableName()).or().eq("table_en_name",tablex.getTableEnName());
List<Tablex> tlist = tablexService.list(queryWrapper);
if(tlist.size()>0){
return Result.error("中文或者英文名称重复,不可转化");
}else {
tablexService.save(tablex);
modulexService.setmodule(tablex.getId(), tablex.getModuleId());
requirementEntity.setEntityStatus(3);
requirementEntityService.updateById(requirementEntity);
return Result.OK("转化成功!");
}
}
/**
* 编辑
*

Loading…
Cancel
Save