Browse Source

2023-11-23 框架更新,集成aviator,oracle数据源,magic_api

develop
zhousq 1 year ago
parent
commit
e63044289d
  1. 7
      lzbi-admin/pom.xml
  2. 5
      lzbi-admin/src/main/resources/application-dev.yml
  3. 10
      lzbi-admin/src/main/resources/application.yml
  4. 12
      lzbi-common/pom.xml
  5. 2
      lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java
  6. 4
      lzbi-generator/src/main/resources/generator.yml
  7. 425
      lzbi-generator/src/main/resources/vm/vue/index-tree.vue.vm
  8. 480
      lzbi-generator/src/main/resources/vm/vue/index.vue.vm
  9. 6
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java
  10. 166
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiTargetAdjustController.java
  11. 166
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiTargetDraftController.java
  12. 323
      lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiTargetAdjust.java
  13. 783
      lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiTargetDraft.java
  14. 64
      lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiTargetAdjustMapper.java
  15. 64
      lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiTargetDraftMapper.java
  16. 2
      lzbi-module/src/main/resources/mapper/DcBusiTargetAdjustMapper.xml

7
lzbi-admin/pom.xml

@ -70,6 +70,13 @@
<groupId>com.lzbi</groupId>
<artifactId>lzbi-module</artifactId>
</dependency>
<!-- 以spring-boot-starter的方式引用 -->
<dependency>
<groupId>org.ssssssss</groupId>
<artifactId>magic-api-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
<build>

5
lzbi-admin/src/main/resources/application-dev.yml

@ -35,6 +35,11 @@ spring:
url: jdbc:mysql://10.10.10.56:13306/lzdc_bi_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: luenmei
password: 123456
# 主库数据源
charge:
url: jdbc:oracle:thin:@//10.10.10.60:1521/HX?CONNECT_TIMEOUT=10000&Read_Timeout=120000
username: lmjt_sys
password: lmjt_sys
# 从库数据源
slave:
# 从数据源开关/默认关闭

10
lzbi-admin/src/main/resources/application.yml

@ -115,3 +115,13 @@ xss:
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
magic-api:
#配置web页面入口
web: /magic/api
#配置文件存储位置。当以classpath开头时,为只读模式
resource:
type: database # 配置存储在数据库中
tableName: magic_api_file # 数据库中的表名
#datasource: master #指定数据源(单数据源时无需配置,多数据源时默认使用主数据源,如果存在其他数据源中需要指定。)
prefix: /magic-api # key前缀
readonly: false

12
lzbi-common/pom.xml

@ -136,6 +136,18 @@
<artifactId>hutool-all</artifactId>
<version>5.8.16</version>
</dependency>
<!-- -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
</dependency>
<!-- -->
<dependency>
<groupId>com.googlecode.aviator</groupId>
<artifactId>aviator</artifactId>
<version>5.4.1</version>
</dependency>
</dependencies>
</project>

2
lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java

@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage","/assetData/**").permitAll()
.antMatchers("/login", "/register", "/captchaImage","/assetData/**","/magic/api/**").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers( "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

4
lzbi-generator/src/main/resources/generator.yml

@ -1,9 +1,9 @@
# 代码生成
gen:
# 作者
author: ruoyi
author: win
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.lzbi.system
packageName: com.lzbi
# 自动去除表前缀,默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)

425
lzbi-generator/src/main/resources/vm/vue/index-tree.vue.vm

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
#foreach($column in $columns)
#if($column.query)
#set($dictType=$column.dictType)
@ -17,14 +17,14 @@
v-model="queryParams.${column.javaField}"
placeholder="请输入${comment}"
clearable
@keyup.enter.native="handleQuery"
@keyup.enter="handleQuery"
/>
</el-form-item>
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
<el-form-item label="${comment}" prop="${column.javaField}">
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
<el-option
v-for="dict in dict.type.${dictType}"
v-for="dict in ${dictType}"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -42,16 +42,15 @@
<el-date-picker clearable
v-model="queryParams.${column.javaField}"
type="date"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
placeholder="选择${comment}">
</el-date-picker>
</el-form-item>
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
<el-form-item label="${comment}">
<el-form-item label="${comment}" style="width: 308px">
<el-date-picker
v-model="daterange${AttrName}"
style="width: 240px"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
@ -62,8 +61,8 @@
#end
#end
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
@ -72,8 +71,7 @@
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
icon="Plus"
@click="handleAdd"
v-hasPermi="['${moduleName}:${businessName}:add']"
>新增</el-button>
@ -82,12 +80,11 @@
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
icon="Sort"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
@ -109,23 +106,23 @@
#if($column.pk)
#elseif($column.list && $column.htmlType == "datetime")
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
<template slot-scope="scope">
<template #default="scope">
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
#elseif($column.list && $column.htmlType == "imageUpload")
<el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
<template slot-scope="scope">
<template #default="scope">
<image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
</template>
</el-table-column>
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}">
<template slot-scope="scope">
<template #default="scope">
#if($column.htmlType == "checkbox")
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
#else
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
#end
</template>
</el-table-column>
@ -138,35 +135,17 @@
#end
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:remove']"
>删除</el-button>
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改${functionName}对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
#foreach($column in $columns)
#set($field=$column.javaField)
#if($column.insert && !$column.pk)
@ -180,7 +159,14 @@
#set($dictType=$column.dictType)
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
<el-form-item label="${comment}" prop="${treeParentCode}">
<treeselect v-model="form.${treeParentCode}" :options="${businessName}Options" :normalizer="normalizer" placeholder="请选择${comment}" />
<el-tree-select
v-model="form.${treeParentCode}"
:data="${businessName}Options"
:props="{ value: '${treeCode}', label: '${treeName}', children: 'children' }"
value-key="${treeCode}"
placeholder="请选择${comment}"
check-strictly
/>
</el-form-item>
#elseif($column.htmlType == "input")
<el-form-item label="${comment}" prop="${field}">
@ -202,7 +188,7 @@
<el-form-item label="${comment}" prop="${field}">
<el-select v-model="form.${field}" placeholder="请选择${comment}">
<el-option
v-for="dict in dict.type.${dictType}"
v-for="dict in ${dictType}"
:key="dict.value"
:label="dict.label"
#if($column.javaType == "Integer" || $column.javaType == "Long")
@ -223,7 +209,7 @@
<el-form-item label="${comment}" prop="${field}">
<el-checkbox-group v-model="form.${field}">
<el-checkbox
v-for="dict in dict.type.${dictType}"
v-for="dict in ${dictType}"
:key="dict.value"
:label="dict.value">
{{dict.label}}
@ -240,7 +226,7 @@
<el-form-item label="${comment}" prop="${field}">
<el-radio-group v-model="form.${field}">
<el-radio
v-for="dict in dict.type.${dictType}"
v-for="dict in ${dictType}"
:key="dict.value"
#if($column.javaType == "Integer" || $column.javaType == "Long")
:label="parseInt(dict.value)"
@ -261,7 +247,7 @@
<el-date-picker clearable
v-model="form.${field}"
type="date"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
placeholder="选择${comment}">
</el-date-picker>
</el-form-item>
@ -274,65 +260,51 @@
#end
#end
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
<script setup name="${BusinessName}">
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "${BusinessName}",
const { proxy } = getCurrentInstance();
#if(${dicts} != '')
dicts: [${dicts}],
#set($dictsNoSymbol=$dicts.replace("'", ""))
const { ${dictsNoSymbol} } = proxy.useDict(${dicts});
#end
components: {
Treeselect
},
data() {
return {
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// ${functionName}表格数据
${businessName}List: [],
// ${functionName}树选项
${businessName}Options: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 是否展开,默认全部展开
isExpandAll: true,
// 重新渲染表格状态
refreshTable: true,
const ${businessName}List = ref([]);
const ${businessName}Options = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const title = ref("");
const isExpandAll = ref(true);
const refreshTable = ref(true);
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
// $comment时间范围
daterange${AttrName}: [],
const daterange${AttrName} = ref([]);
#end
#end
// 查询参数
queryParams: {
#foreach ($column in $columns)
const data = reactive({
form: {},
queryParams: {
#foreach ($column in $columns)
#if($column.query)
$column.javaField: null#if($foreach.count != $columns.size()),#end
$column.javaField: null#if($foreach.count != $columns.size()),#end
#end
#end
},
// 表单参数
form: {},
// 表单校验
rules: {
#foreach ($column in $columns)
},
rules: {
#foreach ($column in $columns)
#if($column.required)
#set($parentheseIndex=$column.columnComment.indexOf("("))
#if($parentheseIndex != -1)
@ -340,166 +312,163 @@ export default {
#else
#set($comment=$column.columnComment)
#end
$column.javaField: [
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
]#if($foreach.count != $columns.size()),#end
$column.javaField: [
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
]#if($foreach.count != $columns.size()),#end
#end
#end
}
};
},
created() {
this.getList();
},
methods: {
/** 查询${functionName}列表 */
getList() {
this.loading = true;
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询${functionName}列表 */
function getList() {
loading.value = true;
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
this.queryParams.params = {};
queryParams.value.params = {};
#break
#end
#end
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0];
this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1];
}
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0];
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1];
}
#end
#end
list${BusinessName}(this.queryParams).then(response => {
this.${businessName}List = this.handleTree(response.data, "${treeCode}", "${treeParentCode}");
this.loading = false;
});
},
/** 转换${functionName}数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.${treeCode},
label: node.${treeName},
children: node.children
};
},
/** 查询${functionName}下拉树结构 */
getTreeselect() {
list${BusinessName}().then(response => {
this.${businessName}Options = [];
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] };
data.children = this.handleTree(response.data, "${treeCode}", "${treeParentCode}");
this.${businessName}Options.push(data);
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
list${BusinessName}(queryParams.value).then(response => {
${businessName}List.value = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}");
loading.value = false;
});
}
/** 查询${functionName}下拉树结构 */
function getTreeselect() {
list${BusinessName}().then(response => {
${businessName}Options.value = [];
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] };
data.children = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}");
${businessName}Options.value.push(data);
});
}
// 取消按钮
function cancel() {
open.value = false;
reset();
}
// 表单重置
function reset() {
form.value = {
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
$column.javaField: []#if($foreach.count != $columns.size()),#end
$column.javaField: []#if($foreach.count != $columns.size()),#end
#else
$column.javaField: null#if($foreach.count != $columns.size()),#end
#end
#end
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
$column.javaField: null#if($foreach.count != $columns.size()),#end
#end
#end
};
proxy.resetForm("${businessName}Ref");
}
/** 搜索按钮操作 */
function handleQuery() {
getList();
}
/** 重置按钮操作 */
function resetQuery() {
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
this.daterange${AttrName} = [];
#end
#end
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
if (row != null && row.${treeCode}) {
this.form.${treeParentCode} = row.${treeCode};
} else {
this.form.${treeParentCode} = 0;
}
this.open = true;
this.title = "添加${functionName}";
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
if (row != null) {
this.form.${treeParentCode} = row.${treeParentCode};
}
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
this.form = response.data;
daterange${AttrName}.value = [];
#end
#end
proxy.resetForm("queryRef");
handleQuery();
}
/** 新增按钮操作 */
function handleAdd(row) {
reset();
getTreeselect();
if (row != null && row.${treeCode}) {
form.value.${treeParentCode} = row.${treeCode};
} else {
form.value.${treeParentCode} = 0;
}
open.value = true;
title.value = "添加${functionName}";
}
/** 展开/折叠操作 */
function toggleExpandAll() {
refreshTable.value = false;
isExpandAll.value = !isExpandAll.value;
nextTick(() => {
refreshTable.value = true;
});
}
/** 修改按钮操作 */
async function handleUpdate(row) {
reset();
await getTreeselect();
if (row != null) {
form.value.${treeParentCode} = row.${treeParentCode};
}
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
form.value = response.data;
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
this.form.$column.javaField = this.form.${column.javaField}.split(",");
form.value.$column.javaField = form.value.${column.javaField}.split(",");
#end
#end
this.open = true;
this.title = "修改${functionName}";
});
},
/** 提交按钮 */
submitForm() {
this.#[[$]]#refs["form"].validate(valid => {
if (valid) {
open.value = true;
title.value = "修改${functionName}";
});
}
/** 提交按钮 */
function submitForm() {
proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => {
if (valid) {
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
this.form.$column.javaField = this.form.${column.javaField}.join(",");
#end
#end
if (this.form.${pkColumn.javaField} != null) {
update${BusinessName}(this.form).then(response => {
this.#[[$modal]]#.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
add${BusinessName}(this.form).then(response => {
this.#[[$modal]]#.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
return del${BusinessName}(row.${pkColumn.javaField});
}).then(() => {
this.getList();
this.#[[$modal]]#.msgSuccess("删除成功");
}).catch(() => {});
form.value.$column.javaField = form.value.${column.javaField}.join(",");
#end
#end
if (form.value.${pkColumn.javaField} != null) {
update${BusinessName}(form.value).then(response => {
proxy.#[[$modal]]#.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
add${BusinessName}(form.value).then(response => {
proxy.#[[$modal]]#.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
}
};
});
}
/** 删除按钮操作 */
function handleDelete(row) {
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
return del${BusinessName}(row.${pkColumn.javaField});
}).then(() => {
getList();
proxy.#[[$modal]]#.msgSuccess("删除成功");
}).catch(() => {});
}
getList();
</script>

480
lzbi-generator/src/main/resources/vm/vue/index.vue.vm

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
#foreach($column in $columns)
#if($column.query)
#set($dictType=$column.dictType)
@ -17,14 +17,14 @@
v-model="queryParams.${column.javaField}"
placeholder="请输入${comment}"
clearable
@keyup.enter.native="handleQuery"
@keyup.enter="handleQuery"
/>
</el-form-item>
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
<el-form-item label="${comment}" prop="${column.javaField}">
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
<el-option
v-for="dict in dict.type.${dictType}"
v-for="dict in ${dictType}"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -42,16 +42,15 @@
<el-date-picker clearable
v-model="queryParams.${column.javaField}"
type="date"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
<el-form-item label="${comment}">
<el-form-item label="${comment}" style="width: 308px">
<el-date-picker
v-model="daterange${AttrName}"
style="width: 240px"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
@ -62,8 +61,8 @@
#end
#end
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
@ -72,8 +71,7 @@
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
icon="Plus"
@click="handleAdd"
v-hasPermi="['${moduleName}:${businessName}:add']"
>新增</el-button>
@ -82,8 +80,7 @@
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['${moduleName}:${businessName}:edit']"
@ -93,8 +90,7 @@
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['${moduleName}:${businessName}:remove']"
@ -104,13 +100,12 @@
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
icon="Download"
@click="handleExport"
v-hasPermi="['${moduleName}:${businessName}:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
@ -127,23 +122,23 @@
<el-table-column label="${comment}" align="center" prop="${javaField}" />
#elseif($column.list && $column.htmlType == "datetime")
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
<template slot-scope="scope">
<template #default="scope">
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
#elseif($column.list && $column.htmlType == "imageUpload")
<el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
<template slot-scope="scope">
<template #default="scope">
<image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
</template>
</el-table-column>
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}">
<template slot-scope="scope">
<template #default="scope">
#if($column.htmlType == "checkbox")
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
#else
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
#end
</template>
</el-table-column>
@ -152,21 +147,9 @@
#end
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:remove']"
>删除</el-button>
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -174,14 +157,14 @@
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改${functionName}对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-dialog :title="title" v-model="open" width="60%" append-to-body :close-on-click-modal="false">
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
#foreach($column in $columns)
#set($field=$column.javaField)
#if($column.insert && !$column.pk)
@ -213,7 +196,7 @@
<el-form-item label="${comment}" prop="${field}">
<el-select v-model="form.${field}" placeholder="请选择${comment}">
<el-option
v-for="dict in dict.type.${dictType}"
v-for="dict in ${dictType}"
:key="dict.value"
:label="dict.label"
#if($column.javaType == "Integer" || $column.javaType == "Long")
@ -234,7 +217,7 @@
<el-form-item label="${comment}" prop="${field}">
<el-checkbox-group v-model="form.${field}">
<el-checkbox
v-for="dict in dict.type.${dictType}"
v-for="dict in ${dictType}"
:key="dict.value"
:label="dict.value">
{{dict.label}}
@ -251,7 +234,7 @@
<el-form-item label="${comment}" prop="${field}">
<el-radio-group v-model="form.${field}">
<el-radio
v-for="dict in dict.type.${dictType}"
v-for="dict in ${dictType}"
:key="dict.value"
#if($column.javaType == "Integer" || $column.javaType == "Long")
:label="parseInt(dict.value)"
@ -272,7 +255,7 @@
<el-date-picker clearable
v-model="form.${field}"
type="date"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
placeholder="请选择${comment}">
</el-date-picker>
</el-form-item>
@ -288,10 +271,10 @@
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd${subClassName}">添加</el-button>
<el-button type="primary" icon="Plus" @click="handleAdd${subClassName}">添加</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete${subClassName}">删除</el-button>
<el-button type="danger" icon="Delete" @click="handleDelete${subClassName}">删除</el-button>
</el-col>
</el-row>
<el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
@ -308,22 +291,27 @@
#if($column.pk || $javaField == ${subTableFkclassName})
#elseif($column.list && $column.htmlType == "input")
<el-table-column label="$comment" prop="${javaField}" width="150">
<template slot-scope="scope">
<template #default="scope">
<el-input v-model="scope.row.$javaField" placeholder="请输入$comment" />
</template>
</el-table-column>
#elseif($column.list && $column.htmlType == "datetime")
<el-table-column label="$comment" prop="${javaField}" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.$javaField" type="date" value-format="yyyy-MM-dd" placeholder="请选择$comment" />
<template #default="scope">
<el-date-picker clearable
v-model="scope.row.$javaField"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择$comment">
</el-date-picker>
</template>
</el-table-column>
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType)
<el-table-column label="$comment" prop="${javaField}" width="150">
<template slot-scope="scope">
<template #default="scope">
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
<el-option
v-for="dict in dict.type.$column.dictType"
v-for="dict in $column.dictType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -333,7 +321,7 @@
</el-table-column>
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType)
<el-table-column label="$comment" prop="${javaField}" width="150">
<template slot-scope="scope">
<template #default="scope">
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
<el-option label="请选择字典生成" value="" />
</el-select>
@ -344,72 +332,60 @@
</el-table>
#end
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
<script setup name="${BusinessName}">
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
export default {
name: "${BusinessName}",
const { proxy } = getCurrentInstance();
#if(${dicts} != '')
dicts: [${dicts}],
#end
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
#set($dictsNoSymbol=$dicts.replace("'", ""))
const { ${dictsNoSymbol} } = proxy.useDict(${dicts});
#end
const ${businessName}List = ref([]);
#if($table.sub)
// 子表选中数据
checked${subClassName}: [],
#end
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// ${functionName}表格数据
${businessName}List: [],
const ${subclassName}List = ref([]);
#end
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
#if($table.sub)
// ${subTable.functionName}表格数据
${subclassName}List: [],
const checked${subClassName} = ref([]);
#end
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
// $comment时间范围
daterange${AttrName}: [],
const daterange${AttrName} = ref([]);
#end
#end
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
#foreach ($column in $columns)
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
#foreach ($column in $columns)
#if($column.query)
$column.javaField: null#if($foreach.count != $columns.size()),#end
$column.javaField: null#if($foreach.count != $columns.size()),#end
#end
#end
},
// 表单参数
form: {},
// 表单校验
rules: {
#foreach ($column in $columns)
},
rules: {
#foreach ($column in $columns)
#if($column.required)
#set($parentheseIndex=$column.columnComment.indexOf("("))
#if($parentheseIndex != -1)
@ -417,186 +393,198 @@ export default {
#else
#set($comment=$column.columnComment)
#end
$column.javaField: [
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
]#if($foreach.count != $columns.size()),#end
$column.javaField: [
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
]#if($foreach.count != $columns.size()),#end
#end
#end
}
};
},
created() {
this.getList();
},
methods: {
/** 查询${functionName}列表 */
getList() {
this.loading = true;
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询${functionName}列表 */
function getList() {
loading.value = true;
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
this.queryParams.params = {};
queryParams.value.params = {};
#break
#end
#end
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0];
this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1];
}
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0];
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1];
}
#end
#end
list${BusinessName}(this.queryParams).then(response => {
this.${businessName}List = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
list${BusinessName}(queryParams.value).then(response => {
${businessName}List.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
// 取消按钮
function cancel() {
open.value = false;
reset();
}
// 表单重置
function reset() {
form.value = {
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
$column.javaField: []#if($foreach.count != $columns.size()),#end
$column.javaField: []#if($foreach.count != $columns.size()),#end
#else
$column.javaField: null#if($foreach.count != $columns.size()),#end
$column.javaField: null#if($foreach.count != $columns.size()),#end
#end
#end
};
};
#if($table.sub)
this.${subclassName}List = [];
#end
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
${subclassName}List.value = [];
#end
proxy.resetForm("${businessName}Ref");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
this.daterange${AttrName} = [];
#end
#end
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.${pkColumn.javaField})
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加${functionName}";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const ${pkColumn.javaField} = row.${pkColumn.javaField} || this.ids
get${BusinessName}(${pkColumn.javaField}).then(response => {
this.form = response.data;
daterange${AttrName}.value = [];
#end
#end
proxy.resetForm("queryRef");
handleQuery();
}
// 多选框选中数据
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.${pkColumn.javaField});
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加${functionName}";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value
get${BusinessName}(_${pkColumn.javaField}).then(response => {
form.value = response.data;
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
this.form.$column.javaField = this.form.${column.javaField}.split(",");
form.value.$column.javaField = form.value.${column.javaField}.split(",");
#end
#end
#if($table.sub)
this.${subclassName}List = response.data.${subclassName}List;
#end
this.open = true;
this.title = "修改${functionName}";
});
},
/** 提交按钮 */
submitForm() {
this.#[[$]]#refs["form"].validate(valid => {
if (valid) {
${subclassName}List.value = response.data.${subclassName}List;
#end
open.value = true;
title.value = "修改${functionName}";
});
}
/** 提交按钮 */
function submitForm() {
proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => {
if (valid) {
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
this.form.$column.javaField = this.form.${column.javaField}.join(",");
form.value.$column.javaField = form.value.${column.javaField}.join(",");
#end
#end
#if($table.sub)
this.form.${subclassName}List = this.${subclassName}List;
#end
if (this.form.${pkColumn.javaField} != null) {
update${BusinessName}(this.form).then(response => {
this.#[[$modal]]#.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
add${BusinessName}(this.form).then(response => {
this.#[[$modal]]#.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
return del${BusinessName}(${pkColumn.javaField}s);
}).then(() => {
this.getList();
this.#[[$modal]]#.msgSuccess("删除成功");
}).catch(() => {});
},
form.value.${subclassName}List = ${subclassName}List.value;
#end
if (form.value.${pkColumn.javaField} != null) {
update${BusinessName}(form.value).then(response => {
proxy.#[[$modal]]#.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
add${BusinessName}(form.value).then(response => {
proxy.#[[$modal]]#.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
return del${BusinessName}(_${pkColumn.javaField}s);
}).then(() => {
getList();
proxy.#[[$modal]]#.msgSuccess("删除成功");
}).catch(() => {});
}
#if($table.sub)
/** ${subTable.functionName}序号 */
row${subClassName}Index({ row, rowIndex }) {
row.index = rowIndex + 1;
},
/** ${subTable.functionName}添加按钮操作 */
handleAdd${subClassName}() {
let obj = {};
/** ${subTable.functionName}序号 */
function row${subClassName}Index({ row, rowIndex }) {
row.index = rowIndex + 1;
}
/** ${subTable.functionName}添加按钮操作 */
function handleAdd${subClassName}() {
let obj = {};
#foreach($column in $subTable.columns)
#if($column.pk || $column.javaField == ${subTableFkclassName})
#elseif($column.list && "" != $javaField)
obj.$column.javaField = "";
obj.$column.javaField = "";
#end
#end
this.${subclassName}List.push(obj);
},
/** ${subTable.functionName}删除按钮操作 */
handleDelete${subClassName}() {
if (this.checked${subClassName}.length == 0) {
this.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
} else {
const ${subclassName}List = this.${subclassName}List;
const checked${subClassName} = this.checked${subClassName};
this.${subclassName}List = ${subclassName}List.filter(function(item) {
return checked${subClassName}.indexOf(item.index) == -1
});
}
},
/** 复选框选中数据 */
handle${subClassName}SelectionChange(selection) {
this.checked${subClassName} = selection.map(item => item.index)
},
#end
/** 导出按钮操作 */
handleExport() {
this.download('${moduleName}/${businessName}/export', {
...this.queryParams
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
}
${subclassName}List.value.push(obj);
}
/** ${subTable.functionName}删除按钮操作 */
function handleDelete${subClassName}() {
if (checked${subClassName}.value.length == 0) {
proxy.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
} else {
const ${subclassName}s = ${subclassName}List.value;
const checked${subClassName}s = checked${subClassName}.value;
${subclassName}List.value = ${subclassName}s.filter(function(item) {
return checked${subClassName}s.indexOf(item.index) == -1
});
}
};
}
/** 复选框选中数据 */
function handle${subClassName}SelectionChange(selection) {
checked${subClassName}.value = selection.map(item => item.index)
}
#end
/** 导出按钮操作 */
function handleExport() {
proxy.download('${moduleName}/${businessName}/export', {
...queryParams.value
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
}
getList();
</script>

6
lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java

@ -153,14 +153,14 @@ public class DcBusiDataScreenMainController extends BaseController{
List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate);
JSONObject all=new JSONObject();
group.forEach(item->{
all.put(item.getCoallost(),item.getMonthAll());
all.put(item.getCoallost(),StringUtils.getfomatDouble(item.getMonthAll()));
all.put("unit",item.getTargetUnit());
});
JSONArray out=new JSONArray();
real.forEach(item->{
JSONObject tmp=new JSONObject();
tmp.put("name",item.getCompanyName());
tmp.put("value",item.getMonthAll());
tmp.put("value",StringUtils.getfomatDouble(item.getMonthAll()));
tmp.put("unit",item.getTargetUnit());
out.add(tmp);
});
@ -168,7 +168,7 @@ public class DcBusiDataScreenMainController extends BaseController{
self.forEach(item->{
JSONObject tmp=new JSONObject();
tmp.put("name",item.getCompanyName());
tmp.put("value",item.getMonthAll());
tmp.put("value",StringUtils.getfomatDouble(item.getMonthAll()));
tmp.put("unit",item.getTargetUnit());
in.add(tmp);
});

166
lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiTargetAdjustController.java

@ -1,132 +1,104 @@
package com.lzbi.bi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.core.page.TableDataInfo;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import com.lzbi.bi.domain.DcBusiTargetAdjust;
import com.lzbi.bi.service.DcBusiTargetAdjustService;
import com.lzbi.bi.service.IDcBusiTargetAdjustService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
* 资产指标调整单;(dc_busi_target_adjust)表控制层
* @author : zhousq
* @date : 2023-11-16
* 资产指标调整单Controller
*
* @author zhousq
* @date 2023-11-23
*/
@Api(tags = "资产指标调整单对象功能接口")
@RestController
@RequestMapping("/assetData/dcBusiTargetAdjust")
public class DcBusiTargetAdjustController extends BaseController{
@RequestMapping("/asset/AssetTargetAdjustBill")
public class DcBusiTargetAdjustController extends BaseController
{
@Autowired
private DcBusiTargetAdjustService dcBusiTargetAdjustService;
private IDcBusiTargetAdjustService dcBusiTargetAdjustService;
/**
* 分页列表查询
* @return 分页数据
* 查询资产指标调整单列表
*/
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetAdjustBill:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiTargetAdjust dcBusiTargetAdjust)
{ startPage();
List<DcBusiTargetAdjust> list = dcBusiTargetAdjustService.selectByVo(dcBusiTargetAdjust);
{
startPage();
List<DcBusiTargetAdjust> list = dcBusiTargetAdjustService.selectDcBusiTargetAdjustList(dcBusiTargetAdjust);
return getDataTable(list);
}
/**
*根据ID获取详情
*@param id
@return DcBusiTargetAdjust 没有反馈空
*/
@ApiOperation("根据ID获取资产指标调整单详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(dcBusiTargetAdjustService.getById(id));
}
/**
* 资产指标调整单-新增
*@param dcBusiTargetAdjust
*@return DcBusiTargetAdjust
*/
@ApiOperation("新增资产指标调整单一条数据")
@Log(title = "", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Valid @RequestBody DcBusiTargetAdjust dcBusiTargetAdjust) {
//BeanValidators.validateWithException(validator, dcBusiTargetAdjust);
dcBusiTargetAdjust.setCreatedBy(getUsername());
dcBusiTargetAdjust.setCreatedTime(DateUtils.getNowDate());
dcBusiTargetAdjust.setTenantId("0");
dcBusiTargetAdjust.setUpdatedBy(getUsername());
dcBusiTargetAdjust.setUpdatedTime(DateUtils.getNowDate());
return toAjax(dcBusiTargetAdjustService.insertByVo(dcBusiTargetAdjust));
}
/**
* 资产指标调整单-修改
*@param dcBusiTargetAdjust
*@return DcBusiTargetAdjust
* 导出资产指标调整单列表
*/
@ApiOperation("资产指标调整单修改")
@Log(title = "", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Valid @RequestBody DcBusiTargetAdjust dcBusiTargetAdjust) {
//BeanValidators.validateWithException(validator, dcBusiTargetAdjust);
dcBusiTargetAdjust.setUpdatedBy(getUsername());
dcBusiTargetAdjust.setUpdatedTime(DateUtils.getNowDate());
return toAjax(dcBusiTargetAdjustService.updateById(dcBusiTargetAdjust));
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetAdjustBill:export')")
@Log(title = "资产指标调整单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcBusiTargetAdjust dcBusiTargetAdjust)
{
List<DcBusiTargetAdjust> list = dcBusiTargetAdjustService.selectDcBusiTargetAdjustList(dcBusiTargetAdjust);
ExcelUtil<DcBusiTargetAdjust> util = new ExcelUtil<DcBusiTargetAdjust>(DcBusiTargetAdjust.class);
util.exportExcel(response, list, "资产指标调整单数据");
}
/**
* 通过ID删除资产指标调整单
* @param
* @return 成功1 失败0
* 获取资产指标调整单详细信息
*/
@ApiOperation("根据ID删除资产指标调整单")
@Log(title = "单一资产指标调整单", businessType = BusinessType.DELETE)
@DeleteMapping("/id/{id}")
public AjaxResult batchRemove(@PathVariable Long id) {
DcBusiTargetAdjust dcBusiTargetAdjust=new DcBusiTargetAdjust();
dcBusiTargetAdjust.setId(id);
return toAjax(dcBusiTargetAdjustService.removeById( dcBusiTargetAdjust));
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetAdjustBill:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiTargetAdjustService.selectDcBusiTargetAdjustById(id));
}
/**
* 批量删除资产指标调整单
* @param ids 数组
* @return 删除的条数
* 新增资产指标调整单
*/
@ApiOperation("批量删除资产指标调整单")
@Log(title = "批量删除资产指标调整单", businessType = BusinessType.DELETE)
@DeleteMapping("/ids/{ids}")
public AjaxResult batchRemove(@PathVariable Long[] ids) {
List<Long> collect = Arrays.stream(ids).collect(Collectors.toList());
return toAjax(dcBusiTargetAdjustService.removeBatchByIds(collect));
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetAdjustBill:add')")
@Log(title = "资产指标调整单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiTargetAdjust dcBusiTargetAdjust)
{
return toAjax(dcBusiTargetAdjustService.insertDcBusiTargetAdjust(dcBusiTargetAdjust));
}
/**
* 通过模版导入"资产指标调整单数据
*
* 修改资产指标调整单
*/
@ApiOperation("资产指标调整单数据导入")
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<DcBusiTargetAdjust> util = new ExcelUtil<>(DcBusiTargetAdjust.class);
util.importTemplateExcel(response, "资产指标调整单导出数据");
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetAdjustBill:edit')")
@Log(title = "资产指标调整单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiTargetAdjust dcBusiTargetAdjust)
{
return toAjax(dcBusiTargetAdjustService.updateDcBusiTargetAdjust(dcBusiTargetAdjust));
}
/**
* "资产指标调整单数据导出功能
* 删除资产指标调整单
*/
@ApiOperation("导出资产指标调整单数据")
@PostMapping("/export")
public void export(HttpServletResponse response, DcBusiTargetAdjust dcBusiTargetAdjust) {
QueryWrapper<DcBusiTargetAdjust> queryWrapper = new QueryWrapper<>();
List<DcBusiTargetAdjust> list = dcBusiTargetAdjustService.list(queryWrapper);
ExcelUtil<DcBusiTargetAdjust> util = new ExcelUtil<>(DcBusiTargetAdjust.class);
util.exportExcel(response, list, "导出的资产指标调整单数据");
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetAdjustBill:remove')")
@Log(title = "资产指标调整单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiTargetAdjustService.deleteDcBusiTargetAdjustByIds(ids));
}
}

166
lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiTargetDraftController.java

@ -1,132 +1,104 @@
package com.lzbi.bi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.core.page.TableDataInfo;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import com.lzbi.bi.domain.DcBusiTargetDraft;
import com.lzbi.bi.service.DcBusiTargetDraftService;
import com.lzbi.bi.service.IDcBusiTargetDraftService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
* 指标数据底稿表;(dc_busi_target_draft)表控制层
* @author : zhousq
* @date : 2023-11-16
* 指标数据底稿Controller
*
* @author zhousq
* @date 2023-11-23
*/
@Api(tags = "指标数据底稿表对象功能接口")
@RestController
@RequestMapping("/assetData/dcBusiTargetDraft")
public class DcBusiTargetDraftController extends BaseController{
@RequestMapping("/asset/AssetTargetdraft")
public class DcBusiTargetDraftController extends BaseController
{
@Autowired
private DcBusiTargetDraftService dcBusiTargetDraftService;
private IDcBusiTargetDraftService dcBusiTargetDraftService;
/**
* 分页列表查询
* @return 分页数据
* 查询指标数据底稿列表
*/
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetdraft:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiTargetDraft dcBusiTargetDraft)
{ startPage();
List<DcBusiTargetDraft> list = dcBusiTargetDraftService.selectByVo(dcBusiTargetDraft);
{
startPage();
List<DcBusiTargetDraft> list = dcBusiTargetDraftService.selectDcBusiTargetDraftList(dcBusiTargetDraft);
return getDataTable(list);
}
/**
*根据ID获取详情
*@param id
@return DcBusiTargetDraft 没有反馈空
*/
@ApiOperation("根据ID获取指标数据底稿表详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(dcBusiTargetDraftService.getById(id));
}
/**
* 指标数据底稿表-新增
*@param dcBusiTargetDraft
*@return DcBusiTargetDraft
*/
@ApiOperation("新增指标数据底稿表一条数据")
@Log(title = "", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Valid @RequestBody DcBusiTargetDraft dcBusiTargetDraft) {
//BeanValidators.validateWithException(validator, dcBusiTargetDraft);
dcBusiTargetDraft.setCreatedBy(getUsername());
dcBusiTargetDraft.setCreatedTime(DateUtils.getNowDate());
dcBusiTargetDraft.setTenantId("0");
dcBusiTargetDraft.setUpdatedBy(getUsername());
dcBusiTargetDraft.setUpdatedTime(DateUtils.getNowDate());
return toAjax(dcBusiTargetDraftService.insertByVo(dcBusiTargetDraft));
}
/**
* 指标数据底稿表-修改
*@param dcBusiTargetDraft
*@return DcBusiTargetDraft
* 导出指标数据底稿列表
*/
@ApiOperation("指标数据底稿表修改")
@Log(title = "", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Valid @RequestBody DcBusiTargetDraft dcBusiTargetDraft) {
//BeanValidators.validateWithException(validator, dcBusiTargetDraft);
dcBusiTargetDraft.setUpdatedBy(getUsername());
dcBusiTargetDraft.setUpdatedTime(DateUtils.getNowDate());
return toAjax(dcBusiTargetDraftService.updateById(dcBusiTargetDraft));
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetdraft:export')")
@Log(title = "指标数据底稿", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcBusiTargetDraft dcBusiTargetDraft)
{
List<DcBusiTargetDraft> list = dcBusiTargetDraftService.selectDcBusiTargetDraftList(dcBusiTargetDraft);
ExcelUtil<DcBusiTargetDraft> util = new ExcelUtil<DcBusiTargetDraft>(DcBusiTargetDraft.class);
util.exportExcel(response, list, "指标数据底稿数据");
}
/**
* 通过ID删除指标数据底稿表
* @param
* @return 成功1 失败0
* 获取指标数据底稿详细信息
*/
@ApiOperation("根据ID删除指标数据底稿表")
@Log(title = "单一指标数据底稿表", businessType = BusinessType.DELETE)
@DeleteMapping("/id/{id}")
public AjaxResult batchRemove(@PathVariable Long id) {
DcBusiTargetDraft dcBusiTargetDraft=new DcBusiTargetDraft();
dcBusiTargetDraft.setId(id);
return toAjax(dcBusiTargetDraftService.removeById( dcBusiTargetDraft));
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetdraft:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiTargetDraftService.selectDcBusiTargetDraftById(id));
}
/**
* 批量删除指标数据底稿表
* @param ids 数组
* @return 删除的条数
* 新增指标数据底稿
*/
@ApiOperation("批量删除指标数据底稿表")
@Log(title = "批量删除指标数据底稿", businessType = BusinessType.DELETE)
@DeleteMapping("/ids/{ids}")
public AjaxResult batchRemove(@PathVariable Long[] ids) {
List<Long> collect = Arrays.stream(ids).collect(Collectors.toList());
return toAjax(dcBusiTargetDraftService.removeBatchByIds(collect));
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetdraft:add')")
@Log(title = "指标数据底稿", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiTargetDraft dcBusiTargetDraft)
{
return toAjax(dcBusiTargetDraftService.insertDcBusiTargetDraft(dcBusiTargetDraft));
}
/**
* 通过模版导入"指标数据底稿表数据
*
* 修改指标数据底稿
*/
@ApiOperation("指标数据底稿表数据导入")
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<DcBusiTargetDraft> util = new ExcelUtil<>(DcBusiTargetDraft.class);
util.importTemplateExcel(response, "指标数据底稿表导出数据");
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetdraft:edit')")
@Log(title = "指标数据底稿", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiTargetDraft dcBusiTargetDraft)
{
return toAjax(dcBusiTargetDraftService.updateDcBusiTargetDraft(dcBusiTargetDraft));
}
/**
* "指标数据底稿表数据导出功能
* 删除指标数据底稿
*/
@ApiOperation("导出指标数据底稿表数据")
@PostMapping("/export")
public void export(HttpServletResponse response, DcBusiTargetDraft dcBusiTargetDraft) {
QueryWrapper<DcBusiTargetDraft> queryWrapper = new QueryWrapper<>();
List<DcBusiTargetDraft> list = dcBusiTargetDraftService.list(queryWrapper);
ExcelUtil<DcBusiTargetDraft> util = new ExcelUtil<>(DcBusiTargetDraft.class);
util.exportExcel(response, list, "导出的指标数据底稿表数据");
@PreAuthorize("@ss.hasPermi('assetData:AssetTargetdraft:remove')")
@Log(title = "指标数据底稿", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiTargetDraftService.deleteDcBusiTargetDraftByIds(ids));
}
}

323
lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiTargetAdjust.java

@ -1,65 +1,296 @@
package com.lzbi.bi.domain;
import com.lzbi.common.core.domain.BaseEntity;
import com.lzbi.module.base.BaseModuleEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lzbi.common.annotation.Excel;
import com.lzbi.common.core.domain.BaseEntity;
/**
* 资产指标调整单;
* @author : zhousq
* @date : 2023-11-16
* 资产指标调整单对象 dc_busi_target_adjust
*
* @author zhousq
* @date 2023-11-23
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "资产指标调整单",description = "")
@TableName("dc_busi_target_adjust")
public class DcBusiTargetAdjust extends BaseModuleEntity {
public class DcBusiTargetAdjust extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 租户号 */
@Excel(name = "租户号")
private String tenantId;
/** 乐观锁 */
@Excel(name = "乐观锁")
private Long REVISION;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
/** 更新人 */
@Excel(name = "更新人")
private String updatedBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedTime;
/** 删除人 */
@Excel(name = "删除人")
private String deleteBy;
/** 删除时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date deleteTime;
/** 单据号 */
@ApiModelProperty(name = "单据号",notes = "")
private String billSerial ;
@Excel(name = "单据号")
private String billSerial;
/** 单据类别 */
@ApiModelProperty(name = "单据类别",notes = "")
private String biilType ;
@Excel(name = "单据类别")
private String biilType;
/** 指标编码 */
@ApiModelProperty(name = "指标编码",notes = "")
private String targetCode ;
@Excel(name = "指标编码")
private String targetCode;
/** 资产ID */
@ApiModelProperty(name = "资产ID",notes = "")
private Integer assetId ;
@Excel(name = "资产ID")
private Long assetId;
/** 原始值 */
@ApiModelProperty(name = "原始值",notes = "")
private Double valOrginal ;
@Excel(name = "原始值")
private BigDecimal valOrginal;
/** 调整值 */
@ApiModelProperty(name = "调整值",notes = "")
private Double valAdjust ;
@Excel(name = "调整值")
private BigDecimal valAdjust;
/** 结果值 */
@ApiModelProperty(name = "结果值",notes = "")
private Double valResult ;
@Excel(name = "结果值")
private BigDecimal valResult;
/** 主键 */
@ApiModelProperty(name = "主键",notes = "")
@TableId
private long id;
private Long id;
/** 调整目标日期 */
@ApiModelProperty(name = "调整目标日期",notes = "")
private Date dateAdjust ;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "调整目标日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date dateAdjust;
/** 调整目标时间 */
@ApiModelProperty(name = "调整目标时间",notes = "")
private String hourAdjust ;
@Excel(name = "调整目标时间")
private String hourAdjust;
/** 调整目标日期字符串 */
@ApiModelProperty(name = "调整目标日期字符串",notes = "")
private String dateAdjustStr ;
@Excel(name = "调整目标日期字符串")
private String dateAdjustStr;
public void setTenantId(String tenantId)
{
this.tenantId = tenantId;
}
public String getTenantId()
{
return tenantId;
}
public void setREVISION(Long REVISION)
{
this.REVISION = REVISION;
}
public Long getREVISION()
{
return REVISION;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
public void setUpdatedBy(String updatedBy)
{
this.updatedBy = updatedBy;
}
public String getUpdatedBy()
{
return updatedBy;
}
public void setUpdatedTime(Date updatedTime)
{
this.updatedTime = updatedTime;
}
public Date getUpdatedTime()
{
return updatedTime;
}
public void setDeleteBy(String deleteBy)
{
this.deleteBy = deleteBy;
}
public String getDeleteBy()
{
return deleteBy;
}
public void setDeleteTime(Date deleteTime)
{
this.deleteTime = deleteTime;
}
public Date getDeleteTime()
{
return deleteTime;
}
public void setBillSerial(String billSerial)
{
this.billSerial = billSerial;
}
public String getBillSerial()
{
return billSerial;
}
public void setBiilType(String biilType)
{
this.biilType = biilType;
}
public String getBiilType()
{
return biilType;
}
public void setTargetCode(String targetCode)
{
this.targetCode = targetCode;
}
public String getTargetCode()
{
return targetCode;
}
public void setAssetId(Long assetId)
{
this.assetId = assetId;
}
public Long getAssetId()
{
return assetId;
}
public void setValOrginal(BigDecimal valOrginal)
{
this.valOrginal = valOrginal;
}
public BigDecimal getValOrginal()
{
return valOrginal;
}
public void setValAdjust(BigDecimal valAdjust)
{
this.valAdjust = valAdjust;
}
public BigDecimal getValAdjust()
{
return valAdjust;
}
public void setValResult(BigDecimal valResult)
{
this.valResult = valResult;
}
public BigDecimal getValResult()
{
return valResult;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setDateAdjust(Date dateAdjust)
{
this.dateAdjust = dateAdjust;
}
public Date getDateAdjust()
{
return dateAdjust;
}
public void setHourAdjust(String hourAdjust)
{
this.hourAdjust = hourAdjust;
}
public String getHourAdjust()
{
return hourAdjust;
}
public void setDateAdjustStr(String dateAdjustStr)
{
this.dateAdjustStr = dateAdjustStr;
}
public String getDateAdjustStr()
{
return dateAdjustStr;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("tenantId", getTenantId())
.append("REVISION", getREVISION())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("deleteBy", getDeleteBy())
.append("deleteTime", getDeleteTime())
.append("billSerial", getBillSerial())
.append("biilType", getBiilType())
.append("targetCode", getTargetCode())
.append("assetId", getAssetId())
.append("valOrginal", getValOrginal())
.append("valAdjust", getValAdjust())
.append("valResult", getValResult())
.append("id", getId())
.append("dateAdjust", getDateAdjust())
.append("hourAdjust", getHourAdjust())
.append("dateAdjustStr", getDateAdjustStr())
.toString();
}
}

783
lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiTargetDraft.java

@ -1,156 +1,729 @@
package com.lzbi.bi.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.lzbi.module.base.BaseModuleEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lzbi.common.annotation.Excel;
import com.lzbi.common.core.domain.BaseEntity;
/**
* 指标数据底稿表;
* @author : zhousq
* @date : 2023-11-16
* 指标数据底稿对象 dc_busi_target_draft
*
* @author zhousq
* @date 2023-11-23
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "指标数据底稿表",description = "")
@TableName("dc_busi_target_draft")
public class DcBusiTargetDraft extends BaseModuleEntity{
public class DcBusiTargetDraft extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 租户号 */
@Excel(name = "租户号")
private String tenantId;
/** 乐观锁 */
@Excel(name = "乐观锁")
private Long REVISION;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
/** 更新人 */
@Excel(name = "更新人")
private String updatedBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedTime;
/** 删除人 */
@Excel(name = "删除人")
private String deleteBy;
/** 删除时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date deleteTime;
/** 主键 */
@ApiModelProperty(name = "主键",notes = "")
@TableId
private long id;
private Long id;
/** 指标主键 */
@ApiModelProperty(name = "指标主键",notes = "")
private Integer targetId ;
@Excel(name = "指标主键")
private Long targetId;
/** 指标编码 */
@ApiModelProperty(name = "指标编码",notes = "")
private String targetCode ;
@Excel(name = "指标编码")
private String targetCode;
/** 年份 */
@ApiModelProperty(name = "年份",notes = "")
private String countYear ;
@Excel(name = "年份")
private String countYear;
/** 月份 */
@ApiModelProperty(name = "月份",notes = "")
private String countMonth ;
@Excel(name = "月份")
private String countMonth;
/** 日 */
@ApiModelProperty(name = "日",notes = "")
private String countDay ;
@Excel(name = "日")
private String countDay;
/** 1时;[00:00:00,00:59:59] */
@ApiModelProperty(name = "1时",notes = "[00:00:00,00:59:59]")
private Double val01 ;
@Excel(name = "1时;[00:00:00,00:59:59]")
private BigDecimal val01;
/** 2时;[01:00:00,01:59:59] */
@ApiModelProperty(name = "2时",notes = "[01:00:00,01:59:59]")
private Double val02 ;
@Excel(name = "2时;[01:00:00,01:59:59]")
private BigDecimal val02;
/** 3时;[02:00:00,02:59:59] */
@ApiModelProperty(name = "3时",notes = "[02:00:00,02:59:59]")
private Double val03 ;
@Excel(name = "3时;[02:00:00,02:59:59]")
private BigDecimal val03;
/** 4时 */
@ApiModelProperty(name = "4时",notes = "")
private Double val04 ;
@Excel(name = "4时")
private BigDecimal val04;
/** 5时 */
@ApiModelProperty(name = "5时",notes = "")
private Double val05 ;
@Excel(name = "5时")
private BigDecimal val05;
/** 6时 */
@ApiModelProperty(name = "6时",notes = "")
private Double val06 ;
@Excel(name = "6时")
private BigDecimal val06;
/** 7时 */
@ApiModelProperty(name = "7时",notes = "")
private Double val07 ;
@Excel(name = "7时")
private BigDecimal val07;
/** 8时 */
@ApiModelProperty(name = "8时",notes = "")
private Double val08 ;
@Excel(name = "8时")
private BigDecimal val08;
/** 9时 */
@ApiModelProperty(name = "9时",notes = "")
private Double val09 ;
@Excel(name = "9时")
private BigDecimal val09;
/** 10时 */
@ApiModelProperty(name = "10时",notes = "")
private Double val10 ;
@Excel(name = "10时")
private BigDecimal val10;
/** 11时 */
@ApiModelProperty(name = "11时",notes = "")
private Double val11 ;
@Excel(name = "11时")
private BigDecimal val11;
/** 12时 */
@ApiModelProperty(name = "12时",notes = "")
private Double val12 ;
@Excel(name = "12时")
private BigDecimal val12;
/** 13时 */
@ApiModelProperty(name = "13时",notes = "")
private Double val13 ;
@Excel(name = "13时")
private BigDecimal val13;
/** 14时 */
@ApiModelProperty(name = "14时",notes = "")
private Double val14 ;
@Excel(name = "14时")
private BigDecimal val14;
/** 15时 */
@ApiModelProperty(name = "15时",notes = "")
private Double val15 ;
@Excel(name = "15时")
private BigDecimal val15;
/** 16时 */
@ApiModelProperty(name = "16时",notes = "")
private Double val16 ;
@Excel(name = "16时")
private BigDecimal val16;
/** 17时 */
@ApiModelProperty(name = "17时",notes = "")
private Double val17 ;
@Excel(name = "17时")
private BigDecimal val17;
/** 18时 */
@ApiModelProperty(name = "18时",notes = "")
private Double val18 ;
@Excel(name = "18时")
private BigDecimal val18;
/** 18时 */
@ApiModelProperty(name = "18时",notes = "")
private Double val19 ;
@Excel(name = "18时")
private BigDecimal val19;
/** 20时 */
@ApiModelProperty(name = "20时",notes = "")
private Double val20 ;
@Excel(name = "20时")
private BigDecimal val20;
/** 21时 */
@ApiModelProperty(name = "21时",notes = "")
private Double val21 ;
@Excel(name = "21时")
private BigDecimal val21;
/** 22时 */
@ApiModelProperty(name = "22时",notes = "")
private Double val22 ;
@Excel(name = "22时")
private BigDecimal val22;
/** 23时 */
@ApiModelProperty(name = "23时",notes = "")
private Double val23 ;
@Excel(name = "23时")
private BigDecimal val23;
/** 24时 */
@ApiModelProperty(name = "24时",notes = "")
private Double val24 ;
@Excel(name = "24时")
private BigDecimal val24;
/** 公司 */
@ApiModelProperty(name = "公司",notes = "")
private String companyCode ;
@Excel(name = "公司")
private String companyCode;
/** 公司名称 */
@ApiModelProperty(name = "公司名称",notes = "")
private String companyName ;
@Excel(name = "公司名称")
private String companyName;
/** 组织机构代码 */
@ApiModelProperty(name = "组织机构代码",notes = "")
private String orgCode ;
@Excel(name = "组织机构代码")
private String orgCode;
/** 组织机构名称 */
@ApiModelProperty(name = "组织机构名称",notes = "")
private String orgName ;
@Excel(name = "组织机构名称")
private String orgName;
/** 生产专业 */
@ApiModelProperty(name = "生产专业",notes = "")
private String workType ;
@Excel(name = "生产专业")
private String workType;
/** 统计单元名称 */
@ApiModelProperty(name = "统计单元名称",notes = "")
private String countUnitName ;
@Excel(name = "统计单元名称")
private String countUnitName;
/** 资产ID */
@ApiModelProperty(name = "资产ID",notes = "")
private Integer assetId ;
@Excel(name = "资产ID")
private Long assetId;
/** 上线 */
@ApiModelProperty(name = "上线",notes = "")
private Double valUpLimit ;
@Excel(name = "上线")
private BigDecimal valUpLimit;
/** 下线 */
@ApiModelProperty(name = "下线",notes = "")
private Double valDownLimit ;
@Excel(name = "下线")
private BigDecimal valDownLimit;
/** 均值 */
@ApiModelProperty(name = "均值",notes = "")
private Double valAvg ;
@Excel(name = "均值")
private BigDecimal valAvg;
/** 合值 */
@ApiModelProperty(name = "合值",notes = "")
private Double valTotal ;
@Excel(name = "合值")
private BigDecimal valTotal;
/** 积算 */
@ApiModelProperty(name = "积算",notes = "")
private Double valCompute ;
@Excel(name = "积算")
private BigDecimal valCompute;
public void setTenantId(String tenantId)
{
this.tenantId = tenantId;
}
public String getTenantId()
{
return tenantId;
}
public void setREVISION(Long REVISION)
{
this.REVISION = REVISION;
}
public Long getREVISION()
{
return REVISION;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
public void setUpdatedBy(String updatedBy)
{
this.updatedBy = updatedBy;
}
public String getUpdatedBy()
{
return updatedBy;
}
public void setUpdatedTime(Date updatedTime)
{
this.updatedTime = updatedTime;
}
public Date getUpdatedTime()
{
return updatedTime;
}
public void setDeleteBy(String deleteBy)
{
this.deleteBy = deleteBy;
}
public String getDeleteBy()
{
return deleteBy;
}
public void setDeleteTime(Date deleteTime)
{
this.deleteTime = deleteTime;
}
public Date getDeleteTime()
{
return deleteTime;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTargetId(Long targetId)
{
this.targetId = targetId;
}
public Long getTargetId()
{
return targetId;
}
public void setTargetCode(String targetCode)
{
this.targetCode = targetCode;
}
public String getTargetCode()
{
return targetCode;
}
public void setCountYear(String countYear)
{
this.countYear = countYear;
}
public String getCountYear()
{
return countYear;
}
public void setCountMonth(String countMonth)
{
this.countMonth = countMonth;
}
public String getCountMonth()
{
return countMonth;
}
public void setCountDay(String countDay)
{
this.countDay = countDay;
}
public String getCountDay()
{
return countDay;
}
public void setVal01(BigDecimal val01)
{
this.val01 = val01;
}
public BigDecimal getVal01()
{
return val01;
}
public void setVal02(BigDecimal val02)
{
this.val02 = val02;
}
public BigDecimal getVal02()
{
return val02;
}
public void setVal03(BigDecimal val03)
{
this.val03 = val03;
}
public BigDecimal getVal03()
{
return val03;
}
public void setVal04(BigDecimal val04)
{
this.val04 = val04;
}
public BigDecimal getVal04()
{
return val04;
}
public void setVal05(BigDecimal val05)
{
this.val05 = val05;
}
public BigDecimal getVal05()
{
return val05;
}
public void setVal06(BigDecimal val06)
{
this.val06 = val06;
}
public BigDecimal getVal06()
{
return val06;
}
public void setVal07(BigDecimal val07)
{
this.val07 = val07;
}
public BigDecimal getVal07()
{
return val07;
}
public void setVal08(BigDecimal val08)
{
this.val08 = val08;
}
public BigDecimal getVal08()
{
return val08;
}
public void setVal09(BigDecimal val09)
{
this.val09 = val09;
}
public BigDecimal getVal09()
{
return val09;
}
public void setVal10(BigDecimal val10)
{
this.val10 = val10;
}
public BigDecimal getVal10()
{
return val10;
}
public void setVal11(BigDecimal val11)
{
this.val11 = val11;
}
public BigDecimal getVal11()
{
return val11;
}
public void setVal12(BigDecimal val12)
{
this.val12 = val12;
}
public BigDecimal getVal12()
{
return val12;
}
public void setVal13(BigDecimal val13)
{
this.val13 = val13;
}
public BigDecimal getVal13()
{
return val13;
}
public void setVal14(BigDecimal val14)
{
this.val14 = val14;
}
public BigDecimal getVal14()
{
return val14;
}
public void setVal15(BigDecimal val15)
{
this.val15 = val15;
}
public BigDecimal getVal15()
{
return val15;
}
public void setVal16(BigDecimal val16)
{
this.val16 = val16;
}
public BigDecimal getVal16()
{
return val16;
}
public void setVal17(BigDecimal val17)
{
this.val17 = val17;
}
public BigDecimal getVal17()
{
return val17;
}
public void setVal18(BigDecimal val18)
{
this.val18 = val18;
}
public BigDecimal getVal18()
{
return val18;
}
public void setVal19(BigDecimal val19)
{
this.val19 = val19;
}
public BigDecimal getVal19()
{
return val19;
}
public void setVal20(BigDecimal val20)
{
this.val20 = val20;
}
public BigDecimal getVal20()
{
return val20;
}
public void setVal21(BigDecimal val21)
{
this.val21 = val21;
}
public BigDecimal getVal21()
{
return val21;
}
public void setVal22(BigDecimal val22)
{
this.val22 = val22;
}
public BigDecimal getVal22()
{
return val22;
}
public void setVal23(BigDecimal val23)
{
this.val23 = val23;
}
public BigDecimal getVal23()
{
return val23;
}
public void setVal24(BigDecimal val24)
{
this.val24 = val24;
}
public BigDecimal getVal24()
{
return val24;
}
public void setCompanyCode(String companyCode)
{
this.companyCode = companyCode;
}
public String getCompanyCode()
{
return companyCode;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
public String getCompanyName()
{
return companyName;
}
public void setOrgCode(String orgCode)
{
this.orgCode = orgCode;
}
public String getOrgCode()
{
return orgCode;
}
public void setOrgName(String orgName)
{
this.orgName = orgName;
}
public String getOrgName()
{
return orgName;
}
public void setWorkType(String workType)
{
this.workType = workType;
}
public String getWorkType()
{
return workType;
}
public void setCountUnitName(String countUnitName)
{
this.countUnitName = countUnitName;
}
public String getCountUnitName()
{
return countUnitName;
}
public void setAssetId(Long assetId)
{
this.assetId = assetId;
}
public Long getAssetId()
{
return assetId;
}
public void setValUpLimit(BigDecimal valUpLimit)
{
this.valUpLimit = valUpLimit;
}
public BigDecimal getValUpLimit()
{
return valUpLimit;
}
public void setValDownLimit(BigDecimal valDownLimit)
{
this.valDownLimit = valDownLimit;
}
public BigDecimal getValDownLimit()
{
return valDownLimit;
}
public void setValAvg(BigDecimal valAvg)
{
this.valAvg = valAvg;
}
public BigDecimal getValAvg()
{
return valAvg;
}
public void setValTotal(BigDecimal valTotal)
{
this.valTotal = valTotal;
}
public BigDecimal getValTotal()
{
return valTotal;
}
public void setValCompute(BigDecimal valCompute)
{
this.valCompute = valCompute;
}
public BigDecimal getValCompute()
{
return valCompute;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("tenantId", getTenantId())
.append("REVISION", getREVISION())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("deleteBy", getDeleteBy())
.append("deleteTime", getDeleteTime())
.append("id", getId())
.append("targetId", getTargetId())
.append("targetCode", getTargetCode())
.append("countYear", getCountYear())
.append("countMonth", getCountMonth())
.append("countDay", getCountDay())
.append("val01", getVal01())
.append("val02", getVal02())
.append("val03", getVal03())
.append("val04", getVal04())
.append("val05", getVal05())
.append("val06", getVal06())
.append("val07", getVal07())
.append("val08", getVal08())
.append("val09", getVal09())
.append("val10", getVal10())
.append("val11", getVal11())
.append("val12", getVal12())
.append("val13", getVal13())
.append("val14", getVal14())
.append("val15", getVal15())
.append("val16", getVal16())
.append("val17", getVal17())
.append("val18", getVal18())
.append("val19", getVal19())
.append("val20", getVal20())
.append("val21", getVal21())
.append("val22", getVal22())
.append("val23", getVal23())
.append("val24", getVal24())
.append("companyCode", getCompanyCode())
.append("companyName", getCompanyName())
.append("orgCode", getOrgCode())
.append("orgName", getOrgName())
.append("workType", getWorkType())
.append("countUnitName", getCountUnitName())
.append("assetId", getAssetId())
.append("valUpLimit", getValUpLimit())
.append("valDownLimit", getValDownLimit())
.append("valAvg", getValAvg())
.append("valTotal", getValTotal())
.append("valCompute", getValCompute())
.toString();
}
}

64
lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiTargetAdjustMapper.java

@ -1,17 +1,61 @@
package com.lzbi.bi.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.bi.domain.DcBusiTargetAdjust;
import java.util.List;
import com.lzbi.bi.domain.DcBusiTargetAdjust;
/**
* 资产指标调整单;(dc_busi_target_adjust)表数据库访问层
* @author : zhousq
* @date : 2023-11-16
* 资产指标调整单Mapper接口
*
* @author zhousq
* @date 2023-11-23
*/
@InterceptorIgnore(tenantLine = "true")
public interface DcBusiTargetAdjustMapper extends BaseMapper<DcBusiTargetAdjust>{
List<DcBusiTargetAdjust> selectByVo( DcBusiTargetAdjust beanVo);
int insertByVo( DcBusiTargetAdjust beanVo);
public interface DcBusiTargetAdjustMapper
{
/**
* 查询资产指标调整单
*
* @param id 资产指标调整单主键
* @return 资产指标调整单
*/
public DcBusiTargetAdjust selectDcBusiTargetAdjustById(Long id);
/**
* 查询资产指标调整单列表
*
* @param dcBusiTargetAdjust 资产指标调整单
* @return 资产指标调整单集合
*/
public List<DcBusiTargetAdjust> selectDcBusiTargetAdjustList(DcBusiTargetAdjust dcBusiTargetAdjust);
/**
* 新增资产指标调整单
*
* @param dcBusiTargetAdjust 资产指标调整单
* @return 结果
*/
public int insertDcBusiTargetAdjust(DcBusiTargetAdjust dcBusiTargetAdjust);
/**
* 修改资产指标调整单
*
* @param dcBusiTargetAdjust 资产指标调整单
* @return 结果
*/
public int updateDcBusiTargetAdjust(DcBusiTargetAdjust dcBusiTargetAdjust);
/**
* 删除资产指标调整单
*
* @param id 资产指标调整单主键
* @return 结果
*/
public int deleteDcBusiTargetAdjustById(Long id);
/**
* 批量删除资产指标调整单
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetAdjustByIds(Long[] ids);
}

64
lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiTargetDraftMapper.java

@ -1,17 +1,61 @@
package com.lzbi.bi.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.bi.domain.DcBusiTargetDraft;
import java.util.List;
import com.lzbi.bi.domain.DcBusiTargetDraft;
/**
* 指标数据底稿表;(dc_busi_target_draft)表数据库访问层
* @author : zhousq
* @date : 2023-11-16
* 指标数据底稿Mapper接口
*
* @author zhousq
* @date 2023-11-23
*/
@InterceptorIgnore(tenantLine = "true")
public interface DcBusiTargetDraftMapper extends BaseMapper<DcBusiTargetDraft>{
List<DcBusiTargetDraft> selectByVo( DcBusiTargetDraft beanVo);
int insertByVo( DcBusiTargetDraft beanVo);
public interface DcBusiTargetDraftMapper
{
/**
* 查询指标数据底稿
*
* @param id 指标数据底稿主键
* @return 指标数据底稿
*/
public DcBusiTargetDraft selectDcBusiTargetDraftById(Long id);
/**
* 查询指标数据底稿列表
*
* @param dcBusiTargetDraft 指标数据底稿
* @return 指标数据底稿集合
*/
public List<DcBusiTargetDraft> selectDcBusiTargetDraftList(DcBusiTargetDraft dcBusiTargetDraft);
/**
* 新增指标数据底稿
*
* @param dcBusiTargetDraft 指标数据底稿
* @return 结果
*/
public int insertDcBusiTargetDraft(DcBusiTargetDraft dcBusiTargetDraft);
/**
* 修改指标数据底稿
*
* @param dcBusiTargetDraft 指标数据底稿
* @return 结果
*/
public int updateDcBusiTargetDraft(DcBusiTargetDraft dcBusiTargetDraft);
/**
* 删除指标数据底稿
*
* @param id 指标数据底稿主键
* @return 结果
*/
public int deleteDcBusiTargetDraftById(Long id);
/**
* 批量删除指标数据底稿
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetDraftByIds(Long[] ids);
}

2
lzbi-module/src/main/resources/mapper/DcBusiTargetAdjustMapper.xml

@ -64,7 +64,7 @@
id,
date_adjust,
hour_adjust,
date_adjust_str,
date_adjust_str
from dc_busi_target_adjust
</sql>
<select id="selectByVo" resultMap="rmDcBusiTargetAdjust" parameterType="com.lzbi.bi.domain.DcBusiTargetAdjust">

Loading…
Cancel
Save