1. 办公基价作价
This commit is contained in:
@ -1,142 +1,146 @@
|
|||||||
package com.ruoyi.common.utils.file;
|
package com.ruoyi.common.utils.file;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.*;
|
||||||
import java.io.FileInputStream;
|
import java.net.URLEncoder;
|
||||||
import java.io.FileNotFoundException;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
/**
|
||||||
import java.io.UnsupportedEncodingException;
|
* 文件处理工具类
|
||||||
import java.net.URLEncoder;
|
*
|
||||||
import javax.servlet.http.HttpServletRequest;
|
* @author ruoyi
|
||||||
|
*/
|
||||||
/**
|
public class FileUtils {
|
||||||
* 文件处理工具类
|
private static final int SIZE = 2048;
|
||||||
*
|
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
|
||||||
* @author ruoyi
|
|
||||||
*/
|
/**
|
||||||
public class FileUtils
|
* 输出指定文件的byte数组
|
||||||
{
|
*
|
||||||
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
|
* @param filePath 文件路径
|
||||||
|
* @param os 输出流
|
||||||
/**
|
* @return
|
||||||
* 输出指定文件的byte数组
|
*/
|
||||||
*
|
public static void writeBytes(String filePath, OutputStream os) throws IOException {
|
||||||
* @param filePath 文件路径
|
FileInputStream fis = null;
|
||||||
* @param os 输出流
|
try {
|
||||||
* @return
|
File file = new File(filePath);
|
||||||
*/
|
if (!file.exists()) {
|
||||||
public static void writeBytes(String filePath, OutputStream os) throws IOException
|
throw new FileNotFoundException(filePath);
|
||||||
{
|
}
|
||||||
FileInputStream fis = null;
|
fis = new FileInputStream(file);
|
||||||
try
|
byte[] b = new byte[SIZE];
|
||||||
{
|
int length;
|
||||||
File file = new File(filePath);
|
while ((length = fis.read(b)) > 0) {
|
||||||
if (!file.exists())
|
os.write(b, 0, length);
|
||||||
{
|
}
|
||||||
throw new FileNotFoundException(filePath);
|
} catch (IOException e) {
|
||||||
}
|
throw e;
|
||||||
fis = new FileInputStream(file);
|
} finally {
|
||||||
byte[] b = new byte[1024];
|
if (os != null) {
|
||||||
int length;
|
try {
|
||||||
while ((length = fis.read(b)) > 0)
|
os.close();
|
||||||
{
|
} catch (IOException e1) {
|
||||||
os.write(b, 0, length);
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
if (fis != null) {
|
||||||
{
|
try {
|
||||||
throw e;
|
fis.close();
|
||||||
}
|
} catch (IOException e1) {
|
||||||
finally
|
e1.printStackTrace();
|
||||||
{
|
}
|
||||||
if (os != null)
|
}
|
||||||
{
|
}
|
||||||
try
|
}
|
||||||
{
|
|
||||||
os.close();
|
/**
|
||||||
}
|
* 删除文件
|
||||||
catch (IOException e1)
|
*
|
||||||
{
|
* @param filePath 文件
|
||||||
e1.printStackTrace();
|
* @return
|
||||||
}
|
*/
|
||||||
}
|
public static boolean deleteFile(String filePath) {
|
||||||
if (fis != null)
|
boolean flag = false;
|
||||||
{
|
File file = new File(filePath);
|
||||||
try
|
// 路径为文件且不为空则进行删除
|
||||||
{
|
if (file.isFile() && file.exists()) {
|
||||||
fis.close();
|
file.delete();
|
||||||
}
|
flag = true;
|
||||||
catch (IOException e1)
|
}
|
||||||
{
|
return flag;
|
||||||
e1.printStackTrace();
|
}
|
||||||
}
|
|
||||||
}
|
/**
|
||||||
}
|
* 文件名称验证
|
||||||
}
|
*
|
||||||
|
* @param filename 文件名称
|
||||||
/**
|
* @return true 正常 false 非法
|
||||||
* 删除文件
|
*/
|
||||||
*
|
public static boolean isValidFilename(String filename) {
|
||||||
* @param filePath 文件
|
return filename.matches(FILENAME_PATTERN);
|
||||||
* @return
|
}
|
||||||
*/
|
|
||||||
public static boolean deleteFile(String filePath)
|
/**
|
||||||
{
|
* 下载文件名重新编码
|
||||||
boolean flag = false;
|
*
|
||||||
File file = new File(filePath);
|
* @param request 请求对象
|
||||||
// 路径为文件且不为空则进行删除
|
* @param fileName 文件名
|
||||||
if (file.isFile() && file.exists())
|
* @return 编码后的文件名
|
||||||
{
|
*/
|
||||||
file.delete();
|
public static String setFileDownloadHeader(HttpServletRequest request, String fileName)
|
||||||
flag = true;
|
throws UnsupportedEncodingException {
|
||||||
}
|
final String agent = request.getHeader("USER-AGENT");
|
||||||
return flag;
|
String filename = fileName;
|
||||||
}
|
if (agent.contains("MSIE")) {
|
||||||
|
// IE浏览器
|
||||||
/**
|
filename = URLEncoder.encode(filename, "utf-8");
|
||||||
* 文件名称验证
|
filename = filename.replace("+", " ");
|
||||||
*
|
} else if (agent.contains("Firefox")) {
|
||||||
* @param filename 文件名称
|
// 火狐浏览器
|
||||||
* @return true 正常 false 非法
|
filename = new String(fileName.getBytes(), "ISO8859-1");
|
||||||
*/
|
} else if (agent.contains("Chrome")) {
|
||||||
public static boolean isValidFilename(String filename)
|
// google浏览器
|
||||||
{
|
filename = URLEncoder.encode(filename, "utf-8");
|
||||||
return filename.matches(FILENAME_PATTERN);
|
} else {
|
||||||
}
|
// 其它浏览器
|
||||||
|
filename = URLEncoder.encode(filename, "utf-8");
|
||||||
/**
|
}
|
||||||
* 下载文件名重新编码
|
return filename;
|
||||||
*
|
}
|
||||||
* @param request 请求对象
|
|
||||||
* @param fileName 文件名
|
/**
|
||||||
* @return 编码后的文件名
|
* 读取文本文件
|
||||||
*/
|
*
|
||||||
public static String setFileDownloadHeader(HttpServletRequest request, String fileName)
|
* @param fileName
|
||||||
throws UnsupportedEncodingException
|
* @return
|
||||||
{
|
*/
|
||||||
final String agent = request.getHeader("USER-AGENT");
|
public static String readFile(String fileName) {
|
||||||
String filename = fileName;
|
InputStream is = null;
|
||||||
if (agent.contains("MSIE"))
|
try {
|
||||||
{
|
is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
|
||||||
// IE浏览器
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
filename = URLEncoder.encode(filename, "utf-8");
|
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"), SIZE);
|
||||||
filename = filename.replace("+", " ");
|
char[] buf = new char[SIZE];
|
||||||
}
|
int numRead = 0;
|
||||||
else if (agent.contains("Firefox"))
|
while ((numRead = reader.read(buf)) != -1) {
|
||||||
{
|
String readData = String.valueOf(buf, 0, numRead);
|
||||||
// 火狐浏览器
|
stringBuffer.append(readData);
|
||||||
filename = new String(fileName.getBytes(), "ISO8859-1");
|
buf = new char[SIZE];
|
||||||
}
|
}
|
||||||
else if (agent.contains("Chrome"))
|
reader.close();
|
||||||
{
|
return stringBuffer.toString();
|
||||||
// google浏览器
|
} catch (IOException e) {
|
||||||
filename = URLEncoder.encode(filename, "utf-8");
|
e.printStackTrace();
|
||||||
}
|
} finally {
|
||||||
else
|
try {
|
||||||
{
|
if (is != null) {
|
||||||
// 其它浏览器
|
is.close();
|
||||||
filename = URLEncoder.encode(filename, "utf-8");
|
}
|
||||||
}
|
} catch (IOException e) {
|
||||||
return filename;
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
37
ruoyi/src/main/java/com/ruoyi/framework/config/UVConfig.java
Normal file
37
ruoyi/src/main/java/com/ruoyi/framework/config/UVConfig.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package com.ruoyi.framework.config;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取项目相关配置
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "uv")
|
||||||
|
public class UVConfig {
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
private String dataUrl;
|
||||||
|
|
||||||
|
private String aitificialOfficeBasePriceUrl;
|
||||||
|
|
||||||
|
public String getDataUrl() {
|
||||||
|
return dataUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataUrl(String dataUrl) {
|
||||||
|
this.dataUrl = dataUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAitificialOfficeBasePriceUrl() {
|
||||||
|
return getDataUrl() + aitificialOfficeBasePriceUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAitificialOfficeBasePriceUrl(String aitificialOfficeBasePriceUrl) {
|
||||||
|
this.aitificialOfficeBasePriceUrl = aitificialOfficeBasePriceUrl;
|
||||||
|
}
|
||||||
|
}
|
32
ruoyi/src/main/java/com/ruoyi/project/common/UVResponse.java
Normal file
32
ruoyi/src/main/java/com/ruoyi/project/common/UVResponse.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package com.ruoyi.project.common;
|
||||||
|
|
||||||
|
public class UVResponse<T> {
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
private String message;
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(T data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
@ -50,9 +50,9 @@ public class UltimateOfficeBasePriceController extends BaseController {
|
|||||||
int pageSize = ServletUtils.getParameterToInt(TableSupport.PAGE_SIZE);
|
int pageSize = ServletUtils.getParameterToInt(TableSupport.PAGE_SIZE);
|
||||||
officeBasePriceUltimate.setPageIndex(pageIndex <= 1 ? 0 : (pageIndex - 1) * pageSize);
|
officeBasePriceUltimate.setPageIndex(pageIndex <= 1 ? 0 : (pageIndex - 1) * pageSize);
|
||||||
officeBasePriceUltimate.setPageSize(pageSize);
|
officeBasePriceUltimate.setPageSize(pageSize);
|
||||||
|
int total = officeBasePriceUltimateService.selectOfficeBasePriceUltimateListCount(officeBasePriceUltimate);
|
||||||
List<UltimateOfficeBasePrice> list =
|
List<UltimateOfficeBasePrice> list =
|
||||||
officeBasePriceUltimateService.selectOfficeBasePriceUltimateList(officeBasePriceUltimate);
|
officeBasePriceUltimateService.selectOfficeBasePriceUltimateList(officeBasePriceUltimate);
|
||||||
int total = officeBasePriceUltimateService.selectOfficeBasePriceUltimateListCount(officeBasePriceUltimate);
|
|
||||||
return getDataTable(list, total);
|
return getDataTable(list, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
|||||||
import com.ruoyi.project.common.VueSelectModel;
|
import com.ruoyi.project.common.VueSelectModel;
|
||||||
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
||||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 办公基价Mapper接口
|
* 办公基价Mapper接口
|
||||||
@ -60,7 +61,15 @@ public interface UltimateOfficeBasePriceMapper {
|
|||||||
* @param officeBasePriceModifyModel
|
* @param officeBasePriceModifyModel
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateBasePrice(OfficeBasePriceModifyModel officeBasePriceModifyModel);
|
int updateBasePriceStatus(OfficeBasePriceModifyModel officeBasePriceModifyModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新当前基价
|
||||||
|
*
|
||||||
|
* @param officeBasePriceModifyModel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateBasePriceCopyNew(OfficeBasePriceModifyModel officeBasePriceModifyModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年月
|
* 年月
|
||||||
@ -77,4 +86,12 @@ public interface UltimateOfficeBasePriceMapper {
|
|||||||
*/
|
*/
|
||||||
int insertArtificialOfficeBasePrice(UltimateOfficeBasePrice ultimateOfficeBasePrice);
|
int insertArtificialOfficeBasePrice(UltimateOfficeBasePrice ultimateOfficeBasePrice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入人工修正办公基价
|
||||||
|
*
|
||||||
|
* @param ultimateOfficeBasePrices
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int batchInsertArtificialOfficeBase(@Param("yearMonth") Integer yearMonth,
|
||||||
|
@Param("list") List<UltimateOfficeBasePrice> ultimateOfficeBasePrices);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package com.ruoyi.project.data.price.service.impl;
|
package com.ruoyi.project.data.price.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Calendar;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import com.ruoyi.common.exception.CustomException;
|
import com.ruoyi.common.exception.CustomException;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.file.FileUtils;
|
||||||
|
import com.ruoyi.framework.config.UVConfig;
|
||||||
|
import com.ruoyi.project.common.UVResponse;
|
||||||
import com.ruoyi.project.common.VueSelectModel;
|
import com.ruoyi.project.common.VueSelectModel;
|
||||||
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
||||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||||
@ -16,7 +17,11 @@ import com.ruoyi.project.system.service.impl.SysUserServiceImpl;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 办公基价Service业务层处理
|
* 办公基价Service业务层处理
|
||||||
@ -31,6 +36,9 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UltimateOfficeBasePriceMapper officeBasePriceUltimateMapper;
|
private UltimateOfficeBasePriceMapper officeBasePriceUltimateMapper;
|
||||||
|
@Autowired
|
||||||
|
private UVConfig uvConfig;
|
||||||
|
|
||||||
|
|
||||||
private static Integer getLastYearMonth(Integer yearMonth) {
|
private static Integer getLastYearMonth(Integer yearMonth) {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
@ -68,47 +76,22 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
|||||||
if (StringUtils.isNull(officeBasePriceUltimates) || officeBasePriceUltimates.size() == 0) {
|
if (StringUtils.isNull(officeBasePriceUltimates) || officeBasePriceUltimates.size() == 0) {
|
||||||
throw new CustomException("导入办公数据不能为空!");
|
throw new CustomException("导入办公数据不能为空!");
|
||||||
}
|
}
|
||||||
int successNum = 0;
|
int successNum = officeBasePriceUltimates.size();
|
||||||
int failureNum = 0;
|
int failureNum = 0;
|
||||||
int insertNum = 0;
|
|
||||||
StringBuilder successMsg = new StringBuilder();
|
StringBuilder successMsg = new StringBuilder();
|
||||||
StringBuilder failureMsg = new StringBuilder();
|
StringBuilder failureMsg = new StringBuilder();
|
||||||
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
||||||
|
|
||||||
// 批量插入
|
// 批量插入
|
||||||
|
officeBasePriceUltimates.stream().parallel().forEach(inputModel -> {
|
||||||
|
inputModel.setYearMonth(yearMonth);
|
||||||
|
officeBasePriceUltimateMapper.insertArtificialOfficeBasePrice(inputModel);
|
||||||
|
});
|
||||||
|
|
||||||
for (UltimateOfficeBasePrice inputModel : officeBasePriceUltimates) {
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
try {
|
String url = String.format(uvConfig.getAitificialOfficeBasePriceUrl(), yearMonth, lastYearMonth);
|
||||||
inputModel.setYearMonth(yearMonth);
|
UVResponse<Integer> affectCount = restTemplate.getForObject(url, UVResponse.class);
|
||||||
officeBasePriceUltimateMapper.insertArtificialOfficeBasePrice(inputModel);
|
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,修改数据:" + affectCount.getData() + "条");
|
||||||
// 验证是否存在这个用户
|
|
||||||
UltimateOfficeBasePrice currentUltimateOfficeBasePrice =
|
|
||||||
officeBasePriceUltimateMapper.getById(yearMonth, lastYearMonth,
|
|
||||||
inputModel.getId());
|
|
||||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice =
|
|
||||||
officeBasePriceUltimateMapper.getByBuildingId(lastYearMonth,
|
|
||||||
inputModel.getBuildingId());
|
|
||||||
if (StringUtils.isNotNull(currentUltimateOfficeBasePrice)) {
|
|
||||||
updateBasePrice(inputModel, currentUltimateOfficeBasePrice, lastUltimateOfficeBasePrice);
|
|
||||||
successNum++;
|
|
||||||
successMsg.append("<br/>" + successNum + "、ID= " + inputModel.getId() + " 更新成功");
|
|
||||||
} else {
|
|
||||||
failureNum++;
|
|
||||||
failureMsg.append("<br/>" + failureNum + "、ID= " + inputModel.getId() + " 失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
failureNum++;
|
|
||||||
String msg = "<br/>" + failureNum + "、ID= " + inputModel.getId() + " 导入失败:";
|
|
||||||
failureMsg.append(msg + e.getMessage());
|
|
||||||
log.error(msg, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (failureNum > 0) {
|
|
||||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
|
||||||
throw new CustomException(failureMsg.toString());
|
|
||||||
} else {
|
|
||||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
|
||||||
}
|
|
||||||
return successMsg.toString();
|
return successMsg.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,19 +130,21 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
|||||||
* @param currentUltimateOfficeBasePrice
|
* @param currentUltimateOfficeBasePrice
|
||||||
* @param lastUltimateOfficeBasePrice
|
* @param lastUltimateOfficeBasePrice
|
||||||
*/
|
*/
|
||||||
private void updateBasePrice(UltimateOfficeBasePrice inputModel,
|
public void updateBasePrice(UltimateOfficeBasePrice inputModel,
|
||||||
UltimateOfficeBasePrice currentUltimateOfficeBasePrice,
|
UltimateOfficeBasePrice currentUltimateOfficeBasePrice,
|
||||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice) {
|
UltimateOfficeBasePrice lastUltimateOfficeBasePrice) {
|
||||||
|
|
||||||
OfficeBasePriceModifyModel officeBasePriceModifyModel = compareYearMonth(inputModel,
|
OfficeBasePriceModifyModel officeBasePriceModifyModel = compareYearMonth(inputModel,
|
||||||
currentUltimateOfficeBasePrice, lastUltimateOfficeBasePrice);
|
currentUltimateOfficeBasePrice, lastUltimateOfficeBasePrice);
|
||||||
if (null != officeBasePriceModifyModel) {
|
if (null != officeBasePriceModifyModel) {
|
||||||
officeBasePriceUltimateMapper.updateBasePrice(officeBasePriceModifyModel);
|
officeBasePriceUltimateMapper.updateBasePriceStatus(officeBasePriceModifyModel);
|
||||||
|
officeBasePriceUltimateMapper.updateBasePriceCopyNew(officeBasePriceModifyModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
officeBasePriceModifyModel = compareLastYearMonth(inputModel, lastUltimateOfficeBasePrice);
|
officeBasePriceModifyModel = compareLastYearMonth(inputModel, lastUltimateOfficeBasePrice);
|
||||||
if (null != officeBasePriceModifyModel) {
|
if (null != officeBasePriceModifyModel) {
|
||||||
officeBasePriceUltimateMapper.updateBasePrice(officeBasePriceModifyModel);
|
officeBasePriceUltimateMapper.updateBasePriceStatus(officeBasePriceModifyModel);
|
||||||
|
officeBasePriceUltimateMapper.updateBasePriceCopyNew(officeBasePriceModifyModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@ ruoyi:
|
|||||||
profile: D:/ruoyi/uploadPath
|
profile: D:/ruoyi/uploadPath
|
||||||
# 获取ip地址开关
|
# 获取ip地址开关
|
||||||
addressEnabled: false
|
addressEnabled: false
|
||||||
|
uv:
|
||||||
|
dataUrl: http://172.16.30.74:9500/api
|
||||||
|
aitificialOfficeBasePriceUrl: /price/office/artificial?yearMonth=%d&lastYearMonth=%d
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
AND a.STATUS = #{status}
|
AND a.STATUS = #{status}
|
||||||
</if>
|
</if>
|
||||||
order by a.BUILDINGID_P ASC,a.ID DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
|
order by a.ModifyDate DESC,a.BUILDINGID_P ASC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getById" resultMap="OfficeBasePriceUltimateResult">
|
<select id="getById" resultMap="OfficeBasePriceUltimateResult">
|
||||||
@ -120,7 +120,18 @@
|
|||||||
<!-- 更新基价 -->
|
<!-- 更新基价 -->
|
||||||
<update id="updateBasePrice" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
|
<update id="updateBasePrice" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
|
||||||
update ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} set Status=0 where id=#{id};
|
update ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} set Status=0 where id=#{id};
|
||||||
insert into ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}(BuildingID
|
</update>
|
||||||
|
<insert id="batchInsertArtificialOfficeBase" >
|
||||||
|
insert into
|
||||||
|
dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}(ID,BuildingID,ProjectID,County,"Loop",Block,ProjectAddr,ProjectName,Year,AvgArea,TotalFloorSum,UpperFloorSum,OfficeClass,Grade,MainPrice_1,MainPriceRent_1,MainPrice,MainPriceRent,ModifyDate)
|
||||||
|
values
|
||||||
|
<foreach collection="list" item="item" separator="," >
|
||||||
|
(#{item.id},#{item.buildingId},#{item.communityId},#{item.countyName},#{item.loopName},#{item.blockName},#{item.communityAddress},#{item.communityName},#{item.year},#{item.avgArea},#{item.totalFloorSum},#{item.upperFloorSum},#{item.officeClass},#{item.officeLevel},#{item.mainPrice_1},#{item.mainPriceRent_1},#{item.mainPrice},#{item.mainPriceRent},getdate())
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<!-- 更新基价 -->
|
||||||
|
<insert id="updateBasePriceCopyNew" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
|
||||||
|
insert into ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}(BuildingID
|
||||||
,UnifiedID
|
,UnifiedID
|
||||||
,ProjectID
|
,ProjectID
|
||||||
,BuildingID_P
|
,BuildingID_P
|
||||||
@ -151,7 +162,7 @@
|
|||||||
,BuildingStd
|
,BuildingStd
|
||||||
,#{comment}
|
,#{comment}
|
||||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} where id=#{id};
|
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} where id=#{id};
|
||||||
</update>
|
</insert>
|
||||||
|
|
||||||
<!-- 获取表名 -->
|
<!-- 获取表名 -->
|
||||||
<select id="getYearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
|
<select id="getYearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
|
||||||
|
Reference in New Issue
Block a user