系统参数

This commit is contained in:
lyd
2022-09-28 14:31:44 +08:00
parent 2a4bbd96e2
commit 2abfb67839
8 changed files with 32 additions and 18 deletions

View File

@@ -73,10 +73,10 @@ public class ParamController {
paramService.download(paramService.queryAll(whereJson), response); paramService.download(paramService.queryAll(whereJson), response);
} }
@PostMapping("/getStageCodeByCode") @PostMapping("/getValueByCode")
@Log("根据编码获取舞台编码") @Log("根据编码获取")
@ApiOperation("根据编码获取舞台编码") @ApiOperation("根据编码获取")
public ResponseEntity<Object> getStageCodeByCode(@RequestBody String code) { public ResponseEntity<Object> getValueByCode(@RequestBody String code) {
return new ResponseEntity<>(paramService.findByCode(code), HttpStatus.CREATED); return new ResponseEntity<>(paramService.findByCode(code), HttpStatus.CREATED);
} }
} }

View File

@@ -25,11 +25,15 @@ public class ParamDto implements Serializable {
private String is_delete; private String is_delete;
private String create_by; private Long create_id;
private Long update_optid;
private String create_name;
private String create_time; private String create_time;
private String update_by; private String update_optname;
private String update_time; private String update_time;
} }

View File

@@ -2,6 +2,7 @@
package org.nl.modules.system.service.impl; package org.nl.modules.system.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
@@ -73,11 +74,15 @@ public class ParamServiceImpl implements ParamService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void create(ParamDto dto) { public void create(ParamDto dto) {
String currentUsername = SecurityUtils.getCurrentUsername(); String currentUsername = SecurityUtils.getCurrentUsername();
Long currentId = StpUtil.getLoginIdAsLong();
String now = DateUtil.now(); String now = DateUtil.now();
dto.setId(IdUtil.simpleUUID()); dto.setId(IdUtil.simpleUUID());
dto.setCreate_by(currentUsername); dto.setCreate_id(currentId);
dto.setUpdate_by(currentUsername); dto.setUpdate_optid(currentId);
dto.setCreate_name(currentUsername);
dto.setUpdate_optname(currentUsername);
dto.setUpdate_time(now); dto.setUpdate_time(now);
dto.setCreate_time(now); dto.setCreate_time(now);
@@ -94,8 +99,10 @@ public class ParamServiceImpl implements ParamService {
String currentUsername = SecurityUtils.getCurrentUsername(); String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now(); String now = DateUtil.now();
dto.setUpdate_optid(StpUtil.getLoginIdAsLong());
dto.setUpdate_time(now); dto.setUpdate_time(now);
dto.setUpdate_by(currentUsername); dto.setUpdate_optname(currentUsername);
WQLObject wo = WQLObject.getWQLObject("sys_param"); WQLObject wo = WQLObject.getWQLObject("sys_param");
JSONObject json = JSONObject.parseObject( JSONObject.toJSONString(dto)); JSONObject json = JSONObject.parseObject( JSONObject.toJSONString(dto));
@@ -122,9 +129,9 @@ public class ParamServiceImpl implements ParamService {
map.put("备注", param.getRemark()); map.put("备注", param.getRemark());
map.put("是否启用", param.getIs_active()); map.put("是否启用", param.getIs_active());
map.put("是否删除", param.getIs_delete()); map.put("是否删除", param.getIs_delete());
map.put("创建者", param.getCreate_by()); map.put("创建者", param.getCreate_name());
map.put("创建时间", param.getCreate_time()); map.put("创建时间", param.getCreate_time());
map.put("修改者", param.getUpdate_by()); map.put("修改者", param.getUpdate_optname());
map.put("修改时间", param.getUpdate_time()); map.put("修改时间", param.getUpdate_time());
list.add(map); list.add(map);
} }

View File

@@ -24,12 +24,12 @@ export function edit(data) {
}) })
} }
export function getStageCodeByCode(code) { export function getValueByCode(code) {
return request({ return request({
url: 'api/param/getStageCodeByCode', url: 'api/param/getValueByCode',
method: 'post', method: 'post',
data: code data: code
}) })
} }
export default { add, edit, del, getStageCodeByCode } export default { add, edit, del, getValueByCode }

View File

@@ -44,6 +44,8 @@ import request from '@/utils/request' // 实现 form generator 使用自己定
import { addDateRange, handleTree, parseTime, resetForm, selectDictLabel, selectDictLabels } from '@/utils/nladmin' import { addDateRange, handleTree, parseTime, resetForm, selectDictLabel, selectDictLabels } from '@/utils/nladmin'
import { getValueByCode } from '@/api/system/param'
LogicFlow.use(Menu) LogicFlow.use(Menu)
Vue.component('tinymce', Tinymce) Vue.component('tinymce', Tinymce)
@@ -56,6 +58,7 @@ Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Vue.prototype.getValueByCode = getValueByCode
Vue.use(scroll) Vue.use(scroll)

View File

@@ -103,7 +103,7 @@ export default {
}, },
initStageData() { initStageData() {
// 获取舞台编码 // 获取舞台编码
paramCrud.getStageCodeByCode(this.stageParam).then(res => { this.getValueByCode(this.stageParam).then(res => {
if (res.value !== undefined) { if (res.value !== undefined) {
crudStage.getNewStageDataByCode(res.value).then(res => { crudStage.getNewStageDataByCode(res.value).then(res => {
data = JSON.parse(res.stage_data) data = JSON.parse(res.stage_data)

View File

@@ -58,7 +58,7 @@
<span v-else>是</span> <span v-else>是</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="create_by" label="创建者" /> <el-table-column prop="create_name" label="创建者" />
<el-table-column v-permission="['admin','param:edit','param:del']" label="操作" width="150px" align="center"> <el-table-column v-permission="['admin','param:edit','param:del']" label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<udOperation <udOperation
@@ -89,9 +89,9 @@ const defaultForm = {
value: null, value: null,
remark: null, remark: null,
is_active: 1, is_active: 1,
create_by: null, create_name: null,
create_time: null, create_time: null,
update_by: null, update_optname: null,
update_time: null update_time: null
} }
export default { export default {