From 83cb560f6aa51fea33d18ba97319c78ef4577da0 Mon Sep 17 00:00:00 2001 From: purple <purple_lihe@163.com> Date: Tue, 2 Jun 2020 19:42:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B9=B3=E5=8F=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/data/computeResidenceRentPrice.js | 7 + ruoyi-ui/src/api/data/lianJiaCommunity.js | 36 ++ .../src/api/data/ultimateOfficeBasePrice.js | 43 +- .../api/data/ultimateResidenceRentPrice.js | 36 ++ .../src/views/data/basis/LianJiaCommunity.vue | 430 ++++++++++++++++++ .../data/price/ComputeResidenceRentPrice.vue | 46 +- .../UltimateOfficeBasePrice.vue | 133 ++++-- ...ice.vue => UltimateResidenceRentPrice.vue} | 147 +++--- .../ruoyi/project/common/VueSelectModel.java | 32 ++ .../basis/controller/AdrDictController.java | 90 ++++ .../basis/domain/LianJiaCommunityDict.java | 183 ++++++++ .../mapper/LianJiaCommunityDictMapper.java | 53 +++ .../service/ILianJiaCommunityDictService.java | 34 ++ .../impl/LianJiaCommunityDictServiceImpl.java | 57 +++ .../ResidenceRentBasePriceController.java | 50 +- ...=> UltimateOfficeBasePriceController.java} | 52 ++- .../price/domain/UltimateOfficeBasePrice.java | 18 +- .../ComputeResidenceRentPriceMapper.java | 6 + .../mapper/UltimateOfficeBasePriceMapper.java | 61 ++- .../IComputeResidenceRentPriceService.java | 7 + .../IUltimateOfficeBasePriceService.java | 32 +- .../ComputeResidenceRentPriceServiceImpl.java | 6 + .../UltimateOfficeBasePriceServiceImpl.java | 65 ++- .../project/system/domain/UploadFile.java | 54 +++ .../system/mapper/UploadFileMapper.java | 24 + .../system/service/IUploadFileService.java | 26 ++ .../service/impl/UploadFileServiceImpl.java | 34 ++ .../src/main/resources/application-druid.yml | 5 + ruoyi/src/main/resources/application-prod.yml | 128 ++++++ ruoyi/src/main/resources/application.yml | 4 +- .../data/ComputeResidenceRentPriceMapper.xml | 8 +- .../data/LianJiaCommunityDictMapper.xml | 79 ++++ .../data/UltimateOfficeBasePriceMapper.xml | 160 +++++-- .../mybatis/system/UploadFileMapper.xml | 25 + .../compute/MapperXmlGeneratorTests.java | 14 +- 35 files changed, 1902 insertions(+), 283 deletions(-) create mode 100644 ruoyi-ui/src/api/data/lianJiaCommunity.js create mode 100644 ruoyi-ui/src/api/data/ultimateResidenceRentPrice.js create mode 100644 ruoyi-ui/src/views/data/basis/LianJiaCommunity.vue rename ruoyi-ui/src/views/data/{cases => price}/UltimateOfficeBasePrice.vue (78%) rename ruoyi-ui/src/views/data/price/{ComputeOfficeBasePrice.vue => UltimateResidenceRentPrice.vue} (72%) create mode 100644 ruoyi/src/main/java/com/ruoyi/project/common/VueSelectModel.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/data/basis/controller/AdrDictController.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/LianJiaCommunityDict.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/data/basis/mapper/LianJiaCommunityDictMapper.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/data/basis/service/ILianJiaCommunityDictService.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/data/basis/service/impl/LianJiaCommunityDictServiceImpl.java rename ruoyi/src/main/java/com/ruoyi/project/data/price/controller/{ComputeOfficeBasePriceController.java => UltimateOfficeBasePriceController.java} (74%) create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/domain/UploadFile.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/mapper/UploadFileMapper.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/service/IUploadFileService.java create mode 100644 ruoyi/src/main/java/com/ruoyi/project/system/service/impl/UploadFileServiceImpl.java create mode 100644 ruoyi/src/main/resources/application-prod.yml create mode 100644 ruoyi/src/main/resources/mybatis/data/LianJiaCommunityDictMapper.xml create mode 100644 ruoyi/src/main/resources/mybatis/system/UploadFileMapper.xml diff --git a/ruoyi-ui/src/api/data/computeResidenceRentPrice.js b/ruoyi-ui/src/api/data/computeResidenceRentPrice.js index fe25c589e..ad6bc3671 100644 --- a/ruoyi-ui/src/api/data/computeResidenceRentPrice.js +++ b/ruoyi-ui/src/api/data/computeResidenceRentPrice.js @@ -34,3 +34,10 @@ export function export2File(query) { params: query }) } + +export function getYearMonthList() { + return request({ + url: '/data/rentprice/residence/compute/yearmonth', + method: 'get' + }) +} diff --git a/ruoyi-ui/src/api/data/lianJiaCommunity.js b/ruoyi-ui/src/api/data/lianJiaCommunity.js new file mode 100644 index 000000000..e75a4fcee --- /dev/null +++ b/ruoyi-ui/src/api/data/lianJiaCommunity.js @@ -0,0 +1,36 @@ +import request from '@/utils/request' + +// 查询链家小区列表 +export function list(query) { + return request({ + url: '/data/adrdict/lianjia/list', + method: 'get', + params: query + }) +} + +// 查询链家小区详细 +export function get(id) { + return request({ + url: '/data/adrdict/lianjia/' + id, + method: 'get' + }) +} + +// 修改链家小区 +export function update(data) { + return request({ + url: '/data/adrdict/lianjia', + method: 'put', + data: data + }) +} + +// 导出链家小区 +export function export2File(query) { + return request({ + url: '/data/adrdict/lianjia/export', + method: 'get', + params: query + }) +} diff --git a/ruoyi-ui/src/api/data/ultimateOfficeBasePrice.js b/ruoyi-ui/src/api/data/ultimateOfficeBasePrice.js index 3518a1663..08af4ce9b 100644 --- a/ruoyi-ui/src/api/data/ultimateOfficeBasePrice.js +++ b/ruoyi-ui/src/api/data/ultimateOfficeBasePrice.js @@ -1,7 +1,7 @@ import request from '@/utils/request' -// 查询【请填写功能名称】列表 -export function listUltimate(query) { +// 查询办公基价列表 +export function list(query) { return request({ url: '/data/compute/price/office/list', method: 'get', @@ -9,25 +9,16 @@ export function listUltimate(query) { }) } -// 查询【请填写功能名称】详细 -export function getUltimate(id) { +// 查询办公基价详细 +export function getById(yearMonth, id) { return request({ - url: '/data/compute/price/office/' + id, + url: '/data/compute/price/office/' + yearMonth + '/' + id, method: 'get' }) } -// // 新增【请填写功能名称】 -// export function addUltimate(data) { -// return request({ -// url: '/data/compute/price/office', -// method: 'post', -// data: data -// }) -// } - -// 修改【请填写功能名称】 -export function updateUltimate(data) { +// 修改办公基价 +export function update(data) { return request({ url: '/data/compute/price/office', method: 'put', @@ -35,19 +26,19 @@ export function updateUltimate(data) { }) } -// // 删除【请填写功能名称】 -// export function delUltimate(id) { -// return request({ -// url: '/data/compute/price/office/' + id, -// method: 'delete' -// }) -// } - -// 导出【请填写功能名称】 -export function exportUltimate(query) { +// 导出办公基价 +export function export2File(query) { return request({ url: '/data/compute/price/office/export', method: 'get', params: query }) } + +// 年月 +export function getYearMonthList() { + return request({ + url: '/data/compute/price/office/yearmonth', + method: 'get' + }) +} diff --git a/ruoyi-ui/src/api/data/ultimateResidenceRentPrice.js b/ruoyi-ui/src/api/data/ultimateResidenceRentPrice.js new file mode 100644 index 000000000..41c472071 --- /dev/null +++ b/ruoyi-ui/src/api/data/ultimateResidenceRentPrice.js @@ -0,0 +1,36 @@ +import request from '@/utils/request' + +// 查询最终住宅租赁基价列表 +export function list(query) { + return request({ + url: '/data/rentprice/residence/ultimate/list', + method: 'get', + params: query + }) +} + +// 查询最终住宅租赁基价详细 +export function get(id) { + return request({ + url: '/data/rentprice/residence/ultimate/' + id, + method: 'get' + }) +} + +// 修改最终住宅租赁基价 +export function update(data) { + return request({ + url: '/data/rentprice/residence/ultimate', + method: 'put', + data: data + }) +} + +// 导出最终住宅租赁基价 +export function export2File(query) { + return request({ + url: '/data/rentprice/residence/ultimate/export', + method: 'get', + params: query + }) +} diff --git a/ruoyi-ui/src/views/data/basis/LianJiaCommunity.vue b/ruoyi-ui/src/views/data/basis/LianJiaCommunity.vue new file mode 100644 index 000000000..edcdb7f8f --- /dev/null +++ b/ruoyi-ui/src/views/data/basis/LianJiaCommunity.vue @@ -0,0 +1,430 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="100px"> + <el-form-item label="链家小区ID" prop="lianJiaCommunityId" clearable> + <el-input + v-model="queryParams.lianJiaCommunityId" + placeholder="请输入链家小区ID" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="联城小区ID" prop="communityId" clearable> + <el-input + v-model="queryParams.communityId" + placeholder="请输入联城小区ID" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="楼栋ID" prop="buildingId" clearable> + <el-input + v-model="queryParams.buildingId" + placeholder="请输入楼栋ID" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="案例URL" prop="lianJiaUrl" clearable> + <el-input + v-model="queryParams.lianJiaUrl" + placeholder="请输入案例URL" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <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-form-item> + </el-form> + + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="success" + icon="el-icon-edit" + size="mini" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['system:user:edit']" + >修改</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['system:user:export']" + >导出</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="info" + icon="el-icon-upload2" + size="mini" + @click="handleImport" + v-hasPermi="['system:user:import']" + >导入</el-button> + </el-col> + </el-row> + + <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="案例小区ID" align="center" prop="lianJiaCommunityId" /> + <el-table-column label="案例小区名称" align="center" prop="lianJiaCommunityName" /> + <el-table-column label="案例小区地址" align="center" prop="lianJiaCommunityAddress" /> + <el-table-column label="链家小区url" align="center" prop="lianJiaCommunityUrl" width="400"> + <template slot-scope="scope"> + <a :href="scope.row.lianJiaCommunityUrl" target="_blank">{{scope.row.lianJiaCommunityUrl}}</a> + </template> + </el-table-column> + <el-table-column label="链家案例url" align="center" prop="lianJiaUrl" width="400"> + <template slot-scope="scope"> + <a :href="scope.row.lianJiaUrl" target="_blank">{{scope.row.lianJiaUrl}}</a> + </template> + </el-table-column> + <el-table-column label="联城小区id" align="center" prop="communityId" /> + <el-table-column label="联城楼栋id" align="center" prop="buildingId" /> + <el-table-column label="小区名称(不带特殊符号的)" align="center" prop="cleanCommunityName" /> + <el-table-column label="小区地址(不带特殊符号的)" align="center" prop="cleanCommunityAddress" /> + <el-table-column label="楼栋地址(不带特殊符号的)" align="center" prop="cleanBuildingAddress" /> + <el-table-column label="是否有效" align="center" prop="enable" :formatter="yesOrNotFormatter" /> + + <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="['system:user:edit']" + >修改</el-button> + <!-- <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['system:user:remove']" + >删除</el-button>--> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageIndex" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 添加或修改办公基价对话框 --> + <!-- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="160px"> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="小区ID"> + <el-input v-model="form.communityId" disabled="true" readonly /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="楼栋ID"> + <el-input v-model="form.buildingId" disabled="true" readonly /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="主力基价(元/㎡)"> + <el-input v-model="form.mainPrice" /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="主力租金(元/月·㎡)"> + <el-input v-model="form.mainPriceRent" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="主力基价涨跌幅"> + <el-input v-model="form.mainPricePst" /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="主力租金涨跌幅"> + <el-input v-model="form.mainPriceRentPst" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="20"> + <el-col :span="12"> + <el-form-item label="主力基价类型"> + <el-input v-model="form.mainPriceType" /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="主力租金类型"> + <el-input v-model="form.mainPriceRentType" /> + </el-form-item> + </el-col> + </el-row> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">确 定</el-button> + <el-button @click="cancel">取 消</el-button> + </div> + </el-dialog> + + <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> + <el-upload + ref="upload" + :limit="1" + accept=".xlsx, .xls" + :headers="upload.headers" + :action="upload.url + '?updateSupport=' + upload.updateSupport" + :disabled="upload.isUploading" + :on-progress="handleFileUploadProgress" + :on-success="handleFileSuccess" + :auto-upload="false" + drag + > + <i class="el-icon-upload"></i> + <div class="el-upload__text"> + 将文件拖到此处,或 + <em>点击上传</em> + </div> + <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div> + </el-upload> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitFileForm">确 定</el-button> + <el-button @click="upload.open = false">取 消</el-button> + </div> + </el-dialog>--> + </div> +</template> + +<script> +import { getToken } from "@/utils/auth"; +import { list, get, update, export2File } from "@/api/data/lianJiaCommunity"; + +export default { + name: "lianJiaCommunity", + data() { + // 年月 + var checkYearMonth = (rule, value, callback) => { + console.log(value); + if (value === "" || !isNaN(parseInt(value))) { + callback(new Error("请输入年月")); + } else { + callback(); + } + }; + + return { + // 遮罩层 + loading: true, + // 选中数组 + ids: [], + // 非单个禁用 + single: true, + // 非多个禁用 + multiple: true, + // 总条数 + total: 0, + // 办公基价表格数据 + dataList: [], + // 弹出层标题 + title: "", + // 是否显示弹出层 + open: false, + // 查询参数 + queryParams: { + lianJiaCommunityId: undefined, + lianJiaUrl: undefined, + communityId: undefined, + buildingId: undefined, + lianJiaUrl: undefined, + pageIndex: 1, + pageSize: 10 + }, + statusOptions: [ + { value: 1, text: "正常" }, + { value: 1, text: "失效" } + ], + upload: { + // 是否显示弹出层(用户导入) + open: false, + // 弹出层标题(用户导入) + title: "", + // 是否禁用上传 + isUploading: false, + // 设置上传的请求头部 + headers: { Authorization: "Bearer " + getToken() }, + // 上传的地址 + url: + process.env.VUE_APP_BASE_API + + "/data/rentprice/residence/ultimate/importData" + }, + // 表单参数 + form: {} + // 表单校验 + // rules: { + // yearMonth: [{ validator: checkYearMonth, trigger: "blur" }] + // } + }; + }, + created() { + this.loading = false; + this.getList(); + }, + methods: { + yesOrNotFormatter: function(row, column, cellValue, index) { + if (cellValue) return "是"; + return "否"; + }, + statusFormatter: function(row, column, cellValue, index) { + if (cellValue) return "正常"; + return "失效"; + }, + dateFormatter: function(row, column, cellValue, index) { + if (cellValue) { + return cellValue.substring(0, 10); + } + return ""; + }, + /** 查询办公基价列表 */ + getList() { + this.loading = true; + list(this.queryParams).then(response => { + this.dataList = response.rows; + this.total = response.total; + this.loading = false; + }); + // this.$refs["queryForm"].validate(valid => { + // if (valid) { + // list(this.queryParams).then(response => { + // this.dataList = response.rows; + // this.total = response.total; + // this.loading = false; + // }); + // } + // }); + }, + // 取消按钮 + cancel() { + this.open = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + id: undefined + }; + this.resetForm("form"); + }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageIndex = 1; + this.getList(); + }, + /** 重置按钮操作 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 多选框选中数据 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id); + this.single = selection.length != 1; + this.multiple = !selection.length; + }, + /** 新增按钮操作 */ + // handleAdd() { + // this.reset(); + // this.open = true; + // this.title = "添加办公基价"; + // }, + /** 修改按钮操作 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids; + get(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "修改办公基价"; + }); + }, + /** 提交按钮 */ + submitForm: function() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != undefined) { + update(this.form).then(response => { + if (response.code === 200) { + this.msgSuccess("修改成功"); + this.open = false; + this.getList(); + } else { + this.msgError(response.msg); + } + }); + } else { + // addUltimate(this.form).then(response => { + // if (response.code === 200) { + // this.msgSuccess("新增成功"); + // this.open = false; + // this.getList(); + // } else { + // this.msgError(response.msg); + // } + // }); + } + } + }); + }, + /** 导出按钮操作 */ + handleExport() { + const queryParams = this.queryParams; + this.$confirm("是否确认导出所有住宅租赁基价数据项?", "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(function() { + return export2File(queryParams); + }) + .then(response => { + this.download(response.msg); + }) + .catch(function() {}); + }, + handleImport() { + this.upload.title = "办公基价导入"; + this.upload.open = true; + }, + // 文件上传中处理 + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + // 文件上传成功处理 + handleFileSuccess(response, file, fileList) { + this.upload.open = false; + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); + this.getList(); + }, + // 提交上传文件 + submitFileForm() { + this.$refs.upload.submit(); + } + } +}; +</script> diff --git a/ruoyi-ui/src/views/data/price/ComputeResidenceRentPrice.vue b/ruoyi-ui/src/views/data/price/ComputeResidenceRentPrice.vue index 9ff7ffebf..066625f35 100644 --- a/ruoyi-ui/src/views/data/price/ComputeResidenceRentPrice.vue +++ b/ruoyi-ui/src/views/data/price/ComputeResidenceRentPrice.vue @@ -1,15 +1,15 @@ <template> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="100px"> - <el-form-item label="年月" prop="yearMonth" clearable> - <el-date-picker - v-model="queryParams.yearMonth" - format="yyyyMM" - value-format="yyyyMM" - type="month" - placeholder="选择年月" - @keyup.enter.native="handleQuery" - ></el-date-picker> + <el-form :model="queryParams" :rules="rules" ref="queryForm" :inline="true" label-width="100px"> + <el-form-item label="年月" prop="yearMonth"> + <el-select v-model="queryParams.yearMonth" placeholder="请选择年月"> + <el-option + v-for="item in yearMonthList" + :value="item.value" + :label="item.label" + :key="item.value" + ></el-option> + </el-select> </el-form-item> <el-form-item label="联城小区ID" prop="communityId" clearable> <el-input @@ -259,7 +259,8 @@ import { list, get, update, - export2File + export2File, + getYearMonthList } from "@/api/data/computeResidenceRentPrice"; export default { @@ -267,8 +268,9 @@ export default { data() { // 年月 var checkYearMonth = (rule, value, callback) => { - console.log(value); - if (value === "" || !isNaN(parseInt(value))) { + if (!value) { + callback(new Error("请输入年月")); + } else if (value === "" || isNaN(parseInt(value))) { callback(new Error("请输入年月")); } else { callback(); @@ -300,6 +302,7 @@ export default { pageIndex: 1, pageSize: 10 }, + yearMonthList: [], statusOptions: [ { value: 1, text: "正常" }, { value: 1, text: "失效" } @@ -322,13 +325,18 @@ export default { form: {}, // 表单校验 rules: { - yearMonth: [{ validator: checkYearMonth, trigger: "blur" }] + yearMonth: [ + { validator: checkYearMonth, trigger: "blur" }, + { validator: checkYearMonth, trigger: "change" } + ] } }; }, created() { this.loading = false; - // this.getList(); + getYearMonthList().then(response => { + this.yearMonthList = response.data; + }); }, methods: { yesOrNotFormatter: function(row, column, cellValue, index) { @@ -346,10 +354,10 @@ export default { return ""; }, /** 查询办公基价列表 */ - getList() { - this.loading = true; - this.$refs["queryForm"].validate(valid => { + getList(formName) { + this.$refs[formName].validate(valid => { if (valid) { + this.loading = true; list(this.queryParams).then(response => { this.dataList = response.rows; this.total = response.total; @@ -373,7 +381,7 @@ export default { /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageIndex = 1; - this.getList(); + this.getList("queryForm"); }, /** 重置按钮操作 */ resetQuery() { diff --git a/ruoyi-ui/src/views/data/cases/UltimateOfficeBasePrice.vue b/ruoyi-ui/src/views/data/price/UltimateOfficeBasePrice.vue similarity index 78% rename from ruoyi-ui/src/views/data/cases/UltimateOfficeBasePrice.vue rename to ruoyi-ui/src/views/data/price/UltimateOfficeBasePrice.vue index ce2f40e67..1ace6b2db 100644 --- a/ruoyi-ui/src/views/data/cases/UltimateOfficeBasePrice.vue +++ b/ruoyi-ui/src/views/data/price/UltimateOfficeBasePrice.vue @@ -1,14 +1,15 @@ <template> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="100px"> - <el-form-item label="年月" prop="yearMonth" clearable> - <el-date-picker - v-model="queryParams.yearMonth" - format="yyyyMM" - type="month" - placeholder="选择年月" - @keyup.enter.native="handleQuery" - ></el-date-picker> + <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="100px" :rules="rules"> + <el-form-item label="年月" prop="yearMonth"> + <el-select v-model="queryParams.yearMonth" placeholder="请选择年月"> + <el-option + v-for="item in yearMonthList" + :value="item.value" + :label="item.label" + :key="item.value" + ></el-option> + </el-select> </el-form-item> <el-form-item label="联城小区ID" prop="communityId" clearable> <el-input @@ -71,11 +72,23 @@ </el-col> </el-row> - <el-table v-loading="loading" :data="ultimateList" @selection-change="handleSelectionChange"> + <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="年月" align="center" prop="yearMonth" /> <el-table-column label="小区ID" align="center" prop="communityId" /> <el-table-column label="楼栋ID" align="center" prop="buildingId" /> + <el-table-column label="项目名称" align="center" prop="communityName" /> + <el-table-column label="办公项目地址" align="center" prop="communityAddress" /> + <el-table-column label="楼栋地址" align="center" prop="buildingAddress" /> + <el-table-column label="区域-板块-环线-街道" align="center" :formatter="regionFormatter" width="300" /> + <el-table-column label="建成年代" align="center" prop="year" /> + <el-table-column label="平均面积" align="center" prop="avgArea" /> + <el-table-column label="总层数" align="center" prop="totalFloorSum" /> + <el-table-column label="地上层数" align="center" prop="upperFloorSum" /> + <el-table-column label="办公分类" align="center" prop="officeClass" /> + <el-table-column label="办公等级" align="center" prop="officeLevel" /> + <el-table-column label="主力基价(上期)" align="center" prop="mainPrice_1" /> + <el-table-column label="主力租金(上期)" align="center" prop="mainPriceRent_1" /> <el-table-column label="主力基价" align="center" prop="mainPrice" /> <el-table-column label="主力租金" align="center" prop="mainPriceRent" /> <el-table-column label="主力基价涨跌幅" align="center" prop="mainPricePst" /> @@ -208,15 +221,27 @@ <script> import { getToken } from "@/utils/auth"; import { - listUltimate, - getUltimate, - updateUltimate, - exportUltimate + list, + getById, + update, + export2File, + getYearMonthList } from "@/api/data/ultimateOfficeBasePrice"; export default { name: "Ultimate", data() { + // 年月 + var checkYearMonth = (rule, value, callback) => { + if (!value) { + callback(new Error("请输入年月")); + } else if (value === "" || isNaN(parseInt(value))) { + callback(new Error("请输入年月")); + } else { + callback(); + } + }; + return { // 遮罩层 loading: true, @@ -234,6 +259,7 @@ export default { title: "", // 是否显示弹出层 open: false, + yearMonthList: [], // 查询参数 queryParams: { yearMonth: undefined, @@ -262,13 +288,33 @@ export default { // 表单参数 form: {}, // 表单校验 - rules: {} + rules: { + yearMonth: [ + { validator: checkYearMonth, trigger: "blur" }, + { validator: checkYearMonth, trigger: "change" } + ] + } }; }, created() { - this.getList(); + this.loading = false; + getYearMonthList().then(response => { + this.yearMonthList = response.data; + }); }, methods: { + regionFormatter: function(row, column, cellValue, index) { + // 区域-板块-环线-街道 + return ( + row["countyName"] + + "-" + + row["blockName"] + + "-" + + row["loopName"] + + "-" + + row["streetName"] + ); + }, yesOrNotFormatter: function(row, column, cellValue, index) { if (cellValue) return "是"; return "否"; @@ -285,11 +331,15 @@ export default { }, /** 查询办公基价列表 */ getList() { - this.loading = true; - listUltimate(this.queryParams).then(response => { - this.ultimateList = response.rows; - this.total = response.total; - this.loading = false; + this.$refs["queryForm"].validate(valid => { + if (valid) { + this.loading = true; + list(this.queryParams).then(response => { + this.dataList = response.rows; + this.total = response.total; + this.loading = false; + }); + } }); }, // 取消按钮 @@ -320,17 +370,12 @@ export default { this.single = selection.length != 1; this.multiple = !selection.length; }, - /** 新增按钮操作 */ - // handleAdd() { - // this.reset(); - // this.open = true; - // this.title = "添加办公基价"; - // }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); const id = row.id || this.ids; - getUltimate(id).then(response => { + const yearMonth = row.yearMonth; + getById(yearMonth, id).then(response => { this.form = response.data; this.open = true; this.title = "修改办公基价"; @@ -340,27 +385,15 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { - if (this.form.id != undefined) { - updateUltimate(this.form).then(response => { - if (response.code === 200) { - this.msgSuccess("修改成功"); - this.open = false; - this.getList(); - } else { - this.msgError(response.msg); - } - }); - } else { - addUltimate(this.form).then(response => { - if (response.code === 200) { - this.msgSuccess("新增成功"); - this.open = false; - this.getList(); - } else { - this.msgError(response.msg); - } - }); - } + update(this.form).then(response => { + if (response.code === 200) { + this.msgSuccess("修改成功"); + this.open = false; + this.getList(); + } else { + this.msgError(response.msg); + } + }); } }); }, @@ -373,7 +406,7 @@ export default { type: "warning" }) .then(function() { - return exportUltimate(queryParams); + return export2File(queryParams); }) .then(response => { this.download(response.msg); diff --git a/ruoyi-ui/src/views/data/price/ComputeOfficeBasePrice.vue b/ruoyi-ui/src/views/data/price/UltimateResidenceRentPrice.vue similarity index 72% rename from ruoyi-ui/src/views/data/price/ComputeOfficeBasePrice.vue rename to ruoyi-ui/src/views/data/price/UltimateResidenceRentPrice.vue index ce2f40e67..6b220e9e9 100644 --- a/ruoyi-ui/src/views/data/price/ComputeOfficeBasePrice.vue +++ b/ruoyi-ui/src/views/data/price/UltimateResidenceRentPrice.vue @@ -5,6 +5,7 @@ <el-date-picker v-model="queryParams.yearMonth" format="yyyyMM" + value-format="yyyyMM" type="month" placeholder="选择年月" @keyup.enter.native="handleQuery" @@ -19,21 +20,6 @@ @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="联城楼栋ID" prop="buildingId" clearable> - <el-input - v-model="queryParams.buildingId" - placeholder="请输入联城楼栋ID" - clearable - size="small" - @keyup.enter.native="handleQuery" - /> - </el-form-item> - <el-form-item label="状态"> - <el-select v-model="queryParams.status" clearable> - <el-option label="正常" value="1"></el-option> - <el-option label="失效" value="0"></el-option> - </el-select> - </el-form-item> <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> @@ -48,7 +34,7 @@ size="mini" :disabled="single" @click="handleUpdate" - v-hasPermi="['system:ultimate:edit']" + v-hasPermi="['system:user:edit']" >修改</el-button> </el-col> <el-col :span="1.5"> @@ -71,26 +57,39 @@ </el-col> </el-row> - <el-table v-loading="loading" :data="ultimateList" @selection-change="handleSelectionChange"> + <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="年月" align="center" prop="yearMonth" /> <el-table-column label="小区ID" align="center" prop="communityId" /> - <el-table-column label="楼栋ID" align="center" prop="buildingId" /> - <el-table-column label="主力基价" align="center" prop="mainPrice" /> - <el-table-column label="主力租金" align="center" prop="mainPriceRent" /> - <el-table-column label="主力基价涨跌幅" align="center" prop="mainPricePst" /> - <el-table-column label="主力租金涨跌幅" align="center" prop="mainPriceRentPst" /> - <el-table-column label="主力基价类型" align="center" prop="mainPriceType" /> - <el-table-column label="主力租金类型" align="center" prop="mainPriceRentType" /> + <el-table-column label="小区名称" align="center" prop="communityName" /> + <el-table-column label="小区地址" align="center" prop="communityAddress" /> + + <el-table-column label="区域" align="center" prop="county" /> + <el-table-column label="板块" align="center" prop="block" /> + <el-table-column label="环线" align="center" prop="loop" /> + <el-table-column label="国际社区分" align="center" prop="loop" /> + <el-table-column label="重点小学名称" align="center" prop="loop" /> + <el-table-column label="物业档次" align="center" prop="loop" /> + <el-table-column label="室数量-AI" align="center" prop="loop" /> + + <el-table-column label="标准基价(元/㎡·月)" align="center" prop="rentPrice" /> + <el-table-column label="平均租金(元/㎡·月)" align="center" prop="rentPrice" /> + <el-table-column label="散租挂牌案例" align="center" prop="散租挂牌案例" /> + <el-table-column label="租金涨跌幅" align="center" prop="voppa" /> + <el-table-column label="租金-工房1室" align="center" prop="gf_1Room" /> + <el-table-column label="租金-工房2室" align="center" prop="gf_2Room" /> + <el-table-column label="租金-公寓2室" align="center" prop="gy_2Room" /> + <el-table-column label="租金-公寓3室" align="center" prop="gy_3Room" /> + <el-table-column label="租金-1房" align="center" prop="one_Room" /> + <el-table-column label="租金-2房" align="center" prop="two_Room" /> + <el-table-column label="租金-3房" align="center" prop="three_Room" /> + <el-table-column label="整租比" align="center" prop="entireRentRatio" /> + <el-table-column label="整租案例" align="center" prop="entireRentNum" /> + <el-table-column label="分租比" align="center" prop="shareRentRatio" /> + <el-table-column label="分租案例" align="center" prop="shareRentNum" /> + <el-table-column label="租售比" align="center" prop="saleRentRatio" /> <el-table-column label="状态" align="center" prop="status" :formatter="statusFormatter" /> - <el-table-column - label="标准楼栋" - align="center" - prop="standardBuilding" - :formatter="yesOrNotFormatter" - /> - <el-table-column label="价格更改说明" align="center" prop="adjustPriceComment" /> - <el-table-column label="更新日期" align="center" prop="updateDate" :formatter="dateFormatter" /> + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <el-button @@ -114,13 +113,13 @@ <pagination v-show="total>0" :total="total" - :page.sync="queryParams.pageNum" + :page.sync="queryParams.pageIndex" :limit.sync="queryParams.pageSize" @pagination="getList" /> <!-- 添加或修改办公基价对话框 --> - <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> + <!-- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="160px"> <el-row :gutter="20"> <el-col :span="12"> @@ -201,22 +200,32 @@ <el-button type="primary" @click="submitFileForm">确 定</el-button> <el-button @click="upload.open = false">取 消</el-button> </div> - </el-dialog> + </el-dialog>--> </div> </template> <script> import { getToken } from "@/utils/auth"; import { - listUltimate, - getUltimate, - updateUltimate, - exportUltimate -} from "@/api/data/ultimateOfficeBasePrice"; + list, + get, + update, + export2File +} from "@/api/data/ultimateResidenceRentPrice"; export default { - name: "Ultimate", + name: "computeResidenceRentBasePrice", data() { + // 年月 + var checkYearMonth = (rule, value, callback) => { + console.log(value); + if (value === "" || !isNaN(parseInt(value))) { + callback(new Error("请输入年月")); + } else { + callback(); + } + }; + return { // 遮罩层 loading: true, @@ -229,7 +238,7 @@ export default { // 总条数 total: 0, // 办公基价表格数据 - ultimateList: [], + dataList: [], // 弹出层标题 title: "", // 是否显示弹出层 @@ -238,8 +247,8 @@ export default { queryParams: { yearMonth: undefined, communityId: undefined, - buildingId: undefined, - pageNum: 1, + communityName: undefined, + pageIndex: 1, pageSize: 10 }, statusOptions: [ @@ -257,16 +266,20 @@ export default { headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 url: - process.env.VUE_APP_BASE_API + "/data/compute/price/office/importData" + process.env.VUE_APP_BASE_API + + "/data/rentprice/residence/ultimate/importData" }, // 表单参数 form: {}, // 表单校验 - rules: {} + rules: { + yearMonth: [{ validator: checkYearMonth, trigger: "blur" }] + } }; }, created() { - this.getList(); + this.loading = false; + // this.getList(); }, methods: { yesOrNotFormatter: function(row, column, cellValue, index) { @@ -286,10 +299,14 @@ export default { /** 查询办公基价列表 */ getList() { this.loading = true; - listUltimate(this.queryParams).then(response => { - this.ultimateList = response.rows; - this.total = response.total; - this.loading = false; + this.$refs["queryForm"].validate(valid => { + if (valid) { + list(this.queryParams).then(response => { + this.dataList = response.rows; + this.total = response.total; + this.loading = false; + }); + } }); }, // 取消按钮 @@ -306,7 +323,7 @@ export default { }, /** 搜索按钮操作 */ handleQuery() { - this.queryParams.pageNum = 1; + this.queryParams.pageIndex = 1; this.getList(); }, /** 重置按钮操作 */ @@ -330,7 +347,7 @@ export default { handleUpdate(row) { this.reset(); const id = row.id || this.ids; - getUltimate(id).then(response => { + get(id).then(response => { this.form = response.data; this.open = true; this.title = "修改办公基价"; @@ -341,7 +358,7 @@ export default { this.$refs["form"].validate(valid => { if (valid) { if (this.form.id != undefined) { - updateUltimate(this.form).then(response => { + update(this.form).then(response => { if (response.code === 200) { this.msgSuccess("修改成功"); this.open = false; @@ -351,15 +368,15 @@ export default { } }); } else { - addUltimate(this.form).then(response => { - if (response.code === 200) { - this.msgSuccess("新增成功"); - this.open = false; - this.getList(); - } else { - this.msgError(response.msg); - } - }); + // addUltimate(this.form).then(response => { + // if (response.code === 200) { + // this.msgSuccess("新增成功"); + // this.open = false; + // this.getList(); + // } else { + // this.msgError(response.msg); + // } + // }); } } }); @@ -367,13 +384,13 @@ export default { /** 导出按钮操作 */ handleExport() { const queryParams = this.queryParams; - this.$confirm("是否确认导出所有办公基价数据项?", "警告", { + this.$confirm("是否确认导出所有住宅租赁基价数据项?", "警告", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }) .then(function() { - return exportUltimate(queryParams); + return export2File(queryParams); }) .then(response => { this.download(response.msg); diff --git a/ruoyi/src/main/java/com/ruoyi/project/common/VueSelectModel.java b/ruoyi/src/main/java/com/ruoyi/project/common/VueSelectModel.java new file mode 100644 index 000000000..c3268f796 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/common/VueSelectModel.java @@ -0,0 +1,32 @@ +package com.ruoyi.project.common; + + +public class VueSelectModel<T> { + private String label; + private T value; + + public VueSelectModel() { + + } + + public VueSelectModel(String label, T data) { + this.label = label; + this.value = data; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public T getValue() { + return value; + } + + public void setValue(T value) { + this.value = value; + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/controller/AdrDictController.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/controller/AdrDictController.java new file mode 100644 index 000000000..dbfed7875 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/controller/AdrDictController.java @@ -0,0 +1,90 @@ +package com.ruoyi.project.data.basis.controller; + +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.framework.web.page.TableSupport; +import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict; +import com.ruoyi.project.data.basis.service.ILianJiaCommunityDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 链家id和联城id对应关系 + * 小区名称和小区地址标准化对应关系 + * 楼栋名称和楼栋地址标准化对应关系 + */ +@RestController +@RequestMapping("/data/adrdict/lianjia") +public class AdrDictController extends BaseController { + @Autowired + private ILianJiaCommunityDictService lianJiaCommunityDictService; + + /** + * @param lianJiaCommunityDict + * @return + */ + @PreAuthorize("@ss.hasPermi('system:user:list')") + @GetMapping("/list") + public TableDataInfo list(LianJiaCommunityDict lianJiaCommunityDict) { + int pageIndex = ServletUtils.getParameterToInt("pageIndex"); + int pageSize = ServletUtils.getParameterToInt(TableSupport.PAGE_SIZE); + lianJiaCommunityDict.setPageIndex(pageIndex <= 1 ? 0 : (pageIndex - 1) * pageSize); + lianJiaCommunityDict.setPageSize(pageSize); + + int total = lianJiaCommunityDictService.selectPageOfTotal(lianJiaCommunityDict); + List<LianJiaCommunityDict> list = + lianJiaCommunityDictService.selectPageOfList(lianJiaCommunityDict); + return getDataTable(list, total); + } + + /** + * 修改 住宅租赁基价 + */ + @PreAuthorize("@ss.hasPermi('system:user:edit')") + @Log(title = "链家小区", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody LianJiaCommunityDict lianJiaCommunityDict) { + return toAjax(lianJiaCommunityDictService.update(lianJiaCommunityDict)); + } + + /** + * 新增角色 + */ + @PreAuthorize("@ss.hasPermi('system:user:add')") + @Log(title = "链家小区", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody LianJiaCommunityDict lianJiaCommunityDict) { + return toAjax(lianJiaCommunityDictService.insert(lianJiaCommunityDict)); + } + + /** + * 删除角色 + */ + @PreAuthorize("@ss.hasPermi('system:user:remove')") + @Log(title = "链家小区", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Integer id) { + return toAjax(lianJiaCommunityDictService.delete(id)); + } + + /** + * + * @param id + * @return + */ + @PreAuthorize("@ss.hasPermi('system:user:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable(value = "id", required = false) Integer id) { + AjaxResult ajax = AjaxResult.success(); + ajax.put(AjaxResult.DATA_TAG, lianJiaCommunityDictService.selectById(id)); + return ajax; + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/LianJiaCommunityDict.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/LianJiaCommunityDict.java new file mode 100644 index 000000000..37185574b --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/LianJiaCommunityDict.java @@ -0,0 +1,183 @@ +package com.ruoyi.project.data.basis.domain; + +import com.ruoyi.framework.web.domain.BaseEntity; + + +/** + * 链家id和联城小区、楼栋id对应关系 + */ +public class LianJiaCommunityDict extends BaseEntity { + + /** + * + */ + private Integer pageIndex; + /** + * + */ + private Integer pageSize; + + /** + * 主键 + */ + private Integer id; + + /** + * 案例id + */ + private String lianJiaCommunityId; + /** + * 案例小区名称 + */ + private String lianJiaCommunityName; + /** + * 案例小区地址 + */ + private String lianJiaCommunityAddress; + /** + * 链家小区url + */ + private String lianJiaCommunityUrl; + /** + * 链家案例url + */ + private String lianJiaUrl; + + /** + * 联城小区id + */ + private String communityId; + /** + * 联城楼栋id + */ + private String buildingId; + /** + * 小区名称(不带特殊符号的) + */ + private String cleanCommunityName; + /** + * 小区地址(不带特殊符号的) + */ + private String cleanCommunityAddress; + /** + * 楼栋地址(不带特殊符号的) + */ + private String cleanBuildingAddress; + + /** + * 是否有效 + */ + private Boolean enable; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getLianJiaCommunityId() { + return lianJiaCommunityId; + } + + public void setLianJiaCommunityId(String lianJiaCommunityId) { + this.lianJiaCommunityId = lianJiaCommunityId; + } + + public String getLianJiaCommunityName() { + return lianJiaCommunityName; + } + + public void setLianJiaCommunityName(String lianJiaCommunityName) { + this.lianJiaCommunityName = lianJiaCommunityName; + } + + public String getLianJiaCommunityAddress() { + return lianJiaCommunityAddress; + } + + public void setLianJiaCommunityAddress(String lianJiaCommunityAddress) { + this.lianJiaCommunityAddress = lianJiaCommunityAddress; + } + + public String getLianJiaCommunityUrl() { + return lianJiaCommunityUrl; + } + + public void setLianJiaCommunityUrl(String lianJiaCommunityUrl) { + this.lianJiaCommunityUrl = lianJiaCommunityUrl; + } + + public String getLianJiaUrl() { + return lianJiaUrl; + } + + public void setLianJiaUrl(String lianJiaUrl) { + this.lianJiaUrl = lianJiaUrl; + } + + public String getCommunityId() { + return communityId; + } + + public void setCommunityId(String communityId) { + this.communityId = communityId; + } + + public String getBuildingId() { + return buildingId; + } + + public void setBuildingId(String buildingId) { + this.buildingId = buildingId; + } + + public String getCleanCommunityName() { + return cleanCommunityName; + } + + public void setCleanCommunityName(String cleanCommunityName) { + this.cleanCommunityName = cleanCommunityName; + } + + public String getCleanCommunityAddress() { + return cleanCommunityAddress; + } + + public void setCleanCommunityAddress(String cleanCommunityAddress) { + this.cleanCommunityAddress = cleanCommunityAddress; + } + + public String getCleanBuildingAddress() { + return cleanBuildingAddress; + } + + public void setCleanBuildingAddress(String cleanBuildingAddress) { + this.cleanBuildingAddress = cleanBuildingAddress; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/mapper/LianJiaCommunityDictMapper.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/mapper/LianJiaCommunityDictMapper.java new file mode 100644 index 000000000..aeb8b03c1 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/mapper/LianJiaCommunityDictMapper.java @@ -0,0 +1,53 @@ +package com.ruoyi.project.data.basis.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict; + +import java.util.List; + +@DS("clean") +public interface LianJiaCommunityDictMapper { + + /** + * 新增 + * + * @param dict + * @return + */ + int insert(LianJiaCommunityDict dict); + + /** + * 更新 + * + * @param dict + * @return + */ + int update(LianJiaCommunityDict dict); + + /** + * 删除 + * + * @param id + */ + void delete(Integer id); + + /** + * @param dict + * @return + */ + List<LianJiaCommunityDict> selectPageOfList(LianJiaCommunityDict dict); + + /** + * + * @param id + * @return + */ + LianJiaCommunityDict selectById(Integer id); + + /** + * @param dict + * @return + */ + int selectPageOfTotal(LianJiaCommunityDict dict); + +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/ILianJiaCommunityDictService.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/ILianJiaCommunityDictService.java new file mode 100644 index 000000000..367475c3a --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/ILianJiaCommunityDictService.java @@ -0,0 +1,34 @@ +package com.ruoyi.project.data.basis.service; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict; + +import java.util.List; + +public interface ILianJiaCommunityDictService { + + int insert(LianJiaCommunityDict dict); + + int update(LianJiaCommunityDict dict); + + int delete(Integer id); + /** + * @param dict + * @return + */ + List<LianJiaCommunityDict> selectPageOfList(LianJiaCommunityDict dict); + + /** + * + * @param id + * @return + */ + LianJiaCommunityDict selectById(Integer id); + + /** + * @param dict + * @return + */ + int selectPageOfTotal(LianJiaCommunityDict dict); + +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/impl/LianJiaCommunityDictServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/impl/LianJiaCommunityDictServiceImpl.java new file mode 100644 index 000000000..5b063217f --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/impl/LianJiaCommunityDictServiceImpl.java @@ -0,0 +1,57 @@ +package com.ruoyi.project.data.basis.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict; +import com.ruoyi.project.data.basis.mapper.LianJiaCommunityDictMapper; +import com.ruoyi.project.data.basis.service.ILianJiaCommunityDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class LianJiaCommunityDictServiceImpl implements ILianJiaCommunityDictService { + + @Autowired + private JdbcTemplate jdbcTemplate; + @Autowired + private LianJiaCommunityDictMapper lianJiaCommunityDictMapper; + + @Override + public int insert(LianJiaCommunityDict dict) { + return jdbcTemplate.update("insert into [dbo].[lianjia_dictionary]([lianjia_community_id]," + + "[lianjia_community_name]," + + "[lianjia_community_address],[lianjia_community_url],[lianjia_community_curl],[community_id]," + + "[building_id],[clean_community_name],[clean_community_address],[clean_building_address],[enable]," + + "[create_time]) value (?,?,?,?,?,?,?,?,?,?,1,getdate());", new Object[]{dict.getLianJiaCommunityId(), + dict.getLianJiaCommunityName(), dict.getLianJiaCommunityAddress(), dict.getLianJiaUrl(), + dict.getLianJiaCommunityUrl(), dict.getCommunityId(), dict.getBuildingId(), dict.getCleanCommunityName() + , dict.getCleanCommunityAddress(), dict.getCleanBuildingAddress()}); + } + + @Override + public int update(LianJiaCommunityDict dict) { + return 0; + } + + @Override + public int delete(Integer id) { + return jdbcTemplate.update("delete from lianjia_dictionary where id= ? ;", new Object[]{id}); + } + + @Override + public List<LianJiaCommunityDict> selectPageOfList(LianJiaCommunityDict dict) { + return lianJiaCommunityDictMapper.selectPageOfList(dict); + } + + @Override + public int selectPageOfTotal(LianJiaCommunityDict dict) { + return lianJiaCommunityDictMapper.selectPageOfTotal(dict); + } + + @Override + public LianJiaCommunityDict selectById(Integer id) { + return lianJiaCommunityDictMapper.selectById(id); + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java index ed0e32062..87a0109b6 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java @@ -1,26 +1,33 @@ package com.ruoyi.project.data.price.controller; import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.config.RuoYiConfig; import com.ruoyi.framework.security.LoginUser; import com.ruoyi.framework.security.service.TokenService; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; import com.ruoyi.framework.web.page.TableSupport; +import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice; import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice; import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice; import com.ruoyi.project.data.price.service.IArtificialResidenceRentPriceService; import com.ruoyi.project.data.price.service.IComputeResidenceRentPriceService; import com.ruoyi.project.data.price.service.IUltimateResidenceRentBasePriceService; +import com.ruoyi.project.system.domain.UploadFile; +import com.ruoyi.project.system.service.IUploadFileService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import java.util.Date; +import java.util.LinkedList; import java.util.List; @RestController @@ -32,7 +39,8 @@ public class ResidenceRentBasePriceController extends BaseController { private IArtificialResidenceRentPriceService artificialResidenceRentPriceService; @Autowired private IUltimateResidenceRentBasePriceService ultimateResidenceRentBasePriceService; - + @Autowired + private IUploadFileService fileService; @Autowired private TokenService tokenService; @@ -54,6 +62,16 @@ public class ResidenceRentBasePriceController extends BaseController { return getDataTable(list, total); } + /** + * 查询 年月 + */ + @PreAuthorize("@ss.hasPermi('system:user:list')") + @GetMapping("/compute/yearmonth") + public AjaxResult yearMonthList() { + List<VueSelectModel> list = computeResidenceRentPriceService.getYearMonth(); + + return AjaxResult.success(list); + } /** * 获取 住宅租赁基价详细信息 @@ -61,6 +79,7 @@ public class ResidenceRentBasePriceController extends BaseController { @PreAuthorize("@ss.hasPermi('system:user:query')") @GetMapping(value = "/compute/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { + return AjaxResult.success(computeResidenceRentPriceService.selectById(id)); } @@ -100,15 +119,27 @@ public class ResidenceRentBasePriceController extends BaseController { @Log(title = "办公基价", businessType = BusinessType.IMPORT) @PreAuthorize("@ss.hasPermi('system:user:import')") @PostMapping("/compute/importData") - public AjaxResult importData(MultipartFile file) throws Exception { + public AjaxResult importData(@RequestParam("id") String id, @RequestParam("module") String module, + MultipartFile file) throws Exception { ExcelUtil<ComputeResidenceRentBasePrice> util = new ExcelUtil<>(ComputeResidenceRentBasePrice.class); - List<ComputeResidenceRentBasePrice> computeResidenceRentBasePrices = util.importExcel(file.getInputStream()); LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); String operName = loginUser.getUsername(); - String message = computeResidenceRentPriceService.batchImport(computeResidenceRentBasePrices, operName); - return AjaxResult.success(message); - } + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file); + UploadFile uploadFile = new UploadFile(); + uploadFile.setFk(id); + uploadFile.setSaveFileName(fileName); + uploadFile.setFileName(file.getOriginalFilename()); + uploadFile.setModuleName(module); + uploadFile.setCreateBy(operName); + fileService.insert(uploadFile); +// List<ComputeResidenceRentBasePrice> computeResidenceRentBasePrices = util.importExcel(file.getInputStream()); +// String message = computeResidenceRentPriceService.batchImport(computeResidenceRentBasePrices, operName); + return AjaxResult.success("not implement"); + } /** * 人工修正住宅租赁 @@ -132,6 +163,9 @@ public class ResidenceRentBasePriceController extends BaseController { } + // 文件保存 + + /** * 查询 住宅租赁基价列表 */ @@ -150,6 +184,10 @@ public class ResidenceRentBasePriceController extends BaseController { return getDataTable(list, total); } + /** + * 人工审核住宅租赁基价导入(模板) + * 记录变化的值和变化次数 + */ /** * 获取 住宅租赁基价详细信息 diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ComputeOfficeBasePriceController.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/UltimateOfficeBasePriceController.java similarity index 74% rename from ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ComputeOfficeBasePriceController.java rename to ruoyi/src/main/java/com/ruoyi/project/data/price/controller/UltimateOfficeBasePriceController.java index ae9ab8a3d..83d4facdd 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ComputeOfficeBasePriceController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/UltimateOfficeBasePriceController.java @@ -6,6 +6,7 @@ import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.framework.security.LoginUser; import com.ruoyi.framework.security.service.TokenService; import com.ruoyi.framework.web.page.TableSupport; +import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice; import com.ruoyi.project.data.price.service.IUltimateOfficeBasePriceService; import org.springframework.security.access.prepost.PreAuthorize; @@ -26,21 +27,21 @@ import com.ruoyi.framework.web.page.TableDataInfo; import org.springframework.web.multipart.MultipartFile; /** - * 【请填写功能名称】Controller + * 办公基价Controller * * @author ruoyi * @date 2020-05-20 */ @RestController @RequestMapping("/data/compute/price/office") -public class ComputeOfficeBasePriceController extends BaseController { +public class UltimateOfficeBasePriceController extends BaseController { @Autowired private IUltimateOfficeBasePriceService officeBasePriceUltimateService; @Autowired private TokenService tokenService; /** - * 查询【请填写功能名称】列表 + * 查询办公基价列表 */ @PreAuthorize("@ss.hasPermi('system:user:list')") @GetMapping("/list") @@ -55,28 +56,38 @@ public class ComputeOfficeBasePriceController extends BaseController { return getDataTable(list, total); } + /** + * 查询 年月 + */ + @PreAuthorize("@ss.hasPermi('system:user:list')") + @GetMapping("/yearmonth") + public AjaxResult yearMonthList() { + List<VueSelectModel> list = officeBasePriceUltimateService.getYearMonthList(); + + return AjaxResult.success(list); + } /** - * 获取【请填写功能名称】详细信息 + * 获取办公基价详细信息 */ @PreAuthorize("@ss.hasPermi('system:user:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) { - return AjaxResult.success(officeBasePriceUltimateService.selectOfficeBasePriceUltimateById(id)); + @GetMapping(value = "/{yearMonth}/{id}") + public AjaxResult getInfo(@PathVariable("yearMonth") Integer yearMonth, @PathVariable("id") Integer id) { + return AjaxResult.success(officeBasePriceUltimateService.getById(yearMonth, id)); } - /** - * 修改【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:user:edit')") - @Log(title = "办公基价", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody UltimateOfficeBasePrice officeBasePriceUltimate) { - return toAjax(officeBasePriceUltimateService.updateOfficeBasePriceUltimate(officeBasePriceUltimate)); - } +// /** +// * 修改办公基价 +// */ +// @PreAuthorize("@ss.hasPermi('system:user:edit')") +// @Log(title = "办公基价", businessType = BusinessType.UPDATE) +// @PutMapping +// public AjaxResult edit(@RequestBody UltimateOfficeBasePrice officeBasePriceUltimate) { +// return toAjax(officeBasePriceUltimateService.updateOfficeBasePriceUltimate(officeBasePriceUltimate)); +// } /** - * 导出【请填写功能名称】列表 + * 导出办公基价列表 */ @PreAuthorize("@ss.hasPermi('system:user:export')") @Log(title = "办公基价", businessType = BusinessType.EXPORT) @@ -100,13 +111,14 @@ public class ComputeOfficeBasePriceController extends BaseController { */ @Log(title = "办公基价", businessType = BusinessType.IMPORT) @PreAuthorize("@ss.hasPermi('system:user:import')") - @PostMapping("/importData") - public AjaxResult importData(MultipartFile file) throws Exception { + @PostMapping("/importData/{yearMonth}") + public AjaxResult importData(@PathVariable("yearMonth") Integer yearMonth, MultipartFile file) throws Exception { + // 修改计价 ExcelUtil<UltimateOfficeBasePrice> util = new ExcelUtil<>(UltimateOfficeBasePrice.class); List<UltimateOfficeBasePrice> officeBasePriceUltimates = util.importExcel(file.getInputStream()); LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); String operName = loginUser.getUsername(); - String message = officeBasePriceUltimateService.batchImport(officeBasePriceUltimates, operName); + String message = officeBasePriceUltimateService.batchImport(yearMonth, officeBasePriceUltimates, operName); return AjaxResult.success(message); } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/domain/UltimateOfficeBasePrice.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/domain/UltimateOfficeBasePrice.java index f57a9810d..0cfa793d0 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/domain/UltimateOfficeBasePrice.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/domain/UltimateOfficeBasePrice.java @@ -19,9 +19,11 @@ public class UltimateOfficeBasePrice extends BaseEntity { private Integer pageSize; @Excel(name = "ID") - private String id; - @JSONField(serialize = false) + private Integer id; +// @JSONField(serialize = false) private Integer yearMonth; + @JSONField(serialize = false) + private Integer lastYearMonth; @Excel(name = "楼栋ID") private String buildingId; @Excel(name = "小区ID") @@ -83,6 +85,14 @@ public class UltimateOfficeBasePrice extends BaseEntity { @Excel(name = "更改价格说明") private String adjustPriceComment; + public Integer getLastYearMonth() { + return lastYearMonth; + } + + public void setLastYearMonth(Integer lastYearMonth) { + this.lastYearMonth = lastYearMonth; + } + public Integer getPageIndex() { return pageIndex; } @@ -99,11 +109,11 @@ public class UltimateOfficeBasePrice extends BaseEntity { this.pageSize = pageSize; } - public String getId() { + public Integer getId() { return id; } - public void setId(String id) { + public void setId(Integer id) { this.id = id; } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/ComputeResidenceRentPriceMapper.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/ComputeResidenceRentPriceMapper.java index b069187d8..34b18f1fe 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/ComputeResidenceRentPriceMapper.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/ComputeResidenceRentPriceMapper.java @@ -1,6 +1,7 @@ package com.ruoyi.project.data.price.mapper; import com.baomidou.dynamic.datasource.annotation.DS; +import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice; import java.util.List; @@ -40,4 +41,9 @@ public interface ComputeResidenceRentPriceMapper { * @return */ int updateComputeResidenceRentBasePrice(ComputeResidenceRentBasePrice ComputeResidenceRentBasePrice); + + /** + * @return + */ + List<VueSelectModel> yearMonthList(); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/UltimateOfficeBasePriceMapper.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/UltimateOfficeBasePriceMapper.java index beba4c1e7..a5019875f 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/UltimateOfficeBasePriceMapper.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/UltimateOfficeBasePriceMapper.java @@ -1,46 +1,77 @@ package com.ruoyi.project.data.price.mapper; +import java.math.BigDecimal; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; +import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice; /** - * 【请填写功能名称】Mapper接口 - * + * 办公基价Mapper接口 + * * @author ruoyi * @date 2020-05-20 */ -@DS("teemlink") -public interface UltimateOfficeBasePriceMapper -{ +@DS("compute") +public interface UltimateOfficeBasePriceMapper { /** - * + * @param yearMonth * @param id * @return */ - UltimateOfficeBasePrice selectOfficeBasePriceUltimateById(String id); + UltimateOfficeBasePrice getById(Integer yearMonth, Integer id); /** - * 查询【请填写功能名称】列表 - * - * @param officeBasePriceUltimate 【请填写功能名称】 - * @return 【请填写功能名称】集合 + * @param yearMonth + * @param buildingId + * @return */ - List<UltimateOfficeBasePrice> selectOfficeBasePriceUltimateList(UltimateOfficeBasePrice officeBasePriceUltimate); + UltimateOfficeBasePrice getByBuildingId(Integer yearMonth, String buildingId); + + /** + * 查询办公基价列表 + * + * @param officeBasePriceUltimate 办公基价 + * @return 办公基价集合 + */ + List<UltimateOfficeBasePrice> getList(UltimateOfficeBasePrice officeBasePriceUltimate); /** * 求和 + * * @param officeBasePriceUltimate * @return */ - Integer selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate); + Integer getCount(UltimateOfficeBasePrice officeBasePriceUltimate); /** * 更新 - * @param officeBasePriceUltimate + * + * @param yearMonth + * @param id + * @param mainPrice + * @param mainPriceRent * @return */ - int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate); + int update(Integer yearMonth, Integer lastYearMonth, int id, BigDecimal mainPrice, BigDecimal mainPriceRent); + + + /** + * 年月 + * + * @return + */ + List<VueSelectModel> getYearMonthList(); + + /** + * 更新 + * + * @param yearMonth + * @param id + * @return + */ + int copyCreate(Integer yearMonth, Integer id); + } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IComputeResidenceRentPriceService.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IComputeResidenceRentPriceService.java index 0c56aaf3c..b2a9567ee 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IComputeResidenceRentPriceService.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IComputeResidenceRentPriceService.java @@ -1,5 +1,6 @@ package com.ruoyi.project.data.price.service; +import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice; import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice; import org.apache.ibatis.annotations.Param; @@ -47,6 +48,12 @@ public interface IComputeResidenceRentPriceService { */ String batchImport(List<ComputeResidenceRentBasePrice> officeBasePriceUltimates, String operName); + /** + * 获取表名 + * + * @return + */ + List<VueSelectModel> getYearMonth(); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateOfficeBasePriceService.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateOfficeBasePriceService.java index 509f9db84..80b7b4ba4 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateOfficeBasePriceService.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateOfficeBasePriceService.java @@ -1,11 +1,12 @@ package com.ruoyi.project.data.price.service; +import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice; import java.util.List; /** - * 【请填写功能名称】Service接口 + * 办公基价Service接口 * * @author ruoyi * @date 2020-05-20 @@ -13,19 +14,28 @@ import java.util.List; public interface IUltimateOfficeBasePriceService { /** - * 查询【请填写功能名称】列表 + * 查询办公基价列表 * - * @param officeBasePriceUltimate 【请填写功能名称】 - * @return 【请填写功能名称】集合 + * @param officeBasePriceUltimate 办公基价 + * @return 办公基价集合 */ List<UltimateOfficeBasePrice> selectOfficeBasePriceUltimateList(UltimateOfficeBasePrice officeBasePriceUltimate); int selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate); + /** + * + * @param id + * @return + */ + UltimateOfficeBasePrice getById(Integer yearMonth, Integer id); - UltimateOfficeBasePrice selectOfficeBasePriceUltimateById(String id); - - int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate); +// /** +// * +// * @param officeBasePriceUltimate +// * @return +// */ +// int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate); /** * @@ -33,7 +43,13 @@ public interface IUltimateOfficeBasePriceService { * @param operName * @return */ - String batchImport(List<UltimateOfficeBasePrice> officeBasePriceUltimates,String operName); + String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates,String operName); + + /** + * + * @return + */ + List<VueSelectModel> getYearMonthList(); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ComputeResidenceRentPriceServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ComputeResidenceRentPriceServiceImpl.java index 857d0f1d4..46a9a8613 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ComputeResidenceRentPriceServiceImpl.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ComputeResidenceRentPriceServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.project.data.price.service.impl; +import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice; import com.ruoyi.project.data.price.mapper.ComputeResidenceRentPriceMapper; import com.ruoyi.project.data.price.service.IComputeResidenceRentPriceService; @@ -48,4 +49,9 @@ public class ComputeResidenceRentPriceServiceImpl implements IComputeResidenceRe public String batchImport(List<ComputeResidenceRentBasePrice> officeBasePriceUltimates, String operName) { return null; } + + @Override + public List<VueSelectModel> getYearMonth() { + return computeResidenceRentPriceMapper.yearMonthList(); + } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateOfficeBasePriceServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateOfficeBasePriceServiceImpl.java index 11210cec8..d51187bb7 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateOfficeBasePriceServiceImpl.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateOfficeBasePriceServiceImpl.java @@ -1,9 +1,12 @@ package com.ruoyi.project.data.price.service.impl; +import java.math.BigDecimal; +import java.util.Calendar; import java.util.List; import com.ruoyi.common.exception.CustomException; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice; import com.ruoyi.project.data.price.mapper.UltimateOfficeBasePriceMapper; import com.ruoyi.project.data.price.service.IUltimateOfficeBasePriceService; @@ -14,7 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** - * 【请填写功能名称】Service业务层处理 + * 办公基价Service业务层处理 * * @author ruoyi * @date 2020-05-20 @@ -27,53 +30,70 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr @Autowired private UltimateOfficeBasePriceMapper officeBasePriceUltimateMapper; + private static Integer getLastYearMonth(Integer yearMonth) { + Calendar calendar = Calendar.getInstance(); + calendar.set(yearMonth / 100, yearMonth % 100, 1); + return new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) - 1)); + } + /** - * 查询【请填写功能名称】列表 + * 查询办公基价列表 * - * @param officeBasePriceUltimate 【请填写功能名称】 - * @return 【请填写功能名称】 + * @param officeBasePriceUltimate 办公基价 + * @return 办公基价 */ @Override public List<UltimateOfficeBasePrice> selectOfficeBasePriceUltimateList(UltimateOfficeBasePrice officeBasePriceUltimate) { - return officeBasePriceUltimateMapper.selectOfficeBasePriceUltimateList(officeBasePriceUltimate); + officeBasePriceUltimate.setLastYearMonth(getLastYearMonth(officeBasePriceUltimate.getYearMonth())); + return officeBasePriceUltimateMapper.getList(officeBasePriceUltimate); } @Override public int selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate) { - return officeBasePriceUltimateMapper.selectOfficeBasePriceUltimateListCount(officeBasePriceUltimate); + officeBasePriceUltimate.setLastYearMonth(getLastYearMonth(officeBasePriceUltimate.getYearMonth())); + return officeBasePriceUltimateMapper.getCount(officeBasePriceUltimate); } @Override - public UltimateOfficeBasePrice selectOfficeBasePriceUltimateById(String id) { - return officeBasePriceUltimateMapper.selectOfficeBasePriceUltimateById(id); + public UltimateOfficeBasePrice getById(Integer yearMonth, Integer id) { + return officeBasePriceUltimateMapper.getById(yearMonth, id); } @Override - public int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate) { - return officeBasePriceUltimateMapper.updateOfficeBasePriceUltimate(officeBasePriceUltimate); - } - - @Override - public String batchImport(List<UltimateOfficeBasePrice> officeBasePriceUltimates, String operName) { + public String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates, + String operName) { if (StringUtils.isNull(officeBasePriceUltimates) || officeBasePriceUltimates.size() == 0) { throw new CustomException("导入办公数据不能为空!"); } int successNum = 0; int failureNum = 0; + int insertNum = 0; StringBuilder successMsg = new StringBuilder(); StringBuilder failureMsg = new StringBuilder(); + Integer lastYearMonth = getLastYearMonth(yearMonth); + for (UltimateOfficeBasePrice officeBasePriceUltimate : officeBasePriceUltimates) { try { // 验证是否存在这个用户 UltimateOfficeBasePrice officeBasePriceUltimateInDb = - officeBasePriceUltimateMapper.selectOfficeBasePriceUltimateById(officeBasePriceUltimate.getId()); - if (StringUtils.isNotNull(officeBasePriceUltimateInDb)) { - this.updateOfficeBasePriceUltimate(officeBasePriceUltimate); - successNum++; - successMsg.append("<br/>" + successNum + "、ID= " + officeBasePriceUltimate.getId() + " 更新成功"); + officeBasePriceUltimateMapper.getById(yearMonth, officeBasePriceUltimate.getId()); + UltimateOfficeBasePrice lastUltimateOfficeBasePrice = + officeBasePriceUltimateMapper.getByBuildingId(lastYearMonth, + officeBasePriceUltimate.getBuildingId()); + if (!StringUtils.isNotNull(officeBasePriceUltimateInDb)) { + if (officeBasePriceUltimateInDb.getMainPrice().subtract(officeBasePriceUltimate.getMainPrice()).compareTo(BigDecimal.ZERO) != 0 + || officeBasePriceUltimateInDb.getMainPriceRent().subtract(officeBasePriceUltimate.getMainPriceRent()).compareTo(BigDecimal.ZERO) != 0) { + int id = officeBasePriceUltimateMapper.copyCreate(yearMonth, officeBasePriceUltimate.getId()); + + officeBasePriceUltimateMapper.update(yearMonth, lastYearMonth, id, + officeBasePriceUltimate.getMainPrice(), + officeBasePriceUltimate.getMainPriceRent()); + successNum++; + successMsg.append("<br/>" + successNum + "、ID= " + officeBasePriceUltimate.getId() + " 更新成功"); + } } else { failureNum++; - failureMsg.append("<br/>" + failureNum + "、ID= " + officeBasePriceUltimate.getId() + " 已存在"); + failureMsg.append("<br/>" + failureNum + "、ID= " + officeBasePriceUltimate.getId() + " 失败"); } } catch (Exception e) { failureNum++; @@ -90,4 +110,9 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr } return successMsg.toString(); } + + @Override + public List<VueSelectModel> getYearMonthList() { + return officeBasePriceUltimateMapper.getYearMonthList(); + } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/UploadFile.java b/ruoyi/src/main/java/com/ruoyi/project/system/domain/UploadFile.java new file mode 100644 index 000000000..33cc69644 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/domain/UploadFile.java @@ -0,0 +1,54 @@ +package com.ruoyi.project.system.domain; + +import com.ruoyi.framework.web.domain.BaseEntity; +import io.swagger.models.auth.In; + +import java.util.Date; + +public class UploadFile extends BaseEntity { + private Long id; + private String fk; + private String moduleName; + private String saveFileName; + private String fileName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFk() { + return fk; + } + + public void setFk(String fk) { + this.fk = fk; + } + + public String getModuleName() { + return moduleName; + } + + public void setModuleName(String moduleName) { + this.moduleName = moduleName; + } + + public String getSaveFileName() { + return saveFileName; + } + + public void setSaveFileName(String saveFileName) { + this.saveFileName = saveFileName; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/mapper/UploadFileMapper.java b/ruoyi/src/main/java/com/ruoyi/project/system/mapper/UploadFileMapper.java new file mode 100644 index 000000000..df12fad2c --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/mapper/UploadFileMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.project.system.mapper; + +import com.ruoyi.project.system.domain.UploadFile; + +import java.util.List; + +public interface UploadFileMapper { + /** + * 插入文件记录 + * + * @param uploadFile + * @return + */ + int insert(UploadFile uploadFile); + + /** + * 获取上传文件 + * + * @param fk + * @return + */ + List<UploadFile> getByFk(String fk); + +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/service/IUploadFileService.java b/ruoyi/src/main/java/com/ruoyi/project/system/service/IUploadFileService.java new file mode 100644 index 000000000..422a5aaa8 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/service/IUploadFileService.java @@ -0,0 +1,26 @@ +package com.ruoyi.project.system.service; + +import com.ruoyi.project.system.domain.UploadFile; + +import java.util.List; + +/** + * 通用文件保存 业务层 + * + * @author purple + */ +public interface IUploadFileService +{ + /** + * 记录上传文件 + * @param uploadFile + */ + int insert(UploadFile uploadFile); + + /** + * 获取文件上传 + * @param fk + * @return + */ + List<UploadFile> getByFk(String fk); +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/UploadFileServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/UploadFileServiceImpl.java new file mode 100644 index 000000000..4407bce5f --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/system/service/impl/UploadFileServiceImpl.java @@ -0,0 +1,34 @@ +package com.ruoyi.project.system.service.impl; + +import com.ruoyi.project.system.domain.*; +import com.ruoyi.project.system.mapper.*; +import com.ruoyi.project.system.service.IUploadFileService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户 业务层处理 + * + * @author ruoyi + */ +@Service +public class UploadFileServiceImpl implements IUploadFileService { + private static final Logger log = LoggerFactory.getLogger(UploadFileServiceImpl.class); + @Autowired + private UploadFileMapper fileMapper; + + + @Override + public int insert(UploadFile uploadFile) { + return fileMapper.insert(uploadFile); + } + + @Override + public List<UploadFile> getByFk(String fk) { + return fileMapper.getByFk(fk); + } +} diff --git a/ruoyi/src/main/resources/application-druid.yml b/ruoyi/src/main/resources/application-druid.yml index 1e36704bb..b9a63c229 100644 --- a/ruoyi/src/main/resources/application-druid.yml +++ b/ruoyi/src/main/resources/application-druid.yml @@ -67,4 +67,9 @@ spring: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute username: sa + password: Lcdatacenter_888 + clean: + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_clean + username: sa password: Lcdatacenter_888 \ No newline at end of file diff --git a/ruoyi/src/main/resources/application-prod.yml b/ruoyi/src/main/resources/application-prod.yml new file mode 100644 index 000000000..a43078b24 --- /dev/null +++ b/ruoyi/src/main/resources/application-prod.yml @@ -0,0 +1,128 @@ +# 项目相关配置 +ruoyi: + # 名称 + name: RuoYi + # 版本 + version: 2.2.0 + # 版权年份 + copyrightYear: 2019 + # 实例演示开关 + demoEnabled: true + # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) + profile: /opt/uv/data/ + # 获取ip地址开关 + addressEnabled: false + +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为8080 + port: 8080 + servlet: + # 应用的访问路径 + context-path: / + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # tomcat最大线程数,默认为200 + max-threads: 800 + # Tomcat启动初始化的线程数,默认值25 + min-spare-threads: 30 + +# 日志配置 +logging: + level: + com.ruoyi: debug + org.springframework: warn + +# Spring配置 +spring: + # 资源信息 + messages: + # 国际化资源文件路径 + basename: i18n/messages + profiles: + active: druid + # 文件上传 + servlet: + multipart: + # 单个文件大小 + max-file-size: 50MB + # 设置总上传的文件大小 + max-request-size: 50MB + # 服务模块 + devtools: + restart: + # 热部署开关 + enabled: true + # redis 配置 + redis: + # 地址 + host: 172.16.30.243 + # 端口,默认为6379 + port: 6030 + # 密码 + password: + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + +# token配置 +token: + # 令牌自定义标识 + header: Authorization + # 令牌秘钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟) + expireTime: 30 + +# MyBatis配置 +mybatis: + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.project.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mybatis/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml + +# PageHelper分页插件 +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql + +# Swagger配置 +swagger: + # 是否开启swagger + enabled: true + # 请求前缀 + pathMapping: /dev-api + +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: /system/notice/* + # 匹配链接 + urlPatterns: /system/*,/monitor/*,/tool/* + +# 代码生成 +gen: + # 作者 + author: ruoyi + # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool + packageName: com.ruoyi.project.system + # 自动去除表前缀,默认是true + autoRemovePre: false + # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) + tablePrefix: sys_ \ No newline at end of file diff --git a/ruoyi/src/main/resources/application.yml b/ruoyi/src/main/resources/application.yml index 13346695f..9b86af7eb 100644 --- a/ruoyi/src/main/resources/application.yml +++ b/ruoyi/src/main/resources/application.yml @@ -46,9 +46,9 @@ spring: servlet: multipart: # 单个文件大小 - max-file-size: 10MB + max-file-size: 50MB # 设置总上传的文件大小 - max-request-size: 20MB + max-request-size: 50MB # 服务模块 devtools: restart: diff --git a/ruoyi/src/main/resources/mybatis/data/ComputeResidenceRentPriceMapper.xml b/ruoyi/src/main/resources/mybatis/data/ComputeResidenceRentPriceMapper.xml index 86968c015..8f122cc4d 100644 --- a/ruoyi/src/main/resources/mybatis/data/ComputeResidenceRentPriceMapper.xml +++ b/ruoyi/src/main/resources/mybatis/data/ComputeResidenceRentPriceMapper.xml @@ -153,7 +153,13 @@ <include refid="selectOfficeBasePriceUltimateVo"/> where id = #{id} </select> - + <!-- 获取表名 --> + <select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel"> + SELECT right(name,6) as value, right(name,6) as label + FROM sys.tables + where name like 'DWA_PROJECTBASEPRICE_RENT_IMDT_%' + order by cast(right(name,6) as int) desc + </select> <!-- <update id="updateComputeResidenceRentBasePrice" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">--> <!-- update TLK_计价办公核准基价 set ITEM_YEARMONTH=ITEM_YEARMONTH--> diff --git a/ruoyi/src/main/resources/mybatis/data/LianJiaCommunityDictMapper.xml b/ruoyi/src/main/resources/mybatis/data/LianJiaCommunityDictMapper.xml new file mode 100644 index 000000000..b645ebd46 --- /dev/null +++ b/ruoyi/src/main/resources/mybatis/data/LianJiaCommunityDictMapper.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.project.data.basis.mapper.LianJiaCommunityDictMapper"> + + <select id="selectPageOfList" resultType="com.ruoyi.project.data.basis.domain.LianJiaCommunityDict"> + SELECT id + ,lianjia_community_id AS lianJiaCommunityid + ,lianjia_community_name as lianJiaCommunityName + ,lianjia_community_address as lianJiaCommunityAddress + ,lianjia_url as lianJiaUrl + ,lianjia_community_url as lianJiaCommunityUrl + ,community_id as communityId + ,building_id as buildingId + ,clean_community_name as cleanCommunityName + ,clean_community_address as cleanCommunityAddress + ,clean_building_address as cleanBuildingAddress + ,enable + ,create_time as createTime + FROM lianjia_dictionary + <where> + <if test="lianJiaCommunityId != null"> + lianjia_community_id = #{lianJiaCommunityId} + </if> + <if test="enable != null"> + AND enable = #{enable} + </if> + <if test="communityId != null"> + AND community_id = #{communityId} + </if> + <if test="buildingId != null"> + AND building_id = #{buildingId} + </if> + <if test="lianJiaUrl != null"> + AND lianjia_url = #{lianJiaUrl} + </if> + </where> + order by create_time DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only + </select> + + <select id="selectPageOfTotal" resultType="int"> + select count(1) from lianjia_dictionary + <where> + <if test="lianJiaCommunityId != null"> + lianjia_community_id = #{lianJiaCommunityId} + </if> + <if test="enable != null"> + AND enable = #{enable} + </if> + <if test="communityId != null"> + AND community_id = #{communityId} + </if> + <if test="buildingId != null"> + AND building_id = #{buildingId} + </if> + <if test="lianJiaUrl != null"> + AND lianjia_url = #{lianJiaUrl} + </if> + </where> + </select> + <select id="selectById" resultType="com.ruoyi.project.data.basis.domain.LianJiaCommunityDict"> + SELECT id + ,lianjia_community_id AS lianJiaCommunityid + ,lianjia_community_name as lianJiaCommunityName + ,lianjia_community_address as lianJiaCommunityAddress + ,lianjia_url as lianJiaUrl + ,lianjia_community_url as lianJiaCommunityUrl + ,community_id as communityId + ,building_id as buildingId + ,clean_community_name as cleanCommunityName + ,clean_community_address as cleanCommunityAddress + ,clean_building_address as cleanBuildingAddress + ,enable + ,create_time as createTime + FROM lianjia_dictionary + where id=#{id} + </select> +</mapper> \ No newline at end of file diff --git a/ruoyi/src/main/resources/mybatis/data/UltimateOfficeBasePriceMapper.xml b/ruoyi/src/main/resources/mybatis/data/UltimateOfficeBasePriceMapper.xml index 674faf03d..6b7c998ec 100644 --- a/ruoyi/src/main/resources/mybatis/data/UltimateOfficeBasePriceMapper.xml +++ b/ruoyi/src/main/resources/mybatis/data/UltimateOfficeBasePriceMapper.xml @@ -7,79 +7,151 @@ <resultMap type="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" id="OfficeBasePriceUltimateResult"> <result property="id" column="id"/> - <result property="yearMonth" column="ITEM_YEARMONTH"/> - <result property="buildingId" column="ITEM_BUILDINGID_P"/> - <result property="communityId" column="ITEM_PROJECTID_P"/> - <result property="mainPrice" column="ITEM_MAINPRICE"/> - <result property="mainPriceRent" column="ITEM_MAINPRICERENT"/> - <result property="mainPricePst" column="ITEM_MAINPRICEPST"/> - <result property="mainPriceRentPst" column="ITEM_MAINPRICERENTPST"/> - <result property="mainPriceType" column="ITEM_MAINPRICETYPE"/> - <result property="mainPriceRentType" column="ITEM_MAINPRICERENTTYPE"/> - <result property="updateDate" column="ITEM_MODIFYDATE"/> - <result property="status" column="ITEM_STATUS"/> - <result property="isStandardBuilding" column="ITEM_BUILDINGSTD"/> - <result property="adjustPriceComment" column="ITEM_ADJEVD"/> + <result property="yearMonth" column="yearMonth"/> + <result property="buildingId" column="BuildingID_P"/> + <result property="communityId" column="ProjectID_P"/> + <result property="mainPrice" column="MainPrice"/> + <result property="mainPriceRent" column="MainPriceRent"/> + <result property="mainPricePst" column="MainPricePst"/> + <result property="mainPriceRentPst" column="MainPriceRentPst"/> + <result property="mainPriceType" column="MainPriceType"/> + <result property="mainPriceRentType" column="MainPriceRentType"/> + <result property="updateDate" column="ModifyDate"/> + <result property="status" column="Status"/> + <result property="isStandardBuilding" column="BuildingStd"/> + <result property="adjustPriceComment" column="AdjEvd"/> + <result property="areaCoefficient" column="AreaCoff"/> + <result property="yearCoefficient" column="YearCoff"/> + <result property="buildingCoefficient" column="BuildingCoff"/> + + <result property="communityName" column="ProjectName"/> + <result property="communityAddress" column="ProjectAddr"/> + <result property="buildingAddress" column="BuildingAddr"/> + <result property="countyName" column="County"/> + <result property="loopName" column="Loop"/> + <result property="blockName" column="Block"/> + <result property="streetName" column="Street"/> + <result property="year" column="year"/> + <result property="avgArea" column="AvgArea"/> + <result property="totalFloorSum" column="TotalFloorSum"/> + <result property="upperFloorSum" column="UpperFloorSum"/> + <result property="officeClass" column="OfficeClass"/> + <result property="officeLevel" column="Grade"/> + <result property="mainPrice_1" column="mainPrice_1"/> + <result property="mainPriceRent_1" column="mainPriceRent_1"/> </resultMap> <sql id="selectOfficeBasePriceUltimateVo"> - select ITEM_YEARMONTH,ITEM_BUILDINGID,ITEM_UNIFIEDID,ITEM_PROJECTID,ITEM_BUILDINGID_P,ITEM_PROJECTID_P,ITEM_MAINPRICE,ITEM_MAINPRICERENT,ITEM_MAINPRICEPST,ITEM_MAINPRICERENTPST,ITEM_MAINPRICETYPE,ITEM_MAINPRICERENTTYPE,ITEM_MODIFYDATE,ITEM_STATUS,ITEM_BUILDINGSTD,ITEM_ADJEVD,ID from TLK_计价办公核准基价 + SELECT a.ID + ,a.BuildingID_P + ,a.ProjectID_P + ,a.MainPrice + ,a.MainPriceRent + ,a.MainPricePst + ,a.MainPriceRentPst + ,a.MainPriceType + ,a.MainPriceRentType + ,a.ModifyDate + ,a.Status + ,a.BuildingStd + ,a.AdjEvd + ,b.AreaCoff + ,b.YearCoff + ,b.BuildingCoff + ,b.ProjectName + ,b.ProjectAddr + ,b.BuildingAddr + ,b.County + ,b.Loop + ,b.Block + ,b.Street + ,b.Year + ,b.AvgArea + ,b.TotalFloorSum + ,b.UpperFloorSum + ,b.OfficeClass + ,b.Grade + ,c.MainPrice AS mainPrice_1 + ,c.MainPriceRent as mainPriceRent_1 + , ${yearMonth} as yearMonth + FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a + left join DIM_OFFICE_PROJECT_BUILDING_201909 b on a.BuildingID_P=b.BuildingID_P + left join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} c on a.BuildingID_P = c.BuildingID_P + WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND A.STATUS=1 AND + c.Status=1 </sql> - <select id="selectOfficeBasePriceUltimateListCount" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" resultType="int"> - select count(1) from TLK_计价办公核准基价 + <select id="getCount" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" resultType="int"> + select count(1) FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a + left join DIM_OFFICE_PROJECT_BUILDING_201909 b on a.BuildingID_P=b.BuildingID_P + left join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} c on a.BuildingID_P = c.BuildingID_P + WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND A.STATUS=1 AND + c.Status=1 <where> - <if test="yearMonth != null"> - AND ITEM_YEARMONTH = #{yearMonth} - </if> <if test="communityId != null"> - AND ITEM_PROJECTID_P = #{communityId} + AND a.PROJECTID_P = #{communityId} </if> <if test="buildingId != null"> - AND ITEM_BUILDINGID_P = #{buildingId} + AND a.BUILDINGID_P = #{buildingId} </if> <if test="status != null"> - AND ITEM_STATUS = #{status} + AND a.STATUS = #{status} </if> </where> </select> - <select id="selectOfficeBasePriceUltimateList" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" + <select id="getList" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" resultMap="OfficeBasePriceUltimateResult"> <include refid="selectOfficeBasePriceUltimateVo"/> <where> - <if test="yearMonth != null"> - AND ITEM_YEARMONTH = #{yearMonth} - </if> <if test="communityId != null"> - AND ITEM_PROJECTID_P = #{communityId} + AND a.PROJECTID_P = #{communityId} </if> <if test="buildingId != null"> - AND ITEM_BUILDINGID_P = #{buildingId} + AND a.BUILDINGID_P = #{buildingId} + </if> + <if test="status != null"> + AND a.STATUS = #{status} </if> </where> - order by ITEM_YEARMONTH DESC,ID DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only; + order by a.BUILDINGID_P ASC,a.ID DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only; </select> - <select id="selectOfficeBasePriceUltimateById" parameterType="String" resultMap="OfficeBasePriceUltimateResult"> + <select id="getById" parameterType="String" resultMap="OfficeBasePriceUltimateResult"> <include refid="selectOfficeBasePriceUltimateVo"/> where id = #{id} </select> - <!-- <insert id="insertOfficeBasePriceUltimate" parameterType="OfficeBasePriceUltimate" useGeneratedKeys="true"--> - <!-- keyProperty="id">--> - <!-- insert into office_base_price_ultimate--> - <!-- <trim prefix="(" suffix=")" suffixOverrides=",">--> - <!-- </trim>--> - <!-- <trim prefix="values (" suffix=")" suffixOverrides=",">--> - <!-- </trim>--> - <!-- </insert>--> - - <update id="updateOfficeBasePriceUltimate" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice"> - update TLK_计价办公核准基价 set ITEM_YEARMONTH=ITEM_YEARMONTH - <trim prefix="SET" suffixOverrides=","> - </trim> - where id = #{id} + <insert id="copyCreate"> + <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> + SELECT LAST_INSERT_ID() + </selectKey> + insert into + dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}(BuildingID,UnifiedID,ProjectID,BuildingID_P,ProjectID_P,MainPrice,MainPriceRent,MainPricePst,MainPriceRentPst,MainPriceType,MainPriceRentType,ModifyDate,Status,BuildingStd,AdjEvd) + select BuildingID,UnifiedID,ProjectID,BuildingID_P,ProjectID_P,MainPrice,MainPriceRent,MainPricePst,MainPriceRentPst,MainPriceType,MainPriceRentType,ModifyDate,0,BuildingStd,AdjEvd + from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} + where id=#{id} + </insert> + <!-- 更新 --> + <update id="update"> + update a set ModifyDate=getdate(), mainPrice=#{mainPrice}, mainPriceRent=#{mainPriceRent}, + mainPricePst = #{mainPrice} * 1.0 / b.mainPrice, mainPriceRentPst = #{mainPriceRentPst} * 1.0 / b.mainPriceRentPst + from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} b on + a.BuildingID_p=b.BuildingID_P + where a.Status=1 and b.Status=1 and a.id=#{id} </update> + <!-- 获取表名 --> + <select id="getYearMonthList" resultType="com.ruoyi.project.common.VueSelectModel"> + SELECT right(name,6) as value, right(name,6) as label + FROM sys.tables + where name like 'ODS_OFFICE_BUILDING_PRICE_INFO_%' + order by cast(right(name,6) as int) desc + </select> + <!-- --> + <select id="getByBuildingId" resultType="com.ruoyi.project.data.price.controller.UltimateOfficeBasePriceController"> + select id,MainPrice,MainPriceRent + from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} + where BuildingID_P=#{buildingI} + </select> </mapper> \ No newline at end of file diff --git a/ruoyi/src/main/resources/mybatis/system/UploadFileMapper.xml b/ruoyi/src/main/resources/mybatis/system/UploadFileMapper.xml new file mode 100644 index 000000000..5b0fa60dc --- /dev/null +++ b/ruoyi/src/main/resources/mybatis/system/UploadFileMapper.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.project.system.mapper.UploadFileMapper"> + + <resultMap type="SysUserRole" id="SysUserRoleResult"> + <result property="userId" column="user_id" /> + <result property="roleId" column="role_id" /> + </resultMap> + <insert id="insert" parameterType="com.ruoyi.project.system.domain.UploadFile"> + insert into sys_file(fk, save_file_name, file_name, module_name, create_by, create_time) + value (#{fk},#{saveFileName},#{fileName},#{moduleName},#{createBy},now()); + </insert> + + <delete id="delete" parameterType="Long"> + delete from sys_file where id=#{id}; + </delete> + + <select id="getByFk" parameterType="com.ruoyi.project.system.domain.UploadFile"> + select fk, save_file_name as saveFileName, file_name as fileName, module_name as moduleName, create_by as + createBy, create_time as createTime + from sys_file where fk=#{fk} + </select> +</mapper> \ No newline at end of file diff --git a/ruoyi/src/test/java/com/uvaluation/compute/MapperXmlGeneratorTests.java b/ruoyi/src/test/java/com/uvaluation/compute/MapperXmlGeneratorTests.java index 67f6cb663..9e4332e32 100644 --- a/ruoyi/src/test/java/com/uvaluation/compute/MapperXmlGeneratorTests.java +++ b/ruoyi/src/test/java/com/uvaluation/compute/MapperXmlGeneratorTests.java @@ -2,12 +2,11 @@ package com.uvaluation.compute; import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice; import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice; +import org.junit.Assert; import org.junit.Test; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.*; public class MapperXmlGeneratorTests { @@ -29,4 +28,13 @@ public class MapperXmlGeneratorTests { } System.out.println(sb.toString()); } + + @Test + public void testDate(){ + Calendar calendar = Calendar.getInstance(); + calendar.set(202006 / 100, 202006 % 100, 1); + Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR), + calendar.get(Calendar.MONTH)-1)); + Assert.assertTrue(Objects.equals(lastYearMonth,202005)); + } }