Merge remote-tracking branch 'origin/master'

master
赵玉瑞 2 years ago
commit f09ea62648
  1. 524
      ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue
  2. 4
      ant-design-vue-jeecg/src/views/fieldx/modules/FieldxForm.vue
  3. 2
      ant-design-vue-jeecg/src/views/functionx/FunctionxList.vue
  4. 15
      ant-design-vue-jeecg/src/views/rulex/modules/RulexForm.vue
  5. 16
      ant-design-vue-jeecg/src/views/tablex/TablexList.vue
  6. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/controller/FunctionxController.java
  7. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/entity/Functionx.java
  8. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java
  9. 83
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java
  10. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java

@ -1,109 +1,60 @@
<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="中文名称">
<a-input placeholder="中文名称" v-model="queryParam.fieldName"></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.fieldEnName"></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 type="list" v-model="queryParam.status" dictCode="a_status" placeholder="请选择实体状态" />
</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>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<a-modal
width="96%"
title="评分项管理"
:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
>
<!-- 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"
<j-vxe-table
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
height='auto'
<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>
toolbar
:toolbarConfig="toolbarConfig"
row-number
row-selection
keep-source
async-remove
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
:pagination="pagination"
style="margin-top: 8px;"
@pageChange="handlePageChange"
@valueChange="valueChange"
@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>
<a-divider type="vertical" />
<a @click="handleDetail(record)">详情</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<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>
</span>
</template>
</j-vxe-table>
</a-table>
</div>
<fieldx-modal ref="modalForm" @ok="modalFormOk"></fieldx-modal>
</a-card>
</a-modal>
</template>
<script>
@ -113,171 +64,362 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import FieldxModal from './modules/FieldxModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import {JVXETypes} from '@/components/jeecg/JVxeTable'
import {filterObj} from '@/utils/util'
import moment from "dayjs";
import { httpAction, getAction } from '@/api/manage'
export default {
name: 'FieldxList',
mixins:[JeecgListMixin, mixinDevice],
components: {
FieldxModal
},
data () {
mixins: [JeecgListMixin, mixinDevice],
components: {},
data() {
return {
description: '字段管理管理页面',
loadRouteType:false,
tableId:'',
tableid:'',
tablename:'',
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,
// },
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'对应实体',
align:"center",
dataIndex: 'tableId_dictText'
key: 'tableId_dictText', title: '对应实体', width: '6%',
type: JVXETypes.normal,
disabled: true,
defaultValue:this.tablename,
},
{
title:'中文名称',
align:"center",
dataIndex: 'fieldName'
key: 'fieldName', title: '中文名称', width: '6%',
type: JVXETypes.input,
validateRules: [{required: true, message: '${title}不能为空'}]
},
{
title:'英文名称',
align:"center",
dataIndex: 'fieldEnName'
key: 'fieldEnName', title: '英文名称', width: '6%',
type: JVXETypes.input,
validateRules: [{required: true, message: '${title}不能为空'}]
},
{
title:'数据类型',
align:"center",
dataIndex: 'type_dictText'
key: 'type', title: '数据类型', width: '6%',
type: JVXETypes.selectSearch,
dictCode:'date_type',
validateRules: [{required: true, message: '${title}不能为空'}]
},
{
title:'数据长度',
align:"center",
dataIndex: 'length'
key: 'accuracy', title: '浮点精度', width: '6%',
type: JVXETypes.inputNumber,
},
{
title:'浮点精度',
align:"center",
dataIndex: 'accuracy'
key: 'format', title: '显示形式', width: '6%',
type: JVXETypes.textarea,
},
{
title:'显示形式',
align:"center",
dataIndex: 'format'
key: 'isPk', title: '是否主键', width: '6%',
type: JVXETypes.select,
dictCode:'yn',
defaultValue:0,
validateRules: [{required: true, message: '${title}不能为空'}]
},
{
title:'是否主键',
align:"center",
dataIndex: 'isPk_dictText'
key: 'isFk', title: '是否外键', width: '6%',
type: JVXETypes.select,
dictCode:'yn',
defaultValue:0,
validateRules: [{required: true, message: '${title}不能为空'}]
},
{
title:'是否外键',
align:"center",
dataIndex: 'isFk_dictText'
key: 'associateTable', title: '关联实体', width: '6%',
type: JVXETypes.select,
dictCode:'tablex,table_name,id',
},
{
title:'关联实体',
align:"center",
dataIndex: 'associateTable'
key: 'associateField', title: '关联字段', width: '6%',
type: JVXETypes.select,
options: [],
placeholder: '请选择${title}',
},
{
title:'关联字段',
align:"center",
dataIndex: 'associateField'
key: 'isNull', title: '是否为空', width: '6%',
type: JVXETypes.select,
dictCode:'yn',
defaultValue:0,
validateRules: [{required: true, message: '${title}不能为空'}]
},
{
title:'是否为空',
align:"center",
dataIndex: 'isNull_dictText'
key: 'isUniqueness', title: '是否重复', width: '6%',
type: JVXETypes.select,
dictCode:'yn',
defaultValue:0,
validateRules: [{required: true, message: '${title}不能为空'}]
},
{
title:'是否重复',
align:"center",
dataIndex: 'isUniqueness_dictText'
key: 'rule', title: '字段规则', width: '6%',
type: JVXETypes.textarea,
},
{
title:'字段规则',
align:"center",
dataIndex: 'rule',
scopedSlots: {customRender: 'htmlSlot'}
key: 'status', title: '字段状态', width: '6%',
type: JVXETypes.select,
dictCode:'a_status',
defaultValue:1,
validateRules: [{required: true, message: '${title}不能为空'}]
},
{
title:'字段状态',
align:"center",
dataIndex: 'status_dictText'
},
{
title:'版本状态',
align:"center",
dataIndex: 'verisonStatus_dictText'
},
{
title:'版本号',
align:"center",
dataIndex: 'verison'
key: 'verisonStatus', title: '版本状态', width: '6%',
type: JVXETypes.select,
dictCode:'verison_status',
defaultValue:1,
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: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
key: 'action',
type: JVXETypes.slot,
fixed: 'right',
//
align: 'center',
minWidth: '6%',
slotName: 'action',
}
],
url: {
add: "/fieldx/fieldx/add",
edit: "/fieldx/fieldx/edit",
list: "/fieldx/fieldx/list",
delete: "/fieldx/fieldx/delete",
deleteBatch: "/fieldx/fieldx/deleteBatch",
exportXlsUrl: "/fieldx/fieldx/exportXls",
importExcelUrl: "fieldx/fieldx/importExcel",
getFieldByTableId:"/fieldx/fieldx/getFieldByTableId",
},
dictOptions:{},
superFieldList:[],
dictOptions: {},
superFieldList: [],
//
loadRouteType: false,
}
},
created() {
this.loadParameter();
this.getSuperFieldList();
this.searchQuery();
},
computed: {
importExcelUrl: function(){
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
submitForm(props) {
this.model = Object.assign({}, props);
var str = props.rowId;
let httpurl = '';
let method = '';
if (str.search("row") !== -1) {
props.row.id ='';
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
props.row.tableId = this.tableid
httpAction(httpurl, props.row, method).then((res) => {
if (res.success) {
this.$message.success(res.message);
this.$emit('ok');
} else {
this.$message.warning(res.message);
}
})
},
//
added(event) {
const {type, row, column, value, target} = event
this.tableid = this.model.id
target.setValues([{
rowKey: row.id,
values: {tableId_dictText: this.model.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);
}
})
},
//
valueChange(event){
const {type, row, column, value, target} = event
if (column.key == "associateTable"){
let tableId = row.associateTable
//
target.setValues([{
rowKey: row.id,
values: {associateField: ''}
}])
target.$refs.vxe.columns[11].options = []
//
getAction(this.url.getFieldByTableId, {"tableId": tableId}).then((res) => {
if (res.success) {
this.fieldxList = res.result.records || res.result;
// 2
target.$refs.vxe.columns[11].options = this.fieldxList;
} else {
this.$message.warning(res.message)
}
});
}
},
edit(record) {
this.model = Object.assign({}, record);
console.log(this.model)
//console.log(topicid);
this.queryParam.tableId = this.model.id;
this.tableid = this.model.id
//console.log(this.queryParam.topicid);
this.loadData();
},
showModal() {
this.visible = true;
},
searchReset() {
this.tableId = this.$route.query.tableId;
this.queryParam ={};
this.queryParam.tableId = this.tableId;
this.loadData(1);
// 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;
},
searchQuery(){
this.tableId = this.$route.query.tableId;
this.queryParam.tableId = this.$route.query.tableId;
this.loadData(1);
handleCancel(e) {
console.log('Clicked cancel button');
this.visible = false;
},
initDictConfig() {
},
//
loadParameter() {
if (this.loadRouteType == false) {
this.queryParam.tableId = this.$route.query.tableId;
this.tableId = this.$route.query.tableId;
console.log(this.queryParam.tableId)
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;
this.loadData(1);
}
},
//
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.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
//param.id = this.id
return filterObj(param);
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'tableId',text:'对应实体',dictCode:'tablex,table_name,id'})

@ -5,7 +5,7 @@
<a-row>
<a-col :span="24">
<a-form-model-item label="对应实体" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableId">
<j-search-select-tag v-model="model.tableId" dict="tablex,table_name,id" />
<j-search-select-tag v-model="model.tableId" placeholder="请选择对应实体" disabled dict="tablex,table_name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -120,6 +120,7 @@
isUniqueness:'0',
status:'1',
verisonStatus:'1',
tableId:'',
},
labelCol: {
xs: { span: 24 },
@ -173,6 +174,7 @@
},
},
created () {
this.model.tableId = this.$route.query.tableId;
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},

@ -183,7 +183,7 @@
{
title:'对应模块',
align:"center",
dataIndex: 'moduleId'
dataIndex: 'moduleId_dictText'
},
{
title:'中文名称',

@ -27,7 +27,7 @@
<a-col :span="24">
<a-form-model-item label="对应实体" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableId">
<j-dict-select-tag type="list" v-model="model.tableId" :dictCode=table placeholder="请选择对应实体" @change="ziduan"/>
<j-dict-select-tag type="list" v-model="model.tableId" :dictCode=table placeholder="请选择对应实体" disabled/>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -149,9 +149,10 @@
add: "/rulex/rulex/add",
edit: "/rulex/rulex/edit",
queryById: "/rulex/rulex/queryById",
query:'modulex/modulex/queryById',
sort:'/rulex/rulex/sort'
},
table:'',
table:'tablex,table_name,id',
field:'fieldx,field_name,id',
}
},
@ -163,9 +164,10 @@
created () {
//model
this.model.moduleId=this.$route.query.moduleid
this.table="tablex,table_name,id,module_id="+this.model.moduleId
// this.table="tablex,table_name,id,module_id="+this.model.moduleId
this.model.functionId=this.$route.query.functionid
this.sort()
this.shiti()
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
@ -177,6 +179,13 @@
console.log(this.model.ruleNo)
})
},
shiti(){
getAction(this.url.query,{id:this.model.moduleId}).then((res)=>{
this.model.tableId=res.result.relatedBean
this.field="fieldx,field_name,id,table_id="+this.model.tableId;
console.log(this.model.tableId,"-----------")
})
},
ziduan(){
this.field="fieldx,field_name,id,table_id="+this.model.tableId;
},

@ -38,7 +38,7 @@
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<!-- <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="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@ -89,7 +89,7 @@
</template>
<template slot="htmlSlot" slot-scope="text,record">
<a @click="tablemanage(record.id)">字段</a>
<a @click="viewVid(record)">字段</a>
</template>
<span slot="action" slot-scope="text, record">
@ -108,6 +108,7 @@
</div>
<tablex-modal ref="modalForm" @ok="modalFormOk"></tablex-modal>
<FieldxList ref="FieldxList"></FieldxList>
</a-card>
</template>
@ -119,6 +120,7 @@
import TablexModal from './modules/TablexModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import JEllipsis from '@/components/jeecg/JEllipsis'
import FieldxList from "@/views/fieldx/FieldxList";
export default {
name: 'TablexList',
@ -126,6 +128,7 @@
components: {
TablexModal,
JEllipsis,
FieldxList,
},
data () {
let ellipsis = (v, l = 20) => (<j-ellipsis value={v} length={l}/>)
@ -243,11 +246,10 @@
},
},
methods: {
tablemanage(tableId) {
this.$router.push({
path: '/fieldx/FieldxList',
query: {tableId: tableId}
})
viewVid(record) {
this.$refs.FieldxList.showModal();
this.$refs.FieldxList.edit(record);
this.$refs.FieldxList.disableSubmit = false;
},
initDictConfig(){
},

@ -23,6 +23,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.modulex.entity.Modulex;
import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -52,6 +54,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class FunctionxController extends JeecgController<Functionx, IFunctionxService> {
@Autowired
private IFunctionxService functionxService;
@Autowired
private IModulexService modulexService;
/**
* 分页列表查询
@ -108,6 +112,14 @@ public class FunctionxController extends JeecgController<Functionx, IFunctionxSe
@ApiOperation(value="功能管理-添加", notes="功能管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody Functionx functionx) {
QueryWrapper<Modulex> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("id",functionx.getModuleId());
Modulex one = modulexService.getOne(queryWrapper);
if(one.getRelatedBean()==null){
return Result.error("请先为对应模块关联实体!!!");
}
//感觉不符合逻辑,上级模块如果是已发布,然后新增也是已发布状态,那样发布按钮还有什么用??
// functionx.setWorkStatus(one.getWorkStatus());
functionxService.save(functionx);
return Result.OK("添加成功!");
}
@ -198,9 +210,9 @@ public class FunctionxController extends JeecgController<Functionx, IFunctionxSe
@GetMapping(value = "/bianma")
public Result<?> moduleCode(@RequestParam(name="id",required=true) String id) {
String s=functionxService.findModuleCode(id);
//后期放入返回值中,当前为返回信息
System.out.println(s);
return Result.OK("编码");
// //后期放入返回值中,当前为返回信息
// System.out.println(s);
return Result.OK(s);
}
//在主界面判断一下登录角色,对操作栏进行替换
@GetMapping(value = "/loginrole")

@ -54,7 +54,7 @@ public class Functionx implements Serializable {
/**对应模块id*/
@Excel(name = "对应模块id", width = 15)
@ApiModelProperty(value = "对应模块id")
// @Dict(dictTable = "modulex",dicCode = "id",dicText = "module_name")
@Dict(dictTable = "modulex",dicCode = "id",dicText = "module_name")
private java.lang.String moduleId;
/**中文名称*/
@Excel(name = "中文名称", width = 15)

@ -103,6 +103,15 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
return Result.error("功能点错误!!!");
}
Functionx functionx = functionxMapper.selectById(rulex.getFunctionId());
if(functionx.getStartTime()!=null){
rulex.setStartTime(functionx.getStartTime());
}
if(functionx.getSubmitTime()!=null){
rulex.setSubmitTime(functionx.getSubmitTime());
}
if(functionx.getRealDuration()!=null){
rulex.setRealDuration(functionx.getRealDuration());
}
rulex.setManagerUsers(functionx.getManagerUsers());
rulex.setWorkStatus(functionx.getWorkStatus());
rulexService.save(rulex);

@ -1,14 +1,14 @@
package org.jeecg.modules.fieldx.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
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.apache.ibatis.annotations.Param;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
@ -75,7 +75,30 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
IPage<Fieldx> pageList = fieldxService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 通过实体查询字段
*
*/
@AutoLog(value = "字段管理-通过实体查询字段")
@ApiOperation(value="字段管理-通过实体查询字段", notes="字段管理-通过实体查询字段")
@GetMapping(value = "/getFieldByTableId")
public Result<?> getFieldByTableId(@RequestParam(name="tableId",required=true) String tableId) {
if (tableId != null){
List<Fieldx> fieldxList = fieldxService.list(new QueryWrapper<Fieldx>().eq("table_id", tableId));
ArrayList<HashMap> hashMaps = new ArrayList<>();
for (Fieldx fieldx:fieldxList){
HashMap<Object, Object> hashMap = new HashMap<>();
hashMap.put("text",fieldx.getFieldName());
hashMap.put("value",fieldx.getId());
hashMaps.add(hashMap);
}
return Result.OK(hashMaps);
}else return Result.error("未找到数据,请重试");
}
/**
* 添加
*
@ -86,6 +109,30 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
@ApiOperation(value="字段管理-添加", notes="字段管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody Fieldx fieldx) {
if(fieldx.getTableId() ==null){
return Result.error("未选择相应实体,添加失败");
}
if(fieldx.getFieldName() ==null){
return Result.error("未输入中文名称,添加失败");
}
if (fieldx.getFieldEnName() == null){
return Result.error("未输入英文名称,添加失败");
}
if (fieldx.getType() == null){
return Result.error("未选择数据类型,添加失败");
}
if (fieldx.getIsNull() == null){
return Result.error("未选择是否为空,添加失败");
}
if (fieldx.getIsUniqueness() == null){
return Result.error("未选择是否重复,添加失败");
}
if (fieldx.getStatus() == null){
return Result.error("未选择字段状态,添加失败");
}
if (fieldx.getVerisonStatus() == null){
return Result.error("未选择版本状态,添加失败");
}
fieldx.setVerison(1);
if (fieldx.getAssociateTable() != null && fieldx.getAssociateTable().equals(fieldx.getTableId())){
return Result.error("实体不能关联自身,添加失败");
@ -119,11 +166,32 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
@ApiOperation(value="字段管理-编辑", notes="字段管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody Fieldx fieldx) {
if(fieldx.getFieldName() ==null){
return Result.error("未输入中文名称,编辑失败");
}
if (fieldx.getFieldEnName() == null){
return Result.error("未输入英文名称,编辑失败");
}
if (fieldx.getType() == null){
return Result.error("未选择数据类型,编辑失败");
}
if (fieldx.getIsNull() == null){
return Result.error("未选择是否为空,编辑失败");
}
if (fieldx.getIsUniqueness() == null){
return Result.error("未选择是否重复,编辑失败");
}
if (fieldx.getStatus() == null){
return Result.error("未选择字段状态,编辑失败");
}
if (fieldx.getVerisonStatus() == null){
return Result.error("未选择版本状态,编辑失败");
}
if (fieldx.getAssociateTable() != null && fieldx.getAssociateTable().equals(fieldx.getTableId())){
return Result.error("实体不能关联自身,编辑失败");
}
if (fieldx.getTableId() != null){
List<Fieldx> fieldxList = fieldxService.list(new QueryWrapper<Fieldx>().eq("table_id", fieldx.getTableId()));
List<Fieldx> fieldxList = fieldxService.list(new QueryWrapper<Fieldx>().eq("table_id", fieldx.getTableId()).ne("id",fieldx.getId()));
for (Fieldx fieldx1 : fieldxList){
if (fieldx1.getFieldName().equals(fieldx.getFieldName())){
return Result.error("编辑失败,所属实体已有该中文名称");
@ -151,8 +219,13 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
@ApiOperation(value="字段管理-通过id删除", notes="字段管理-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
List<Fieldx> fieldxList = fieldxService.list(new QueryWrapper<Fieldx>().eq("associate_field", id));
if (!fieldxList.isEmpty()){
return Result.error("该字段已被关联,不能删除");
}
Fieldx fieldx = fieldxService.getById(id);
fieldxService.removeById(id);
// 更新sql语句
tablexService.updateSql(fieldx.getTableId(),createSql(fieldx.getTableId()));
return Result.OK("删除成功!");
}

@ -150,7 +150,15 @@ public class TablexController extends JeecgController<Tablex, ITablexService> {
@ApiOperation(value="实体表-通过id删除", notes="实体表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
tablexService.removeById(id);
List<Fieldx> fieldxList = fieldxService.list(new QueryWrapper<Fieldx>().eq("table_id", id));
if (!fieldxList.isEmpty()){
return Result.error("该表内已有字段,不能删除");
}
List<Fieldx> fieldxList1 = fieldxService.list(new QueryWrapper<Fieldx>().eq("associate_table", id));
if (!fieldxList1.isEmpty()){
return Result.error("该表已被关联,不能删除");
}
// tablexService.removeById(id);
return Result.OK("删除成功!");
}

Loading…
Cancel
Save