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

master
shiji 1 year ago
commit e1975c46b2
  1. 296
      ant-design-vue-jeecg/src/views/functionx/modules/FunctionxForm1.vue
  2. 60
      ant-design-vue-jeecg/src/views/functionx/modules/FunctionxModal1.vue
  3. 274
      ant-design-vue-jeecg/src/views/modulex/modules/ModulexForm1.vue
  4. 60
      ant-design-vue-jeecg/src/views/modulex/modules/ModulexModal1.vue
  5. 57
      ant-design-vue-jeecg/src/views/requirementitem/RequirementItemList.vue
  6. 245
      ant-design-vue-jeecg/src/views/rulex/modules/RulexForm1.vue
  7. 60
      ant-design-vue-jeecg/src/views/rulex/modules/RulexModal1.vue
  8. 39
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/controller/FunctionxController.java
  9. 171
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementfun/controller/RequirementFunController.java
  10. 69
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementfun/entity/RequirementFun.java
  11. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementfun/mapper/RequirementFunMapper.java
  12. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementfun/mapper/xml/RequirementFunMapper.xml
  13. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementfun/service/IRequirementFunService.java
  14. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementfun/service/impl/RequirementFunServiceImpl.java
  15. 45
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java
  16. 124
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java
  17. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/Modulex.java

@ -0,0 +1,296 @@
<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/zhgn",
edit: "/functionx/functionx/edit",
queryById: "/functionx/functionx/queryById",
bianma:'/functionx/functionx/bianma',
getmoduleid:"/modulex/modulex/getmoduleid"
},
moduleid:'',
modulecode:'',
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//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 (record) {
getAction(this.url.getmoduleid,{requirementid:record.id}).then((res)=>{
if (res.success) {
this.moduleid=res.result;
this.model.moduleId=res.result;
//
this.modulebianma(this.moduleid);
this.modelDefault = JSON.parse(JSON.stringify(this.model));
this.edit(this.modelDefault);
}else{
this.$message.warning(res.message);
}
});
},
edit (record) {
this.model = Object.assign({}, record);
if(this.model.functionName1!=null){
this.model.functionName=this.model.functionName1;
}
if(this.model.functionEnName1!=null){
this.model.functionEnName=this.model.functionEnName1
}
if(this.model.functionCode1!=null){
this.model.functionCode=this.model.functionCode1
}
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-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></functionx-form1>
</j-modal>
</template>
<script>
import FunctionxForm1 from './FunctionxForm1'
export default {
name: 'FunctionxModal1',
components: {
FunctionxForm1
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(record);
})
},
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,274 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="上级模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
<!-- <a-input v-model="model.pid" placeholder="请输入上级模块id" ></a-input>-->
<j-dict-select-tag v-model="model.pid" dict-code="modulex,module_name,id"
placeholder="请输入上级模块" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="项目名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectId">
<!-- <a-input v-model="model.projectId" placeholder="请输入项目id" ></a-input>-->
<j-dict-select-tag v-model="model.projectId" dict-code="projectx,project_name,id"
placeholder="请输入项目id" style="width: 100%" disabled/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleName">
<a-input v-model="model.moduleName" placeholder="请输入中文名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleEnName">
<a-input v-model="model.moduleEnName" placeholder="请输入英文名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="模块编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleCode">
<a-input v-model="model.moduleCode" 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="managerUsers">
<!-- <a-input v-model="model.managerUsers" placeholder="请输入责任人" ></a-input>-->
<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">
<!-- <a-input-number v-model="model.workLevel" placeholder="请输入任务等级" style="width: 100%" />-->
<j-dict-select-tag v-model="model.workLevel" dict-code="work_level"
placeholder="请输入任务等级" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="任务状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workStatus">
<!-- <a-input-number v-model="model.workStatus" placeholder="请输入任务状态" style="width: 100%" />-->
<j-dict-select-tag v-model="model.workStatus" dict-code="work_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="publishTime">
<j-date placeholder="请选择发布时间" date-format="YYYY-MM-DD HH:mm:ss" 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="duration">
<a-input-number :min="0.1" :max="16" :precision="1" 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="startTime">
<j-date placeholder="请选择开始时间" date-format="YYYY-MM-DD HH:mm:ss" 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="submitTime">
<j-date placeholder="请选择提交时间" date-format="YYYY-MM-DD HH:mm:ss" 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-input-number :min="0.1" :max="16" :precision="1" 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="userRole">
<!-- <a-input v-model="model.userRole" placeholder="请输入用户角色" ></a-input>-->
<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="relatedBean">-->
<!-- <j-dict-select-tag v-model="model.relatedBean" dict-code="tablex,table_name,id"-->
<!-- placeholder="请输入关联实体" ></j-dict-select-tag>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="原型图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="prototypes">
<!-- <a-input v-model="model.prototypes" placeholder="请输入原型图" ></a-input>-->
<j-image-upload isMultiple v-model="model.prototypes" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="分析图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diagrams">
<!-- <a-input v-model="model.diagrams" placeholder="请输入分析图" ></a-input>-->
<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="模块状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<!-- <a-input-number v-model="model.status" placeholder="请输入模块状态" style="width: 100%" />-->
<j-dict-select-tag type="radio" v-model="model.status" placeholder="请输入模块状态" dict-code="a_status" />
</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%" />-->
<j-dict-select-tag type="radioButton" v-model="model.verisonStatus" dict-code="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-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@api/manage'
import { validateDuplicateValue } from '@/utils/util'
import moment from "dayjs";
export default {
name: 'ModulexForm1',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
workLevel: 2,
workStatus: 0,
duration: 1,
submitTime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
realDuration: 16,
status: 1,
verisonStatus: 1,
requirementid:"",
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
projectId: [
{ required: true, message: '请输入项目id!'},
],
moduleName: [
{ required: true, message: '请输入中文名称!'},
],
moduleEnName: [
{ required: true, message: '请输入英文名称!'},
],
moduleCode: [
{ required: true, message: '请输入模块编码!'},
],
workLevel: [
{ required: true, message: '请输入任务等级!'},
],
workStatus: [
{ required: true, message: '请输入任务状态!'},
],
duration: [
{ required: true, message: '请输入任务时长!'},
],
realDuration: [
{ required: true, message: '请输入实际时长!'},
],
status: [
{ required: true, message: '请输入模块状态!'},
],
verisonStatus: [
{ required: true, message: '请输入版本状态!'},
],
verison: [
{ required: true, message: '请输入版本号!'},
],
},
url: {
add: "/modulex/modulex/zhmk",
edit: "/modulex/modulex/edit",
queryById: "/modulex/modulex/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
},
methods: {
add (record) {
this.model.projectId = record.projectId;
this.model.requirementid = record.id;
this.modelDefault = JSON.parse(JSON.stringify(this.model));
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
if (this.model.fuzhi){
this.model.id = null;
this.model.moduleName = this.model.moduleName + '+1';
this.model.moduleEnName = this.model.moduleEnName + '+1';
this.model.moduleCode = this.model.moduleCode + '+1';
this.model.createTime = null;
}
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="关闭">
<modulex-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></modulex-form1>
</j-modal>
</template>
<script>
import ModulexForm1 from './ModulexForm1'
export default {
name: 'ModulexModal',
components: {
ModulexForm1
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(record);
})
},
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>

@ -77,6 +77,15 @@
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap" class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<span slot="zh" slot-scope="text, record" v-if="record.xqflag==='1'">
<a @click="zhmk(record)">模块</a>
<a-divider type="vertical"/>
<a @click="zhgn(record)">功能</a>
<a-divider type="vertical"/>
<a @click="zhgz(record)">规则</a>
</span>
<span v-else>无操作权限</span>
<template slot="htmlSlot" slot-scope="text"> <template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div> <div v-html="text"></div>
@ -117,6 +126,9 @@
</div> </div>
<requirement-item-modal ref="modalForm" @ok="modalFormOk"></requirement-item-modal> <requirement-item-modal ref="modalForm" @ok="modalFormOk"></requirement-item-modal>
<modulex-modal1 ref="modulex" @ok="modalFormOk"></modulex-modal1>
<functionx-modal1 ref="functionxm" @ok="modalFormOk"></functionx-modal1>
<rulex-modal1 ref="rulexmd" @ok="modalFormOk"></rulex-modal1>
</a-card> </a-card>
</template> </template>
@ -128,12 +140,15 @@
import RequirementItemModal from './modules/RequirementItemModal' import RequirementItemModal from './modules/RequirementItemModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import ModulexModal1 from "../modulex/modules/ModulexModal1";
import FunctionxModal1 from "../functionx/modules/FunctionxModal1";
import RulexModal1 from "../rulex/modules/RulexModal1";
export default { export default {
name: 'RequirementItemList', name: 'RequirementItemList',
mixins:[JeecgListMixin, mixinDevice], mixins:[JeecgListMixin, mixinDevice],
components: { components: {
RequirementItemModal RequirementItemModal,ModulexModal1,FunctionxModal1,RulexModal1
}, },
data () { data () {
return { return {
@ -211,6 +226,12 @@
align:"center", align:"center",
dataIndex: 'updateBy_dictText' dataIndex: 'updateBy_dictText'
}, },
{
title: '转化',
dataIndex: 'zh',
align: "center",
scopedSlots: {customRender: 'zh'}
},
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
@ -229,6 +250,7 @@
qrxq:"/requirementitem/requirementItem/qrxq", qrxq:"/requirementitem/requirementItem/qrxq",
checkqx:"/requirementtype/requirementType/checkqx", checkqx:"/requirementtype/requirementType/checkqx",
wdxqlist:"/requirementitem/requirementItem/wdxqlist", wdxqlist:"/requirementitem/requirementItem/wdxqlist",
checkzh:"/modulex/modulex/checkzh",
}, },
dictOptions:{}, dictOptions:{},
@ -244,6 +266,39 @@
}, },
}, },
methods: { methods: {
zhmk(record){
getAction(this.url.checkzh,{requirementid:record.id,funlevel:2}).then((res)=>{
if (res.success) {
this.$refs.modulex.add(record);
this.$refs.modulex.title = "新增";
this.$refs.modulex.disableSubmit = false;
}else{
this.$message.warning(res.message);
}
});
},
zhgn(record){
getAction(this.url.checkzh,{requirementid:record.id,funlevel:3}).then((res)=>{
if (res.success) {
this.$refs.functionxm.add(record);
this.$refs.functionxm.title = "新增";
this.$refs.functionxm.disableSubmit = false;
}else{
this.$message.warning(res.message);
}
});
},
zhgz(record){
getAction(this.url.checkzh,{requirementid:record.id,funlevel:4}).then((res)=>{
if (res.success) {
this.$refs.rulexmd.add(record);
this.$refs.rulexmd.title = "新增";
this.$refs.rulexmd.disableSubmit = false;
}else{
this.$message.warning(res.message);
}
});
},
checkqx(record){ checkqx(record){
getAction(this.url.checkqx,{createBy:record.createBy}).then((res)=>{ getAction(this.url.checkqx,{createBy:record.createBy}).then((res)=>{
if (res.success) { if (res.success) {

@ -0,0 +1,245 @@
<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="请输入规则序号" disabled></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="tableId">
<j-dict-select-tag type="list" v-model="model.tableId" :dictCode=table placeholder="请选择对应实体" disabled/>
</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=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="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="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 { validateDuplicateValue } from '@/utils/util'
export default {
name: 'RulexForm1',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
ruleNo:'',
ruleCode:''
},
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/zhgz",
edit: "/rulex/rulex/edit",
queryById: "/rulex/rulex/queryById",
query:'modulex/modulex/queryById',
sort:'/rulex/rulex/sort',
getmoduleid:"/modulex/modulex/getmoduleid",
getfunctionid:"/modulex/modulex/getfunctionid",
},
table:'tablex,table_name,id',
field:'fieldx,field_name,id',
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
// this.table="tablex,table_name,id,module_id="+this.model.moduleId
},
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)
})
},
shiti(){
getAction(this.url.query,{id:this.model.moduleId}).then((res)=>{
this.model.tableId=res.result.relatedBean
this.field="fieldx,field_name,id,table_id="+this.model.tableId;
console.log(this.model.tableId,"-----------")
})
},
ziduan(){
this.field="fieldx,field_name,id,table_id="+this.model.tableId;
},
add (record) {
getAction(this.url.getmoduleid,{requirementid:record.id}).then((res)=>{
if (res.success) {
this.model.moduleId=res.result;
getAction(this.url.getfunctionid,{requirementid:record.id}).then((res1)=>{
if (res1.success) {
this.model.functionId=res1.result;
this.sort();
this.shiti();
this.modelDefault = JSON.parse(JSON.stringify(this.model));
this.edit(this.modelDefault);
}else{
this.$message.warning(res1.message);
}
});
}else{
this.$message.warning(res.message);
}
});
},
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-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rulex-form1>
</j-modal>
</template>
<script>
import RulexForm1 from './RulexForm1'
export default {
name: 'RulexModal1',
components: {
RulexForm1
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(record);
})
},
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>

@ -24,6 +24,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.requirementfun.entity.RequirementFun;
import org.jeecg.modules.demo.requirementfun.service.IRequirementFunService;
import org.jeecg.modules.demo.requirementitem.entity.RequirementItem;
import org.jeecg.modules.demo.requirementitem.service.IRequirementItemService;
import org.jeecg.modules.modulex.entity.Modulex; import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.service.IModulexService; import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -57,6 +61,11 @@ public class FunctionxController extends JeecgController<Functionx, IFunctionxSe
private IFunctionxService functionxService; private IFunctionxService functionxService;
@Autowired @Autowired
private IModulexService modulexService; private IModulexService modulexService;
@Autowired
private IRequirementFunService requirementFunService;
@Autowired
private IRequirementItemService requirementItemService;
/** /**
* 分页列表查询 * 分页列表查询
@ -125,6 +134,36 @@ public class FunctionxController extends JeecgController<Functionx, IFunctionxSe
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/**
* 转化功能
*
* @param functionx
* @return
*/
@AutoLog(value = "转化功能")
@ApiOperation(value="转化功能", notes="转化功能")
@PostMapping(value = "/zhgn")
public Result<?> zhgn(@RequestBody Functionx functionx) {
QueryWrapper<Modulex> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("id",functionx.getModuleId());
Modulex one = modulexService.getOne(queryWrapper);
if(one.getRelatedBean()==null){
return Result.error("请先为对应模块关联实体!!!");
}
//感觉不符合逻辑,上级模块如果是已发布,然后新增也是已发布状态,那样发布按钮还有什么用??
// functionx.setWorkStatus(one.getWorkStatus());
functionxService.save(functionx);
RequirementItem requirementItem = requirementItemService.getById(functionx.getModuleId());
requirementItem.setRequirementStatus(2);
requirementItemService.updateById(requirementItem);
RequirementFun requirementFun1 = new RequirementFun();
requirementFun1.setRequirementId(functionx.getModuleId());
requirementFun1.setFunId(functionx.getId());
requirementFun1.setFunLevel(3);
requirementFunService.save(requirementFun1);
return Result.OK("添加成功!");
}
/** /**
* 编辑 * 编辑
* *

@ -0,0 +1,171 @@
package org.jeecg.modules.demo.requirementfun.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.requirementfun.entity.RequirementFun;
import org.jeecg.modules.demo.requirementfun.service.IRequirementFunService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 需求功能关联管理
* @Author: jeecg-boot
* @Date: 2023-07-04
* @Version: V1.0
*/
@Api(tags="需求功能关联管理")
@RestController
@RequestMapping("/requirementfun/requirementFun")
@Slf4j
public class RequirementFunController extends JeecgController<RequirementFun, IRequirementFunService> {
@Autowired
private IRequirementFunService requirementFunService;
/**
* 分页列表查询
*
* @param requirementFun
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "需求功能关联管理-分页列表查询")
@ApiOperation(value="需求功能关联管理-分页列表查询", notes="需求功能关联管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(RequirementFun requirementFun,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<RequirementFun> queryWrapper = QueryGenerator.initQueryWrapper(requirementFun, req.getParameterMap());
Page<RequirementFun> page = new Page<RequirementFun>(pageNo, pageSize);
IPage<RequirementFun> pageList = requirementFunService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param requirementFun
* @return
*/
@AutoLog(value = "需求功能关联管理-添加")
@ApiOperation(value="需求功能关联管理-添加", notes="需求功能关联管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody RequirementFun requirementFun) {
requirementFunService.save(requirementFun);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param requirementFun
* @return
*/
@AutoLog(value = "需求功能关联管理-编辑")
@ApiOperation(value="需求功能关联管理-编辑", notes="需求功能关联管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody RequirementFun requirementFun) {
requirementFunService.updateById(requirementFun);
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) {
requirementFunService.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.requirementFunService.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) {
RequirementFun requirementFun = requirementFunService.getById(id);
if(requirementFun==null) {
return Result.error("未找到对应数据");
}
return Result.OK(requirementFun);
}
/**
* 导出excel
*
* @param request
* @param requirementFun
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, RequirementFun requirementFun) {
return super.exportXls(request, requirementFun, RequirementFun.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, RequirementFun.class);
}
}

@ -0,0 +1,69 @@
package org.jeecg.modules.demo.requirementfun.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 需求功能关联管理
* @Author: jeecg-boot
* @Date: 2023-07-04
* @Version: V1.0
*/
@Data
@TableName("requirement_fun")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="requirement_fun对象", description="需求功能关联管理")
public class RequirementFun implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**需求id*/
@Excel(name = "需求id", width = 15)
@ApiModelProperty(value = "需求id")
private java.lang.String requirementId;
/**功能层级*/
@Excel(name = "功能层级", width = 15)
@ApiModelProperty(value = "功能层级")
private java.lang.Integer funLevel;
/**功能id*/
@Excel(name = "功能id", width = 15)
@ApiModelProperty(value = "功能id")
private java.lang.String funId;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.requirementfun.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.requirementfun.entity.RequirementFun;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 需求功能关联管理
* @Author: jeecg-boot
* @Date: 2023-07-04
* @Version: V1.0
*/
public interface RequirementFunMapper extends BaseMapper<RequirementFun> {
}

@ -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.requirementfun.mapper.RequirementFunMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.requirementfun.service;
import org.jeecg.modules.demo.requirementfun.entity.RequirementFun;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 需求功能关联管理
* @Author: jeecg-boot
* @Date: 2023-07-04
* @Version: V1.0
*/
public interface IRequirementFunService extends IService<RequirementFun> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.requirementfun.service.impl;
import org.jeecg.modules.demo.requirementfun.entity.RequirementFun;
import org.jeecg.modules.demo.requirementfun.mapper.RequirementFunMapper;
import org.jeecg.modules.demo.requirementfun.service.IRequirementFunService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 需求功能关联管理
* @Author: jeecg-boot
* @Date: 2023-07-04
* @Version: V1.0
*/
@Service
public class RequirementFunServiceImpl extends ServiceImpl<RequirementFunMapper, RequirementFun> implements IRequirementFunService {
}

@ -14,6 +14,10 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.functionx.entity.Functionx; import org.jeecg.modules.demo.functionx.entity.Functionx;
import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper; import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper;
import org.jeecg.modules.demo.requirementfun.entity.RequirementFun;
import org.jeecg.modules.demo.requirementfun.service.IRequirementFunService;
import org.jeecg.modules.demo.requirementitem.entity.RequirementItem;
import org.jeecg.modules.demo.requirementitem.service.IRequirementItemService;
import org.jeecg.modules.demo.rulex.entity.Rulex; import org.jeecg.modules.demo.rulex.entity.Rulex;
import org.jeecg.modules.demo.rulex.service.IRulexService; import org.jeecg.modules.demo.rulex.service.IRulexService;
@ -53,6 +57,10 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
private IRulexService rulexService; private IRulexService rulexService;
@Autowired @Autowired
FunctionxMapper functionxMapper; FunctionxMapper functionxMapper;
@Autowired
private IRequirementFunService requirementFunService;
@Autowired
private IRequirementItemService requirementItemService;
/** /**
@ -118,6 +126,43 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/**
* 转化规则
*
* @param rulex
* @return
*/
@AutoLog(value = "转化规则")
@ApiOperation(value="转化规则", notes="转化规则")
@PostMapping(value = "/zhgz")
public Result<?> zhgz(@RequestBody Rulex rulex) {
if(rulex.getFunctionId()==null){
return Result.error("功能点错误!!!");
}
Functionx functionx = functionxMapper.selectById(rulex.getFunctionId());
if(functionx.getStartTime()!=null){
rulex.setStartTime(functionx.getStartTime());
}
if(functionx.getSubmitTime()!=null){
rulex.setSubmitTime(functionx.getSubmitTime());
}
if(functionx.getRealDuration()!=null){
rulex.setRealDuration(functionx.getRealDuration());
}
rulex.setManagerUsers(functionx.getManagerUsers());
rulex.setWorkStatus(functionx.getWorkStatus());
rulexService.save(rulex);
RequirementItem requirementItem = requirementItemService.getById(rulex.getModuleId());
requirementItem.setRequirementStatus(2);
requirementItemService.updateById(requirementItem);
RequirementFun requirementFun1 = new RequirementFun();
requirementFun1.setRequirementId(rulex.getModuleId());
requirementFun1.setFunId(rulex.getId());
requirementFun1.setFunLevel(4);
requirementFunService.save(requirementFun1);
return Result.OK("添加成功!");
}
/** /**
* 编辑 * 编辑
* *

@ -12,6 +12,10 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.requirementfun.entity.RequirementFun;
import org.jeecg.modules.demo.requirementfun.service.IRequirementFunService;
import org.jeecg.modules.demo.requirementitem.entity.RequirementItem;
import org.jeecg.modules.demo.requirementitem.service.IRequirementItemService;
import org.jeecg.modules.modulex.entity.Modulex; import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.mapper.ModulexMapper; import org.jeecg.modules.modulex.mapper.ModulexMapper;
import org.jeecg.modules.modulex.service.IModulexService; import org.jeecg.modules.modulex.service.IModulexService;
@ -41,6 +45,10 @@ public class ModulexController extends JeecgController<Modulex, IModulexService>
private IModulexService modulexService; private IModulexService modulexService;
@Resource @Resource
private ModulexMapper modulexMapper; private ModulexMapper modulexMapper;
@Autowired
private IRequirementFunService requirementFunService;
@Autowired
private IRequirementItemService requirementItemService;
/** /**
* 分页列表查询 * 分页列表查询
@ -137,6 +145,42 @@ public class ModulexController extends JeecgController<Modulex, IModulexService>
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/**
* 转化模块
* moduleName 中文名称
* 相同上级的模块不能重名
*/
@AutoLog(value = "转化模块")
@ApiOperation(value = "转化模块", notes = "转化模块")
@PostMapping(value = "/zhmk")
public Result<?> zhmk(@RequestBody Modulex modulex) {
//版本号 顺序累加;初始值1
if (StringUtils.hasText(modulex.getPid())) {
List<String> collect = modulexService.list(
new LambdaQueryWrapper<Modulex>()
.eq(StringUtils.hasText(modulex.getPid()), Modulex::getPid, modulex.getPid()))
.stream().map(Modulex::getModuleName).collect(Collectors.toList());
collect.add(modulex.getModuleName());
HashSet<String> setList = new HashSet<>(collect);
if (collect.size() != setList.size()){
return Result.error("相同上级的模块不能重名");
}
}
Integer newVersion = modulexService.getMaxVersion(modulex.getVerison());
modulex.setVerison(newVersion + 1);
modulexService.save(modulex);
RequirementItem requirementItem = requirementItemService.getById(modulex.getRequirementid());
requirementItem.setRequirementStatus(2);
requirementItemService.updateById(requirementItem);
RequirementFun requirementFun1 = new RequirementFun();
requirementFun1.setRequirementId(modulex.getRequirementid());
requirementFun1.setFunId(modulex.getId());
requirementFun1.setFunLevel(2);
requirementFunService.save(requirementFun1);
return Result.OK("成功!");
}
/** /**
* 编辑 * 编辑
* *
@ -219,4 +263,84 @@ public class ModulexController extends JeecgController<Modulex, IModulexService>
return super.importExcel(request, response, Modulex.class); return super.importExcel(request, response, Modulex.class);
} }
/**
* 检查是否转化
*
* @param
* @return
*/
@AutoLog(value = "检查是否转化")
@ApiOperation(value = "检查是否转化", notes = "检查是否转化")
@GetMapping(value = "/checkzh")
public Result<?> checkzh(@RequestParam(name = "requirementid", required = true) String requirementid,@RequestParam(name = "funlevel", required = true) Integer funlevel,HttpServletRequest req) {
RequirementFun requirementFun = new RequirementFun();
QueryWrapper<RequirementFun> queryWrapper = QueryGenerator.initQueryWrapper(requirementFun, req.getParameterMap());
queryWrapper.eq("requirement_id",requirementid);
queryWrapper.eq("fun_level",funlevel);
List<RequirementFun> listrf = requirementFunService.list(queryWrapper);
if(listrf.size()>0){
return Result.error("已转化,不可再次转化");
}else{
if(funlevel!=2){
RequirementFun requirementFunzh = new RequirementFun();
QueryWrapper<RequirementFun> queryWrapperzh = QueryGenerator.initQueryWrapper(requirementFunzh, req.getParameterMap());
queryWrapperzh.eq("requirement_id",requirementid);
queryWrapperzh.eq("fun_level",funlevel-1);
List<RequirementFun> listzh = requirementFunService.list(queryWrapperzh);
if(listzh.size()>0){
return Result.OK("");
}else{
if(funlevel==3){
return Result.error("该需求无转化模块,不能转化功能");
}
if(funlevel==4){
return Result.error("该需求无转化功能,不能转化规则");
}
return Result.OK("");
}
}else{
return Result.OK("");
}
}
}
/**
* 查询模块id
*
* @param
* @return
*/
@AutoLog(value = "查询模块id")
@ApiOperation(value = "查询模块id", notes = "查询模块id")
@GetMapping(value = "/getmoduleid")
public Result<?> getmoduleid(@RequestParam(name = "requirementid", required = true) String requirementid,HttpServletRequest req) {
RequirementFun requirementFun = new RequirementFun();
QueryWrapper<RequirementFun> queryWrapper = QueryGenerator.initQueryWrapper(requirementFun, req.getParameterMap());
queryWrapper.eq("requirement_id",requirementid);
queryWrapper.eq("fun_level",2);
List<RequirementFun> listrf = requirementFunService.list(queryWrapper);
return Result.OK(listrf.get(0).getFunId());
}
/**
* 查询功能id
*
* @param
* @return
*/
@AutoLog(value = "查询功能id")
@ApiOperation(value = "查询功能id", notes = "查询功能id")
@GetMapping(value = "/getfunctionid")
public Result<?> getfunctionid(@RequestParam(name = "requirementid", required = true) String requirementid,HttpServletRequest req) {
RequirementFun requirementFun = new RequirementFun();
QueryWrapper<RequirementFun> queryWrapper = QueryGenerator.initQueryWrapper(requirementFun, req.getParameterMap());
queryWrapper.eq("requirement_id",requirementid);
queryWrapper.eq("fun_level",3);
List<RequirementFun> listrf = requirementFunService.list(queryWrapper);
return Result.OK(listrf.get(0).getFunId());
}
} }

@ -197,4 +197,7 @@ public class Modulex implements Serializable {
@Excel(name = "版本号", width = 15) @Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号") @ApiModelProperty(value = "版本号")
private Integer verison; private Integer verison;
@TableField(exist = false)
private String requirementid;
} }

Loading…
Cancel
Save