diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/domain/CleanResidenceRentAggregationCase.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/domain/CleanResidenceRentAggregationCase.java index dc914c034..163fe750e 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/cases/domain/CleanResidenceRentAggregationCase.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/cases/domain/CleanResidenceRentAggregationCase.java @@ -9,42 +9,153 @@ import java.util.Date; public class CleanResidenceRentAggregationCase { private Integer yearMonth; + /** + * 案例单套ID + */ private String householdsIdSRC; + /** + * 案例小区ID + */ private String projectIdSRC; + /** + * 小区ID + */ private String communityId; + private String buildingId; + /** + * WHEN A.RentType=1 THEN ''整租'' + * WHEN A.RentType=2 THEN ''散租'' + * WHEN A.RentType=3 THEN ''分租'' + */ private Integer rentType; + /** + * 室 + */ private Integer roomNum; + /** + * 厅 + */ private Integer hallNum; + /** + * 卫 + */ private Integer bashRoomNum; + /** + * 面积 + */ private BigDecimal area; + /** + * 朝向 + */ private String toward; + /** + * UpperFloorSum 总层数 + */ private String totalFloor; + /** + * UpperFloorNum 所在层 + */ private String currentFloor; + /** + * 有无电梯 + */ private Boolean elevator; + /** + * 装修类型 + */ private String decoration; + /** + * 建成年代 + */ private Integer year; + /** + * 房屋面积系数 + */ private BigDecimal areaCoefficient; + /** + * 朝向系数 + */ private BigDecimal towardCoefficient; + /** + * 楼层系数 + */ private BigDecimal floorCoefficient; + /** + * 装修系数 + */ private Integer decorationCoefficient; + /** + * 建成年代系数 + */ private BigDecimal yearCoefficient; + /** + * 楼栋系数 + */ private BigDecimal buildingCoefficient; + /** + * 室厅修正系数 + */ private BigDecimal roomTypeCoefficient; + /** + * 总价(元) + */ private BigDecimal totalPrice; + /** + * 单价(元每平方米) + */ private BigDecimal unitPrice; + /** + * 散租单价 + */ private BigDecimal priceScatterRent; + /** + * 整租单价 + */ private BigDecimal priceEntireRent; + /** + * 合租单间价 + */ private BigDecimal priceShareRent0; + /** + * 合租折算价 + */ private BigDecimal priceShareRent; + /** + * 带看总次数 + */ private Integer visitedNum; + /** + * 首次带看时间 + */ private Date firstVisitedDate; + /** + * 15天内带看总次数 + */ private Integer visitedNum15; + /** + * 30天内带看总次数 + */ private Integer visitedNum30; + /** + * 案例状态 + */ private Integer status; + /** + * 最近一次挂牌总价调整幅度 + */ private BigDecimal adjustedValue; + /** + * 最近一次挂牌总价调整比例 + */ private BigDecimal adjustedPst; + /** + * 累计挂牌总价调整幅度 + */ private BigDecimal adjustedCumValue; + /** + * 累计挂牌总价调整比例 + */ private BigDecimal adjustedCumPst; /** * 累计挂牌总价绝对调整幅度 diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/ResidenceRentAggregationCaseMapper.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/ResidenceRentAggregationCaseMapper.java new file mode 100644 index 000000000..d870c6198 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/ResidenceRentAggregationCaseMapper.java @@ -0,0 +1,27 @@ +package com.ruoyi.project.data.cases.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.ruoyi.project.data.cases.domain.CleanResidenceRentAggregationCase; +import com.ruoyi.project.data.cases.domain.OriginalResidenceSaleOpeningCase; +import com.ruoyi.project.data.cases.domain.OriginalResidenceSaleOpeningCaseQueryModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 汇总案例查询 + * + * @author lihe + */ +@DS("compute") +public interface ResidenceRentAggregationCaseMapper { + + /** + * 获取每月汇总案例列表 + * + * @param yearMonth + * @return + */ + List getMonthly(@Param("yearMonth") Integer yearMonth); + +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/sync/SyncOriginalResidenceRentAggregationCaseMapper.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/sync/SyncOriginalResidenceRentAggregationCaseMapper.java deleted file mode 100644 index 1fa15630b..000000000 --- a/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/sync/SyncOriginalResidenceRentAggregationCaseMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ruoyi.project.data.cases.mapper.sync; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase; -import org.apache.ibatis.annotations.Param; - -/** - * @author lihe - */ -@DS("calc") -public interface SyncOriginalResidenceRentAggregationCaseMapper { - - /** - * 创建挂牌案例表 - * @param yearMonth - */ - int createTable(@Param("yearMonth") Integer yearMonth); - - /** - * - * @param originalResidenceRentOpeningCase - * @return - */ - int insert(OriginalResidenceRentOpeningCase originalResidenceRentOpeningCase); - -} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/sync/SyncResidenceRentCaseMapper.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/sync/SyncResidenceRentCaseMapper.java new file mode 100644 index 000000000..56d9b2378 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/data/cases/mapper/sync/SyncResidenceRentCaseMapper.java @@ -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.CleanResidenceRentAggregationCase; +import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase; +import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice; +import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice; +import org.apache.ibatis.annotations.Param; + +/** + * @author lihe + */ +@DS("calc") +public interface SyncResidenceRentCaseMapper { + + /** + * 创建案例汇总表 + * + * @param yearMonth + * @return + */ + int createAggregationCaseTable(@Param("yearMonth") Integer yearMonth); + + /** + * 插入案例汇总表 + * + * @param cleanResidenceRentAggregationCase + * @return + */ + int insertAggregationCaseTable(CleanResidenceRentAggregationCase cleanResidenceRentAggregationCase); + + /** + * 创建最终价格表 + * + * @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(UltimateResidenceRentBasePrice ultimateOfficeBasePrice); + +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java index b2885b8d5..8cbe65320 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java @@ -20,7 +20,7 @@ import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice; import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice; import com.ruoyi.project.data.price.service.IArtificialResidenceRentPriceService; import com.ruoyi.project.data.price.service.IComputeResidenceRentPriceService; -import com.ruoyi.project.data.price.service.IUltimateResidenceRentBasePriceService; +import com.ruoyi.project.data.price.service.IUltimateResidenceRentPriceService; import com.ruoyi.project.system.domain.UploadFile; import com.ruoyi.project.system.service.IUploadFileService; import org.springframework.beans.factory.annotation.Autowired; @@ -38,7 +38,7 @@ public class ResidenceRentBasePriceController extends BaseController { @Autowired private IArtificialResidenceRentPriceService artificialResidenceRentPriceService; @Autowired - private IUltimateResidenceRentBasePriceService ultimateResidenceRentBasePriceService; + private IUltimateResidenceRentPriceService ultimateResidenceRentBasePriceService; @Autowired private IUploadFileService fileService; @Autowired diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/UltimateResidenceRentPriceMapper.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/UltimateResidenceRentPriceMapper.java index 398716e59..fb5dec868 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/UltimateResidenceRentPriceMapper.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/mapper/UltimateResidenceRentPriceMapper.java @@ -3,25 +3,48 @@ package com.ruoyi.project.data.price.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice; +import org.apache.ibatis.annotations.Param; import java.util.List; /** - * 【请填写功能名称】Mapper接口 + * 住宅租赁最终基价DAO * - * @author ruoyi + * @author purple * @date 2020-05-20 */ @DS("compute") public interface UltimateResidenceRentPriceMapper { + /** + * 获取分页列表 + * + * @param ultimateResidenceRentBasePrice + * @return + */ List selectPageList(UltimateResidenceRentBasePrice ultimateResidenceRentBasePrice); + /** + * 获取分页总数 + * + * @param ultimateResidenceRentBasePrice + * @return + */ Integer selectPageCount(UltimateResidenceRentBasePrice ultimateResidenceRentBasePrice); /** + * 获取有效价格表 + * * @return */ List yearMonthList(); + /** + * 获取某个月的数据 + * + * @param yearMonth + * @return + */ + List getMonthly(@Param("yearMonth") Integer yearMonth); + } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateResidenceRentBasePriceService.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateResidenceRentPriceService.java similarity index 75% rename from ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateResidenceRentBasePriceService.java rename to ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateResidenceRentPriceService.java index 183b34b51..7ee260f7f 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateResidenceRentBasePriceService.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/IUltimateResidenceRentPriceService.java @@ -2,21 +2,30 @@ package com.ruoyi.project.data.price.service; import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice; +import org.apache.ibatis.annotations.Param; import java.util.List; /** - * 住宅租赁基价 + * 住宅租赁最终基价 + * + * @author lihe */ -public interface IUltimateResidenceRentBasePriceService { +public interface IUltimateResidenceRentPriceService { /** + * 获取分页列表 + * * @param ultimateResidenceRentBasePrice * @return */ List selectList(UltimateResidenceRentBasePrice ultimateResidenceRentBasePrice); + + /** + * 获取分页总数 + * * @param ultimateResidenceRentBasePrice * @return */ diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ArtificialResidenceRentPriceServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ArtificialResidenceRentPriceServiceImpl.java index f130524c0..75b34dbee 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ArtificialResidenceRentPriceServiceImpl.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ArtificialResidenceRentPriceServiceImpl.java @@ -6,9 +6,16 @@ import com.microsoft.sqlserver.jdbc.SQLServerDataTable; import com.microsoft.sqlserver.jdbc.SQLServerException; import com.ruoyi.common.utils.LoadUtil; import com.ruoyi.project.common.VueSelectModel; +import com.ruoyi.project.data.cases.domain.CleanResidenceRentAggregationCase; +import com.ruoyi.project.data.cases.domain.OfficeAggregationCase; +import com.ruoyi.project.data.cases.mapper.ResidenceRentAggregationCaseMapper; +import com.ruoyi.project.data.cases.mapper.sync.SyncResidenceRentCaseMapper; import com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice; import com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice; +import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice; +import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice; import com.ruoyi.project.data.price.mapper.ArtificialResidenceRentPriceMapper; +import com.ruoyi.project.data.price.mapper.UltimateResidenceRentPriceMapper; import com.ruoyi.project.data.price.service.IArtificialResidenceRentPriceService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,6 +23,7 @@ import org.springframework.beans.BeanUtils; 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; import org.springframework.transaction.annotation.Transactional; @@ -45,6 +53,12 @@ public class ArtificialResidenceRentPriceServiceImpl implements IArtificialResid private ArtificialResidenceRentPriceMapper artificialResidenceRentPriceMapper; @Autowired private JdbcTemplate jdbcTemplate; + @Autowired + private SyncResidenceRentCaseMapper syncResidenceRentCaseMapper; + @Autowired + private ResidenceRentAggregationCaseMapper residenceRentAggregationCaseMapper; + @Autowired + private UltimateResidenceRentPriceMapper ultimateResidenceRentPriceMapper; @Override public ArtificialResidenceRentBasePrice selectById(Integer yearMonth, String id) { @@ -101,7 +115,8 @@ public class ArtificialResidenceRentPriceServiceImpl implements IArtificialResid Date valuePoint = calendar.getTime(); calendar.add(Calendar.MONTH, -1); Date lastValuePoint = calendar.getTime(); - String lastYearMonth = String.format("%d%02d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1); + Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR), + calendar.get(Calendar.MONTH) + 1)); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); String priceDate = simpleDateFormat.format(valuePoint); String lastPriceDate = simpleDateFormat.format(lastValuePoint); @@ -173,16 +188,69 @@ public class ArtificialResidenceRentPriceServiceImpl implements IArtificialResid // 人工修正导入 String rawSql = LoadUtil.loadContent("sql-template/update_rent_price.sql"); String sql = rawSql.replace("#yearMonth#", yearMonth.toString()) - .replace("#lastYearMonth#", lastYearMonth) + .replace("#lastYearMonth#", lastYearMonth.toString()) .replace("#priceDate#", priceDate) .replace("#lastPriceDate#", lastPriceDate); jdbcTemplate.update(sql); artificialResidenceRentPriceMapper.initProcedure(); + calendar.setTime(lastValuePoint); + calendar.add(Calendar.MONTH, -1); + Integer lastPriceTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR), + calendar.get(Calendar.MONTH) + 1)); + + pushData(yearMonth, lastYearMonth, lastPriceTableRoute); } catch (Exception e) { - e.printStackTrace(); + log.error("住宅租赁基价人工修正异常", e); } StringBuilder successMsg = new StringBuilder("恭喜您,数据已全部导入成功!共 " + (successNum - failureNum) + " 条"); return successMsg.toString(); } + + /** + * 数据推送 + * + * @param yearMonth 作价表 + * @param currentPriceTableRoute 当期表 + * @param lastPriceTableRoute 上期表 + */ + @Async + public void pushData(Integer yearMonth, Integer currentPriceTableRoute, Integer lastPriceTableRoute) { + try { + // 案例同步 + syncResidenceRentCaseMapper.createAggregationCaseTable(currentPriceTableRoute); + List list = residenceRentAggregationCaseMapper.getMonthly(yearMonth); + list.parallelStream().forEach(cleanResidenceRentAggregationCase -> { + cleanResidenceRentAggregationCase.setYearMonth(currentPriceTableRoute); + syncResidenceRentCaseMapper.insertAggregationCaseTable(cleanResidenceRentAggregationCase); + }); + + // 当期价格同步 + syncResidenceRentCaseMapper.createUltimatePriceTable(currentPriceTableRoute); + List ultimateResidenceRentBasePrices = + ultimateResidenceRentPriceMapper.getMonthly(yearMonth); + ultimateResidenceRentBasePrices.parallelStream().forEach(ultimateResidenceRentBasePrice -> { + ultimateResidenceRentBasePrice.setYearMonth(currentPriceTableRoute); + syncResidenceRentCaseMapper.insertUltimatePriceTable(ultimateResidenceRentBasePrice); + }); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); + String operateDate = simpleDateFormat.format(calendar.getTime()); + + // 上期价格同步 + syncResidenceRentCaseMapper.dumpPriceTable(lastPriceTableRoute, operateDate); + syncResidenceRentCaseMapper.clearPriceTable(lastPriceTableRoute); + List lastUltimateResidenceRentBasePrices = + ultimateResidenceRentPriceMapper.getMonthly(lastPriceTableRoute); + lastUltimateResidenceRentBasePrices.parallelStream().forEach(ultimateResidenceRentBasePrice -> { + ultimateResidenceRentBasePrice.setYearMonth(lastPriceTableRoute); + syncResidenceRentCaseMapper.insertUltimatePriceTable(ultimateResidenceRentBasePrice); + }); + } catch (Exception e) { + log.error("推送住宅租赁数据失败", e); + } + } + } \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateOfficeBasePriceServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateOfficeBasePriceServiceImpl.java index 31e1782ad..31275216d 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateOfficeBasePriceServiceImpl.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateOfficeBasePriceServiceImpl.java @@ -253,36 +253,41 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr */ @Async public void pushData(Integer yearMonth, Integer currentPriceTableRoute, Integer lastPriceTableRoute) { - // 案例同步 - syncOfficeAggregationCaseMapper.createAggregationCaseTable(currentPriceTableRoute); - List list = originalOfficeCaseMapper.getOfficeAggregationCases(yearMonth); - list.parallelStream().forEach(officeAggregationCase -> { - officeAggregationCase.setYearMonth(currentPriceTableRoute); - syncOfficeAggregationCaseMapper.insertAggregationCase(officeAggregationCase); - }); + try { + // 案例同步 + syncOfficeAggregationCaseMapper.createAggregationCaseTable(currentPriceTableRoute); + List list = originalOfficeCaseMapper.getOfficeAggregationCases(yearMonth); + list.parallelStream().forEach(officeAggregationCase -> { + officeAggregationCase.setYearMonth(currentPriceTableRoute); + syncOfficeAggregationCaseMapper.insertAggregationCase(officeAggregationCase); + }); - // 当期价格同步 - syncOfficeAggregationCaseMapper.createUltimatePriceTable(currentPriceTableRoute); - List ultimateOfficeBasePrices = - ultimateOfficeBasePriceMapper.getUltimateOfficeBasePrices(yearMonth); - ultimateOfficeBasePrices.parallelStream().forEach(ultimateOfficeBasePrice -> { - ultimateOfficeBasePrice.setYearMonth(currentPriceTableRoute); - syncOfficeAggregationCaseMapper.insertUltimatePriceTable(ultimateOfficeBasePrice); - }); + // 当期价格同步 + syncOfficeAggregationCaseMapper.createUltimatePriceTable(currentPriceTableRoute); + List ultimateOfficeBasePrices = + ultimateOfficeBasePriceMapper.getUltimateOfficeBasePrices(yearMonth); + ultimateOfficeBasePrices.parallelStream().forEach(ultimateOfficeBasePrice -> { + ultimateOfficeBasePrice.setYearMonth(currentPriceTableRoute); + syncOfficeAggregationCaseMapper.insertUltimatePriceTable(ultimateOfficeBasePrice); + }); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); - String operateDate = simpleDateFormat.format(calendar.getTime()); + 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 lastUltimateOfficeBasePrices = - ultimateOfficeBasePriceMapper.getUltimateOfficeBasePrices(lastPriceTableRoute); - lastUltimateOfficeBasePrices.parallelStream().forEach(ultimateOfficeBasePrice -> { - ultimateOfficeBasePrice.setYearMonth(lastPriceTableRoute); - syncOfficeAggregationCaseMapper.insertUltimatePriceTable(ultimateOfficeBasePrice); - }); + // 上期价格同步 + syncOfficeAggregationCaseMapper.dumpPriceTable(lastPriceTableRoute, operateDate); + syncOfficeAggregationCaseMapper.clearPriceTable(lastPriceTableRoute); + List lastUltimateOfficeBasePrices = + ultimateOfficeBasePriceMapper.getUltimateOfficeBasePrices(lastPriceTableRoute); + lastUltimateOfficeBasePrices.parallelStream().forEach(ultimateOfficeBasePrice -> { + ultimateOfficeBasePrice.setYearMonth(lastPriceTableRoute); + syncOfficeAggregationCaseMapper.insertUltimatePriceTable(ultimateOfficeBasePrice); + }); + } catch (Exception e) { + log.error("推送办公数据失败", e); + } } + } diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateResidenceRentBasePriceServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateResidenceRentPriceServiceImpl.java similarity index 83% rename from ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateResidenceRentBasePriceServiceImpl.java rename to ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateResidenceRentPriceServiceImpl.java index 286475287..7d2ba19e0 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateResidenceRentBasePriceServiceImpl.java +++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/UltimateResidenceRentPriceServiceImpl.java @@ -3,7 +3,7 @@ package com.ruoyi.project.data.price.service.impl; import com.ruoyi.project.common.VueSelectModel; import com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice; import com.ruoyi.project.data.price.mapper.UltimateResidenceRentPriceMapper; -import com.ruoyi.project.data.price.service.IUltimateResidenceRentBasePriceService; +import com.ruoyi.project.data.price.service.IUltimateResidenceRentPriceService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -14,13 +14,11 @@ import java.util.List; /** * 核准住宅租赁基价 Service业务层处理 * - * @author ruoyi + * @author purple * @date 2020-05-20 */ @Service -public class UltimateResidenceRentBasePriceServiceImpl implements IUltimateResidenceRentBasePriceService { - - private static final Logger log = LoggerFactory.getLogger(UltimateResidenceRentBasePriceServiceImpl.class); +public class UltimateResidenceRentPriceServiceImpl implements IUltimateResidenceRentPriceService { @Autowired private UltimateResidenceRentPriceMapper ultimateResidenceRentPriceMapper; @@ -40,5 +38,4 @@ public class UltimateResidenceRentBasePriceServiceImpl implements IUltimateResid return ultimateResidenceRentPriceMapper.yearMonthList(); } - } diff --git a/ruoyi/src/main/resources/mybatis/data/ResidenceRentAggregationCaseMapper.xml b/ruoyi/src/main/resources/mybatis/data/ResidenceRentAggregationCaseMapper.xml new file mode 100644 index 000000000..07161788d --- /dev/null +++ b/ruoyi/src/main/resources/mybatis/data/ResidenceRentAggregationCaseMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi/src/main/resources/mybatis/data/SyncOriginalResidenceRentAggregationCaseMapper.xml b/ruoyi/src/main/resources/mybatis/data/SyncResidenceRentCaseMapper.xml similarity index 63% rename from ruoyi/src/main/resources/mybatis/data/SyncOriginalResidenceRentAggregationCaseMapper.xml rename to ruoyi/src/main/resources/mybatis/data/SyncResidenceRentCaseMapper.xml index 689feef1c..00918ba26 100644 --- a/ruoyi/src/main/resources/mybatis/data/SyncOriginalResidenceRentAggregationCaseMapper.xml +++ b/ruoyi/src/main/resources/mybatis/data/SyncResidenceRentCaseMapper.xml @@ -2,8 +2,8 @@ - - + + IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL drop table ${targetTableName}; @@ -68,7 +68,7 @@ ) - + insert into dbo.DW_HOUSINGCASE_RENT_COMM_${yearMonth} ( HouseholdsID_SRC @@ -128,27 +128,74 @@ , ShareRentRatio ) values ( - #{caseLianJiaId}, - #{caseLianJiaCommunityId}, - #{caseTitle}, - #{caseApartmentLayout}, - #{caseArea}, - #{caseToward}, - #{caseStorey}, - #{caseLastDeal,jdbcType=DATE}, - #{caseElevator}, - #{caseDecoration}, - #{caseYear}, - #{caseAddress}, - #{casePrice}, - #{caseCommunityName}, - #{caseVisitedNum}, - #{caseFirstVisitTime,jdbcType=DATE}, - #{caseVisitedNum15}, - #{caseVisitedNum30}, - #{caseUrl}, - #{caseCommunityUrl}, - #{caseGetDate,jdbcType=DATE} + #{householdsIdSRC}, + #{projectIdSRC}, + #{communityId}, + #{buildingId}, + #{rentType}, + #{roomNum}, + #{hallNum}, + #{bashRoomNum}, + #{area}, + #{toward}, + #{totalFloor}, + #{currentFloor}, + #{elevator}, + #{decoration}, + #{year}, + #{areaCoefficient}, + #{towardCoefficient}, + #{floorCoefficient}, + #{decorationCoefficient}, + #{yearCoefficient}, + #{buildingCoefficient}, + #{roomTypeCoefficient}, + #{totalPrice}, + #{unitPrice}, + #{priceScatterRent}, + #{priceEntireRent}, + #{priceShareRent0}, + #{priceShareRent}, + #{visitedNum}, + #{firstVisitedDate,jdbcType=DATE}, + #{visitedNum15}, + #{visitedNum30}, + #{status}, + #{adjustedValue}, + #{adjustedPst}, + #{adjustedCumValue}, + #{adjustedCumPst}, + #{adjustedCumValueAbs}, + #{adjustedCumPstAbs}, + #{adjustedCumNum}, + #{priceTotalIn}, + #{priceTotalOut}, + #{priceDateIn,jdbcType=DATE}, + #{priceDateOut,jdbcType=DATE}, + #{origin}, + #{urlHouseholds}, + #{urlProjects}, + #{caseName}, + #{caseType}, + #{rentPrice_1}, + #{range}, + #{rangeFlag}, + #{rentPrice}, + #{entireRentRatio}, + #{shareRentRatio} ) + + + + + IF OBJECT_ID(#{backUpTableName}, 'U') IS NOT NULL + drop table ${backUpTableName} + select * into ${backUpTableName} from ${targetTableName} + + + + IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL + truncate table ${targetTableName} + \ No newline at end of file diff --git a/ruoyi/src/main/resources/mybatis/data/UltimateResidenceRentBasePriceMapper.xml b/ruoyi/src/main/resources/mybatis/data/UltimateResidenceRentPriceMapper.xml similarity index 68% rename from ruoyi/src/main/resources/mybatis/data/UltimateResidenceRentBasePriceMapper.xml rename to ruoyi/src/main/resources/mybatis/data/UltimateResidenceRentPriceMapper.xml index b4015d0e1..63d8bfeb1 100644 --- a/ruoyi/src/main/resources/mybatis/data/UltimateResidenceRentBasePriceMapper.xml +++ b/ruoyi/src/main/resources/mybatis/data/UltimateResidenceRentPriceMapper.xml @@ -111,4 +111,57 @@ where name like 'ODS_PROJECT_RENT_PRICE_INFO_%' and name not like '%_bak' order by cast(right(name,6) as int) desc + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi/src/test/java/com/ruoyi/GenerateTableTests.java b/ruoyi/src/test/java/com/ruoyi/GenerateTableTests.java index 4ef5df63a..6e1a8502d 100644 --- a/ruoyi/src/test/java/com/ruoyi/GenerateTableTests.java +++ b/ruoyi/src/test/java/com/ruoyi/GenerateTableTests.java @@ -1,6 +1,7 @@ package com.ruoyi; +import com.ruoyi.project.data.cases.domain.CleanResidenceRentAggregationCase; import com.ruoyi.project.data.cases.domain.OfficeAggregationCase; import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase; import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice; @@ -95,7 +96,7 @@ public class GenerateTableTests { @Test public void generateBatchGuoHaoInsertSqL() { - Class targetClass = UltimateOfficeBasePrice.class; + Class targetClass = CleanResidenceRentAggregationCase.class; List fieldList = new ArrayList<>(); while (targetClass != null) {