Merge remote-tracking branch 'origin/master'

master
赵玉瑞 2 years ago
commit a41855f18c
  1. 6
      ant-design-vue-jeecg/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue
  2. 9
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  3. 18
      ant-design-vue-jeecg/src/utils/util.js
  4. 500
      ant-design-vue-jeecg/src/views/functionx/FunctionxList.vue
  5. 279
      ant-design-vue-jeecg/src/views/functionx/modules/FunctionxForm.vue
  6. 60
      ant-design-vue-jeecg/src/views/functionx/modules/FunctionxModal.vue
  7. 84
      ant-design-vue-jeecg/src/views/functionx/modules/FunctionxModal__Style#Drawer.vue
  8. 274
      ant-design-vue-jeecg/src/views/rulex/RulexList.vue
  9. 227
      ant-design-vue-jeecg/src/views/rulex/modules/RulexForm.vue
  10. 60
      ant-design-vue-jeecg/src/views/rulex/modules/RulexModal.vue
  11. 84
      ant-design-vue-jeecg/src/views/rulex/modules/RulexModal__Style#Drawer.vue
  12. 237
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/controller/FunctionxController.java
  13. 147
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/entity/Functionx.java
  14. 42
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/mapper/FunctionxMapper.java
  15. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/mapper/xml/FunctionxMapper.xml
  16. 30
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/IFunctionxService.java
  17. 136
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionxServiceImpl.java
  18. 171
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java
  19. 130
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/entity/Rulex.java
  20. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/mapper/RulexMapper.java
  21. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/mapper/xml/RulexMapper.xml
  22. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java
  23. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java
  24. 25
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/DuplicateCheckController.java
  25. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
  26. 27
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml
  27. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/DuplicateCheckVo.java

@ -58,7 +58,7 @@
@change="handleTableChange"
>
<!-- selectionRows 这个是 选择过的用户 selectedRowKeys 这个是 选择中的 用户
dataSource 这个是原始数据
dataSource 这个是原始数据
-->
</a-table>
</a-card>
@ -163,7 +163,7 @@ export default {
selectUserRows: {
deep: true,
handler() {
this.$bus.$emit('headleUser', {
restle: this.selectUserRows, //
userSelect: this._props.userSelect, //
@ -296,7 +296,7 @@ export default {
this.selectUserRows.push(row)
}
}
this.selectUserIds = this.selectUserRows.map((row) => row.username).join(',')
this.selectUserIds = this.selectUserRows.map((row) => row.id).join(',')
},
// ,
onDepSelect(selectedDepIds) {

@ -274,6 +274,15 @@ export const JeecgListMixin = {
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
},
fuzhi: function(record){
record.id=''
record.functionName=record.functionName+1
record.functionEnName=record.functionEnName+1
record.functionCode=record.functionCode+1
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "复制";
this.$refs.modalForm.disableSubmit = false;
},
handleAdd: function () {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";

@ -358,6 +358,7 @@ export function jsExpand(options = {}) {
* @param callback
*/
export function validateDuplicateValue(tableName, fieldName, fieldVal, dataId, callback) {
if (fieldVal) {
let params = { tableName, fieldName, fieldVal, dataId }
api
@ -372,6 +373,23 @@ export function validateDuplicateValue(tableName, fieldName, fieldVal, dataId, c
callback()
}
}
export function validateDuplicateValue1(tableName, fieldName, fieldVal, dataId,moduleid, callback) {
if (fieldVal) {
let params = { tableName, fieldName, fieldVal, dataId ,moduleid}
api
.duplicateCheck(params)
.then((res) => {
res['success'] ? callback() : callback(res['message'])
})
.catch((err) => {
callback(err.message || err)
})
} else {
callback()
}
}
/**
* 根据编码校验规则code校验传入的值是否合法

@ -0,0 +1,500 @@
<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.functionName"></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.functionEnName"></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.functionType" dictCode="function_type" placeholder="请选择功能类型"/>
</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.workStatus" dictCode="work_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>-->
<a-button @click="fanhui" type="primary" icon="rollback">返回</a-button>
</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="action1" slot-scope="text, record">
<a @click="guize(record)">开发规则</a>
</span>
<span slot="action" slot-scope="text, record" v-if="role==2">
<a @click="fabu(record)" v-if="record.workStatus==0">发布</a>
<a v-else="">已发布</a>
<a-divider type="vertical" />
<a @click="kaishi(record)">开始</a>
<a-divider type="vertical" />
<a @click="tijiao(record)">提交</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">详情</a>
</span>
<span slot="action" slot-scope="text, record" v-if="role==1">
<a @click="fabu(record)" v-if="record.workStatus==0">发布</a>
<a v-else="">已发布</a>
<a-divider type="vertical" />
<a @click="kaishi(record)">开始</a>
<a-divider type="vertical" />
<a @click="tijiao(record)">提交</a>
<a-divider type="vertical" />
<a @click="fuzhi(record)">复制</a>
<a-divider type="vertical" />
<a @click="cehui(record)">撤回</a>
<a-divider type="vertical" />
<a @click="fankui(record)">DEBUG</a>
<a-divider type="vertical" />
<a @click="shenhe(record)">审核</a>
<a-divider type="vertical" />
<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>
<functionx-modal ref="modalForm" @ok="modalFormOk"></functionx-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import FunctionxModal from './modules/FunctionxModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
import store from '@/store'
export default {
name: 'FunctionxList',
mixins:[JeecgListMixin, mixinDevice],
components: {
FunctionxModal
},
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: 'moduleId'
},
{
title:'中文名称',
align:"center",
dataIndex: 'functionName'
},
{
title:'英文名称',
align:"center",
dataIndex: 'functionEnName'
},
{
title:'功能编码',
align:"center",
dataIndex: 'functionCode'
},
{
title:'功能类型',
align:"center",
dataIndex: 'functionType_dictText'
},
{
title:'功能描述',
align:"center",
dataIndex: 'pmDescribe',
scopedSlots: {customRender: 'htmlSlot'}
},
{
title:'分析图',
align:"center",
dataIndex: 'diagrams',
scopedSlots: {customRender: 'imgSlot'}
},
// {
// title:'',
// align:"center",
// dataIndex: 'userRole_dictText'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'managerUsers_dictText'
// },
{
title:'任务等级',
align:"center",
dataIndex: 'workLevel_dictText'
},
{
title:'任务状态',
align:"center",
dataIndex: 'workStatus_dictText'
},
{
title:'发布时间',
align:"center",
dataIndex: 'publishTime',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title:'开始时间',
align:"center",
dataIndex: 'startTime',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title:'任务时长',
align:"center",
dataIndex: 'duration'
},
{
title:'提交时间',
align:"center",
dataIndex: 'submitTime',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title:'实际时长',
align:"center",
dataIndex: 'realDuration'
},
{
title: '规则管理',
align:"center",
dataIndex: 'action1',
width:147,
scopedSlots: { customRender: 'action1' }
},
// {
// title:'',
// align:"center",
// dataIndex: 'status_dictText'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'verisonStatus_dictText'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'verison'
// },
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/functionx/functionx/list",
delete: "/functionx/functionx/delete",
deleteBatch: "/functionx/functionx/deleteBatch",
exportXlsUrl: "/functionx/functionx/exportXls",
importExcelUrl: "functionx/functionx/importExcel",
loginrole:'functionx/functionx/loginrole',
fabu:'functionx/functionx/fabu',
kaishi:'functionx/functionx/kaishi',
tijiao:'functionx/functionx/tijiao',
cehui:'functionx/functionx/cehui',
shenhe:'functionx/functionx/shenhe'
},
dictOptions:{},
superFieldList:[],
loadRouteType:false,
role:'',
queryParam:{},
}
},
created() {
let usercode = store.getters.userInfo.id
//id
this.loginrole(usercode)
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
shenhe(record){
getAction(this.url.shenhe,{id:record.id}).then((res)=>{
if (res.success) {
//
this.$message.success(res.result);
this.loadData();
}else{
this.$message.warning(res.message);
}
})
},
cehui(record){
getAction(this.url.cehui,{id:record.id}).then((res)=>{
if (res.success) {
//
this.$message.success(res.result);
this.loadData();
}else{
this.$message.warning(res.message);
}
})
},
tijiao(record){
getAction(this.url.tijiao,{id:record.id}).then((res)=>{
if (res.success) {
//
this.$message.success(res.result);
this.loadData();
}else{
this.$message.warning(res.message);
}
})
},
kaishi(record){
getAction(this.url.kaishi,{id:record.id}).then((res)=>{
if (res.success) {
//
this.$message.success(res.result);
this.loadData();
}else{
this.$message.warning(res.message);
}
})
},
//
fabu(record){
getAction(this.url.fabu,{id:record.id}).then((res)=>{
if (res.success) {
//
this.$message.success(res.result);
this.loadData();
}
})
},
loginrole(id){
getAction(this.url.loginrole,{id:id}).then((res)=>{
if (res.success) {
//
this.role=res.result;
}
})
},
guize(record){
this.$router.push({
/*返回产品*/
path: '/src/views/rulex/RulexList',/*在引号中填写返回vue*/
query:{
moduleid:record.moduleId,
functionid:record.id
},
});
},
fanhui(){
this.$router.push({
/*返回产品*/
path: '',/*在引号中填写返回vue*/
});
},
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'moduleId',text:'对应模块id',dictCode:''})
fieldList.push({type:'string',value:'functionName',text:'中文名称',dictCode:''})
fieldList.push({type:'string',value:'functionEnName',text:'英文名称',dictCode:''})
fieldList.push({type:'string',value:'functionCode',text:'功能编码',dictCode:''})
fieldList.push({type:'int',value:'functionType',text:'功能类型',dictCode:''})
fieldList.push({type:'string',value:'pmDescribe',text:'功能描述',dictCode:''})
fieldList.push({type:'string',value:'diagrams',text:'分析图',dictCode:''})
fieldList.push({type:'list_multi',value:'userRole',text:'用户角色',dictTable:'', dictText:'', dictCode:''})
fieldList.push({type:'sel_user',value:'managerUsers',text:'责任人'})
fieldList.push({type:'int',value:'workLevel',text:'任务等级',dictCode:''})
fieldList.push({type:'int',value:'workStatus',text:'任务状态',dictCode:''})
fieldList.push({type:'date',value:'publishTime',text:'发布时间'})
fieldList.push({type:'date',value:'startTime',text:'开始时间'})
fieldList.push({type:'double',value:'duration',text:'任务时长',dictCode:''})
fieldList.push({type:'date',value:'submitTime',text:'提交时间'})
fieldList.push({type:'double',value:'realDuration',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
},
loadParameter() {
if (this.loadRouteType === false) {
this.id = this.$route.query.moduleid;
// console.log("***********")
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!");
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for------------
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getQueryParams() {
//
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;
param.moduleId = this.$route.query.moduleid;
return filterObj(param);
},
searchReset() {
this.queryParam=''
this.loadData();
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,279 @@
<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="对应模块id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleId">-->
<!-- <a-input v-model="model.moduleId" placeholder="请输入对应模块id" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="functionName">
<a-input v-model="model.functionName" placeholder="请输入中文名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="functionEnName">
<a-input v-model="model.functionEnName" placeholder="请输入英文名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="功能类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="functionType">
<j-dict-select-tag type="list" v-model="model.functionType" dictCode="function_type" placeholder="请选择功能类型" @change="functionxbianma"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="功能编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="functionCode">
<a-input v-model="model.functionCode" placeholder="请输入功能编码" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="用户角色" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userRole">
<j-multi-select-tag type="list_multi" v-model="model.userRole" dictCode="sys_role,role_name,id" placeholder="请选择用户角色" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="managerUsers">
<j-select-user-by-dep v-model="model.managerUsers" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="任务等级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workLevel">
<j-dict-select-tag type="list" v-model="model.workLevel" dictCode="work_level" placeholder="请选择任务等级" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="任务状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workStatus">-->
<!-- <j-dict-select-tag type="list" v-model="model.workStatus" dictCode="work_status" placeholder="请选择任务状态" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="发布时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="publishTime">-->
<!-- <j-date placeholder="请选择发布时间" v-model="model.publishTime" style="width: 100%" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startTime">-->
<!-- <j-date placeholder="请选择开始时间" v-model="model.startTime" style="width: 100%" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="任务时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration">
<a-input-number v-model="model.duration" placeholder="请输入任务时长" style="width: 100%" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="提交时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitTime">-->
<!-- <j-date placeholder="请选择提交时间" v-model="model.submitTime" style="width: 100%" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="实际时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realDuration">-->
<!-- <a-input-number v-model="model.realDuration" placeholder="请输入实际时长" style="width: 100%" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="功能状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">-->
<!-- <j-dict-select-tag type="list" v-model="model.status" dictCode="a_status" placeholder="请选择功能状态" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="版本状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verisonStatus">-->
<!-- <j-dict-select-tag type="list" v-model="model.verisonStatus" dictCode="verison_status" placeholder="请选择版本状态" />-->
<!-- </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-col :span="24">
<a-form-model-item label="分析图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diagrams">
<j-image-upload isMultiple v-model="model.diagrams" ></j-image-upload>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="功能描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pmDescribe">
<j-editor v-model="model.pmDescribe" />
</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 { validateDuplicateValue1 } from '@/utils/util'
export default {
name: 'FunctionxForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
workLevel:2,
workStatus:0,
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
moduleId: [
{ required: true, message: '请输入对应模块id!'},
],
functionName: [
{ required: true, message: '请输入中文名称!'},
{ validator: (rule, value, callback) => validateDuplicateValue1('functionx', 'function_name', value, this.model.id,this.moduleid, callback)},
],
functionEnName: [
{ required: true, message: '请输入英文名称!'},
{ validator: (rule, value, callback) => validateDuplicateValue1('functionx', 'function_en_name', value, this.model.id,this.moduleid, callback)},
],
functionCode: [
{ required: true, message: '请输入功能编码!'},
],
functionType: [
{ required: true, message: '请输入功能类型!'},
],
workLevel: [
{ required: true, message: '请输入任务等级!'},
],
workStatus: [
{ required: true, message: '请输入任务状态!'},
],
realDuration: [
{ required: true, message: '请输入实际时长!'},
],
status: [
{ required: true, message: '请输入功能状态!'},
],
verisonStatus: [
{ required: true, message: '请输入版本状态!'},
],
verison: [
{ required: true, message: '请输入版本号!'},
],
},
url: {
add: "/functionx/functionx/add",
edit: "/functionx/functionx/edit",
queryById: "/functionx/functionx/queryById",
bianma:'/functionx/functionx/bianma'
},
moduleid:'',
modulecode:'',
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.moduleid=this.$route.query.moduleid
this.model.moduleId=this.$route.query.moduleid
//
this.modulebianma(this.moduleid)
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
functionxbianma(){
if(this.model.functionType==0){
this.model.functionCode=this.modulecode+"列表"
}
else if(this.model.functionType==1){
this.model.functionCode=this.modulecode+"增加"
}
else if(this.model.functionType==2){
this.model.functionCode=this.modulecode+"删除"
}
else if(this.model.functionType==3){
this.model.functionCode=this.modulecode+"修改"
}
else if(this.model.functionType==4){
this.model.functionCode=this.modulecode+"查看"
}
else if(this.model.functionType==5){
this.model.functionCode=this.modulecode+"导入"
}
else if(this.model.functionType==6){
this.model.functionCode=this.modulecode+"导出"
}
else {
this.model.functionCode=this.modulecode+"其他"
}
console.log(this.model.functionCode,"---------")
},
modulebianma(id){
getAction(this.url.bianma,{id:id}).then((res)=>{
if (res.success) {
//
this.modulecode=res.result;
}
})
},
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="关闭">
<functionx-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></functionx-form>
</j-modal>
</template>
<script>
import FunctionxForm from './FunctionxForm'
export default {
name: 'FunctionxModal',
components: {
FunctionxForm
},
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">
<functionx-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></functionx-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 FunctionxForm from './FunctionxForm'
export default {
name: 'FunctionxModal',
components: {
FunctionxForm
},
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>

@ -0,0 +1,274 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</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>
<!-- 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-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<rulex-modal ref="modalForm" @ok="modalFormOk"></rulex-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RulexModal from './modules/RulexModal'
export default {
name: 'RulexList',
mixins:[JeecgListMixin, mixinDevice],
components: {
RulexModal
},
data () {
return {
description: '规则管理管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'对应模块id',
align:"center",
dataIndex: 'moduleId'
},
{
title:'对应功能id',
align:"center",
dataIndex: 'functionId'
},
{
title:'规则序号',
align:"center",
dataIndex: 'ruleNo'
},
{
title:'规则编码',
align:"center",
dataIndex: 'ruleCode'
},
{
title:'规则描述',
align:"center",
dataIndex: 'pmDescribe'
},
{
title:'分析图',
align:"center",
dataIndex: 'diagrams',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'对应实体id',
align:"center",
dataIndex: 'tableId_dictText'
},
{
title:'对应字段',
align:"center",
dataIndex: 'fieldId_dictText'
},
{
title:'责任人',
align:"center",
dataIndex: 'managerUsers'
},
{
title:'任务等级',
align:"center",
dataIndex: 'workLevel_dictText'
},
{
title:'任务状态',
align:"center",
dataIndex: 'workStatus_dictText'
},
{
title:'开始时间',
align:"center",
dataIndex: 'startTime'
},
{
title:'任务时长',
align:"center",
dataIndex: 'duration'
},
{
title:'提交时间',
align:"center",
dataIndex: 'submitTime'
},
{
title:'实际时长',
align:"center",
dataIndex: 'realDuration'
},
{
title:'规则状态',
align:"center",
dataIndex: 'status'
},
{
title:'版本状态',
align:"center",
dataIndex: 'verisonStatus'
},
{
title:'版本号',
align:"center",
dataIndex: 'verison'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/rulex/rulex/list",
delete: "/rulex/rulex/delete",
deleteBatch: "/rulex/rulex/deleteBatch",
exportXlsUrl: "/rulex/rulex/exportXls",
importExcelUrl: "rulex/rulex/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:'moduleId',text:'对应模块id',dictCode:''})
fieldList.push({type:'string',value:'functionId',text:'对应功能id',dictCode:''})
fieldList.push({type:'string',value:'ruleNo',text:'规则序号',dictCode:''})
fieldList.push({type:'string',value:'ruleCode',text:'规则编码',dictCode:''})
fieldList.push({type:'string',value:'pmDescribe',text:'规则描述',dictCode:''})
fieldList.push({type:'string',value:'diagrams',text:'分析图',dictCode:''})
fieldList.push({type:'string',value:'tableId',text:'对应实体id',dictCode:''})
fieldList.push({type:'string',value:'fieldId',text:'对应字段',dictCode:''})
fieldList.push({type:'string',value:'managerUsers',text:'责任人',dictCode:''})
fieldList.push({type:'int',value:'workLevel',text:'任务等级',dictCode:''})
fieldList.push({type:'int',value:'workStatus',text:'任务状态',dictCode:''})
fieldList.push({type:'datetime',value:'startTime',text:'开始时间'})
fieldList.push({type:'double',value:'duration',text:'任务时长',dictCode:''})
fieldList.push({type:'datetime',value:'submitTime',text:'提交时间'})
fieldList.push({type:'double',value:'realDuration',text:'实际时长',dictCode:''})
fieldList.push({type:'int',value:'status',text:'规则状态',dictCode:''})
fieldList.push({type:'int',value:'verisonStatus',text:'版本状态',dictCode:''})
fieldList.push({type:'string',value:'verison',text:'版本号',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,227 @@
<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="对应模块id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleId">-->
<!-- <a-input v-model="model.moduleId" placeholder="请输入对应模块id" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="对应功能id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="functionId">-->
<!-- <a-input v-model="model.functionId" placeholder="请输入对应功能id" ></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="规则序号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ruleNo">
<a-input v-model="model.ruleNo" placeholder="请输入规则序号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="规则编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ruleCode">
<a-input v-model="model.ruleCode" placeholder="请输入规则编码" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="规则描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pmDescribe">
<a-input v-model="model.pmDescribe" placeholder="请输入规则描述" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="分析图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diagrams">
<j-image-upload isMultiple v-model="model.diagrams" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="对应实体id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableId">
<j-dict-select-tag type="list" v-model="model.tableId" dictCode="" placeholder="请选择对应实体id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="对应字段" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fieldId">
<j-dict-select-tag type="list" v-model="model.fieldId" dictCode="" placeholder="请选择对应字段" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="managerUsers">
<a-input v-model="model.managerUsers" placeholder="请输入责任人" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="任务等级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workLevel">
<j-dict-select-tag type="list" v-model="model.workLevel" dictCode="" placeholder="请选择任务等级" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="任务状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workStatus">
<j-dict-select-tag type="list" v-model="model.workStatus" dictCode="" placeholder="请选择任务状态" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startTime">
<j-date placeholder="请选择开始时间" v-model="model.startTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="任务时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration">
<a-input-number v-model="model.duration" placeholder="请输入任务时长" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="提交时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitTime">
<j-date placeholder="请选择提交时间" v-model="model.submitTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="实际时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realDuration">
<a-input-number v-model="model.realDuration" placeholder="请输入实际时长" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="规则状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<a-input-number v-model="model.status" placeholder="请输入规则状态" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="版本状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verisonStatus">
<a-input-number v-model="model.verisonStatus" placeholder="请输入版本状态" 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 v-model="model.verison" placeholder="请输入版本号" ></a-input>
</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: 'RulexForm',
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: {
moduleId: [
{ required: true, message: '请输入对应模块id!'},
],
functionId: [
{ required: true, message: '请输入对应功能id!'},
],
ruleNo: [
{ required: true, message: '请输入规则序号!'},
],
ruleCode: [
{ required: true, message: '请输入规则编码!'},
],
tableId: [
{ required: true, message: '请输入对应实体id!'},
],
fieldId: [
{ required: true, message: '请输入对应字段!'},
],
workLevel: [
{ required: true, message: '请输入任务等级!'},
],
workStatus: [
{ required: true, message: '请输入任务状态!'},
],
realDuration: [
{ required: true, message: '请输入实际时长!'},
],
status: [
{ required: true, message: '请输入规则状态!'},
],
verisonStatus: [
{ required: true, message: '请输入版本状态!'},
],
verison: [
{ required: true, message: '请输入版本号!'},
],
},
url: {
add: "/rulex/rulex/add",
edit: "/rulex/rulex/edit",
queryById: "/rulex/rulex/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.model.moduleId=this.$route.query.moduleid
this.model.functionId=this.$route.query.functionid
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="关闭">
<rulex-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rulex-form>
</j-modal>
</template>
<script>
import RulexForm from './RulexForm'
export default {
name: 'RulexModal',
components: {
RulexForm
},
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">
<rulex-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></rulex-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 RulexForm from './RulexForm'
export default {
name: 'RulexModal',
components: {
RulexForm
},
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>

@ -0,0 +1,237 @@
package org.jeecg.modules.demo.functionx.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.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.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.functionx.service.IFunctionxService;
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-04-10
* @Version: V1.0
*/
@Api(tags="功能管理")
@RestController
@RequestMapping("/functionx/functionx")
@Slf4j
public class FunctionxController extends JeecgController<Functionx, IFunctionxService> {
@Autowired
private IFunctionxService functionxService;
/**
* 分页列表查询
*
* @param functionx
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "功能管理-分页列表查询")
@ApiOperation(value="功能管理-分页列表查询", notes="功能管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(Functionx functionx,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//QueryWrapper<Functionx> queryWrapper = QueryGenerator.initQueryWrapper(functionx, req.getParameterMap());
//判断一下登陆人,如果是项目负责人,就可以看到所有,如果是参与干活的人,只能看到自己参与的
QueryWrapper<Functionx> queryWrapper=new QueryWrapper<>();
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> role = functionxService.findRole(user.getId());
if(role.contains("1645284981182980098")||role.contains("f6817f48af4fb3af11b9e8bf182f618b")){
}else{
//因为开发者是以id,id,id的方式存储,理论上可以用模糊查询到
queryWrapper.like("manager_users",user.getId());
}
queryWrapper.eq("module_id",functionx.getModuleId());
queryWrapper.orderByDesc("work_level");
if(functionx.getFunctionName()!=null){
queryWrapper.like("function_name",functionx.getFunctionName());
}
if(functionx.getFunctionEnName()!=null){
queryWrapper.like("function_en_name",functionx.getFunctionEnName());
}
if(functionx.getWorkStatus()!=null){
queryWrapper.eq("work_status",functionx.getWorkStatus());
}
if(functionx.getFunctionType()!=null){
queryWrapper.eq("function_type",functionx.getFunctionType());
}
Page<Functionx> page = new Page<Functionx>(pageNo, pageSize);
IPage<Functionx> pageList = functionxService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param functionx
* @return
*/
@AutoLog(value = "功能管理-添加")
@ApiOperation(value="功能管理-添加", notes="功能管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody Functionx functionx) {
functionxService.save(functionx);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param functionx
* @return
*/
@AutoLog(value = "功能管理-编辑")
@ApiOperation(value="功能管理-编辑", notes="功能管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody Functionx functionx) {
functionxService.updateById(functionx);
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) {
functionxService.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.functionxService.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) {
Functionx functionx = functionxService.getById(id);
if(functionx==null) {
return Result.error("未找到对应数据");
}
return Result.OK(functionx);
}
/**
* 导出excel
*
* @param request
* @param functionx
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, Functionx functionx) {
return super.exportXls(request, functionx, Functionx.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, Functionx.class);
}
//获得模块管理的编码,填充给功能编码
@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("编码");
}
//在主界面判断一下登录角色,对操作栏进行替换
@GetMapping(value = "/loginrole")
public Result<?> loginrole(@RequestParam(name="id",required=true) String id) {
List<String> list=functionxService.findRole(id);
if(list.contains("1645284981182980098")||list.contains("f6817f48af4fb3af11b9e8bf182f618b"))//是项目负责人,管理员也可以
return Result.OK("1");
else
return Result.OK("2");
}
@GetMapping(value = "/fabu")
public Result<?> fabu(@RequestParam(name="id",required=true) String id) {
return functionxService.fabu(id);
}
@GetMapping(value = "/kaishi")
public Result<?> kaishi(@RequestParam(name="id",required=true) String id) {
return functionxService.kaishi(id);
}
@GetMapping(value = "/tijiao")
public Result<?> tijiao(@RequestParam(name="id",required=true) String id) {
return functionxService.tijiao(id);
}
@GetMapping(value = "/cehui")
public Result<?> cehui(@RequestParam(name="id",required=true) String id) {
return functionxService.cehui(id);
}
@GetMapping(value = "/shenhe")
public Result<?> shenhe(@RequestParam(name="id",required=true) String id) {
return functionxService.shenhe(id);
}
}

@ -0,0 +1,147 @@
package org.jeecg.modules.demo.functionx.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-04-10
* @Version: V1.0
*/
@Data
@TableName("functionx")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="functionx对象", description="功能管理")
public class Functionx 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;
/**对应模块id*/
@Excel(name = "对应模块id", width = 15)
@ApiModelProperty(value = "对应模块id")
// @Dict(dictTable = "modulex",dicCode = "id",dicText = "module_name")
private java.lang.String moduleId;
/**中文名称*/
@Excel(name = "中文名称", width = 15)
@ApiModelProperty(value = "中文名称")
private java.lang.String functionName;
/**英文名称*/
@Excel(name = "英文名称", width = 15)
@ApiModelProperty(value = "英文名称")
private java.lang.String functionEnName;
/**功能编码*/
@Excel(name = "功能编码", width = 15)
@ApiModelProperty(value = "功能编码")
private java.lang.String functionCode;
/**功能
* 列表0增加1删除2修改3查看4导入5导出6其它99默认99
* 类型*/
@Excel(name = "功能类型", width = 15)
@ApiModelProperty(value = "功能类型")
@Dict(dicCode = "function_type")
private java.lang.Integer functionType;
/**功能描述*/
@Excel(name = "功能描述", width = 15)
@ApiModelProperty(value = "功能描述")
private java.lang.String pmDescribe;
/**分析图*/
@Excel(name = "分析图", width = 15)
@ApiModelProperty(value = "分析图")
private java.lang.String diagrams;
/**用户角色*/
@Excel(name = "用户角色", width = 15)
@ApiModelProperty(value = "用户角色")
private java.lang.String userRole;
/**责任人*/
@Excel(name = "责任人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "责任人")
private java.lang.String managerUsers;
/**任务等级*/
@Excel(name = "任务等级", width = 15)
@ApiModelProperty(value = "任务等级")
@Dict(dicCode = "work_level")
private java.lang.Integer workLevel;
/**任务状
* 未发布0已发布1开发中2已完成3已审核4DEBUG9默认0
* */
@Excel(name = "任务状态", width = 15)
@ApiModelProperty(value = "任务状态")
@Dict(dicCode = "work_status")
private java.lang.Integer workStatus;
/**发布时间*/
@Excel(name = "发布时间", width = 15, format = "yyyy-MM-dd")
@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 publishTime;
/**开始时间*/
@Excel(name = "开始时间", width = 15, format = "yyyy-MM-dd")
@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 startTime;
/**任务时长*/
@Excel(name = "任务时长", width = 15)
@ApiModelProperty(value = "任务时长")
private java.lang.Double duration;
/**提交时间*/
@Excel(name = "提交时间", width = 15, format = "yyyy-MM-dd")
@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 submitTime;
/**实际时长*/
@Excel(name = "实际时长", width = 15)
@ApiModelProperty(value = "实际时长")
private java.lang.Double realDuration;
/**功能状态*/
@Excel(name = "功能状态", width = 15)
@ApiModelProperty(value = "功能状态")
@Dict(dicCode = "status")
private java.lang.Integer status;
/**版本状态*/
@Excel(name = "版本状态", width = 15)
@ApiModelProperty(value = "版本状态")
@Dict(dicCode = "verison_status")
private java.lang.Integer verisonStatus;
/**版本号*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private java.lang.Integer verison;
}

@ -0,0 +1,42 @@
package org.jeecg.modules.demo.functionx.mapper;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* @Description: 功能管理
* @Author: jeecg-boot
* @Date: 2023-04-10
* @Version: V1.0
*/
@Repository
public interface FunctionxMapper extends BaseMapper<Functionx> {
@Select("select module_code from modulex where id=#{id}")
String findModuleCode(String id);
@Select("select role_id from sys_user_role where user_id=#{id}")
List<String> findRole(String id);
@Update("update rulex set work_status=1 where function_id=#{id} and work_status=0")
void updateruleByFunctionId(String id);
@Update("update rulex set work_status=2,submit_time=#{date},real_duration=#{v} where function_id=#{id} and work_status=2")
void updateruleByFunctionIdStartTime(@Param("id") String id, @Param("date") Date date,@Param("v") Double v);
@Update("update rulex set work_status=2,start_time=#{date} where function_id=#{id} and work_status=1")
void updateruleByFunctionIdStart(@Param("id")String id,@Param("date") Date date);
//撤回
@Update("update rulex set work_status=2,submit_time=null,real_duration=null where function_id=#{id} ")
void rule(String id);
//审核
@Update("update rulex set work_status=4 where function_id=#{id} and work_status=3")
void uprule(String id);
@Update("update functionx set work_status=2,submit_time=null,real_duration=null where id=#{id} ")
void cehui(String id);
}

@ -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.functionx.mapper.FunctionxMapper">
</mapper>

@ -0,0 +1,30 @@
package org.jeecg.modules.demo.functionx.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 功能管理
* @Author: jeecg-boot
* @Date: 2023-04-10
* @Version: V1.0
*/
public interface IFunctionxService extends IService<Functionx> {
String findModuleCode(String id);
List<String> findRole(String id);
Result<?> fabu(String id);
Result<?> kaishi(String id);
Result<?> tijiao(String id);
Result<?> cehui(String id);
Result<?> shenhe(String id);
}

@ -0,0 +1,136 @@
package org.jeecg.modules.demo.functionx.service.impl;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper;
import org.jeecg.modules.demo.functionx.service.IFunctionxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Description: 功能管理
* @Author: jeecg-boot
* @Date: 2023-04-10
* @Version: V1.0
*/
@Service
public class FunctionxServiceImpl extends ServiceImpl<FunctionxMapper, Functionx> implements IFunctionxService {
@Autowired
FunctionxMapper functionxMapper;
@Override
public String findModuleCode(String id) {
return functionxMapper.findModuleCode(id);
}
@Override
public List<String> findRole(String id) {
return functionxMapper.findRole(id);
}
@Override
public Result<?> fabu(String id) {
Functionx functionx = functionxMapper.selectById(id);
//先判断一下当前是什么状态,如果不是处于未发布状态就不让发布
//先改变功能的状态,变为已发布
//然后改变对应规则的所有状态
if(functionx.getWorkStatus()==0){
functionx.setWorkStatus(1);
functionx.setPublishTime(new Date());
functionxMapper.updateById(functionx);
functionxMapper.updateruleByFunctionId(id);
return Result.OK("发布成功!!");
}else{
return Result.error("当前功能已发布!!!");
}
}
@Override
public Result<?> kaishi(String id) {
Functionx functionx = functionxMapper.selectById(id);
//只用判断前一级的状态
//然后改变对应规则的所有状态
if(functionx.getWorkStatus()==0)
return Result.error("请先进行发布!!!");
else if(functionx.getWorkStatus()==1){
functionx.setWorkStatus(2);
functionx.setStartTime(new Date());
functionxMapper.updateById(functionx);
functionxMapper.updateruleByFunctionIdStart(id,new Date());
return Result.OK("开始工作!!");
}else if(functionx.getWorkStatus()==2){
return Result.error("已经开始!!!");
}else {
return Result.error("当前不处于开始阶段!!!");
}
}
@Override
public Result<?> tijiao(String id) {
Functionx functionx = functionxMapper.selectById(id);
//只用判断前一级的状态
//然后改变对应规则的所有状态
if(functionx.getWorkStatus()==1)
return Result.error("请先开始工作!!!");
else if(functionx.getWorkStatus()==2){
functionx.setWorkStatus(3);
functionx.setSubmitTime(new Date());
//获得实际工作时间
//更新规则的提交时间还有时长
long a=(new Date().getTime()-functionx.getStartTime().getTime());
String s=""+a;
BigDecimal bigDecimal=new BigDecimal(s);
BigDecimal divide = bigDecimal.divide(new BigDecimal("3600000"),1,BigDecimal.ROUND_HALF_UP);
double v = Double.parseDouble(divide.toString());
functionx.setRealDuration(v);
functionxMapper.updateById(functionx);
functionxMapper.updateruleByFunctionIdStartTime(id,new Date(),v);
return Result.OK("提交成功!!");
}else if(functionx.getWorkStatus()==3){
return Result.error("已提交!!!");
}else{
return Result.error("当前不属于提交阶段!!!");
}
}
@Override
public Result<?> cehui(String id) {
Functionx functionx = functionxMapper.selectById(id);
if(functionx.getWorkStatus()==2){
return Result.error("正处于开发中!!");
}
// functionxMapper.updateById(functionx);
functionxMapper.cehui(id);
//工作状态全部开发者,提交时间null,真实工作时间null
functionxMapper.rule(id);
return Result.OK("撤回成功!!!");
}
@Override
public Result<?> shenhe(String id) {
Functionx functionx = functionxMapper.selectById(id);
if(functionx.getWorkStatus()==3){
functionx.setWorkStatus(4);
functionxMapper.updateById(functionx);
functionxMapper.uprule(id);
return Result.OK("审核通过!!1");
}
if(functionx.getWorkStatus()==4){
return Result.error("已审核!!!");
}
if(functionx.getWorkStatus()<3){
return Result.error("请先完成之前的步骤");
}
if(functionx.getWorkStatus()==9){
return Result.error("出现BUG,请先解决");
}
return null;
}
}

@ -0,0 +1,171 @@
package org.jeecg.modules.demo.rulex.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.rulex.entity.Rulex;
import org.jeecg.modules.demo.rulex.service.IRulexService;
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-04-10
* @Version: V1.0
*/
@Api(tags="规则管理")
@RestController
@RequestMapping("/rulex/rulex")
@Slf4j
public class RulexController extends JeecgController<Rulex, IRulexService> {
@Autowired
private IRulexService rulexService;
/**
* 分页列表查询
*
* @param rulex
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "规则管理-分页列表查询")
@ApiOperation(value="规则管理-分页列表查询", notes="规则管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(Rulex rulex,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<Rulex> queryWrapper = QueryGenerator.initQueryWrapper(rulex, req.getParameterMap());
Page<Rulex> page = new Page<Rulex>(pageNo, pageSize);
IPage<Rulex> pageList = rulexService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param rulex
* @return
*/
@AutoLog(value = "规则管理-添加")
@ApiOperation(value="规则管理-添加", notes="规则管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody Rulex rulex) {
rulexService.save(rulex);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param rulex
* @return
*/
@AutoLog(value = "规则管理-编辑")
@ApiOperation(value="规则管理-编辑", notes="规则管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody Rulex rulex) {
rulexService.updateById(rulex);
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) {
rulexService.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.rulexService.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) {
Rulex rulex = rulexService.getById(id);
if(rulex==null) {
return Result.error("未找到对应数据");
}
return Result.OK(rulex);
}
/**
* 导出excel
*
* @param request
* @param rulex
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, Rulex rulex) {
return super.exportXls(request, rulex, Rulex.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, Rulex.class);
}
}

@ -0,0 +1,130 @@
package org.jeecg.modules.demo.rulex.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-04-10
* @Version: V1.0
*/
@Data
@TableName("rulex")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="rulex对象", description="规则管理")
public class Rulex 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;
/**对应模块id*/
@Excel(name = "对应模块id", width = 15)
@ApiModelProperty(value = "对应模块id")
private java.lang.String moduleId;
/**对应功能id*/
@Excel(name = "对应功能id", width = 15)
@ApiModelProperty(value = "对应功能id")
private java.lang.String functionId;
/**规则序号*/
@Excel(name = "规则序号", width = 15)
@ApiModelProperty(value = "规则序号")
private java.lang.String ruleNo;
/**规则编码*/
@Excel(name = "规则编码", width = 15)
@ApiModelProperty(value = "规则编码")
private java.lang.String ruleCode;
/**规则描述*/
@Excel(name = "规则描述", width = 15)
@ApiModelProperty(value = "规则描述")
private java.lang.String pmDescribe;
/**分析图*/
@Excel(name = "分析图", width = 15)
@ApiModelProperty(value = "分析图")
private java.lang.String diagrams;
/**对应实体id*/
@Excel(name = "对应实体id", width = 15)
@ApiModelProperty(value = "对应实体id")
private java.lang.String tableId;
/**对应字段*/
@Excel(name = "对应字段", width = 15)
@ApiModelProperty(value = "对应字段")
private java.lang.String fieldId;
/**责任人*/
@Excel(name = "责任人", width = 15)
@ApiModelProperty(value = "责任人")
private java.lang.String managerUsers;
/**任务等级*/
@Excel(name = "任务等级", width = 15)
@ApiModelProperty(value = "任务等级")
private java.lang.Integer workLevel;
/**任务状态*/
@Excel(name = "任务状态", width = 15)
@ApiModelProperty(value = "任务状态")
private java.lang.Integer workStatus;
/**开始时间*/
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@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 startTime;
/**任务时长*/
@Excel(name = "任务时长", width = 15)
@ApiModelProperty(value = "任务时长")
private java.lang.Double duration;
/**提交时间*/
@Excel(name = "提交时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@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 submitTime;
/**实际时长*/
@Excel(name = "实际时长", width = 15)
@ApiModelProperty(value = "实际时长")
private java.lang.Double realDuration;
/**规则状态*/
@Excel(name = "规则状态", width = 15)
@ApiModelProperty(value = "规则状态")
private java.lang.Integer status;
/**版本状态*/
@Excel(name = "版本状态", width = 15)
@ApiModelProperty(value = "版本状态")
private java.lang.Integer verisonStatus;
/**版本号*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private java.lang.String verison;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.rulex.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 规则管理
* @Author: jeecg-boot
* @Date: 2023-04-10
* @Version: V1.0
*/
public interface RulexMapper extends BaseMapper<Rulex> {
}

@ -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.rulex.mapper.RulexMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.rulex.service;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 规则管理
* @Author: jeecg-boot
* @Date: 2023-04-10
* @Version: V1.0
*/
public interface IRulexService extends IService<Rulex> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.rulex.service.impl;
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.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 规则管理
* @Author: jeecg-boot
* @Date: 2023-04-10
* @Version: V1.0
*/
@Service
public class RulexServiceImpl extends ServiceImpl<RulexMapper, Rulex> implements IRulexService {
}

@ -34,7 +34,7 @@ public class DuplicateCheckController {
/**
* 校验数据是否在系统中是否存在
*
*
* @return
*/
@RequestMapping(value = "/check", method = RequestMethod.GET)
@ -47,14 +47,25 @@ public class DuplicateCheckController {
//SQL注入校验(只限制非法串改数据库)
final String[] sqlInjCheck = {duplicateCheckVo.getTableName(),duplicateCheckVo.getFieldName()};
SqlInjectionUtil.filterContent(sqlInjCheck);
if (StringUtils.isNotBlank(duplicateCheckVo.getDataId())) {
// [2].编辑页面校验
num = sysDictMapper.duplicateCheckCountSql(duplicateCheckVo);
} else {
// [1].添加页面校验
num = sysDictMapper.duplicateCheckCountSqlNoDataId(duplicateCheckVo);
if(duplicateCheckVo.getModuleid()!=null){
if (StringUtils.isNotBlank(duplicateCheckVo.getDataId())) {
// [2].编辑页面校验
num = sysDictMapper.duplicateCheckCountSql1(duplicateCheckVo);
} else {
// [1].添加页面校验
num = sysDictMapper.duplicateCheckCountSqlNoDataId1(duplicateCheckVo);
}
}else{
if (StringUtils.isNotBlank(duplicateCheckVo.getDataId())) {
// [2].编辑页面校验
num = sysDictMapper.duplicateCheckCountSql(duplicateCheckVo);
} else {
// [1].添加页面校验
num = sysDictMapper.duplicateCheckCountSqlNoDataId(duplicateCheckVo);
}
}
if (num == null || num == 0) {
// 该值可用
return Result.ok("该值可用!");

@ -25,14 +25,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @since 2018-12-28
*/
public interface SysDictMapper extends BaseMapper<SysDict> {
/**
* 重复检查SQL
* @return
*/
public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
public List<DictModel> queryDictItemsByCode(@Param("code") String code);
@Deprecated
@ -58,13 +58,13 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @return
*/
public List<DictModel> queryAllDepartBackDictModel();
/**
* 查询所有用户 作为字典信息 username -->value,realname -->text
* @return
*/
public List<DictModel> queryAllUserBackDictModel();
/**
* 通过关键字查询出字典表
* @param table
@ -153,4 +153,13 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @return
*/
List<DictModel> queryAllTableDictItems(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
/*
* 针对模块中的功能点
* */
Long duplicateCheckCountSql1(DuplicateCheckVo duplicateCheckVo);
Long duplicateCheckCountSqlNoDataId1(DuplicateCheckVo duplicateCheckVo);
}

@ -8,10 +8,10 @@
where dict_id = (select id from sys_dict where dict_code = #{code})
order by s.sort_order asc
</select>
<!-- 通过字典code获取字典数据 -->
<select id="queryDictTextByKey" parameterType="String" resultType="String">
select s.item_text from sys_dict_item s
select s.item_text from sys_dict_item s
where s.dict_id = (select id from sys_dict where dict_code = #{code})
and s.item_value = #{key}
</select>
@ -21,7 +21,7 @@
<select id="queryTableDictItemsByCode" parameterType="String" resultType="org.jeecg.common.system.vo.DictModel">
select ${text} as "text",${code} as "value" from ${table}
</select>
<!--通过查询指定table的 text code 获取字典(指定查询条件)-->
<select id="queryTableDictItemsByCodeAndFilter" parameterType="String" resultType="org.jeecg.common.system.vo.DictModel">
select ${text} as "text",${code} as "value" from ${table}
@ -29,7 +29,7 @@
where ${filterSql}
</if>
</select>
<!--通过查询指定table的 text code key 获取字典值-->
<select id="queryTableDictTextByKey" parameterType="String" resultType="String">
select ${text} as "text" from ${table} where ${code}= #{key}
@ -47,27 +47,36 @@
<select id="duplicateCheckCountSql" resultType="Long" parameterType="org.jeecg.modules.system.model.DuplicateCheckVo">
SELECT COUNT(*) FROM ${tableName} WHERE ${fieldName} = #{fieldVal} and id &lt;&gt; #{dataId}
</select>
<!-- 重复校验 sql语句 -->
<select id="duplicateCheckCountSqlNoDataId" resultType="Long" parameterType="org.jeecg.modules.system.model.DuplicateCheckVo">
SELECT COUNT(*) FROM ${tableName} WHERE ${fieldName} = #{fieldVal}
</select>
<!-- 重复校验 sql语句 -->
<select id="duplicateCheckCountSql1" resultType="Long" parameterType="org.jeecg.modules.system.model.DuplicateCheckVo">
SELECT COUNT(*) FROM ${tableName} WHERE ${fieldName} = #{fieldVal} and id &lt;&gt; #{dataId} and module_id=#{moduleid}
</select>
<!-- 重复校验 sql语句 -->
<select id="duplicateCheckCountSqlNoDataId1" resultType="Long" parameterType="org.jeecg.modules.system.model.DuplicateCheckVo">
SELECT COUNT(*) FROM ${tableName} WHERE ${fieldName} = #{fieldVal} and module_id=#{moduleid}
</select>
<!-- 查询部门信息 作为字典数据 -->
<select id="queryAllDepartBackDictModel" resultType="org.jeecg.common.system.vo.DictModel">
select id as "value",depart_name as "text" from sys_depart where del_flag = '0'
</select>
<!-- 查询用户信息 作为字典数据 -->
<select id="queryAllUserBackDictModel" resultType="org.jeecg.common.system.vo.DictModel">
select username as "value",realname as "text" from sys_user where del_flag = '0'
</select>
<!--通过查询指定table的 text code 获取字典数据,且支持关键字查询 -->
<select id="queryTableDictItems" parameterType="String" resultType="org.jeecg.common.system.vo.DictModel">
select ${text} as "text",${code} as "value" from ${table} where ${text} like #{keyword}
</select>
<!-- 根据表名、显示字段名、存储字段名、父ID查询树 -->
<select id="queryTreeList" parameterType="Object" resultType="org.jeecg.modules.system.model.TreeSelectModel">
select ${text} as "title",

@ -1,6 +1,8 @@
package org.jeecg.modules.system.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -22,23 +24,27 @@ public class DuplicateCheckVo implements Serializable {
*/
@ApiModelProperty(value="表名",name="tableName",example="sys_log")
private String tableName;
/**
* 字段名
*/
@ApiModelProperty(value="字段名",name="fieldName",example="id")
private String fieldName;
/**
* 字段值
*/
@ApiModelProperty(value="字段值",name="fieldVal",example="1000")
private String fieldVal;
/**
* 数据ID
*/
@ApiModelProperty(value="数据ID",name="dataId",example="2000")
private String dataId;
}
@ApiModelProperty(value="数据ID",name="dataId",example="2000")
@TableField(exist = false)
private String moduleid;
}

Loading…
Cancel
Save