Browse Source

1.0.0 新增测算接口

release/v1.0.0
peihao 4 years ago
parent
commit
e94e00b77e
  1. 105
      air/src/main/java/com/air/entity/MeasureData.java
  2. 14
      air/src/main/java/com/air/mapper/MeasureDataMapper.java
  3. 46
      air/src/main/java/com/air/measuredata/controller/MeasureDataController.java
  4. 28
      air/src/main/java/com/air/measuredata/dto/MeasureStatisticsDto.java
  5. 28
      air/src/main/java/com/air/measuredata/dto/MeasureTrendDto.java
  6. 183
      air/src/main/java/com/air/measuredata/entity/MeasureData.java
  7. 20
      air/src/main/java/com/air/measuredata/mapper/MeasureDataMapper.java
  8. 20
      air/src/main/java/com/air/measuredata/serivce/MeasureDataService.java
  9. 54
      air/src/main/java/com/air/measuredata/serivce/impl/MeasureDataServiceImpl.java
  10. 154
      air/src/main/java/com/air/measuredata/vo/MeasureDataVo.java
  11. 14
      air/src/main/java/com/air/service/MeasureDataService.java
  12. 18
      air/src/main/java/com/air/service/impl/MeasureDataServiceImpl.java
  13. 2
      air/src/main/resources/mapper/MeasureDataMapper.xml

105
air/src/main/java/com/air/entity/MeasureData.java

@ -1,105 +0,0 @@
package com.air.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 测算数据
*
* @author peihao
* @date 2021/5/18
**/
@Data
@TableName("measure_data")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "测算数据")
public class MeasureData extends Model<MeasureData> {
private static final long serialVersionUID = 1L;
@TableId
@ApiModelProperty(value = "测算数据id")
private Long measureDataId;
@ApiModelProperty(value = "土地编号")
private String annoId;
@ApiModelProperty(value = "起拍楼面价")
private Integer purchasePrice;
@ApiModelProperty(value = "住宅定价")
private Integer housingPrice;
@ApiModelProperty(value = "商业定价")
private Integer commercePrice;
@ApiModelProperty(value = "车位定价")
private Integer parkingPrice;
@ApiModelProperty(value = "车位配比(个/100㎡)")
private Integer parkingAllocation;
@ApiModelProperty(value = "单车指标")
private Integer singleIndicator;
@ApiModelProperty(value = "单方成本")
private Integer singlePrimeCost;
@ApiModelProperty(value = "管理费率")
private Integer manageFeeRate;
@ApiModelProperty(value = "销售费率")
private Integer salesRate;
@ApiModelProperty(value = "财务费率")
private Integer financialRates;
@ApiModelProperty(value = "净利率")
private Integer netProfitRatio;
@ApiModelProperty(value = "预测楼面价")
private Integer forecastGfa;
@ApiModelProperty(value = "预测溢价率")
private Integer projectedPremiumRate;
@ApiModelProperty(value = "成交楼面价")
private Integer transactionFloorPrice;
@ApiModelProperty(value = "实际溢价率")
private Integer realPremiumRate;
@ApiModelProperty(value = "是否准确")
private String isAccuracy;
@ApiModelProperty(value = "误差绝对值")
private Integer errorAbsoluteValue;
@ApiModelProperty(value = "状态")
private String statusCd;
@ApiModelProperty(value = "状态时间")
private LocalDateTime statusDate;
@ApiModelProperty(value = "创建人")
private String createUserId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value = "修改人")
private String updateUserId;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateDate;
@ApiModelProperty(value = "备注")
private String remark;
}

14
air/src/main/java/com/air/mapper/MeasureDataMapper.java

@ -1,14 +0,0 @@
package com.air.mapper;
import com.air.entity.MeasureData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 测算数据
*
* @author peihao
* @date 2021/5/18
**/
public interface MeasureDataMapper extends BaseMapper<MeasureData> {
}

46
air/src/main/java/com/air/controller/MeasureDataController.java → air/src/main/java/com/air/measuredata/controller/MeasureDataController.java

@ -1,7 +1,9 @@
package com.air.controller;
package com.air.measuredata.controller;
import com.air.entity.MeasureData;
import com.air.service.MeasureDataService;
import cn.hutool.core.bean.BeanUtil;
import com.air.measuredata.entity.MeasureData;
import com.air.measuredata.serivce.MeasureDataService;
import com.air.measuredata.vo.MeasureDataVo;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cinderella.framework.common.core.util.R;
@ -53,31 +55,34 @@ public class MeasureDataController {
}
/**
* 新增测算数据
* 保存测算数据
*
* @param measureData 测算数据
* @param measureDataVo 保存测算数据
* @return R
*/
@ApiOperation(value = "新增测算数据", notes = "新增测算数据")
@ApiOperation(value = "保存测算数据", notes = "保存测算数据")
@PostMapping
@PreAuthorize("@pms.hasPermission('generator_measuredata_add')")
public R save(@RequestBody MeasureData measureData) {
return R.ok(measureDataService.save(measureData));
public R save(@RequestBody MeasureDataVo measureDataVo) {
MeasureData measureData = new MeasureData();
BeanUtil.copyProperties(measureDataVo,measureData);
return R.ok(measureDataService.saveOrUpdate(measureData));
}
/**
* 修改测算数据
*
* @param measureData 测算数据
* @return R
*/
@ApiOperation(value = "修改测算数据", notes = "修改测算数据")
@PutMapping
@PreAuthorize("@pms.hasPermission('generator_measuredata_edit')")
public R updateById(@RequestBody MeasureData measureData) {
return R.ok(measureDataService.updateById(measureData));
@ApiOperation(value = "测算结果统计", notes = "测算结果统计")
@GetMapping("/statistics")
public R statistics() {
return R.ok(measureDataService.statistics());
}
@ApiOperation(value = "测算趋势统计", notes = "测算趋势统计")
@GetMapping("/trend")
public R trend() {
return R.ok(measureDataService.trend());
}
/**
* 通过id删除测算数据
*
@ -86,7 +91,6 @@ public class MeasureDataController {
*/
@ApiOperation(value = "通过id删除测算数据", notes = "通过id删除测算数据")
@DeleteMapping("/{measureDataId}")
@PreAuthorize("@pms.hasPermission('generator_measuredata_del')")
public R removeById(@PathVariable Long measureDataId) {
return R.ok(measureDataService.removeById(measureDataId));
}

28
air/src/main/java/com/air/measuredata/dto/MeasureStatisticsDto.java

@ -0,0 +1,28 @@
package com.air.measuredata.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 测算结果统计
*
* @author peihao
* @date 2021/5/18
**/
@Data
@ApiModel(value = "测算结果统计")
public class MeasureStatisticsDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "测算宗数")
private Integer totle;
@ApiModelProperty(value = "准确率")
private BigDecimal precision;
@ApiModelProperty(value = "预测误差")
private BigDecimal error;
}

28
air/src/main/java/com/air/measuredata/dto/MeasureTrendDto.java

@ -0,0 +1,28 @@
package com.air.measuredata.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 测算趋势统计
*
* @author peihao
* @date 2021/5/18
**/
@Data
@ApiModel(value = "测算趋势统计")
public class MeasureTrendDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "溢价率差异值")
private BigDecimal premiumSpread;
@ApiModelProperty(value = "平均差异值")
private BigDecimal average;
@ApiModelProperty(value = "我的净利率")
private BigDecimal interestRate;
}

183
air/src/main/java/com/air/measuredata/entity/MeasureData.java

@ -0,0 +1,183 @@
package com.air.measuredata.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 测算数据
*
* @author peihao
* @date 2021/5/18
**/
@Data
@TableName("measure_data")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "测算数据")
public class MeasureData extends Model<MeasureData> {
private static final long serialVersionUID = 1L;
@TableId
@ApiModelProperty(value = "测算数据id")
private Long measureDataId;
@ApiModelProperty(value = "已挂牌地块标识")
private Long landListedId;
@ApiModelProperty(value = "土地编号")
private String annoId;
@ApiModelProperty(value = "住宅定价")
private BigDecimal housingPrice;
@ApiModelProperty(value = "商业定价")
private BigDecimal commercePrice;
@ApiModelProperty(value = "商务定价")
private BigDecimal businessPrice;
@ApiModelProperty(value = "车位配比(个/100㎡)")
private BigDecimal parkingAllocation;
@ApiModelProperty(value = "单车指标")
private BigDecimal singleIndicator;
@ApiModelProperty(value = "车位可售")
private BigDecimal parkingSaleRate;
@ApiModelProperty(value = "单方成本")
private BigDecimal singlePrimeCost;
@ApiModelProperty(value = "车位定价")
private BigDecimal parkingPrice;
@ApiModelProperty(value = "商业配比")
private BigDecimal commerceRate;
@ApiModelProperty(value = "商务配比")
private BigDecimal businessRate;
@ApiModelProperty(value = "管理费率")
private BigDecimal manageFeeRate;
@ApiModelProperty(value = "销售费率")
private BigDecimal salesRate;
@ApiModelProperty(value = "财务费率")
private BigDecimal financialRate;
@ApiModelProperty(value = "前融比例")
private BigDecimal financingRate;
@ApiModelProperty(value = "前融利率")
private BigDecimal financingInterest;
@ApiModelProperty(value = "前融周期")
private Integer financingPeriod;
@ApiModelProperty(value = "开发贷比例")
private BigDecimal loansRate;
@ApiModelProperty(value = "开发贷利率")
private BigDecimal loansInterest;
@ApiModelProperty(value = "开发贷周期")
private Integer loansPeriod;
@ApiModelProperty(value = "无偿移交住宅计容占比")
private BigDecimal freeHousingRate;
@ApiModelProperty(value = "无偿移交商业计容占比")
private BigDecimal freeCommerceRate;
@ApiModelProperty(value = "无偿移交商务计容占比")
private BigDecimal freeBusinessRate;
@ApiModelProperty(value = "自持住宅计容占比")
private BigDecimal selfHousingRate;
@ApiModelProperty(value = "住宅可售数量")
private Integer selfHousingAmount;
@ApiModelProperty(value = "住宅可售价格")
private BigDecimal selfHousingPrice;
@ApiModelProperty(value = "自持商业计容占比")
private BigDecimal selfCommerceRate;
@ApiModelProperty(value = "商业可售数量")
private Integer selfCommerceAamount;
@ApiModelProperty(value = "商业可售价格")
private BigDecimal selfCommercePrice;
@ApiModelProperty(value = "自持商务计容占比")
private BigDecimal selfBusinessRate;
@ApiModelProperty(value = "商务可售数量")
private Integer selfBusinessAmount;
@ApiModelProperty(value = "商务可售价格")
private BigDecimal selfBusinessPrice;
@ApiModelProperty(value = "起拍楼面价")
private BigDecimal floorPrice;
@ApiModelProperty(value = "土地总价")
private BigDecimal landTotalPrice;
@ApiModelProperty(value = "净利率")
private BigDecimal netProfitRatio;
@ApiModelProperty(value = "溢价率")
private BigDecimal premiumRate;
@ApiModelProperty(value = "预测楼面价")
private BigDecimal forecastFloorPrice;
@ApiModelProperty(value = "预测土地总价")
private BigDecimal forecastLandTotalPrice;
@ApiModelProperty(value = "预测净利率")
private BigDecimal forecastNetProfitRatio;
@ApiModelProperty(value = "预测溢价率")
private BigDecimal forecastPremiumRate;
@ApiModelProperty(value = "成交楼面价")
private BigDecimal transactionFloorPrice;
@ApiModelProperty(value = "是否准确")
private Long accuracy;
@ApiModelProperty(value = "误差绝对值")
private BigDecimal errorAbsoluteValue;
@ApiModelProperty(value = "状态")
private String statusCd;
@ApiModelProperty(value = "状态时间")
private LocalDateTime statusDate;
@ApiModelProperty(value = "创建人")
private String createUserId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value = "修改人")
private String updateUserId;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateDate;
@ApiModelProperty(value = "备注")
private String remark;
}

20
air/src/main/java/com/air/measuredata/mapper/MeasureDataMapper.java

@ -0,0 +1,20 @@
package com.air.measuredata.mapper;
import com.air.measuredata.entity.MeasureData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
/**
* 测算数据
*
* @author peihao
* @date 2021/5/18
**/
public interface MeasureDataMapper extends BaseMapper<MeasureData> {
@Select("select sum(error_absolute_value) from measure_data")
BigDecimal getErrorAbsoluteValueSum();
}

20
air/src/main/java/com/air/measuredata/serivce/MeasureDataService.java

@ -0,0 +1,20 @@
package com.air.measuredata.serivce;
import com.air.measuredata.dto.MeasureStatisticsDto;
import com.air.measuredata.dto.MeasureTrendDto;
import com.air.measuredata.entity.MeasureData;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 测算数据
*
* @author peihao
* @date 2021-05-18 09:40:33
*/
public interface MeasureDataService extends IService<MeasureData> {
MeasureStatisticsDto statistics();
MeasureTrendDto trend();
}

54
air/src/main/java/com/air/measuredata/serivce/impl/MeasureDataServiceImpl.java

@ -0,0 +1,54 @@
package com.air.measuredata.serivce.impl;
import com.air.measuredata.dto.MeasureStatisticsDto;
import com.air.measuredata.dto.MeasureTrendDto;
import com.air.measuredata.entity.MeasureData;
import com.air.measuredata.mapper.MeasureDataMapper;
import com.air.measuredata.serivce.MeasureDataService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 测算数据
*
* @author peihao
* @date 2021-05-18 09:40:33
*/
@Service
public class MeasureDataServiceImpl extends ServiceImpl<MeasureDataMapper, MeasureData> implements MeasureDataService {
@Override
public MeasureStatisticsDto statistics() {
MeasureStatisticsDto statisticsDto = new MeasureStatisticsDto();
//总宗数
BigDecimal totle = new BigDecimal(this.count());
if (totle.intValue() == 0){
return statisticsDto;
}
//测试正确数
int precisionSum = this.count(Wrappers.<MeasureData>query().lambda().eq(MeasureData::getAccuracy, 1));
//准确率
BigDecimal precision = new BigDecimal(precisionSum).divide(totle).setScale(2, BigDecimal.ROUND_HALF_UP);
//误差之和
BigDecimal absoluteValueSum = baseMapper.getErrorAbsoluteValueSum();
//预测误差
BigDecimal error = absoluteValueSum.divide(totle).setScale(2, BigDecimal.ROUND_HALF_UP);
statisticsDto.setTotle(totle.intValue());
statisticsDto.setPrecision(precision);
statisticsDto.setError(error);
return statisticsDto;
}
@Override
public MeasureTrendDto trend() {
MeasureTrendDto trendDto = new MeasureTrendDto();
//统计时间
LocalDate startTime = LocalDate.now().minusYears(1);
return trendDto;
}
}

154
air/src/main/java/com/air/measuredata/vo/MeasureDataVo.java

@ -0,0 +1,154 @@
package com.air.measuredata.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 测算数据
*
* @author peihao
* @date 2021/5/18
**/
@Data
@ApiModel(value = "测算数据")
public class MeasureDataVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "测算数据id")
private Long measureDataId;
@ApiModelProperty(value = "已挂牌地块标识")
private Long landListedId;
@ApiModelProperty(value = "土地编号")
private String annoId;
@ApiModelProperty(value = "住宅定价")
private BigDecimal housingPrice;
@ApiModelProperty(value = "商业定价")
private BigDecimal commercePrice;
@ApiModelProperty(value = "商务定价")
private BigDecimal businessPrice;
@ApiModelProperty(value = "车位配比(个/100㎡)")
private BigDecimal parkingAllocation;
@ApiModelProperty(value = "单车指标")
private BigDecimal singleIndicator;
@ApiModelProperty(value = "车位可售")
private BigDecimal parkingSaleRate;
@ApiModelProperty(value = "单方成本")
private BigDecimal singlePrimeCost;
@ApiModelProperty(value = "车位定价")
private BigDecimal parkingPrice;
@ApiModelProperty(value = "商业配比")
private BigDecimal commerceRate;
@ApiModelProperty(value = "商务配比")
private BigDecimal businessRate;
@ApiModelProperty(value = "管理费率")
private BigDecimal manageFeeRate;
@ApiModelProperty(value = "销售费率")
private BigDecimal salesRate;
@ApiModelProperty(value = "财务费率")
private BigDecimal financialRate;
@ApiModelProperty(value = "前融比例")
private BigDecimal financingRate;
@ApiModelProperty(value = "前融利率")
private BigDecimal financingInterest;
@ApiModelProperty(value = "前融周期")
private Integer financingPeriod;
@ApiModelProperty(value = "开发贷比例")
private BigDecimal loansRate;
@ApiModelProperty(value = "开发贷利率")
private BigDecimal loansInterest;
@ApiModelProperty(value = "开发贷周期")
private Integer loansPeriod;
@ApiModelProperty(value = "无偿移交住宅计容占比")
private BigDecimal freeHousingRate;
@ApiModelProperty(value = "无偿移交商业计容占比")
private BigDecimal freeCommerceRate;
@ApiModelProperty(value = "无偿移交商务计容占比")
private BigDecimal freeBusinessRate;
@ApiModelProperty(value = "自持住宅计容占比")
private BigDecimal selfHousingRate;
@ApiModelProperty(value = "住宅可售数量")
private Integer selfHousingAmount;
@ApiModelProperty(value = "住宅可售价格")
private BigDecimal selfHousingPrice;
@ApiModelProperty(value = "自持商业计容占比")
private BigDecimal selfCommerceRate;
@ApiModelProperty(value = "商业可售数量")
private Integer selfCommerceAamount;
@ApiModelProperty(value = "商业可售价格")
private BigDecimal selfCommercePrice;
@ApiModelProperty(value = "自持商务计容占比")
private BigDecimal selfBusinessRate;
@ApiModelProperty(value = "商务可售数量")
private Integer selfBusinessAmount;
@ApiModelProperty(value = "商务可售价格")
private BigDecimal selfBusinessPrice;
@ApiModelProperty(value = "起拍楼面价")
private BigDecimal floorPrice;
@ApiModelProperty(value = "土地总价")
private BigDecimal landTotalPrice;
@ApiModelProperty(value = "净利率")
private BigDecimal netProfitRatio;
@ApiModelProperty(value = "溢价率")
private BigDecimal premiumRate;
@ApiModelProperty(value = "预测楼面价")
private BigDecimal forecastFloorPrice;
@ApiModelProperty(value = "预测土地总价")
private BigDecimal forecastLandTotalPrice;
@ApiModelProperty(value = "预测净利率")
private BigDecimal forecastNetProfitRatio;
@ApiModelProperty(value = "预测溢价率")
private BigDecimal forecastPremiumRate;
@ApiModelProperty(value = "成交楼面价")
private BigDecimal transactionFloorPrice;
@ApiModelProperty(value = "是否准确")
private Long accuracy;
@ApiModelProperty(value = "误差绝对值")
private BigDecimal errorAbsoluteValue;
}

14
air/src/main/java/com/air/service/MeasureDataService.java

@ -1,14 +0,0 @@
package com.air.service;
import com.air.entity.MeasureData;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 测算数据
*
* @author peihao
* @date 2021-05-18 09:40:33
*/
public interface MeasureDataService extends IService<MeasureData> {
}

18
air/src/main/java/com/air/service/impl/MeasureDataServiceImpl.java

@ -1,18 +0,0 @@
package com.air.service.impl;
import com.air.entity.MeasureData;
import com.air.mapper.MeasureDataMapper;
import com.air.service.MeasureDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 测算数据
*
* @author peihao
* @date 2021-05-18 09:40:33
*/
@Service
public class MeasureDataServiceImpl extends ServiceImpl<MeasureDataMapper, MeasureData> implements MeasureDataService {
}

2
air/src/main/resources/mapper/MeasureDataMapper.xml

@ -2,6 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.air.mapper.MeasureDataMapper">
<mapper namespace="com.air.measuredata.mapper.MeasureDataMapper">
</mapper>

Loading…
Cancel
Save