master
YTD 2 years ago
parent 89c57a1280
commit 7d9a362b95
  1. 9
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  2. 183
      ant-design-vue-jeecg/src/views/rulex/RulexList.vue
  3. 102
      ant-design-vue-jeecg/src/views/rulex/modules/RulexForm.vue
  4. 34
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java
  5. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/mapper/RulexMapper.java
  6. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/IRulexService.java
  7. 20
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/service/impl/RulexServiceImpl.java

@ -283,6 +283,15 @@ export const JeecgListMixin = {
this.$refs.modalForm.title = "复制";
this.$refs.modalForm.disableSubmit = false;
},
fuzhi1: function(record){
record.id=''
record.rule_no=''
record.rule_code=''
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "复制";
this.$refs.modalForm.disableSubmit = false;
},
handleAdd: function () {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";

@ -4,6 +4,28 @@
<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.ruleCode"></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.tableId" :dictCode=table placeholder="请选择对应实体" @change="ziduan"/>
</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.fieldId" :dictCode=field 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>
@ -17,13 +39,14 @@
<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>
<!-- <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 -->
@ -67,23 +90,24 @@
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<span slot="action" slot-scope="text, record"v-if="role==2">
<a @click="handleDetail(record)">详情</a>
</span>
<span slot="action" slot-scope="text, record"v-if="role==1">
<a @click="fuzhi1(record)">复制</a>
<a-divider type="vertical" />
<a @click="fankui(record)">DEBUG</a>
<a-divider type="vertical" />
<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-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
@ -99,7 +123,9 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RulexModal from './modules/RulexModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
import store from '@/store'
export default {
name: 'RulexList',
mixins:[JeecgListMixin, mixinDevice],
@ -122,14 +148,14 @@
}
},
{
title:'对应模块id',
title:'对应模块',
align:"center",
dataIndex: 'moduleId'
dataIndex: 'moduleId_dictText'
},
{
title:'对应功能id',
title:'对应功能',
align:"center",
dataIndex: 'functionId'
dataIndex: 'functionId_dictText'
},
{
title:'规则序号',
@ -153,7 +179,7 @@
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'对应实体id',
title:'对应实体',
align:"center",
dataIndex: 'tableId_dictText'
},
@ -162,11 +188,6 @@
align:"center",
dataIndex: 'fieldId_dictText'
},
{
title:'责任人',
align:"center",
dataIndex: 'managerUsers'
},
{
title:'任务等级',
align:"center",
@ -197,21 +218,6 @@
align:"center",
dataIndex: 'realDuration'
},
{
title:'规则状态',
align:"center",
dataIndex: 'status'
},
{
title:'版本状态',
align:"center",
dataIndex: 'verisonStatus'
},
{
title:'版本号',
align:"center",
dataIndex: 'verison'
},
{
title: '操作',
dataIndex: 'action',
@ -227,13 +233,25 @@
deleteBatch: "/rulex/rulex/deleteBatch",
exportXlsUrl: "/rulex/rulex/exportXls",
importExcelUrl: "rulex/rulex/importExcel",
loginrole:'functionx/functionx/loginrole',
},
dictOptions:{},
superFieldList:[],
loadRouteType:false,
queryParam:{},
moduleid:'',
role:'',
table:'',
field:'fieldx,field_name,id',
}
},
created() {
let usercode = store.getters.userInfo.id
this.loginrole(usercode)
this.moduleid=this.$route.query.moduleid
this.table="tablex,table_name,id,module_id="+this.$route.query.moduleid
this.getSuperFieldList();
},
computed: {
@ -242,6 +260,27 @@
},
},
methods: {
ziduan(){
this.field="fieldx,field_name,id,table_id="+this.model.tableId;
},
loginrole(id){
getAction(this.url.loginrole,{id:id}).then((res)=>{
if (res.success) {
//
this.role=res.result;
}
})
},
fanhui(){
this.$router.push({
/*返回产品*/
path: '/src/views/functionx/FunctionxList',/*在引号中填写返回vue*/
query:{
moduleid:this.moduleid
}
});
},
initDictConfig(){
},
getSuperFieldList(){
@ -265,7 +304,63 @@
fieldList.push({type:'int',value:'verisonStatus',text:'版本状态',dictCode:''})
fieldList.push({type:'string',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.functionId = this.$route.query.functionid;
return filterObj(param);
},
searchReset() {
this.queryParam=''
this.loadData();
},
}
}
</script>

@ -15,7 +15,7 @@
<!-- </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-input v-model="model.ruleNo" placeholder="请输入规则序号" disabled></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -23,74 +23,50 @@
<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 label="对应实体" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableId">
<j-dict-select-tag type="list" v-model="model.tableId" :dictCode=table placeholder="请选择对应实体" @change="ziduan"/>
</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>
<j-dict-select-tag type="list" v-model="model.fieldId" :dictCode=field 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%" />
<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="" placeholder="请选择任务状态" />-->
<!-- </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 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="verison">
<a-input v-model="model.verison" placeholder="请输入版本号" ></a-input>
<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>
@ -119,6 +95,8 @@
data () {
return {
model:{
ruleNo:'',
ruleCode:''
},
labelCol: {
xs: { span: 24 },
@ -145,9 +123,9 @@
tableId: [
{ required: true, message: '请输入对应实体id!'},
],
fieldId: [
{ required: true, message: '请输入对应字段!'},
],
// fieldId: [
// { required: true, message: '!'},
// ],
workLevel: [
{ required: true, message: '请输入任务等级!'},
],
@ -170,8 +148,11 @@
url: {
add: "/rulex/rulex/add",
edit: "/rulex/rulex/edit",
queryById: "/rulex/rulex/queryById"
}
queryById: "/rulex/rulex/queryById",
sort:'/rulex/rulex/sort'
},
table:'',
field:'fieldx,field_name,id',
}
},
computed: {
@ -182,10 +163,23 @@
created () {
//model
this.model.moduleId=this.$route.query.moduleid
this.table="tablex,table_name,id,module_id="+this.model.moduleId
this.model.functionId=this.$route.query.functionid
this.sort()
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
sort(){
getAction(this.url.sort,{id:this.model.functionId}).then((res)=>{
console.log(res)
this.model.ruleNo=res.result.substring(0,3);
this.model.ruleCode=res.result.substring(3)+this.model.ruleNo;
console.log(this.model.ruleNo)
})
},
ziduan(){
this.field="fieldx,field_name,id,table_id="+this.model.tableId;
},
add () {
this.edit(this.modelDefault);
},

@ -12,6 +12,8 @@ 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.functionx.entity.Functionx;
import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import org.jeecg.modules.demo.rulex.service.IRulexService;
@ -49,8 +51,11 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class RulexController extends JeecgController<Rulex, IRulexService> {
@Autowired
private IRulexService rulexService;
@Autowired
FunctionxMapper functionxMapper;
/**
/**
* 分页列表查询
*
* @param rulex
@ -66,7 +71,19 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<Rulex> queryWrapper = QueryGenerator.initQueryWrapper(rulex, req.getParameterMap());
// QueryWrapper<Rulex> queryWrapper = QueryGenerator.initQueryWrapper(rulex, req.getParameterMap());
QueryWrapper<Rulex> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("function_id",rulex.getFunctionId());
queryWrapper.orderByDesc("work_level");
if(rulex.getRuleCode()!=null){
queryWrapper.eq("rule_code",rulex.getRuleCode());
}
if(rulex.getTableId()!=null){
queryWrapper.eq("table_id",rulex.getTableId());
}
if(rulex.getFieldId()!=null){
queryWrapper.eq("field_id",rulex.getFieldId());
}
Page<Rulex> page = new Page<Rulex>(pageNo, pageSize);
IPage<Rulex> pageList = rulexService.page(page, queryWrapper);
return Result.OK(pageList);
@ -82,6 +99,12 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
@ApiOperation(value="规则管理-添加", notes="规则管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody Rulex rulex) {
if(rulex.getFunctionId()==null){
return Result.error("功能点错误!!!");
}
Functionx functionx = functionxMapper.selectById(rulex.getFunctionId());
rulex.setManagerUsers(functionx.getManagerUsers());
rulex.setWorkStatus(functionx.getWorkStatus());
rulexService.save(rulex);
return Result.OK("添加成功!");
}
@ -168,4 +191,9 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
return super.importExcel(request, response, Rulex.class);
}
}
@GetMapping(value = "/sort")
public Result<?> sort(@RequestParam(name="id",required=true) String id) {
return rulexService.sort(id);
}
}

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.rulex.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -14,4 +15,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface RulexMapper extends BaseMapper<Rulex> {
@Select("select rule_no from rulex where function_id=#{id} order by rule_no desc limit 0,1")
String sort(String id);
@Select("select function_code from functionx where id=#{id}")
String find(String id);
}

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.rulex.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.rulex.entity.Rulex;
import com.baomidou.mybatisplus.extension.service.IService;
@ -11,4 +12,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IRulexService extends IService<Rulex> {
Result<?> sort(String id);
}

@ -1,8 +1,10 @@
package org.jeecg.modules.demo.rulex.service.impl;
import org.jeecg.common.api.vo.Result;
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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -16,4 +18,22 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class RulexServiceImpl extends ServiceImpl<RulexMapper, Rulex> implements IRulexService {
@Autowired
RulexMapper rulexMapper;
@Override
public Result<?> sort(String id) {
String sort=rulexMapper.sort(id);
String functioncode=rulexMapper.find(id);
if(sort==null){
return Result.OK("001"+functioncode);
}else{
int i = Integer.parseInt(sort);
i++;
String s = Integer.toString(i);
while(s.length()<3){
s="0"+s;
}
return Result.OK(s+functioncode);
}
}
}

Loading…
Cancel
Save