feature (办公作价): 推送作价数据
1. 创建案例表 2. 推送案例数据 3. 创建价格表(备份上期价格表) 4. 推送价格数据
This commit is contained in:
parent
991f21a96d
commit
482fefebfd
@ -0,0 +1,146 @@
|
||||
package com.ruoyi.project.data.cases.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 办公案例汇总
|
||||
*
|
||||
* @author purple
|
||||
*/
|
||||
public class OfficeAggregationCase extends OriginalOfficeCase {
|
||||
private Integer yearMonth;
|
||||
private String buildingId;
|
||||
private String communityId;
|
||||
private String totalFloor;
|
||||
private BigDecimal floorCoefficient;
|
||||
private Integer decorationCoefficient;
|
||||
private BigDecimal priceAmend;
|
||||
private BigDecimal mainPrice_1;
|
||||
private BigDecimal mainPriceRent_1;
|
||||
private BigDecimal listedPrice_1;
|
||||
private BigDecimal listedPriceRent_1;
|
||||
private BigDecimal listedPrice;
|
||||
private BigDecimal listedPriceRent;
|
||||
private BigDecimal vopp;
|
||||
private String voppt;
|
||||
|
||||
public Integer getYearMonth() {
|
||||
return yearMonth;
|
||||
}
|
||||
|
||||
public void setYearMonth(Integer yearMonth) {
|
||||
this.yearMonth = yearMonth;
|
||||
}
|
||||
|
||||
public String getBuildingId() {
|
||||
return buildingId;
|
||||
}
|
||||
|
||||
public void setBuildingId(String buildingId) {
|
||||
this.buildingId = buildingId;
|
||||
}
|
||||
|
||||
public String getCommunityId() {
|
||||
return communityId;
|
||||
}
|
||||
|
||||
public void setCommunityId(String communityId) {
|
||||
this.communityId = communityId;
|
||||
}
|
||||
|
||||
public String getTotalFloor() {
|
||||
return totalFloor;
|
||||
}
|
||||
|
||||
public void setTotalFloor(String totalFloor) {
|
||||
this.totalFloor = totalFloor;
|
||||
}
|
||||
|
||||
public BigDecimal getFloorCoefficient() {
|
||||
return floorCoefficient;
|
||||
}
|
||||
|
||||
public void setFloorCoefficient(BigDecimal floorCoefficient) {
|
||||
this.floorCoefficient = floorCoefficient;
|
||||
}
|
||||
|
||||
public Integer getDecorationCoefficient() {
|
||||
return decorationCoefficient;
|
||||
}
|
||||
|
||||
public void setDecorationCoefficient(Integer decorationCoefficient) {
|
||||
this.decorationCoefficient = decorationCoefficient;
|
||||
}
|
||||
|
||||
public BigDecimal getPriceAmend() {
|
||||
return priceAmend;
|
||||
}
|
||||
|
||||
public void setPriceAmend(BigDecimal priceAmend) {
|
||||
this.priceAmend = priceAmend;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPrice_1() {
|
||||
return mainPrice_1;
|
||||
}
|
||||
|
||||
public void setMainPrice_1(BigDecimal mainPrice_1) {
|
||||
this.mainPrice_1 = mainPrice_1;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPriceRent_1() {
|
||||
return mainPriceRent_1;
|
||||
}
|
||||
|
||||
public void setMainPriceRent_1(BigDecimal mainPriceRent_1) {
|
||||
this.mainPriceRent_1 = mainPriceRent_1;
|
||||
}
|
||||
|
||||
public BigDecimal getListedPrice_1() {
|
||||
return listedPrice_1;
|
||||
}
|
||||
|
||||
public void setListedPrice_1(BigDecimal listedPrice_1) {
|
||||
this.listedPrice_1 = listedPrice_1;
|
||||
}
|
||||
|
||||
public BigDecimal getListedPriceRent_1() {
|
||||
return listedPriceRent_1;
|
||||
}
|
||||
|
||||
public void setListedPriceRent_1(BigDecimal listedPriceRent_1) {
|
||||
this.listedPriceRent_1 = listedPriceRent_1;
|
||||
}
|
||||
|
||||
public BigDecimal getListedPrice() {
|
||||
return listedPrice;
|
||||
}
|
||||
|
||||
public void setListedPrice(BigDecimal listedPrice) {
|
||||
this.listedPrice = listedPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getListedPriceRent() {
|
||||
return listedPriceRent;
|
||||
}
|
||||
|
||||
public void setListedPriceRent(BigDecimal listedPriceRent) {
|
||||
this.listedPriceRent = listedPriceRent;
|
||||
}
|
||||
|
||||
public BigDecimal getVopp() {
|
||||
return vopp;
|
||||
}
|
||||
|
||||
public void setVopp(BigDecimal vopp) {
|
||||
this.vopp = vopp;
|
||||
}
|
||||
|
||||
public String getVoppt() {
|
||||
return voppt;
|
||||
}
|
||||
|
||||
public void setVoppt(String voppt) {
|
||||
this.voppt = voppt;
|
||||
}
|
||||
}
|
@ -1,8 +1,16 @@
|
||||
package com.ruoyi.project.data.cases.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.data.cases.domain.OfficeAggregationCase;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 办公案例DAO
|
||||
*
|
||||
* @author purple
|
||||
*/
|
||||
@DS("compute")
|
||||
public interface OriginalOfficeCaseMapper {
|
||||
/**
|
||||
@ -26,6 +34,25 @@ public interface OriginalOfficeCaseMapper {
|
||||
*/
|
||||
void createAssembleTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 初始化案例汇总表
|
||||
*
|
||||
* @param yearMonth
|
||||
*/
|
||||
void initAssembleTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 初始化价格表
|
||||
*
|
||||
* @param yearMonth
|
||||
*/
|
||||
void initPriceTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 获取汇总案例列表
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
List<OfficeAggregationCase> getOfficeAggregationCases(@Param("yearMonth") Integer yearMonth);
|
||||
}
|
||||
|
@ -0,0 +1,65 @@
|
||||
package com.ruoyi.project.data.cases.mapper.sync;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.data.cases.domain.OfficeAggregationCase;
|
||||
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author lihe
|
||||
*/
|
||||
@DS("calc")
|
||||
public interface SyncOfficeAggregationCaseMapper {
|
||||
|
||||
/**
|
||||
* 创建案例合并库
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
int createAggregationCaseTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 推送到CALC库
|
||||
*
|
||||
* @param officeAggregationCase
|
||||
* @return
|
||||
*/
|
||||
int insertAggregationCase(OfficeAggregationCase officeAggregationCase);
|
||||
|
||||
/**
|
||||
* 创建最终价格表
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
int createUltimatePriceTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 备份价格表
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param operateDate
|
||||
* @return
|
||||
*/
|
||||
int dumpPriceTable(@Param("yearMonth") Integer yearMonth, @Param("operateDate") String operateDate);
|
||||
|
||||
/**
|
||||
* 清空价格表
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
int clearPriceTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 插入最终价格
|
||||
*
|
||||
* @param ultimateOfficeBasePrice
|
||||
* @return
|
||||
*/
|
||||
int insertUltimatePriceTable(UltimateOfficeBasePrice ultimateOfficeBasePrice);
|
||||
|
||||
|
||||
}
|
@ -25,10 +25,9 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 办公基价Controller
|
||||
* 办公基价
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-05-20
|
||||
* @author purple
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/data/compute/price/office")
|
||||
@ -117,7 +116,7 @@ public class UltimateOfficeBasePriceController extends BaseController {
|
||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||
String operName = loginUser.getUsername();
|
||||
String message = officeBasePriceUltimateService.batchImport(yearMonth, officeBasePriceUltimates, operName);
|
||||
return AjaxResult.success("");
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author purple
|
||||
* @date 2020-05-20
|
||||
*/
|
||||
public class UltimateOfficeBasePrice extends BaseEntity {
|
||||
@ -19,7 +19,6 @@ public class UltimateOfficeBasePrice extends BaseEntity {
|
||||
|
||||
@Excel(name = "id")
|
||||
private String id;
|
||||
// @JSONField(serialize = false)
|
||||
private Integer yearMonth;
|
||||
@JSONField(serialize = false)
|
||||
private Integer lastYearMonth;
|
||||
|
@ -6,6 +6,7 @@ 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;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@ -46,6 +47,14 @@ public interface UltimateOfficeBasePriceMapper {
|
||||
*/
|
||||
List<UltimateOfficeBasePrice> getList(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
* 查询某表数据
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
List<UltimateOfficeBasePrice> getUltimateOfficeBasePrices(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 求和
|
||||
*
|
||||
|
@ -6,15 +6,14 @@ import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 办公基价Service接口
|
||||
* 办公基价Service
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-05-20
|
||||
* @author purple
|
||||
*/
|
||||
public interface IUltimateOfficeBasePriceService {
|
||||
|
||||
/**
|
||||
* 查询办公基价列表
|
||||
* 查询分页每页数据
|
||||
*
|
||||
* @param officeBasePriceUltimate 办公基价
|
||||
* @return 办公基价集合
|
||||
@ -22,6 +21,7 @@ public interface IUltimateOfficeBasePriceService {
|
||||
List<UltimateOfficeBasePrice> selectOfficeBasePriceUltimateList(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
* 查询分页共条数
|
||||
*
|
||||
* @param officeBasePriceUltimate
|
||||
* @return
|
||||
@ -29,18 +29,21 @@ public interface IUltimateOfficeBasePriceService {
|
||||
int selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
* 获取单个实例
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, String id);
|
||||
|
||||
/**
|
||||
* 可能修改当期的价格、也可能修改往期
|
||||
*
|
||||
* @param officeBasePriceUltimate
|
||||
* @return
|
||||
*/
|
||||
int update(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
// /**
|
||||
// * 可能修改当期的价格、也可能修改往期
|
||||
// *
|
||||
// * @param officeBasePriceUltimate
|
||||
// * @return
|
||||
// */
|
||||
// int update(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
* @param officeBasePriceUltimates
|
||||
@ -50,6 +53,8 @@ public interface IUltimateOfficeBasePriceService {
|
||||
String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates, String operName);
|
||||
|
||||
/**
|
||||
* 获取办公表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<VueSelectModel> getYearMonthList();
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.project.data.price.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@ -14,7 +13,9 @@ import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.LoadUtil;
|
||||
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.cases.domain.OfficeAggregationCase;
|
||||
import com.ruoyi.project.data.cases.mapper.OriginalOfficeCaseMapper;
|
||||
import com.ruoyi.project.data.cases.mapper.sync.SyncOfficeAggregationCaseMapper;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import com.ruoyi.project.data.price.mapper.UltimateOfficeBasePriceMapper;
|
||||
import com.ruoyi.project.data.price.service.IUltimateOfficeBasePriceService;
|
||||
@ -23,13 +24,13 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@DS("compute")
|
||||
public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePriceService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(UltimateOfficeBasePriceServiceImpl.class);
|
||||
@ -42,9 +43,13 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
private String computePassword;
|
||||
|
||||
@Autowired
|
||||
private UltimateOfficeBasePriceMapper officeBasePriceUltimateMapper;
|
||||
private UltimateOfficeBasePriceMapper ultimateOfficeBasePriceMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
@Autowired
|
||||
private OriginalOfficeCaseMapper originalOfficeCaseMapper;
|
||||
@Autowired
|
||||
private SyncOfficeAggregationCaseMapper syncOfficeAggregationCaseMapper;
|
||||
|
||||
private static Integer getLastYearMonth(Integer yearMonth) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@ -61,19 +66,19 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
@Override
|
||||
public List<UltimateOfficeBasePrice> selectOfficeBasePriceUltimateList(UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
officeBasePriceUltimate.setLastYearMonth(getLastYearMonth(officeBasePriceUltimate.getYearMonth()));
|
||||
return officeBasePriceUltimateMapper.getList(officeBasePriceUltimate);
|
||||
return ultimateOfficeBasePriceMapper.getList(officeBasePriceUltimate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
officeBasePriceUltimate.setLastYearMonth(getLastYearMonth(officeBasePriceUltimate.getYearMonth()));
|
||||
return officeBasePriceUltimateMapper.getCount(officeBasePriceUltimate);
|
||||
return ultimateOfficeBasePriceMapper.getCount(officeBasePriceUltimate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UltimateOfficeBasePrice getById(Integer yearMonth, String id) {
|
||||
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
||||
return officeBasePriceUltimateMapper.getById(yearMonth, lastYearMonth, id);
|
||||
return ultimateOfficeBasePriceMapper.getById(yearMonth, lastYearMonth, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -88,14 +93,14 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
||||
|
||||
officeBasePriceUltimateMapper.initProcedure();
|
||||
ultimateOfficeBasePriceMapper.initProcedure();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String operateDate = simpleDateFormat.format(calendar.getTime());
|
||||
officeBasePriceUltimateMapper.dumpTable(yearMonth, operateDate);
|
||||
officeBasePriceUltimateMapper.clearArtificialTable(yearMonth);
|
||||
officeBasePriceUltimateMapper.prepareBachImport(yearMonth);
|
||||
ultimateOfficeBasePriceMapper.dumpTable(yearMonth, operateDate);
|
||||
ultimateOfficeBasePriceMapper.clearArtificialTable(yearMonth);
|
||||
ultimateOfficeBasePriceMapper.prepareBachImport(yearMonth);
|
||||
|
||||
try {
|
||||
// 声明变量
|
||||
@ -187,7 +192,7 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
}
|
||||
}
|
||||
// 删除存储过程,还原环境
|
||||
officeBasePriceUltimateMapper.initProcedure();
|
||||
ultimateOfficeBasePriceMapper.initProcedure();
|
||||
conn.close();
|
||||
|
||||
int year = yearMonth / 100;
|
||||
@ -210,121 +215,7 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
|
||||
@Override
|
||||
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
|
||||
*/
|
||||
public void updateBasePrice(UltimateOfficeBasePrice inputModel,
|
||||
UltimateOfficeBasePrice currentUltimateOfficeBasePrice,
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice) {
|
||||
|
||||
OfficeBasePriceModifyModel officeBasePriceModifyModel = compareYearMonth(inputModel,
|
||||
currentUltimateOfficeBasePrice, lastUltimateOfficeBasePrice);
|
||||
if (null != officeBasePriceModifyModel) {
|
||||
officeBasePriceUltimateMapper.updateStatus(officeBasePriceModifyModel);
|
||||
officeBasePriceUltimateMapper.updateBasePriceCopyNew(officeBasePriceModifyModel);
|
||||
}
|
||||
|
||||
officeBasePriceModifyModel = compareLastYearMonth(inputModel, lastUltimateOfficeBasePrice);
|
||||
if (null != officeBasePriceModifyModel) {
|
||||
officeBasePriceUltimateMapper.updateBasePriceStatus(officeBasePriceModifyModel);
|
||||
officeBasePriceUltimateMapper.updateBasePriceCopyNew(officeBasePriceModifyModel);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上期价格
|
||||
*
|
||||
* @param inputModel
|
||||
* @param ultimateOfficeBasePrice
|
||||
* @return
|
||||
*/
|
||||
private OfficeBasePriceModifyModel compareYearMonth(UltimateOfficeBasePrice inputModel,
|
||||
UltimateOfficeBasePrice ultimateOfficeBasePrice,
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice) {
|
||||
BigDecimal inputMainPrice = inputModel.getMainPrice();
|
||||
BigDecimal mainPrice = ultimateOfficeBasePrice.getMainPrice();
|
||||
BigDecimal inputMainPriceRent = inputModel.getMainPriceRent();
|
||||
BigDecimal mainPriceRent = ultimateOfficeBasePrice.getMainPriceRent();
|
||||
if (Objects.equals(inputMainPrice, mainPrice) && Objects.equals(inputMainPriceRent, mainPriceRent)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
OfficeBasePriceModifyModel officeBasePriceModifyModel =
|
||||
new OfficeBasePriceModifyModel(inputModel.getId(),
|
||||
inputModel.getYearMonth());
|
||||
officeBasePriceModifyModel.setMainPrice(inputModel.getMainPrice_1());
|
||||
if (null != lastUltimateOfficeBasePrice.getMainPrice() && lastUltimateOfficeBasePrice.getMainPrice().compareTo(BigDecimal.ZERO) != 0) {
|
||||
BigDecimal mainPricePst =
|
||||
inputModel.getMainPrice().divide(lastUltimateOfficeBasePrice.getMainPrice(), 4);
|
||||
officeBasePriceModifyModel.setMainPricePst(mainPricePst);
|
||||
}
|
||||
|
||||
officeBasePriceModifyModel.setMainPriceRent(inputModel.getMainPriceRent_1());
|
||||
if (null != lastUltimateOfficeBasePrice.getMainPriceRent() && lastUltimateOfficeBasePrice.getMainPriceRent().compareTo(BigDecimal.ZERO) != 0) {
|
||||
BigDecimal mainPriceRentPst =
|
||||
inputModel.getMainPriceRent().divide(lastUltimateOfficeBasePrice.getMainPriceRent(), 4);
|
||||
officeBasePriceModifyModel.setMainPriceRentPst(mainPriceRentPst);
|
||||
}
|
||||
|
||||
return officeBasePriceModifyModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上期价格
|
||||
*
|
||||
* @param inputModel
|
||||
* @param lastUltimateOfficeBasePrice
|
||||
* @return
|
||||
*/
|
||||
private OfficeBasePriceModifyModel compareLastYearMonth(UltimateOfficeBasePrice inputModel,
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice) {
|
||||
BigDecimal inputMainPrice = inputModel.getMainPrice_1();
|
||||
BigDecimal mainPrice_1 = lastUltimateOfficeBasePrice.getMainPrice();
|
||||
BigDecimal inputMainPriceRent = inputModel.getMainPriceRent_1();
|
||||
BigDecimal mainPriceRent_1 = lastUltimateOfficeBasePrice.getMainPriceRent();
|
||||
if (Objects.equals(inputMainPrice, mainPrice_1) && Objects.equals(inputMainPriceRent, mainPriceRent_1)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
return officeBasePriceModifyModel;
|
||||
return ultimateOfficeBasePriceMapper.getYearMonthList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -345,4 +236,43 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
.replace("#lastMonth#", lastPriceDate);
|
||||
jdbcTemplate.update(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据推送
|
||||
*
|
||||
* @param yearMonth 作价表
|
||||
* @param currentPriceTableRoute 当期表
|
||||
* @param lastPriceTableRoute 上期表
|
||||
*/
|
||||
@Async
|
||||
public void pushData(Integer yearMonth, Integer currentPriceTableRoute, Integer lastPriceTableRoute) {
|
||||
// 案例同步
|
||||
syncOfficeAggregationCaseMapper.createAggregationCaseTable(currentPriceTableRoute);
|
||||
List<OfficeAggregationCase> list = originalOfficeCaseMapper.getOfficeAggregationCases(yearMonth);
|
||||
list.parallelStream().forEach(officeAggregationCase -> {
|
||||
syncOfficeAggregationCaseMapper.insertAggregationCase(officeAggregationCase);
|
||||
});
|
||||
|
||||
// 当期价格同步
|
||||
syncOfficeAggregationCaseMapper.createUltimatePriceTable(currentPriceTableRoute);
|
||||
List<UltimateOfficeBasePrice> ultimateOfficeBasePrices =
|
||||
ultimateOfficeBasePriceMapper.getUltimateOfficeBasePrices(yearMonth);
|
||||
ultimateOfficeBasePrices.parallelStream().forEach(ultimateOfficeBasePrice -> {
|
||||
syncOfficeAggregationCaseMapper.insertUltimatePriceTable(ultimateOfficeBasePrice);
|
||||
});
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
String operateDate = simpleDateFormat.format(calendar.getTime());
|
||||
|
||||
// 上期价格同步
|
||||
syncOfficeAggregationCaseMapper.dumpPriceTable(lastPriceTableRoute, operateDate);
|
||||
syncOfficeAggregationCaseMapper.clearPriceTable(lastPriceTableRoute);
|
||||
List<UltimateOfficeBasePrice> lastUltimateOfficeBasePrices =
|
||||
ultimateOfficeBasePriceMapper.getUltimateOfficeBasePrices(lastPriceTableRoute);
|
||||
lastUltimateOfficeBasePrices.parallelStream().forEach(ultimateOfficeBasePrice -> {
|
||||
syncOfficeAggregationCaseMapper.insertUltimatePriceTable(ultimateOfficeBasePrice);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -70,9 +70,9 @@ spring:
|
||||
password: Lcdatacenter_888
|
||||
calc:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=CALC
|
||||
username: purple
|
||||
password: liancheng
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_calc
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
spider:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||
|
@ -70,9 +70,9 @@ spring:
|
||||
password: Lcdatacenter_888
|
||||
calc:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=CALC
|
||||
username: purple
|
||||
password: liancheng
|
||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_calc
|
||||
username: sa
|
||||
password: Lcdatacenter_888
|
||||
spider:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||
|
@ -154,4 +154,54 @@
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
</update>
|
||||
<!-- 汇总案例 -->
|
||||
<select id="getOfficeAggregationCases" resultType="com.ruoyi.project.data.cases.domain.OfficeAggregationCase">
|
||||
SELECT url as url
|
||||
,title as title
|
||||
,容积率 as floorAreaRatio
|
||||
,总价售 as caseTotalPrice
|
||||
,均价售 as caseUnitPrice
|
||||
,楼盘名称 as name
|
||||
,楼盘名称_M as name_m
|
||||
,楼层 as caseFloor
|
||||
,面积 as area
|
||||
,物业费 as managementFee
|
||||
,工位数 as seatCount
|
||||
,地址 as address
|
||||
,地铁 as metro
|
||||
,发布时间 as publishDate
|
||||
,房源编号 as sourceNo
|
||||
,百度lng as lng
|
||||
,百度lat as lat
|
||||
,区域 as county
|
||||
,分类 as catalog
|
||||
,来源 as source
|
||||
,等级 as level
|
||||
,楼盘网址 as homePageUrl
|
||||
,装修 as decoration
|
||||
,类型 as type
|
||||
,板块 as block
|
||||
,挂牌中介 as agency
|
||||
,月租金租 as rentOfMonthly
|
||||
,标准租金租 as rentOfStandard
|
||||
,更新时间 as updateDate
|
||||
,得房率 as score
|
||||
,总价 as totalPrice
|
||||
,单价 as unitPrice
|
||||
,BuildingID_P as buildingId
|
||||
,ProjectID_P as communityId
|
||||
,TotalFloorSum as totalFloor
|
||||
,FloorCoff as floorCoefficient
|
||||
,DecorationCoff as decorationCoefficient
|
||||
,PriceAmend as priceAmend
|
||||
,MainPrice_1 as mainPrice_1
|
||||
,MainPriceRent_1 as mainPriceRent_1
|
||||
,ListedPrice_1 as listedPrice_1
|
||||
,ListedPriceRent_1 as listedPriceRent_1
|
||||
,ListedPrice as listedPrice
|
||||
,ListedPriceRent as listedPriceRent
|
||||
,VOPP as vopp
|
||||
,VOPPT as voppt
|
||||
FROM dbo.DW_OFFICECASE_COMM_${yearMonth}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,279 @@
|
||||
<?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.cases.mapper.sync.SyncOfficeAggregationCaseMapper">
|
||||
<!-- 创建表 -->
|
||||
<update id="createAggregationCaseTable">
|
||||
<bind name="targetTableName" value="'dbo.DW_OFFICECASE_COMM_' + yearMonth"/>
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
|
||||
CREATE TABLE ${targetTableName}
|
||||
(
|
||||
ID int identity(1,1) NOT NULL,
|
||||
url varchar (1000) NULL,
|
||||
title varchar (1000) NULL,
|
||||
容积率 varchar (1000) NULL,
|
||||
总价售 varchar (1000) NULL,
|
||||
均价售 varchar (1000) NULL,
|
||||
楼盘名称 varchar (1000) NULL,
|
||||
楼盘名称_M nvarchar (512) NULL,
|
||||
楼层 varchar (1000) NULL,
|
||||
面积 varchar (1000) NULL,
|
||||
物业费 varchar (1000) NULL,
|
||||
工位数 varchar (1000) NULL,
|
||||
地址 varchar (1000) NULL,
|
||||
地铁 varchar (1000) NULL,
|
||||
发布时间 date NULL,
|
||||
房源编号 varchar (1000) NULL,
|
||||
百度lng varchar (1000) NULL,
|
||||
百度lat varchar (1000) NULL,
|
||||
区域 varchar (1000) NULL,
|
||||
分类 varchar (1000) NULL,
|
||||
来源 varchar (1000) NULL,
|
||||
等级 varchar (1000) NULL,
|
||||
楼盘网址 varchar (1000) NULL,
|
||||
装修 varchar (1000) NULL,
|
||||
类型 varchar (1000) NULL,
|
||||
板块 varchar (1000) NULL,
|
||||
挂牌中介 varchar (1000) NULL,
|
||||
月租金租 varchar (1000) NULL,
|
||||
标准租金租 varchar (1000) NULL,
|
||||
更新时间 varchar (1000) NULL,
|
||||
得房率 varchar (1000) NULL,
|
||||
总价 decimal (18, 2) NULL,
|
||||
单价 decimal (18, 2) NULL,
|
||||
BuildingID_P bigint NULL,
|
||||
ProjectID_P bigint NULL,
|
||||
TotalFloorSum nvarchar (32) NULL,
|
||||
FloorCoff decimal (7, 4) NULL,
|
||||
DecorationCoff decimal (7, 4) NULL,
|
||||
PriceAmend numeric (38, 12) NULL,
|
||||
MainPrice_1 decimal (38, 6) NULL,
|
||||
MainPriceRent_1 decimal (38, 6) NULL,
|
||||
ListedPrice_1 decimal (38, 6) NULL,
|
||||
ListedPriceRent_1 decimal (38, 6) NULL,
|
||||
ListedPrice decimal (38, 6) NULL,
|
||||
ListedPriceRent decimal (38, 6) NULL,
|
||||
VOPP numeric (38, 6) NULL,
|
||||
VOPPT nvarchar (32) NULL
|
||||
)
|
||||
</update>
|
||||
<!--同步-->
|
||||
<insert id="insertAggregationCase" parameterType="com.ruoyi.project.data.cases.domain.OfficeAggregationCase">
|
||||
insert into dbo.DW_OFFICECASE_COMM_${yearMonth}
|
||||
(
|
||||
url
|
||||
, title
|
||||
, 容积率
|
||||
, 总价售
|
||||
, 均价售
|
||||
, 楼盘名称
|
||||
, 楼盘名称_M
|
||||
, 楼层
|
||||
, 面积
|
||||
, 物业费
|
||||
, 工位数
|
||||
, 地址
|
||||
, 地铁
|
||||
, 发布时间
|
||||
, 房源编号
|
||||
, 百度lng
|
||||
, 百度lat
|
||||
, 区域
|
||||
, 分类
|
||||
, 来源
|
||||
, 等级
|
||||
, 楼盘网址
|
||||
, 装修
|
||||
, 类型
|
||||
, 板块
|
||||
, 挂牌中介
|
||||
, 月租金租
|
||||
, 标准租金租
|
||||
, 更新时间
|
||||
, 得房率
|
||||
, 总价
|
||||
, 单价
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, TotalFloorSum
|
||||
, FloorCoff
|
||||
, DecorationCoff
|
||||
, PriceAmend
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, ListedPrice_1
|
||||
, ListedPriceRent_1
|
||||
, ListedPrice
|
||||
, ListedPriceRent
|
||||
, VOPP
|
||||
, VOPPT
|
||||
) values
|
||||
(
|
||||
#{url},
|
||||
#{title},
|
||||
#{floorAreaRatio},
|
||||
#{caseTotalPrice},
|
||||
#{caseUnitPrice},
|
||||
#{name},
|
||||
#{name_m},
|
||||
#{caseFloor},
|
||||
#{area},
|
||||
#{managementFee},
|
||||
#{seatCount},
|
||||
#{address},
|
||||
#{metro},
|
||||
#{publishDate,jdbcType=DATE},
|
||||
#{sourceNo},
|
||||
#{lng},
|
||||
#{lat},
|
||||
#{county},
|
||||
#{catalog},
|
||||
#{source},
|
||||
#{level},
|
||||
#{homePageUrl},
|
||||
#{decoration},
|
||||
#{type},
|
||||
#{block},
|
||||
#{agency},
|
||||
#{rentOfMonthly},
|
||||
#{rentOfStandard},
|
||||
#{updateDate,jdbcType=DATE},
|
||||
#{score},
|
||||
#{totalPrice},
|
||||
#{unitPrice},
|
||||
#{buildingId},
|
||||
#{communityId},
|
||||
#{totalFloor},
|
||||
#{floorCoefficient},
|
||||
#{decorationCoefficient},
|
||||
#{priceAmend},
|
||||
#{mainPrice_1},
|
||||
#{mainPriceRent_1},
|
||||
#{listedPrice_1},
|
||||
#{listedPriceRent_1},
|
||||
#{listedPrice},
|
||||
#{listedPriceRent},
|
||||
#{vopp},
|
||||
#{voppt}
|
||||
)
|
||||
</insert>
|
||||
<!--备份表-->
|
||||
<update id="dumpPriceTable">
|
||||
<bind name="targetTableName" value="'dbo.ODS_OFFICE_BUILDING_PRICE_INFO_' + yearMonth"/>
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
select * into ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}_${operateDate}_bak from ${targetTableName}
|
||||
</update>
|
||||
<!--创建价格表-->
|
||||
<update id="createPriceTable">
|
||||
<bind name="targetTableName" value="'dbo.ODS_OFFICE_BUILDING_PRICE_INFO_' + yearMonth"/>
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
|
||||
create table ${targetTableName}(
|
||||
id bigint identity not null ,
|
||||
BuildingID bigint not null,
|
||||
UnifiedID bigint null,
|
||||
ProjectID bigint not null,
|
||||
BuildingID_P nvarchar(20) not null,
|
||||
ProjectID_P bigint null,
|
||||
MainPrice decimal(38, 6) null,
|
||||
MainPriceRent decimal(38, 6) null,
|
||||
MainPricePst decimal(38, 6) null,
|
||||
MainPriceRentPst decimal(38, 6) null,
|
||||
MainPriceType varchar(2) null,
|
||||
MainPriceRentType varchar(2) null,
|
||||
ModifyDate date null,
|
||||
Status nvarchar(30) null,
|
||||
BuildingStd tinyint null,
|
||||
AdjEvd nvarchar(1000) null,
|
||||
MainPrice_1 decimal(38, 6) null,
|
||||
MainPriceRent_1 decimal(38, 6) null,
|
||||
AreaCoff decimal(7, 4) null,
|
||||
YearCoff decimal(7, 4) null,
|
||||
BuildingCoff decimal(7, 4) null,
|
||||
ProjectName nvarchar(1024) null,
|
||||
ProjectAddr nvarchar(1024) null,
|
||||
BuildingAddr nvarchar(1024) null,
|
||||
County nvarchar(512) null,
|
||||
Loop nvarchar(512) null,
|
||||
Block nvarchar(512) null,
|
||||
Street nvarchar(512) null,
|
||||
Year int null,
|
||||
AvgArea decimal(18, 2) null,
|
||||
TotalFloorSum nvarchar(32) null,
|
||||
UpperFloorSum nvarchar(32) null,
|
||||
OfficeClass nvarchar(256) null,
|
||||
Grade nvarchar(64) null
|
||||
);
|
||||
</update>
|
||||
<!--插入价格表-->
|
||||
<update id="insertUltimatePriceTable" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
||||
insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
(
|
||||
BuildingID_P
|
||||
, ProjectID_P
|
||||
, MainPrice
|
||||
, MainPriceRent
|
||||
, MainPricePst
|
||||
, MainPriceRentPst
|
||||
, MainPriceType
|
||||
, MainPriceRentType
|
||||
, ModifyDate
|
||||
, Status
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, AreaCoff
|
||||
, YearCoff
|
||||
, BuildingCoff
|
||||
, ProjectName
|
||||
, ProjectAddr
|
||||
, BuildingAddr
|
||||
, County
|
||||
, Loop
|
||||
, Block
|
||||
, Street
|
||||
, Year
|
||||
, AvgArea
|
||||
, TotalFloorSum
|
||||
, UpperFloorSum
|
||||
, OfficeClass
|
||||
, Grade
|
||||
) values(
|
||||
#{buildingId},
|
||||
#{communityId},
|
||||
#{mainPrice},
|
||||
#{mainPriceRent},
|
||||
#{mainPricePst},
|
||||
#{mainPriceRentPst},
|
||||
#{mainPriceType},
|
||||
#{mainPriceRentType},
|
||||
#{updateDate,jdbcType=DATE},
|
||||
#{status},
|
||||
#{standardBuilding},
|
||||
#{adjustPriceComment},
|
||||
#{mainPrice_1},
|
||||
#{mainPriceRent_1},
|
||||
#{areaCoefficient},
|
||||
#{yearCoefficient},
|
||||
#{buildingCoefficient},
|
||||
#{communityName},
|
||||
#{communityAddress},
|
||||
#{buildingAddress},
|
||||
#{countyName},
|
||||
#{loopName},
|
||||
#{blockName},
|
||||
#{streetName},
|
||||
#{year},
|
||||
#{avgArea},
|
||||
#{totalFloorSum},
|
||||
#{upperFloorSum},
|
||||
#{officeClass},
|
||||
#{officeLevel}
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
@ -333,4 +333,41 @@
|
||||
<update id="clearArtificialTable">
|
||||
truncate table DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}
|
||||
</update>
|
||||
<update id="clearPriceTable">
|
||||
truncate table ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
</update>
|
||||
<select id="getUltimateOfficeBasePrices" resultType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
||||
SELECT 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
|
||||
,ModifyDate as updateDate
|
||||
,Status as status
|
||||
,BuildingStd as standardBuilding
|
||||
,AdjEvd as adjustPriceComment
|
||||
,MainPrice_1 as mainPrice_1
|
||||
,MainPriceRent_1 as mainPriceRent_1
|
||||
,AreaCoff as areaCoefficient
|
||||
,YearCoff as yearCoefficient
|
||||
,BuildingCoff as buildingCoefficient
|
||||
,ProjectName as communityName
|
||||
,ProjectAddr as communityAddress
|
||||
,BuildingAddr as buildingAddress
|
||||
,County as countyName
|
||||
,Loop as loopName
|
||||
,Block as blockName
|
||||
,Street as streetName
|
||||
,Year as year
|
||||
,AvgArea as avgArea
|
||||
,TotalFloorSum as totalFloorSum
|
||||
,UpperFloorSum as upperFloorSum
|
||||
,OfficeClass as officeClass
|
||||
,Grade as officeLevel,
|
||||
${yearMonth} as yearMonth
|
||||
FROM dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
</select>
|
||||
</mapper>
|
@ -16,7 +16,7 @@ on a.BuildingID_p = c.BuildingID_p and c.status=1 and (
|
||||
cast(a.MainPriceRent_1 as decimal(18,1)) <> cast(isnull(c.MainPriceRent, 0) as decimal(18,1)))
|
||||
where b.BuildingID_p is not null or c.BuildingID is not null;
|
||||
|
||||
--价格调整
|
||||
-- 上期价格变化
|
||||
select a.BuildingID, a.UnifiedID, a.ProjectID, a.BuildingID_P, a.ProjectID_P, b.MainPrice_1 as MainPrice, b.MainPriceRent_1 as MainPriceRent,
|
||||
a.MainPricePst, a.MainPriceRentPst,
|
||||
a.MainPriceType, a.MainPriceRentType, b.ModifyDate, 1 as Status, a.BuildingStd,
|
||||
@ -126,7 +126,8 @@ from #InfoChgLst;
|
||||
|
||||
--当周期价格调整
|
||||
select a.BuildingID, a.UnifiedID, a.ProjectID, a.BuildingID_P, a.ProjectID_P, b.MainPrice, b.MainPriceRent,
|
||||
b.MainPrice*1.0/c.MainPrice as MainPricePst, b.MainPriceRent*1.0/c.MainPriceRent as MainPriceRentPst,
|
||||
((b.MainPrice*1.0/c.MainPrice) - 1) as MainPricePst,
|
||||
((b.MainPriceRent*1.0/c.MainPriceRent) - 1) as MainPriceRentPst,
|
||||
a.MainPriceType, a.MainPriceRentType, b.ModifyDate, 1 as Status, a.BuildingStd,
|
||||
case when MainPriceChg=0 then '' else 'MainPriceChg|' end + case when MainPriceRentChg=0 then '' else 'MainPriceRentChg|' end as AdjEvd
|
||||
, c.MainPrice_1
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.ruoyi;
|
||||
|
||||
|
||||
import com.ruoyi.project.data.cases.domain.OfficeAggregationCase;
|
||||
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase;
|
||||
import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
@ -73,7 +75,7 @@ public class GenerateTableTests {
|
||||
|
||||
@Test
|
||||
public void generateBatchInsertSqL() {
|
||||
Class targetClass = OriginalResidenceRentClosingCase .class;
|
||||
Class targetClass = OriginalResidenceRentClosingCase.class;
|
||||
|
||||
List<Field> fieldList = new ArrayList<>();
|
||||
while (targetClass != null) {
|
||||
@ -90,4 +92,24 @@ public class GenerateTableTests {
|
||||
}
|
||||
System.out.println(sb.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void generateBatchGuoHaoInsertSqL() {
|
||||
Class targetClass = UltimateOfficeBasePrice.class;
|
||||
|
||||
List<Field> fieldList = new ArrayList<>();
|
||||
while (targetClass != null) {
|
||||
fieldList.addAll(new ArrayList<>(Arrays.asList(targetClass.getDeclaredFields())));
|
||||
targetClass = targetClass.getSuperclass();
|
||||
}
|
||||
Field[] fields = new Field[fieldList.size()];
|
||||
fieldList.toArray(fields);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
sb.append("#{"+fields[i].getName()+"},");
|
||||
sb.append("\n");
|
||||
}
|
||||
System.out.println(sb.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.compute;
|
||||
|
||||
import com.ruoyi.RuoYiApplication;
|
||||
import com.ruoyi.project.data.cases.service.IOriginalOfficeCaseService;
|
||||
import com.ruoyi.project.data.price.service.impl.UltimateOfficeBasePriceServiceImpl;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -17,6 +18,8 @@ public class OfficeBasePriceTests {
|
||||
@Autowired
|
||||
private IOriginalOfficeCaseService originalOfficeCaseService;
|
||||
|
||||
@Autowired
|
||||
private UltimateOfficeBasePriceServiceImpl ultimateOfficeBasePriceService;
|
||||
|
||||
/**
|
||||
* 下载案例并且作价
|
||||
@ -26,4 +29,9 @@ public class OfficeBasePriceTests {
|
||||
originalOfficeCaseService.compute();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPushData() {
|
||||
ultimateOfficeBasePriceService.pushData(202007, 202006, 202005);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user