数据平台前后端分离
This commit is contained in:
parent
83cb560f6a
commit
23db85a2c1
@ -1,74 +1,74 @@
|
||||
import axios from 'axios'
|
||||
import { Notification, MessageBox, Message } from 'element-ui'
|
||||
import store from '@/store'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
// 超时
|
||||
timeout: 10000
|
||||
})
|
||||
// request拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(res => {
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200;
|
||||
// 获取错误信息
|
||||
const message = errorCode[code] || res.data.msg || errorCode['default']
|
||||
if (code === 401) {
|
||||
MessageBox.confirm(
|
||||
'登录状态已过期,您可以继续留在该页面,或者重新登录',
|
||||
'系统提示',
|
||||
{
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
).then(() => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.reload() // 为了重新实例化vue-router对象 避免bug
|
||||
})
|
||||
})
|
||||
} else if (code === 500) {
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error'
|
||||
})
|
||||
return Promise.reject(new Error(message))
|
||||
} else if (code !== 200) {
|
||||
Notification.error({
|
||||
title: message
|
||||
})
|
||||
return Promise.reject('error')
|
||||
} else {
|
||||
return res.data
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
Message({
|
||||
message: error.message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default service
|
||||
import axios from 'axios'
|
||||
import { Notification, MessageBox, Message } from 'element-ui'
|
||||
import store from '@/store'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
// 超时
|
||||
timeout: 30 * 1000
|
||||
})
|
||||
// request拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(res => {
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200;
|
||||
// 获取错误信息
|
||||
const message = errorCode[code] || res.data.msg || errorCode['default']
|
||||
if (code === 401) {
|
||||
MessageBox.confirm(
|
||||
'登录状态已过期,您可以继续留在该页面,或者重新登录',
|
||||
'系统提示',
|
||||
{
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
).then(() => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.reload() // 为了重新实例化vue-router对象 避免bug
|
||||
})
|
||||
})
|
||||
} else if (code === 500) {
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error'
|
||||
})
|
||||
return Promise.reject(new Error(message))
|
||||
} else if (code !== 200) {
|
||||
Notification.error({
|
||||
title: message
|
||||
})
|
||||
return Promise.reject('error')
|
||||
} else {
|
||||
return res.data
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
Message({
|
||||
message: error.message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default service
|
||||
|
@ -42,16 +42,6 @@
|
||||
</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:ultimate:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
@ -72,11 +62,11 @@
|
||||
</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 v-loading="loading" :data="dataList">
|
||||
<!-- <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="小区ID" align="center" prop="communityId" width="110" />
|
||||
<el-table-column label="楼栋ID" align="center" prop="buildingId" width="110" />
|
||||
<el-table-column label="项目名称" align="center" prop="communityName" />
|
||||
<el-table-column label="办公项目地址" align="center" prop="communityAddress" />
|
||||
<el-table-column label="楼栋地址" align="center" prop="buildingAddress" />
|
||||
@ -104,7 +94,12 @@
|
||||
/>
|
||||
<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">
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -113,13 +108,6 @@
|
||||
@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>
|
||||
@ -134,52 +122,149 @@
|
||||
|
||||
<!-- 添加或修改办公基价对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="160px">
|
||||
<el-form ref="form" :model="form" :rules="updateRules" 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-input v-model="form.communityId" disabled 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-input v-model="form.buildingId" disabled 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 label="项目名称">
|
||||
<el-input v-model="form.communityName" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主力租金(元/月·㎡)">
|
||||
<el-input v-model="form.mainPriceRent" />
|
||||
<el-form-item label="办公项目地址">
|
||||
<el-input v-model="form.communityAddress" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :span="24">
|
||||
<el-form-item label="楼栋地址">
|
||||
<el-input v-model="form.buildingAddress" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="楼栋地址">
|
||||
<el-input v-model="form.complexRegion" disabled 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.year" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年份修正系数">
|
||||
<el-input v-model="form.yearCoefficient" disabled 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.avgArea" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面积修正系数">
|
||||
<el-input v-model="form.areaCoefficient" disabled 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.complexFloorInfo" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="办公分类-办公等级">
|
||||
<el-input v-model="form.complexOfficeInfo" disabled 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.mainPricePst" />
|
||||
<el-input v-model="form.mainPricePst" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主力租金涨跌幅">
|
||||
<el-input v-model="form.mainPriceRentPst" />
|
||||
<el-input v-model="form.mainPriceRentPst" disabled 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.mainPriceType" />
|
||||
<el-input v-model="form.mainPriceType" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主力租金类型">
|
||||
<el-input v-model="form.mainPriceRentType" />
|
||||
<el-input v-model="form.mainPriceRentType" disabled 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.buildingCoefficient" disabled readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否标准楼栋">
|
||||
<el-input
|
||||
v-model="form.standardBuilding"
|
||||
disabled
|
||||
readonly
|
||||
:formatter="yesOrNotFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主力基价(上期)" prop="mainPrice_1">
|
||||
<el-input v-model="form.mainPrice_1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主力租金(上期)" prop="mainPriceRent_1">
|
||||
<el-input v-model="form.mainPriceRent_1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主力基价(元/㎡)" prop="mainPrice">
|
||||
<el-input v-model="form.mainPrice" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主力租金(元/月·㎡)" prop="mainPriceRent">
|
||||
<el-input v-model="form.mainPriceRent" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="更改价格说明">
|
||||
<el-input v-model="form.adjustPriceComment" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -190,7 +275,13 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="80%"
|
||||
top="10vh"
|
||||
append-to-body
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
@ -241,6 +332,19 @@ export default {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
var checkPrice = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error("请输入价格"));
|
||||
} else if (value === "" || isNaN(parseFloat(value))) {
|
||||
callback(new Error("请输入价格"));
|
||||
} else {
|
||||
if (value <= 0) {
|
||||
callback(new Error("请输入合理价格"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -254,7 +358,7 @@ export default {
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 办公基价表格数据
|
||||
ultimateList: [],
|
||||
dataList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@ -293,6 +397,28 @@ export default {
|
||||
{ validator: checkYearMonth, trigger: "blur" },
|
||||
{ validator: checkYearMonth, trigger: "change" }
|
||||
]
|
||||
},
|
||||
updateRules: {
|
||||
yearMonth: [
|
||||
{ validator: checkYearMonth, trigger: "blur" },
|
||||
{ validator: checkYearMonth, trigger: "change" }
|
||||
],
|
||||
mainPrice: [
|
||||
{ validator: checkPrice, trigger: "blur" },
|
||||
{ validator: checkPrice, trigger: "change" }
|
||||
],
|
||||
mainPriceRent: [
|
||||
{ validator: checkPrice, trigger: "blur" },
|
||||
{ validator: checkPrice, trigger: "change" }
|
||||
],
|
||||
mainPrice_1: [
|
||||
{ validator: checkPrice, trigger: "blur" },
|
||||
{ validator: checkPrice, trigger: "change" }
|
||||
],
|
||||
mainPriceRent_1: [
|
||||
{ validator: checkPrice, trigger: "blur" },
|
||||
{ validator: checkPrice, trigger: "change" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -375,7 +501,25 @@ export default {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
const yearMonth = row.yearMonth;
|
||||
console.log(yearMonth);
|
||||
getById(yearMonth, id).then(response => {
|
||||
// 复合信息
|
||||
response.data.complexRegion =
|
||||
response.data.countyName +
|
||||
"-" +
|
||||
response.data.blockName +
|
||||
"-" +
|
||||
response.data.loopName +
|
||||
"-" +
|
||||
response.data.streetName +
|
||||
"-" +
|
||||
response.data.buildingAddress;
|
||||
// 办公信息
|
||||
response.data.complexOfficeInfo =
|
||||
response.data.officeClass + "-" + response.data.officeLevel;
|
||||
// 层数信息
|
||||
response.data.complexFloorInfo =
|
||||
response.data.upperFloorSum + "-" + response.data.totalFloorSum;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改办公基价";
|
||||
|
@ -76,15 +76,15 @@ public class UltimateOfficeBasePriceController extends BaseController {
|
||||
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.update(officeBasePriceUltimate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出办公基价列表
|
||||
|
@ -0,0 +1,67 @@
|
||||
package com.ruoyi.project.data.price.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class OfficeBasePriceModifyModel {
|
||||
private Integer id;
|
||||
private Integer yearMonth;
|
||||
private BigDecimal mainPrice;
|
||||
private BigDecimal mainPricePst;
|
||||
private BigDecimal mainPriceRent;
|
||||
private BigDecimal mainPriceRentPst;
|
||||
private String comment;
|
||||
|
||||
public OfficeBasePriceModifyModel(Integer id, Integer yearMonth) {
|
||||
this.id = id;
|
||||
this.yearMonth = yearMonth;
|
||||
}
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Integer getYearMonth() {
|
||||
return yearMonth;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPrice() {
|
||||
return mainPrice;
|
||||
}
|
||||
|
||||
public void setMainPrice(BigDecimal mainPrice) {
|
||||
this.mainPrice = mainPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPricePst() {
|
||||
return mainPricePst;
|
||||
}
|
||||
|
||||
public void setMainPricePst(BigDecimal mainPricePst) {
|
||||
this.mainPricePst = mainPricePst;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPriceRent() {
|
||||
return mainPriceRent;
|
||||
}
|
||||
|
||||
public void setMainPriceRent(BigDecimal mainPriceRent) {
|
||||
this.mainPriceRent = mainPriceRent;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPriceRentPst() {
|
||||
return mainPriceRentPst;
|
||||
}
|
||||
|
||||
public void setMainPriceRentPst(BigDecimal mainPriceRentPst) {
|
||||
this.mainPriceRentPst = mainPriceRentPst;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
}
|
@ -34,13 +34,13 @@ public class UltimateOfficeBasePrice extends BaseEntity {
|
||||
private String communityAddress;
|
||||
@Excel(name = "楼栋地址")
|
||||
private String buildingAddress;
|
||||
@Excel(name = "楼栋地址")
|
||||
@Excel(name = "区域")
|
||||
private String countyName;
|
||||
@Excel(name = "板块地址")
|
||||
@Excel(name = "板块")
|
||||
private String blockName;
|
||||
@Excel(name = "街道地址")
|
||||
@Excel(name = "街道")
|
||||
private String streetName;
|
||||
@Excel(name = "环线地址")
|
||||
@Excel(name = "环线")
|
||||
private String loopName;
|
||||
@Excel(name = "建成年代")
|
||||
private Integer year;
|
||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
|
||||
/**
|
||||
@ -21,7 +22,14 @@ public interface UltimateOfficeBasePriceMapper {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, Integer id);
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, Integer lastYearMonth, Integer id);
|
||||
|
||||
/**
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice getByRouteId(Integer yearMonth, Integer id);
|
||||
|
||||
/**
|
||||
* @param yearMonth
|
||||
@ -47,16 +55,12 @@ public interface UltimateOfficeBasePriceMapper {
|
||||
Integer getCount(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* 更新当期基价
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @param mainPrice
|
||||
* @param mainPriceRent
|
||||
* @param officeBasePriceModifyModel
|
||||
* @return
|
||||
*/
|
||||
int update(Integer yearMonth, Integer lastYearMonth, int id, BigDecimal mainPrice, BigDecimal mainPriceRent);
|
||||
|
||||
int updateBasePrice(OfficeBasePriceModifyModel officeBasePriceModifyModel);
|
||||
|
||||
/**
|
||||
* 年月
|
||||
@ -65,13 +69,4 @@ public interface UltimateOfficeBasePriceMapper {
|
||||
*/
|
||||
List<VueSelectModel> getYearMonthList();
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int copyCreate(Integer yearMonth, Integer id);
|
||||
|
||||
}
|
||||
|
@ -24,29 +24,27 @@ public interface IUltimateOfficeBasePriceService {
|
||||
int selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, Integer id);
|
||||
|
||||
// /**
|
||||
// *
|
||||
// * @param officeBasePriceUltimate
|
||||
// * @return
|
||||
// */
|
||||
// int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
/**
|
||||
* 可能修改当期的价格、也可能修改往期
|
||||
*
|
||||
* @param officeBasePriceUltimate
|
||||
* @return
|
||||
*/
|
||||
int update(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param officeBasePriceUltimates
|
||||
* @param operName
|
||||
* @return
|
||||
*/
|
||||
String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates,String operName);
|
||||
String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates, String operName);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<VueSelectModel> getYearMonthList();
|
||||
|
@ -7,6 +7,7 @@ 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.OfficeBasePriceModifyModel;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import com.ruoyi.project.data.price.mapper.UltimateOfficeBasePriceMapper;
|
||||
import com.ruoyi.project.data.price.service.IUltimateOfficeBasePriceService;
|
||||
@ -56,7 +57,8 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
|
||||
@Override
|
||||
public UltimateOfficeBasePrice getById(Integer yearMonth, Integer id) {
|
||||
return officeBasePriceUltimateMapper.getById(yearMonth, id);
|
||||
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
||||
return officeBasePriceUltimateMapper.getById(yearMonth, lastYearMonth, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -72,32 +74,29 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
||||
|
||||
for (UltimateOfficeBasePrice officeBasePriceUltimate : officeBasePriceUltimates) {
|
||||
for (UltimateOfficeBasePrice inputModel : officeBasePriceUltimates) {
|
||||
try {
|
||||
// 验证是否存在这个用户
|
||||
UltimateOfficeBasePrice officeBasePriceUltimateInDb =
|
||||
officeBasePriceUltimateMapper.getById(yearMonth, officeBasePriceUltimate.getId());
|
||||
UltimateOfficeBasePrice currentUltimateOfficeBasePrice =
|
||||
officeBasePriceUltimateMapper.getById(yearMonth, lastYearMonth,
|
||||
inputModel.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());
|
||||
inputModel.getBuildingId());
|
||||
if (!StringUtils.isNotNull(currentUltimateOfficeBasePrice)) {
|
||||
if (currentUltimateOfficeBasePrice.getMainPrice().subtract(inputModel.getMainPrice()).compareTo(BigDecimal.ZERO) != 0
|
||||
|| currentUltimateOfficeBasePrice.getMainPriceRent().subtract(inputModel.getMainPriceRent()).compareTo(BigDecimal.ZERO) != 0) {
|
||||
updateBasePrice(inputModel, currentUltimateOfficeBasePrice, lastUltimateOfficeBasePrice);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、ID= " + officeBasePriceUltimate.getId() + " 更新成功");
|
||||
successMsg.append("<br/>" + successNum + "、ID= " + inputModel.getId() + " 更新成功");
|
||||
}
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、ID= " + officeBasePriceUltimate.getId() + " 失败");
|
||||
failureMsg.append("<br/>" + failureNum + "、ID= " + inputModel.getId() + " 失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、ID= " + officeBasePriceUltimate.getId() + " 导入失败:";
|
||||
String msg = "<br/>" + failureNum + "、ID= " + inputModel.getId() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
@ -115,4 +114,78 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
public List<VueSelectModel> getYearMonthList() {
|
||||
return officeBasePriceUltimateMapper.getYearMonthList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param officeBasePriceUltimate
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int update(UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
// 当期价格
|
||||
Integer lastYearMonth = getLastYearMonth(officeBasePriceUltimate.getYearMonth());
|
||||
UltimateOfficeBasePrice ultimateOfficeBasePrice =
|
||||
officeBasePriceUltimateMapper.getByRouteId(officeBasePriceUltimate.getYearMonth(),
|
||||
officeBasePriceUltimate.getId());
|
||||
// 上期价格
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice =
|
||||
officeBasePriceUltimateMapper.getByBuildingId(lastYearMonth,
|
||||
officeBasePriceUltimate.getBuildingId());
|
||||
|
||||
updateBasePrice(officeBasePriceUltimate, ultimateOfficeBasePrice, lastUltimateOfficeBasePrice);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 基价更新
|
||||
*
|
||||
* @param inputModel
|
||||
* @param currentUltimateOfficeBasePrice
|
||||
* @param lastUltimateOfficeBasePrice
|
||||
*/
|
||||
private void updateBasePrice(UltimateOfficeBasePrice inputModel,
|
||||
UltimateOfficeBasePrice currentUltimateOfficeBasePrice,
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice) {
|
||||
// 上期价格比较
|
||||
if (StringUtils.isNotNull(lastUltimateOfficeBasePrice) &&
|
||||
StringUtils.isNotNull(lastUltimateOfficeBasePrice.getMainPrice()) &&
|
||||
StringUtils.isNotNull(lastUltimateOfficeBasePrice.getMainPriceRent()) &&
|
||||
(lastUltimateOfficeBasePrice.getMainPrice().compareTo(inputModel.getMainPrice_1()) != 0 ||
|
||||
lastUltimateOfficeBasePrice.getMainPriceRent().compareTo(inputModel.getMainPriceRent_1()) != 0)) {
|
||||
OfficeBasePriceModifyModel officeBasePriceModifyModel =
|
||||
new OfficeBasePriceModifyModel(lastUltimateOfficeBasePrice.getId(),
|
||||
lastUltimateOfficeBasePrice.getYearMonth());
|
||||
officeBasePriceModifyModel.setMainPrice(inputModel.getMainPrice_1());
|
||||
officeBasePriceModifyModel.setMainPricePst(lastUltimateOfficeBasePrice.getMainPricePst());
|
||||
officeBasePriceModifyModel.setMainPriceRent(inputModel.getMainPriceRent_1());
|
||||
officeBasePriceModifyModel.setMainPriceRentPst(lastUltimateOfficeBasePrice.getMainPriceRentPst());
|
||||
// 上期价格
|
||||
officeBasePriceUltimateMapper.updateBasePrice(officeBasePriceModifyModel);
|
||||
}
|
||||
|
||||
// 本期价格比较
|
||||
if (StringUtils.isNotNull(currentUltimateOfficeBasePrice) &&
|
||||
StringUtils.isNotNull(currentUltimateOfficeBasePrice.getMainPrice()) &&
|
||||
StringUtils.isNotNull(currentUltimateOfficeBasePrice.getMainPriceRent()) &&
|
||||
(currentUltimateOfficeBasePrice.getMainPrice().compareTo(inputModel.getMainPrice()) != 0 ||
|
||||
currentUltimateOfficeBasePrice.getMainPriceRent().compareTo(inputModel.getMainPriceRent()) != 0)) {
|
||||
OfficeBasePriceModifyModel officeBasePriceModifyModel = new OfficeBasePriceModifyModel(inputModel.getId()
|
||||
, inputModel.getYearMonth());
|
||||
officeBasePriceModifyModel.setMainPrice(inputModel.getMainPrice());
|
||||
BigDecimal mainPricePst =
|
||||
inputModel.getMainPrice().divide(lastUltimateOfficeBasePrice.getMainPrice(), 4);
|
||||
officeBasePriceModifyModel.setMainPricePst(mainPricePst);
|
||||
officeBasePriceModifyModel.setMainPriceRent(inputModel.getMainPriceRent());
|
||||
BigDecimal mainPriceRentPst =
|
||||
inputModel.getMainPriceRent().divide(lastUltimateOfficeBasePrice.getMainPriceRent(),
|
||||
4);
|
||||
officeBasePriceModifyModel.setMainPriceRentPst(mainPriceRentPst);
|
||||
if(StringUtils.isNotNull(inputModel.getAdjustPriceComment()))
|
||||
officeBasePriceModifyModel.setComment(inputModel.getAdjustPriceComment());
|
||||
// 上期价格
|
||||
officeBasePriceUltimateMapper.updateBasePrice(officeBasePriceModifyModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,16 +33,13 @@ spring:
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
filters: stat,wall
|
||||
wall:
|
||||
multiStatementAllow: true
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
primary: master
|
||||
datasource:
|
||||
# 主库数据源
|
||||
|
@ -23,7 +23,6 @@
|
||||
<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"/>
|
||||
@ -41,7 +40,7 @@
|
||||
<result property="mainPriceRent_1" column="mainPriceRent_1"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOfficeBasePriceUltimateVo">
|
||||
<sql id="getById">
|
||||
SELECT a.ID
|
||||
,a.BuildingID_P
|
||||
,a.ProjectID_P
|
||||
@ -77,68 +76,81 @@
|
||||
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 b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND c.Status=1
|
||||
</sql>
|
||||
|
||||
<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="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
</where>
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND c.Status=1
|
||||
<if test="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getList" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice"
|
||||
resultMap="OfficeBasePriceUltimateResult">
|
||||
<include refid="selectOfficeBasePriceUltimateVo"/>
|
||||
<where>
|
||||
<if test="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
</where>
|
||||
<include refid="getById"/>
|
||||
<if test="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
order by a.BUILDINGID_P ASC,a.ID DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
|
||||
</select>
|
||||
|
||||
<select id="getById" parameterType="String" resultMap="OfficeBasePriceUltimateResult">
|
||||
<include refid="selectOfficeBasePriceUltimateVo"/>
|
||||
where id = #{id}
|
||||
<select id="getById" resultMap="OfficeBasePriceUltimateResult">
|
||||
<include refid="getById"/>
|
||||
<if test="id != null">
|
||||
AND a.id=#{id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<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 id="updateBasePrice" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
|
||||
update ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} set Status=0 where id=#{id};
|
||||
insert into 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
|
||||
,getdate()
|
||||
,1
|
||||
,BuildingStd
|
||||
,#{comment}
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} where id=#{id};
|
||||
</update>
|
||||
|
||||
<!-- 获取表名 -->
|
||||
@ -149,9 +161,39 @@
|
||||
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
|
||||
<select id="getByBuildingId" resultType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
||||
select ID
|
||||
,BuildingID_P as buildingId
|
||||
,ProjectID_P as communityId
|
||||
,MainPrice as mainPrice
|
||||
,MainPriceRent as mainPriceRent
|
||||
,MainPricePst as mainPricePst
|
||||
,MainPriceRentPst as mainPriceRentPst
|
||||
,MainPriceType as mainPriceType
|
||||
,MainPriceRentType as mainPriceRentType
|
||||
,Status as status
|
||||
,BuildingStd as isStandardBuilding
|
||||
,AdjEvd as adjustPriceComment
|
||||
,${yearMonth} as yearMonth
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
where BuildingID_P=#{buildingI}
|
||||
where BuildingID_P=#{buildingId} AND status= 1
|
||||
</select>
|
||||
<!-- 查询价格 -->
|
||||
<select id="getByRouteId" resultType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
||||
SELECT ID
|
||||
,BuildingID_P as buildingId
|
||||
,ProjectID_P as communityId
|
||||
,MainPrice as mainPrice
|
||||
,MainPriceRent as mainPriceRent
|
||||
,MainPricePst as mainPricePst
|
||||
,MainPriceRentPst as mainPriceRentPst
|
||||
,MainPriceType as mainPriceType
|
||||
,MainPriceRentType as mainPriceRentType
|
||||
,Status as status
|
||||
,BuildingStd as isStandardBuilding
|
||||
,AdjEvd as adjustPriceComment
|
||||
,${yearMonth} as yearMonth
|
||||
FROM dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
WHERE ID=#{id}
|
||||
</select>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user