From 33cfc36560178952db34ef375f09cb75f0724291 Mon Sep 17 00:00:00 2001 From: mors <3067699729@qq.com> Date: Tue, 11 Apr 2023 17:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/mixins/JeecgListMixin.js | 178 ++++---- .../src/views/modulex/ModulexList.vue | 134 +++++- .../src/views/modulex/modules/BugxForm.vue | 261 +++++------- .../src/views/modulex/modules/BugxModal.vue | 1 - .../src/views/modulex/modules/ModulexForm.vue | 14 +- .../projectUserRole/ProjectUserRoleList.vue | 2 +- .../src/views/projectx/ProjectxList.vue | 6 +- .../views/projectx/modules/ProjectxForm.vue | 243 ++++++----- .../demo/bugx/controller/BugxController.java | 397 +++++++++--------- .../modulex/controller/ModulexController.java | 30 +- .../jeecg/modules/modulex/entity/Modulex.java | 20 +- .../modulex/service/IModulexService.java | 9 + .../service/impl/ModulexServiceImpl.java | 53 ++- .../modules/projectx/entity/Projectx.java | 12 +- 14 files changed, 764 insertions(+), 596 deletions(-) diff --git a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js index 38b8b8f..de07a8e 100644 --- a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js +++ b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js @@ -3,27 +3,27 @@ * 高级查询按钮调用 superQuery方法 高级查询组件ref定义为superQueryModal * data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除 */ -import { filterObj } from '@/utils/util'; -import { deleteAction, getAction,downFile,getFileAccessHttpUrl } from '@/api/manage' +import {filterObj} from '@/utils/util'; +import {deleteAction, getAction, downFile, getFileAccessHttpUrl} from '@/api/manage' import Vue from 'vue' -import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" +import {ACCESS_TOKEN, TENANT_ID} from "@/store/mutation-types" import store from '@/store' import {Modal} from 'ant-design-vue' export const JeecgListMixin = { - data(){ + data() { return { - pagedOld:{ - record:{}, - title:"", + pagedOld: { + record: {}, + title: "", }, /* 查询条件-请不要在queryParam中声明非字符串值的属性 */ queryParam: {}, /* 数据源 */ - dataSource:[], + dataSource: [], /* 分页参数 */ - ipagination:{ + ipagination: { current: 1, pageSize: 10, pageSizeOptions: ['10', '20', '30'], @@ -35,22 +35,22 @@ export const JeecgListMixin = { total: 0 }, /* 排序参数 */ - isorter:{ + isorter: { column: 'createTime', order: 'desc', }, /* 筛选参数 */ filters: {}, /* table加载状态 */ - loading:false, + loading: false, /* table选中keys*/ selectedRowKeys: [], /* table选中records*/ selectionRows: [], /* 查询折叠 */ - toggleSearchStatus:false, + toggleSearchStatus: false, /* 高级查询条件生效状态 */ - superQueryFlag:false, + superQueryFlag: false, /* 高级查询条件 */ superQueryParams: '', /** 高级查询拼接方式 */ @@ -58,30 +58,30 @@ export const JeecgListMixin = { } }, created() { - if(!this.disableMixinCreated){ - console.log(' -- mixin created -- ') - this.loadData(); - //初始化字典配置 在自己页面定义 - this.initDictConfig(); - } + if (!this.disableMixinCreated) { + console.log(' -- mixin created -- ') + this.loadData(); + //初始化字典配置 在自己页面定义 + this.initDictConfig(); + } this.$bus.$on('getInfo', (oldFunction) => { oldFunction(this.pagedOld) }) }, computed: { //token header - tokenHeader(){ + tokenHeader() { let head = {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)} let tenantid = Vue.ls.get(TENANT_ID) - if(tenantid){ + if (tenantid) { head['tenant-id'] = tenantid } return head; } }, - methods:{ + methods: { loadData(arg) { - if(!this.url.list){ + if (!this.url.list) { this.$message.error("请设置url.list属性!") return } @@ -94,32 +94,31 @@ export const JeecgListMixin = { 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.dataSource = res.result.records || res.result; + if (res.result.total) { this.ipagination.total = res.result.total; - }else{ + } else { this.ipagination.total = 0; } //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ } - if(res.code===510){ + if (res.code === 510) { this.$message.warning(res.message) } this.loading = false; }) }, - initDictConfig(){ + initDictConfig() { console.log("--这是一个假的方法!") }, handleSuperQuery(params, matchType) { //高级查询方法 - if(!params){ - this.superQueryParams='' + if (!params) { + this.superQueryParams = '' this.superQueryFlag = false - }else{ + } else { this.superQueryFlag = true - this.superQueryParams=JSON.stringify(params) + this.superQueryParams = JSON.stringify(params) this.superQueryMatchType = matchType } this.loadData(1) @@ -127,11 +126,11 @@ export const JeecgListMixin = { getQueryParams() { //获取查询条件 let sqp = {} - if(this.superQueryParams){ - sqp['superQueryParams']=encodeURI(this.superQueryParams) + if (this.superQueryParams) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams) sqp['superQueryMatchType'] = this.superQueryMatchType } - var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); + 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; @@ -165,7 +164,7 @@ export const JeecgListMixin = { this.loadData(1); }, batchDel: function () { - if(!this.url.deleteBatch){ + if (!this.url.deleteBatch) { this.$message.error("请设置url.deleteBatch属性!") return } @@ -225,7 +224,7 @@ export const JeecgListMixin = { } }, handleDelete: function (id) { - if(!this.url.delete){ + if (!this.url.delete) { this.$message.error("请设置url.delete属性!") return } @@ -242,7 +241,7 @@ export const JeecgListMixin = { }); }, startorstop: function (id) { - if(!this.url.update){ + if (!this.url.update) { this.$message.error("请设置url.update属性!") return } @@ -258,40 +257,45 @@ export const JeecgListMixin = { } }); }, - reCalculatePage(count){ + reCalculatePage(count) { //总数量-count - let total=this.ipagination.total-count; + let total = this.ipagination.total - count; //获取删除后的分页数 - let currentIndex=Math.ceil(total/this.ipagination.pageSize); + let currentIndex = Math.ceil(total / this.ipagination.pageSize); //删除后的分页数<所在当前页 - if(currentIndex0){ + if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { param['selections'] = this.selectedRowKeys.join(",") } - console.log("导出参数",param) - downFile(this.url.exportXlsUrl,param).then((data)=>{ + console.log("导出参数", param) + downFile(this.url.exportXlsUrl, param).then((data) => { if (!data) { this.$message.warning("文件下载失败") return } if (typeof window.navigator.msSaveBlob !== 'undefined') { - window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls') - }else{ - let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'})) + window.navigator.msSaveBlob(new Blob([data], {type: 'application/vnd.ms-excel'}), fileName + '.xls') + } else { + let url = window.URL.createObjectURL(new Blob([data], {type: 'application/vnd.ms-excel'})) let link = document.createElement('a') link.style.display = 'none' link.href = url - link.setAttribute('download', fileName+'.xls') + link.setAttribute('download', fileName + '.xls') document.body.appendChild(link) link.click() document.body.removeChild(link); //下载完成移除元素 @@ -361,28 +365,28 @@ export const JeecgListMixin = { } }) }, - daochu(fileName){ - if(!fileName || typeof fileName != "string"){ + daochu(fileName) { + if (!fileName || typeof fileName != "string") { fileName = "导出文件" } let param = this.getQueryParams(); - if(this.selectedRowKeys && this.selectedRowKeys.length>0){ + if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { param['selections'] = this.selectedRowKeys.join(",") } - console.log("导出参数",param) - downFile(this.url.standards,param).then((data)=>{ + console.log("导出参数", param) + downFile(this.url.standards, param).then((data) => { if (!data) { this.$message.warning("文件下载失败") return } if (typeof window.navigator.msSaveBlob !== 'undefined') { - window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls') - }else{ - let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'})) + window.navigator.msSaveBlob(new Blob([data], {type: 'application/vnd.ms-excel'}), fileName + '.xls') + } else { + let url = window.URL.createObjectURL(new Blob([data], {type: 'application/vnd.ms-excel'})) let link = document.createElement('a') link.style.display = 'none' link.href = url - link.setAttribute('download', fileName+'.xls') + link.setAttribute('download', fileName + '.xls') document.body.appendChild(link) link.click() document.body.removeChild(link); //下载完成移除元素 @@ -391,7 +395,7 @@ export const JeecgListMixin = { }) }, /* 导入 */ - handleImportExcel(info){ + handleImportExcel(info) { if (info.file.status !== 'uploading') { console.log(info.file, info.fileList); } @@ -399,7 +403,7 @@ export const JeecgListMixin = { if (info.file.response.success) { // this.$message.success(`${info.file.name} 文件上传成功`); if (info.file.response.code === 201) { - let { message, result: { msg, fileUrl, fileName } } = info.file.response + let {message, result: {msg, fileUrl, fileName}} = info.file.response let href = window._CONFIG['domianURL'] + fileUrl this.$warning({ title: message, @@ -440,21 +444,21 @@ export const JeecgListMixin = { } }, /* 图片预览 */ - getImgView(text){ - if(text && text.indexOf(",")>0){ - text = text.substring(0,text.indexOf(",")) + getImgView(text) { + if (text && text.indexOf(",") > 0) { + text = text.substring(0, text.indexOf(",")) } return getFileAccessHttpUrl(text) }, /* 文件下载 */ // update--autor:lvdandan-----date:20200630------for:修改下载文件方法名uploadFile改为downloadFile------ - downloadFile(text){ - if(!text){ + downloadFile(text) { + if (!text) { this.$message.warning("未知的文件") return; } - if(text.indexOf(",")>0){ - text = text.substring(0,text.indexOf(",")) + if (text.indexOf(",") > 0) { + text = text.substring(0, text.indexOf(",")) } let url = getFileAccessHttpUrl(text) window.open(url); diff --git a/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue b/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue index 882fd8e..c28604d 100644 --- a/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue +++ b/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue @@ -50,13 +50,38 @@ class="j-table-force-nowrap" @change="handleTableChange"> - + + + 功能 + + 实体 + + 复制 + + + 发布 + + + 开始 + + + 提交 + + + 撤回 + + + BUG反馈 + + + 审核 + + 编辑 + 详情 @@ -71,6 +96,8 @@ + + @@ -81,10 +108,14 @@ import {mixinDevice} from '@/utils/mixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin' import ModulexModal from './modules/ModulexModal' +import {getAction} from "@api/manage"; +import BugxModal from "@views/modulex/modules/BugxModal"; + export default { name: 'ModulexList', mixins: [JeecgListMixin, mixinDevice], components: { + BugxModal, ModulexModal }, data() { @@ -103,12 +134,12 @@ export default { } }, { - title: '上级模块id', + title: '上级模块', align: "center", dataIndex: 'pid_dictText' }, { - title: '项目id', + title: '项目', align: "center", dataIndex: 'projectId_dictText' }, @@ -151,9 +182,9 @@ export default { title: '发布时间', align: "center", dataIndex: 'publishTime', - customRender: function (text) { - return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) - } + // customRender: function (text) { + // return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) + // } }, { title: '任务时长', @@ -187,8 +218,8 @@ export default { // dataIndex: 'userRole' // }, { - title:'关联实体', - align:"center", + title: '关联实体', + align: "center", dataIndex: 'relatedBean_dictText' }, // { @@ -211,6 +242,14 @@ export default { align: "center", dataIndex: 'verisonStatus_dictText' }, + { + title: '管理', + dataIndex: 'htmlSlot', + align: "center", + fixed: "right", + // width: 147, + scopedSlots: {customRender: 'htmlSlot'} + }, // { // title:'版本号', // align:"center", @@ -221,7 +260,7 @@ export default { dataIndex: 'action', align: "center", fixed: "right", - width: 147, + // width: 147, scopedSlots: {customRender: 'action'} } ], @@ -246,6 +285,79 @@ export default { }, }, methods: { + shenhe(record) { + getAction('/modulex/modulex/shenhe', {id: record.id}).then((res) => { + if (res.success) { + //重新计算分页问题 + this.$message.success(res.result); + this.loadData(); + } else { + this.$message.warning(res.message); + } + }) + }, + bugfankui: function (record) { + this.$refs.BugxModal.add(record.id); + this.$refs.BugxModal.title = "BUG反馈"; + this.$refs.BugxModal.disableSubmit = false; + }, + chehui(record) { + getAction('/modulex/modulex/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('/modulex/modulex/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('/modulex/modulex/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('/modulex/modulex/fabu', {id: record.id}).then((res) => { + if (res.success) { + //重新计算分页问题 + this.$message.success(res.result); + this.loadData(); + } + }) + }, + functionManage(record) { + this.$router.push({ + path: '/src/views/functionx/FunctionxList', + query: { + moduleid: record.id + } + // query: {id: '123456'} + }) + }, + tablexManage(record) { + this.$router.push({ + path: '/src/views/tablex/TablexList', + //query: {id: '123456'} + }) + }, initDictConfig() { }, getSuperFieldList() { diff --git a/ant-design-vue-jeecg/src/views/modulex/modules/BugxForm.vue b/ant-design-vue-jeecg/src/views/modulex/modules/BugxForm.vue index 0333128..4e1a5df 100644 --- a/ant-design-vue-jeecg/src/views/modulex/modules/BugxForm.vue +++ b/ant-design-vue-jeecg/src/views/modulex/modules/BugxForm.vue @@ -3,86 +3,29 @@ - - - - - + - + - - - - - - - - - - - - - - - - - - - - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -91,108 +34,106 @@ \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/modulex/modules/BugxModal.vue b/ant-design-vue-jeecg/src/views/modulex/modules/BugxModal.vue index 5e25e18..0563e54 100644 --- a/ant-design-vue-jeecg/src/views/modulex/modules/BugxModal.vue +++ b/ant-design-vue-jeecg/src/views/modulex/modules/BugxModal.vue @@ -31,7 +31,6 @@ methods: { add (id) { this.visible=true - this.$nextTick(()=>{ this.$refs.realForm.add(id); }) diff --git a/ant-design-vue-jeecg/src/views/modulex/modules/ModulexForm.vue b/ant-design-vue-jeecg/src/views/modulex/modules/ModulexForm.vue index 619c975..e726eb5 100644 --- a/ant-design-vue-jeecg/src/views/modulex/modules/ModulexForm.vue +++ b/ant-design-vue-jeecg/src/views/modulex/modules/ModulexForm.vue @@ -4,14 +4,14 @@ - + + placeholder="请输入上级模块" style="width: 100%" /> - + @@ -226,6 +226,14 @@ }, 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 () { diff --git a/ant-design-vue-jeecg/src/views/projectUserRole/ProjectUserRoleList.vue b/ant-design-vue-jeecg/src/views/projectUserRole/ProjectUserRoleList.vue index 8c359e0..efe4ed9 100644 --- a/ant-design-vue-jeecg/src/views/projectUserRole/ProjectUserRoleList.vue +++ b/ant-design-vue-jeecg/src/views/projectUserRole/ProjectUserRoleList.vue @@ -119,7 +119,7 @@ } }, { - title:'项目id', + title:'项目', align:"center", dataIndex: 'projectId_dictText' }, diff --git a/ant-design-vue-jeecg/src/views/projectx/ProjectxList.vue b/ant-design-vue-jeecg/src/views/projectx/ProjectxList.vue index 0c2b0c2..1cec1ae 100644 --- a/ant-design-vue-jeecg/src/views/projectx/ProjectxList.vue +++ b/ant-design-vue-jeecg/src/views/projectx/ProjectxList.vue @@ -82,13 +82,15 @@ + 复制 + 编辑 diff --git a/ant-design-vue-jeecg/src/views/projectx/modules/ProjectxForm.vue b/ant-design-vue-jeecg/src/views/projectx/modules/ProjectxForm.vue index e31b1c1..102b938 100644 --- a/ant-design-vue-jeecg/src/views/projectx/modules/ProjectxForm.vue +++ b/ant-design-vue-jeecg/src/views/projectx/modules/ProjectxForm.vue @@ -5,63 +5,65 @@ - + - + - + - + - - + + - + - + - + - + - + - + - + @@ -70,19 +72,20 @@ - - - - - - - - - + + + + + + + + + - + - + @@ -93,104 +96,112 @@ \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/controller/BugxController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/controller/BugxController.java index a61731e..1428624 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/controller/BugxController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/controller/BugxController.java @@ -8,6 +8,7 @@ import java.util.stream.Collectors; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -48,234 +49,236 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; - /** +/** * @Description: BUG管理 * @Author: jeecg-boot - * @Date: 2023-04-11 + * @Date: 2023-04-11 * @Version: V1.0 */ -@Api(tags="BUG管理") +@Api(tags = "BUG管理") @RestController @RequestMapping("/bugx/bugx") @Slf4j public class BugxController extends JeecgController { - @Autowired - private IBugxService bugxService; - @Autowired - FunctionxMapper functionxMapper; - @Autowired - ProjectxMapper projectxMapper; - @Autowired - ModulexMapper modulexMapper; - @Autowired - RulexMapper rulexMapper; - /** - * 分页列表查询 - * - * @param bugx - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "BUG管理-分页列表查询") - @ApiOperation(value="BUG管理-分页列表查询", notes="BUG管理-分页列表查询") - @GetMapping(value = "/list") - public Result queryPageList(Bugx bugx, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - // QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(bugx, req.getParameterMap()); - QueryWrapper queryWrapper=new QueryWrapper<>(); - queryWrapper.orderByDesc("bug_level"); - LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); - List role = functionxMapper.findRole(user.getId()); - if(role.contains("1645284981182980098")||role.contains("f6817f48af4fb3af11b9e8bf182f618b")){ - }else{ - //因为开发者是以id,id,id的方式存储,理论上可以用模糊查询到 - queryWrapper.like("manager_users",user.getId()); - } - if(bugx.getType()!=null){ - queryWrapper.eq("type",bugx.getType()); - } - if(bugx.getBugStatus()!=null){ - queryWrapper.eq("bug_status",bugx.getBugStatus()); - } - Page page = new Page(pageNo, pageSize); - IPage pageList = bugxService.page(page, queryWrapper); - return Result.OK(pageList); - } + @Autowired + private IBugxService bugxService; + @Resource + FunctionxMapper functionxMapper; + @Resource + ProjectxMapper projectxMapper; + @Resource + ModulexMapper modulexMapper; + @Resource + RulexMapper rulexMapper; - /** - * 添加 - * - * @param bugx - * @return - */ - @AutoLog(value = "BUG管理-添加") - @ApiOperation(value="BUG管理-添加", notes="BUG管理-添加") - @PostMapping(value = "/add") - public Result add(@RequestBody Bugx bugx) { - QueryWrapper queryWrapper=new QueryWrapper(); - String code=null; - int a=0; - //根源是找最终的项目id + /** + * 分页列表查询 + * + * @param bugx + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "BUG管理-分页列表查询") + @ApiOperation(value = "BUG管理-分页列表查询", notes = "BUG管理-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(Bugx bugx, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + // QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(bugx, req.getParameterMap()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.orderByDesc("bug_level"); + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List role = functionxMapper.findRole(user.getId()); + if (role.contains("1645284981182980098") || role.contains("f6817f48af4fb3af11b9e8bf182f618b")) { + } else { + //因为开发者是以id,id,id的方式存储,理论上可以用模糊查询到 + queryWrapper.like("manager_users", user.getId()); + } + if (bugx.getType() != null) { + queryWrapper.eq("type", bugx.getType()); + } + if (bugx.getBugStatus() != null) { + queryWrapper.eq("bug_status", bugx.getBugStatus()); + } + Page page = new Page(pageNo, pageSize); + IPage pageList = bugxService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param bugx + * @return + */ + @AutoLog(value = "BUG管理-添加") + @ApiOperation(value = "BUG管理-添加", notes = "BUG管理-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody Bugx bugx) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String code = null; + int a = 0; + //根源是找最终的项目id // if(bugx.getProjectId()!=null){ // queryWrapper.eq("project_id",bugx.getProjectId()); // a=bugxService.count(queryWrapper); // code=bugxService.sort(bugx.getProjectId()); // projectxMapper.upDeBug(bugx.getProjectId()); // }else - if(bugx.getModuleId()!=null){ - queryWrapper.eq("module_id",bugx.getModuleId()); - queryWrapper.isNull("function_id"); - a=bugxService.count(queryWrapper); - Modulex modulex = modulexMapper.selectById(bugx.getModuleId()); - code=bugxService.sort(modulex.getProjectId()); - bugx.setProjectId(modulex.getProjectId()); - bugx.setManagerUsers(modulex.getManagerUsers()); - rulexMapper.upMstatus(bugx.getModuleId()); - }else if(bugx.getFunctionId()!=null){ - queryWrapper.eq("function_id",bugx.getFunctionId()); - queryWrapper.isNull("rule_id"); - a=bugxService.count(queryWrapper); - Functionx functionx = functionxMapper.selectById(bugx.getFunctionId()); - Modulex modulex = modulexMapper.selectById(functionx.getModuleId()); - code=bugxService.sort(modulex.getProjectId()); - bugx.setModuleId(functionx.getModuleId()); - bugx.setProjectId(modulex.getProjectId()); - bugx.setManagerUsers(functionx.getManagerUsers()); - rulexMapper.upFstatus(bugx.getFunctionId()); - }else{ - queryWrapper.eq("rule_id",bugx.getRuleId()); - a=bugxService.count(queryWrapper); - Rulex rulex = rulexMapper.selectById(bugx.getRuleId()); - Modulex modulex = modulexMapper.selectById(rulex.getModuleId()); - bugx.setModuleId(rulex.getModuleId()); - bugx.setFunctionId(rulex.getFunctionId()); - code=bugxService.sort(modulex.getProjectId()); - bugx.setProjectId(modulex.getProjectId()); - bugx.setManagerUsers(rulex.getManagerUsers()); - rulexMapper.upRstatus(bugx.getRuleId()); - } - if(a>=1){ - return Result.error("当前BUG以提出!!"); - } - //设置BUG编码 - if(code==null){ - bugx.setBugCode("E00001"); - }else{ - int i = Integer.parseInt(code.substring(1)); - i++; - String s = Integer.toString(i); - while(s.length()<5){ - s="0"+s; - } - bugx.setBugCode("E"+s); - } - bugx.setPublishTime(new Date()); - bugxService.save(bugx); - return Result.OK("提交BUG成功!"); - } + if (bugx.getModuleId() != null) { + queryWrapper.eq("module_id", bugx.getModuleId()); + queryWrapper.isNull("function_id"); + a = bugxService.count(queryWrapper); + Modulex modulex = modulexMapper.selectById(bugx.getModuleId()); + code = bugxService.sort(modulex.getProjectId()); + bugx.setProjectId(modulex.getProjectId()); + bugx.setManagerUsers(modulex.getManagerUsers()); + rulexMapper.upMstatus(bugx.getModuleId()); + } else if (bugx.getFunctionId() != null) { + queryWrapper.eq("function_id", bugx.getFunctionId()); + queryWrapper.isNull("rule_id"); + a = bugxService.count(queryWrapper); + Functionx functionx = functionxMapper.selectById(bugx.getFunctionId()); + Modulex modulex = modulexMapper.selectById(functionx.getModuleId()); + code = bugxService.sort(modulex.getProjectId()); + bugx.setModuleId(functionx.getModuleId()); + bugx.setProjectId(modulex.getProjectId()); + bugx.setManagerUsers(functionx.getManagerUsers()); + rulexMapper.upFstatus(bugx.getFunctionId()); + } else { + queryWrapper.eq("rule_id", bugx.getRuleId()); + a = bugxService.count(queryWrapper); + Rulex rulex = rulexMapper.selectById(bugx.getRuleId()); + Modulex modulex = modulexMapper.selectById(rulex.getModuleId()); + bugx.setModuleId(rulex.getModuleId()); + bugx.setFunctionId(rulex.getFunctionId()); + code = bugxService.sort(modulex.getProjectId()); + bugx.setProjectId(modulex.getProjectId()); + bugx.setManagerUsers(rulex.getManagerUsers()); + rulexMapper.upRstatus(bugx.getRuleId()); + } + if (a >= 1) { + return Result.error("当前BUG以提出!!"); + } + //设置BUG编码 + if (code == null) { + bugx.setBugCode("E00001"); + } else { + int i = Integer.parseInt(code.substring(1)); + i++; + String s = Integer.toString(i); + while (s.length() < 5) { + s = "0" + s; + } + bugx.setBugCode("E" + s); + } + bugx.setPublishTime(new Date()); + bugxService.save(bugx); + return Result.OK("提交BUG成功!"); + } - /** - * 编辑 - * - * @param bugx - * @return - */ - @AutoLog(value = "BUG管理-编辑") - @ApiOperation(value="BUG管理-编辑", notes="BUG管理-编辑") - @PutMapping(value = "/edit") - public Result edit(@RequestBody Bugx bugx) { - if(bugx.getBugStatus()==4){ - return Result.error("已提交过!!"); - } - if(bugx.getBugStatus()==2) - return Result.error("当前BUG已解决!!"); - //提交时就相当于xiugai - bugx.setSubmitTime(new Date()); - bugx.setBugStatus(4); - bugxService.updateById(bugx); - return Result.OK("提交成功!"); - } + /** + * 编辑 + * + * @param bugx + * @return + */ + @AutoLog(value = "BUG管理-编辑") + @ApiOperation(value = "BUG管理-编辑", notes = "BUG管理-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody Bugx bugx) { + if (bugx.getBugStatus() == 4) { + return Result.error("已提交过!!"); + } + if (bugx.getBugStatus() == 2) + return Result.error("当前BUG已解决!!"); + //提交时就相当于xiugai + bugx.setSubmitTime(new Date()); + bugx.setBugStatus(4); + bugxService.updateById(bugx); + return Result.OK("提交成功!"); + } - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "BUG管理-通过id删除") - @ApiOperation(value="BUG管理-通过id删除", notes="BUG管理-通过id删除") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - bugxService.removeById(id); - return Result.OK("删除成功!"); - } + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "BUG管理-通过id删除") + @ApiOperation(value = "BUG管理-通过id删除", notes = "BUG管理-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + bugxService.removeById(id); + return Result.OK("删除成功!"); + } - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "BUG管理-批量删除") - @ApiOperation(value="BUG管理-批量删除", notes="BUG管理-批量删除") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.bugxService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "BUG管理-批量删除") + @ApiOperation(value = "BUG管理-批量删除", notes = "BUG管理-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.bugxService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } - /** - * 通过id查询 - * - * @param id - * @return - */ - @AutoLog(value = "BUG管理-通过id查询") - @ApiOperation(value="BUG管理-通过id查询", notes="BUG管理-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - Bugx bugx = bugxService.getById(id); - if(bugx==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(bugx); - } + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "BUG管理-通过id查询") + @ApiOperation(value = "BUG管理-通过id查询", notes = "BUG管理-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + Bugx bugx = bugxService.getById(id); + if (bugx == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(bugx); + } /** - * 导出excel - * - * @param request - * @param bugx - */ + * 导出excel + * + * @param request + * @param bugx + */ @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, Bugx bugx) { return super.exportXls(request, bugx, Bugx.class, "BUG管理"); } /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, Bugx.class); } - @GetMapping(value = "/shenhe") - public Result shenhe(@RequestParam(name="id",required=true) String id) { - return bugxService.shenhe(id); - } - @GetMapping(value = "/bohui") - public Result bohui(@RequestParam(name="id",required=true) String id) { - return bugxService.bohui(id); - } + @GetMapping(value = "/shenhe") + public Result shenhe(@RequestParam(name = "id", required = true) String id) { + return bugxService.shenhe(id); + } + + @GetMapping(value = "/bohui") + public Result bohui(@RequestParam(name = "id", required = true) String id) { + return bugxService.bohui(id); + } - } +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java index beebbcb..1f2c9ce 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java @@ -57,7 +57,35 @@ public class ModulexController extends JeecgController return Result.OK(pageList); } - /** + @GetMapping(value = "/fabu") + public Result fabu(@RequestParam(name="id",required=true) String id) { + Modulex byId = modulexService.getById(id); + if (byId.getWorkStatus() != 0){ + return Result.error("当前功能已发布!!!"); + }else { + byId.setWorkStatus(1); + modulexService.updateById(byId); + return Result.OK("发布成功!!"); + } + } + @GetMapping(value = "/kaishi") + public Result kaishi(@RequestParam(name="id",required=true) String id) { + return modulexService.kaishi(id); + } + @GetMapping(value = "/tijiao") + public Result tijiao(@RequestParam(name="id",required=true) String id) { + return modulexService.tijiao(id); + } + @GetMapping(value = "/cehui") + public Result cehui(@RequestParam(name="id",required=true) String id) { + return modulexService.cehui(id); + } + @GetMapping(value = "/shenhe") + public Result shenhe(@RequestParam(name="id",required=true) String id) { + return modulexService.shenhe(id); + } + + /** * 添加 * * @param modulex diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/Modulex.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/Modulex.java index 8921e72..b64cb8a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/Modulex.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/Modulex.java @@ -106,16 +106,16 @@ public class Modulex implements Serializable { private Integer workLevel; /** * 任务状态 - * 值:未发布0、已发布1、开发中2、已完成3、已审核4、DEBUG9;默认0 + * 值:未发布0、已发布1、开发中2、已完成3、已审核4、DEBUG 9;默认 0 */ @Excel(name = "任务状态", width = 15) @ApiModelProperty(value = "任务状态") @Dict(dicCode = "work_status") private Integer workStatus; /**发布时间*/ - @Excel(name = "发布时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") + @Excel(name = "发布时间", width = 15, 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 Date publishTime; /** @@ -126,15 +126,15 @@ public class Modulex implements Serializable { @ApiModelProperty(value = "任务时长") private Double duration; /**开始时间*/ - @Excel(name = "开始时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") + @Excel(name = "开始时间", width = 15, 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 Date startTime; /**提交时间*/ - @Excel(name = "提交时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") + @Excel(name = "提交时间", width = 15, 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 Date submitTime; /**实际时长*/ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java index 9efcc5d..23ce969 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java @@ -2,6 +2,7 @@ package org.jeecg.modules.modulex.service; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.common.api.vo.Result; import org.jeecg.modules.modulex.entity.Modulex; /** @@ -16,4 +17,12 @@ public interface IModulexService extends IService { * 得到最大的版本号 */ Integer getMaxVersion(Integer verison); + + Result kaishi(String id); + + Result tijiao(String id); + + Result cehui(String id); + + Result shenhe(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java index 8835e6f..f03310c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java @@ -1,5 +1,6 @@ package org.jeecg.modules.modulex.service.impl; +import org.jeecg.common.api.vo.Result; import org.jeecg.modules.modulex.entity.Modulex; import org.jeecg.modules.modulex.mapper.ModulexMapper; import org.jeecg.modules.modulex.service.IModulexService; @@ -7,6 +8,7 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.Date; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -14,7 +16,7 @@ import java.util.stream.Collectors; /** * @Description: 模块管理 * @Author: jeecg-boot - * @Date: 2023-04-10 + * @Date: 2023-04-10 * @Version: V1.0 */ @Service @@ -27,4 +29,53 @@ public class ModulexServiceImpl extends ServiceImpl impl public Integer getMaxVersion(Integer verison) { return this.list().size(); } + + @Override + public Result kaishi(String id) { + Modulex byId = this.getById(id); + if (byId.getWorkStatus() != 1) { + return Result.error("当前不处于已发布阶段,无法开始,请先发布"); + } else { + byId.setWorkStatus(2); + byId.setStartTime(new Date()); + this.updateById(byId); + return Result.OK("任务开始成功"); + } + } + + @Override + public Result tijiao(String id) { + Modulex byId = this.getById(id); + if (byId.getWorkStatus() != 2) { + return Result.error("当前不处于开发中阶段,无法提交"); + } else { + byId.setWorkStatus(3); + byId.setSubmitTime(new Date()); + this.updateById(byId); + return Result.OK("提交成功!!"); + } + + } + + @Override + public Result cehui(String id) { + Modulex byId = this.getById(id); + if (byId.getWorkStatus() == 2) { + return Result.error("正处于开发中"); + } + byId.setWorkStatus(2); + this.updateById(byId); + return Result.OK("撤回成功"); + } + + @Override + public Result shenhe(String id) { + Modulex byId = this.getById(id); + if (byId.getWorkStatus() == 4) { + return Result.error("已审核"); + } + byId.setWorkStatus(4); + this.updateById(byId); + return Result.OK("审核通过"); + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/projectx/entity/Projectx.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/projectx/entity/Projectx.java index b66b103..d21b3a5 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/projectx/entity/Projectx.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/projectx/entity/Projectx.java @@ -88,15 +88,15 @@ public class Projectx implements Serializable { @ApiModelProperty(value = "数据地址") private String projectDbUrl; /**开始时间*/ - @Excel(name = "开始时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") + @Excel(name = "开始时间", width = 15, 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 Date startTime; /**完成时间*/ - @Excel(name = "完成时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") + @Excel(name = "完成时间", width = 15, 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 Date completeTime; /**