Browse Source

1.0.0 新增小程序接口

release/v1.0.0
peihao 4 years ago
parent
commit
c18eac8c33
  1. 52
      air/src/main/java/com/air/applets/controller/AuctionRecordController.java
  2. 76
      air/src/main/java/com/air/applets/controller/BlocksController.java
  3. 44
      air/src/main/java/com/air/applets/controller/LandAttachmentController.java
  4. 149
      air/src/main/java/com/air/applets/controller/LandListedController.java
  5. 45
      air/src/main/java/com/air/applets/controller/LandListedLonLatController.java
  6. 44
      air/src/main/java/com/air/applets/controller/LandToListAttachmentController.java
  7. 93
      air/src/main/java/com/air/applets/controller/LandToListController.java
  8. 44
      air/src/main/java/com/air/applets/controller/LandToListLonLatController.java
  9. 142
      air/src/main/java/com/air/applets/controller/MeasureDataController.java
  10. 39
      air/src/main/java/com/air/applets/dto/BlocksPreSaleTotalDto.java
  11. 212
      air/src/main/java/com/air/applets/dto/LandDto.java
  12. 4
      air/src/main/java/com/air/applets/dto/MeasureStatisticsDto.java
  13. 25
      air/src/main/java/com/air/applets/dto/MeasureSubmitDto.java
  14. 6
      air/src/main/java/com/air/applets/dto/MeasureTrendDto.java
  15. 5
      air/src/main/java/com/air/applets/entity/MeasureData.java
  16. 13
      air/src/main/java/com/air/applets/mapper/MeasureDataMapper.java
  17. 12
      air/src/main/java/com/air/applets/serivce/MeasureDataService.java
  18. 31
      air/src/main/java/com/air/applets/serivce/impl/MeasureDataServiceImpl.java
  19. 43
      air/src/main/java/com/air/applets/vo/LandVo.java
  20. 5
      air/src/main/java/com/air/applets/vo/MeasureDataVo.java
  21. 22
      air/src/main/java/com/air/enums/LandListStatusEnum.java
  22. 31
      air/src/main/java/com/air/enums/MeasureStatusEnum.java
  23. 19
      air/src/main/java/com/air/land/mapper/LandListedMapper.java
  24. 18
      air/src/main/java/com/air/land/mapper/LandToListMapper.java
  25. 4
      air/src/main/java/com/air/land/service/LandAttachmentService.java
  26. 33
      air/src/main/java/com/air/land/service/LandListedService.java
  27. 6
      air/src/main/java/com/air/land/service/LandToListService.java
  28. 7
      air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java
  29. 15
      air/src/main/java/com/air/land/service/impl/LandToListServiceImpl.java
  30. 98
      air/src/main/java/com/air/measuredata/controller/MeasureDataController.java
  31. 20
      air/src/main/java/com/air/sysMessage/controller/SysMessageController.java
  32. 42
      air/src/main/java/com/air/sysMessage/entity/SysMessage.java
  33. 7
      air/src/main/java/com/air/sysMessage/mapper/SysMessageMapper.java
  34. 8
      air/src/main/java/com/air/sysMessage/service/SysMessageService.java
  35. 7
      air/src/main/java/com/air/sysMessage/service/impl/SysMessageServiceImpl.java
  36. 40
      air/src/main/resources/mapper/LandListedMapper.xml
  37. 24
      air/src/main/resources/mapper/LandToListMapper.xml
  38. 12
      air/src/main/resources/mapper/MeasureDataMapper.xml
  39. 4
      air/src/main/resources/mapper/SysMessageMapper.xml

52
air/src/main/java/com/air/applets/controller/AuctionRecordController.java

@ -0,0 +1,52 @@
package com.air.applets.controller;
import com.air.land.entity.AuctionRecord;
import com.air.land.service.AuctionRecordService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.cinderella.framework.common.core.util.R;
import com.cinderella.framework.common.data.mybatis.QueryPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 小程序竞拍记录管理
*
* @author peihao
* @date 2021-05-18 09:39:41
*/
@RestController("applets_auctionRecordController")
@AllArgsConstructor
@Validated
@RequestMapping("/applets/auctionRecord")
@Api(value = "auctionRecord", tags = "小程序竞拍记录管理")
public class AuctionRecordController {
private final AuctionRecordService auctionRecordService;
/**
* 查询参拍记录列表
*
* @param landListedId 已挂牌地块标识
* @return
*/
@ApiOperation(value = "查询参拍记录列表", notes = "查询参拍记录列表")
@GetMapping("/list")
public R<IPage<AuctionRecord>> getAuctionRecordPage(QueryPage page, @RequestParam(required = false) String landListedId) {
LambdaQueryWrapper<AuctionRecord> lambda = Wrappers.<AuctionRecord>query().lambda();
if (landListedId != null) {
lambda.eq(AuctionRecord::getLandListedId, landListedId);
}
IPage<AuctionRecord> recordPage = auctionRecordService.page(page.toPage(),
lambda.orderByDesc(AuctionRecord::getUpdateDate));
return R.ok(recordPage, "查询成功");
}
}

76
air/src/main/java/com/air/applets/controller/BlocksController.java

@ -0,0 +1,76 @@
package com.air.applets.controller;
import cn.hutool.core.date.DateUtil;
import com.air.applets.dto.BlocksPreSaleTotalDto;
import com.air.housing.service.BlocksService;
import com.cinderella.framework.common.core.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 小程序楼盘信息管理
*
* @author peihao
* @date 2021-05-18 09:39:45
*/
@RestController("applets_blocksController")
@AllArgsConstructor
@RequestMapping("/applets/blocks")
@Api(value = "blocks", tags = "小程序楼盘信息管理")
public class BlocksController {
private final BlocksService blocksService;
/**
* 销售情况统计
*
* @param landListedId 已挂牌地块id
* @param transactionStatus 交易状态
* @return R
*/
@ApiOperation(value = "销售情况统计", notes = "销售情况统计")
@GetMapping("getPreSaleTotal")
public R<BlocksPreSaleTotalDto> getPreSaleTotal(@RequestParam String landListedId, @RequestParam String transactionStatus) {
BlocksPreSaleTotalDto preSaleTotalDto = new BlocksPreSaleTotalDto();
preSaleTotalDto.setPreSaleTotal(200);
preSaleTotalDto.setDestroyTotal(58);
preSaleTotalDto.setDestroyTotalRate(25.6d);
preSaleTotalDto.setPreSaleBusinessPrice(13555.6);
preSaleTotalDto.setPreSaleHousePrice(15680.2);
return R.ok(preSaleTotalDto);
}
/**
* 查询预售明细列表
*
* @param landListedId 已挂牌地块id
* @param transactionStatus 交易状态
* @return R
*/
@ApiOperation(value = "查询预售明细列表", notes = "查询预售明细列表")
@GetMapping("getPreSaleDetailList")
public R<List<BlocksPreSaleTotalDto>> getPreSaleDetailList(@RequestParam String landListedId, @RequestParam String transactionStatus) {
List<BlocksPreSaleTotalDto> list = new ArrayList<>();
for (int i = 1; i<6;i++){
BlocksPreSaleTotalDto preSaleTotalDto = new BlocksPreSaleTotalDto();
preSaleTotalDto.setPreSaleTotal(200);
preSaleTotalDto.setDestroyTotal(58);
preSaleTotalDto.setDestroyTotalRate(25.6d);
preSaleTotalDto.setPreSaleLicenseNo("2021070"+i+"号");
preSaleTotalDto.setEvidenceDate(DateUtil.formatDate(new Date()));
list.add(preSaleTotalDto);
}
return R.ok(list);
}
}

44
air/src/main/java/com/air/applets/controller/LandAttachmentController.java

@ -0,0 +1,44 @@
package com.air.applets.controller;
import com.air.land.entity.LandAttachment;
import com.air.land.service.LandAttachmentService;
import com.cinderella.framework.common.core.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 小程序已挂牌地块资料文件信息管理
*
* @author peihao
* @date 2021-05-18 09:39:41
*/
@RestController("applets_landAttachmentController")
@AllArgsConstructor
@RequestMapping("/applets/landAttachment")
@Api(value = "landAttachment", tags = "小程序已挂牌地块资料文件信息管理")
public class LandAttachmentController {
private final LandAttachmentService attachmentService;
/**
* 通过序号和文件类型查询文件列表
*
* @param landListedId 已挂牌地块标识
* @param fileType 文件类型
* @return
*/
@ApiOperation(value = "通过序号和文件类型查询文件列表", notes = "通过序号和文件类型查询文件列表")
@GetMapping
public R<List<LandAttachment>> getAuctionRecordPage(@RequestParam String landListedId, String fileType) {
return attachmentService.getListAttachment(landListedId, fileType);
}
}

149
air/src/main/java/com/air/applets/controller/LandListedController.java

@ -0,0 +1,149 @@
package com.air.applets.controller;
import cn.hutool.core.util.StrUtil;
import com.air.applets.dto.LandDto;
import com.air.applets.vo.LandVo;
import com.air.enums.LandListStatusEnum;
import com.air.land.dto.LandListedDto;
import com.air.land.dto.LandListedStatisticsDto;
import com.air.land.entity.LandListed;
import com.air.land.service.LandListedService;
import com.air.land.service.LandToListService;
import com.air.land.vo.LandListedAppletsVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cinderella.framework.common.core.util.R;
import com.cinderella.framework.common.data.mybatis.QueryPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 已挂牌地块
*
* @author peihao
* @date 2021-05-18 09:39:59
*/
@RestController("applets_landListedController")
@RequestMapping("/applets/landlisted")
@Api(value = "landlisted", tags = "小程序已挂牌地块据管理")
public class LandListedController {
@Autowired
private LandListedService landListedService;
@Autowired
private LandToListService landToListService;
/**
* 地块列表分页查询
*
* @param queryPage 分页对象
* @param landVo 查询参数
* @return
*/
@ApiOperation(value = "地块列表分页查询", notes = "地块列表分页查询")
@GetMapping("page")
public R<Page<LandDto>> getLandListedPage(QueryPage queryPage, LandVo landVo) {
List<LandDto> landDtos;
Page<LandDto> page = queryPage.toPage();
if (LandListStatusEnum.TO_BE_LISTED.getCode().equals(landVo.getTransactionStatus())) {
if (StrUtil.isNotEmpty(landVo.getStartDate()) || StrUtil.isNotEmpty(landVo.getEndDate())) {
return R.ok();
}
//交易状态为 待挂牌时,查询拟挂牌地块数据
landDtos = landToListService.appletsLandToList(page, landVo);
} else {
landDtos = landListedService.appletsLandListed(page, landVo);
}
return R.ok(page.setRecords(landDtos), "查询成功");
}
/**
* 查询已挂牌地块信息列表
*
* @param appletsVo 查询参数
* @return R
*/
/*@ApiOperation(value = "查询已挂牌地块信息列表", notes = "查询已挂牌地块信息列表")
@GetMapping("/list")
public R<Page<LandListedDto>> getLandListedByDate(QueryPage page, LandListedAppletsVo appletsVo) {
if (StringUtils.isEmpty(appletsVo.getAnnoDate()) && StringUtils.isEmpty(appletsVo.getAuctionDate())) {
return R.failed("公告日期或拍卖日期为空");
}
if (StringUtils.isNotEmpty(appletsVo.getAnnoDate()) && StringUtils.isNotEmpty(appletsVo.getAuctionDate())) {
return R.failed("公告日期和拍卖日期只填之一");
}
return landListedService.getLandListedByDate(page, appletsVo);
}*/
/**
* 已挂牌地块详细查询接口
*
* @param landListedId
* @return R
*/
@ApiOperation(value = "已挂牌地块详细查询接口", notes = "通过id已挂牌地块详细查询接口")
@GetMapping("/{landListedId}")
public R<LandListed> getById(@PathVariable("landListedId") String landListedId) {
return R.ok(landListedService.getById(landListedId));
}
/**
* 按日期统计地块数量
*
* @param appletsVo 查询参数
* @return R
*/
@ApiOperation(value = "按日期统计地块数量", notes = "按日期统计地块数量")
@GetMapping("/statistics")
public R<LandListedStatisticsDto> appletsStatistics(LandListedAppletsVo appletsVo) {
if (StringUtils.isEmpty(appletsVo.getDate())) {
return R.failed("查询日期不能为空");
}
return landListedService.appletsStatistics(appletsVo);
}
}

45
air/src/main/java/com/air/applets/controller/LandListedLonLatController.java

@ -0,0 +1,45 @@
package com.air.applets.controller;
import com.air.land.entity.LandListedLonLat;
import com.air.land.service.LandListedLonLatService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.cinderella.framework.common.core.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 小程序已挂牌地块经纬度管理
*
* @author peihao
* @date 2021-05-18 09:40:04
*/
@RestController("applets_landListedLonLatController")
@AllArgsConstructor
@RequestMapping("/applets/landlistedlonlat")
@Api(value = "landlistedlonlat", tags = "小程序已挂牌地块经纬度管理")
public class LandListedLonLatController {
private final LandListedLonLatService landListedLonLatService;
/**
* 经纬度列表查询
*
* @return
*/
@ApiOperation(value = "通过公告序号经纬度列表查询", notes = "通过公告序号经纬度列表查询")
@GetMapping("/list/{landListedId}")
public R<List<LandListedLonLat>> getLandListedLonLatPage(@PathVariable String landListedId) {
List<LandListedLonLat> list = landListedLonLatService.list(Wrappers.<LandListedLonLat>query().lambda()
.eq(LandListedLonLat::getLandListedId, landListedId)
.orderByDesc(LandListedLonLat::getUpdateDate));
return R.ok(list, "查询成功");
}
}

44
air/src/main/java/com/air/applets/controller/LandToListAttachmentController.java

@ -0,0 +1,44 @@
package com.air.applets.controller;
import com.air.land.entity.LandToListAttachment;
import com.air.land.service.LandToListAttachmentService;
import com.cinderella.framework.common.core.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 小程序拟挂牌地块资料文件信息管理
*
* @author peihao
* @date 2021-05-18 09:39:41
*/
@RestController("applets_landToListAttachmentController")
@AllArgsConstructor
@RequestMapping("/applets/landToListAttachment")
@Api(value = "landToListAttachment", tags = "小程序拟挂牌地块资料文件信息管理")
public class LandToListAttachmentController {
private final LandToListAttachmentService attachmentService;
/**
* 通过序号和文件类型查询文件列表
*
* @param proposedseriaId 拟公告序号
* @param fileType 文件类型
* @return
*/
@ApiOperation(value = "通过序号和文件类型查询文件列表", notes = "通过序号和文件类型查询文件列表")
@GetMapping
public R<List<LandToListAttachment>> getListToListAttachment(@RequestParam String proposedseriaId, String fileType) {
return attachmentService.getListAttachment(proposedseriaId, fileType);
}
}

93
air/src/main/java/com/air/applets/controller/LandToListController.java

@ -0,0 +1,93 @@
package com.air.applets.controller;
import cn.hutool.core.util.ObjectUtil;
import com.air.land.entity.LandToList;
import com.air.land.service.LandToListService;
import com.air.land.vo.LandToListPageVo;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cinderella.framework.common.core.util.R;
import com.cinderella.framework.common.data.mybatis.QueryPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 小程序拟挂牌地块管理
*
* @author peihao
* @date 2021-05-18 09:40:09
*/
@RestController("applets_landToListController")
@RequestMapping("/applets/landtolist")
@Api(value = "landtolist", tags = "小程序拟挂牌地块管理")
public class LandToListController {
@Autowired
private LandToListService landToListService;
/**
* 分页查询
*
* @param page 分页对象
* @param pageVo 拟挂牌地块
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping
public R<Page<LandToList>> getLandToListPage(QueryPage page, LandToListPageVo pageVo) {
Page<LandToList> result = landToListService.page(page.toPage(), Wrappers.<LandToList>query().lambda()
//地块名称
.eq(StringUtils.isNotEmpty(pageVo.getLandName()), LandToList::getLandName, pageVo.getLandName())
//供地状态
.eq(StringUtils.isNotEmpty(pageVo.getSupplyStatus()), LandToList::getSupplyStatus, pageVo.getSupplyStatus())
//预计挂牌时间
.eq(StringUtils.isNotEmpty(pageVo.getEstimatedListingTime()), LandToList::getEstimatedListingTime, pageVo.getEstimatedListingTime())
//地块编号
.eq(StringUtils.isNotEmpty(pageVo.getLandCode()), LandToList::getLandCode, pageVo.getLandCode())
//土地用途
.eq(StringUtils.isNotEmpty(pageVo.getLandUsage()), LandToList::getLandUsage, pageVo.getLandUsage())
//地质灾害
.eq(ObjectUtil.isNotEmpty(pageVo.getGeologicHazard()), LandToList::getGeologicHazard, pageVo.getGeologicHazard())
//人防还建
.eq(StringUtils.isNotEmpty(pageVo.getCivilAirDefence()), LandToList::getCivilAirDefence, pageVo.getCivilAirDefence())
//特殊规划
.eq(StringUtils.isNotEmpty(pageVo.getSpecialPlan()), LandToList::getSpecialPlan, pageVo.getSpecialPlan())
//勾地形式
.eq(StringUtils.isNotEmpty(pageVo.getHookForm()), LandToList::getHookForm, pageVo.getHookForm())
//勾地企业
.eq(StringUtils.isNotEmpty(pageVo.getLandEnterprises()), LandToList::getLandEnterprises, pageVo.getLandEnterprises())
//出让人
.eq(StringUtils.isNotEmpty(pageVo.getBargainor()), LandToList::getBargainor, pageVo.getBargainor())
//城市
.eq(StringUtils.isNotEmpty(pageVo.getCity()), LandToList::getCity, pageVo.getCity())
//行政区
.eq(StringUtils.isNotEmpty(pageVo.getCanton()), LandToList::getCanton, pageVo.getCanton())
//大组团
.like(StringUtils.isNotEmpty(pageVo.getBigGroup()), LandToList::getBigGroup, pageVo.getBigGroup())
//小组团
.like(StringUtils.isNotEmpty(pageVo.getSmallGroup()), LandToList::getSmallGroup, pageVo.getSmallGroup())
.orderByDesc(LandToList::getUpdateDate));
return R.ok(result, "查询成功");
}
/**
* 通过id查询拟挂牌地块
*
* @param id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{id}")
public R<LandToList> getById(@PathVariable("id") String id) {
return R.ok(landToListService.getById(id));
}
}

44
air/src/main/java/com/air/applets/controller/LandToListLonLatController.java

@ -0,0 +1,44 @@
package com.air.applets.controller;
import com.air.land.entity.LandToListLonLat;
import com.air.land.service.LandToListLonLatService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.cinderella.framework.common.core.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 小程序拟挂牌地块经纬度
*
* @author peihao
* @date 2021-05-18 09:40:15
*/
@RestController("applets_landToListLonLatController")
@AllArgsConstructor
@RequestMapping("/applets/landtolistlonlat")
@Api(value = "landtolistlonlat", tags = "小程序拟挂牌地块经纬度管理")
public class LandToListLonLatController {
private final LandToListLonLatService landToListLonLatService;
/**
* 通过拟公告序号经纬度列表查询
*
* @return
*/
@ApiOperation(value = "通过拟公告序号经纬度列表查询", notes = "通过拟公告序号经纬度列表查询")
@GetMapping("/list/{proposedseriaId}")
public R<List<LandToListLonLat>> getLandListedLonLatPage(@PathVariable String proposedseriaId) {
List<LandToListLonLat> list = landToListLonLatService.list(Wrappers.<LandToListLonLat>query().lambda()
.eq(LandToListLonLat::getProposedseriaId, proposedseriaId));
return R.ok(list, "查询成功");
}
}

142
air/src/main/java/com/air/applets/controller/MeasureDataController.java

@ -0,0 +1,142 @@
package com.air.applets.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.air.applets.dto.MeasureStatisticsDto;
import com.air.applets.dto.MeasureSubmitDto;
import com.air.applets.dto.MeasureTrendDto;
import com.air.applets.entity.MeasureData;
import com.air.applets.serivce.MeasureDataService;
import com.air.applets.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;
import com.cinderella.framework.common.security.util.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 小程序测算数据管理
*
* @author peihao
* @date 2021-05-18 09:40:33
*/
@RestController
@AllArgsConstructor
@RequestMapping("/applets/measuredata")
@Api(value = "measuredata", tags = "小程序测算数据管理")
public class MeasureDataController {
private final MeasureDataService measureDataService;
/**
* 测算记录列表
*
* @param page 分页对象
* @param measureData 测算数据
* @return
*/
@ApiOperation(value = "测算记录列表分页查询", notes = "测算记录列表分页查询")
@GetMapping("/page")
public R getMeasureDataPage(Page page, MeasureData measureData) {
measureData.setCreateUserId(SecurityUtils.getUser().getId().toString());
return R.ok(measureDataService.page(page, Wrappers.query(measureData)));
}
/**
* 通过id查询测算数据
*
* @param measureDataId id
* @return R
*/
@ApiOperation(value = "通过id查询测算详情", notes = "通过id查询测算详情")
@GetMapping("/{measureDataId}")
public R getById(@PathVariable("measureDataId") Long measureDataId) {
return R.ok(measureDataService.getById(measureDataId));
}
/**
* 保存测算数据
*
* @param measureDataVo 测算数据
* @return R
*/
@ApiOperation(value = "保存测算数据", notes = "保存测算数据")
@PostMapping
public R<Boolean> save(@RequestBody MeasureDataVo measureDataVo) {
if (StrUtil.isEmpty(measureDataVo.getLandListedId()) && StrUtil.isEmpty(measureDataVo.getProposedseriaId())) {
return R.failed("地块id不能为空");
}
if (StrUtil.isNotEmpty(measureDataVo.getLandListedId()) && StrUtil.isNotEmpty(measureDataVo.getProposedseriaId())) {
return R.failed("已挂牌地块标识和拟挂牌地块标识选填其一!");
}
if (null == measureDataVo.getMeasureDataId()) {
MeasureData measureData;
if (null == measureDataVo.getLandListedId()) {
measureData = measureDataService.getOne(Wrappers.<MeasureData>query().lambda()
.eq(MeasureData::getProposedseriaId, measureDataVo.getProposedseriaId()));
} else {
measureData = measureDataService.getOne(Wrappers.<MeasureData>query().lambda()
.eq(MeasureData::getLandListedId, measureDataVo.getLandListedId()));
}
if (null != measureData) {
return R.failed("该地块已存在测算数据,不能再次新增");
}
}
MeasureData measureData = new MeasureData();
BeanUtil.copyProperties(measureDataVo, measureData);
measureData.setCreateUserId(SecurityUtils.getUser().getId().toString());
return R.ok(measureDataService.saveOrUpdate(measureData));
}
/**
* 提交测算数据
*
* @param measureDataVo 测算数据
* @return R
*/
@ApiOperation(value = "提交测算数据", notes = "提交测算数据")
@PostMapping("submit")
public R<MeasureSubmitDto> submit(@RequestBody MeasureDataVo measureDataVo) {
return R.ok(new MeasureSubmitDto());
}
/**
* 查询用户测算结果统计
*
* @return R
*/
@ApiOperation(value = "测算结果统计", notes = "测算结果统计")
@GetMapping("/statistics")
public R<MeasureStatisticsDto> statistics() {
return R.ok(measureDataService.statistics());
}
/**
* 查询用户测算趋势统计
*
* @return R
*/
@ApiOperation(value = "测算趋势统计", notes = "测算趋势统计")
@GetMapping("/trend")
public R<List<MeasureTrendDto>> trend() {
return R.ok(measureDataService.trend());
}
/**
* 通过id删除测算数据
*
* @param measureDataId 测算数据id
* @return R
*/
@ApiOperation(value = "通过id删除测算数据", notes = "通过id删除测算数据")
@DeleteMapping("/{measureDataId}")
public R<Boolean> removeById(@PathVariable Long measureDataId) {
return R.ok(measureDataService.removeById(measureDataId));
}
}

39
air/src/main/java/com/air/applets/dto/BlocksPreSaleTotalDto.java

@ -0,0 +1,39 @@
package com.air.applets.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 房屋销售合计
*
* @author peihao
* @date 2021/5/18
**/
@Data
@ApiModel(value = "房屋销售合计")
public class BlocksPreSaleTotalDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "合计预售")
private int preSaleTotal;
@ApiModelProperty(value = "去化")
private int destroyTotal;
@ApiModelProperty(value = "去化率")
private double destroyTotalRate;
@ApiModelProperty(value = "预售住宅均价")
private double preSaleHousePrice;
@ApiModelProperty(value = "预售商业均价")
private double preSaleBusinessPrice;
@ApiModelProperty(value = "预售明细")
private String preSaleLicenseNo;
@ApiModelProperty(value = "取证时间")
private String evidenceDate;
}

212
air/src/main/java/com/air/applets/dto/LandDto.java

@ -0,0 +1,212 @@
package com.air.applets.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.time.LocalDate;
/**
* 小程序地块列表
*
* @author peihao
* @date 2021/5/18
**/
@Data
@ApiModel(value = "小程序地块列表")
public class LandDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private String landListedId;
@NotBlank(message = "公告id不能为空")
private String annoId;
@NotBlank(message = "地块编号不能为空")
private String landCode;
@NotBlank(message = "地块位置不能为空")
private String landPosition;
@ApiModelProperty(value = "土地用途")
private String landUsage;
@ApiModelProperty(value = "土地出让面积-平方")
private String landTransferSquare;
@ApiModelProperty(value = "土地出让面积-亩")
private String landTransferMu;
@ApiModelProperty(value = "总计容建筑面积")
private String totalConsArea;
@ApiModelProperty(value = "容积率")
private String plotRatio;
@ApiModelProperty(value = "建筑密度")
private String buildingDensity;
@ApiModelProperty(value = "绿地率")
private String greenSpaceRatio;
@ApiModelProperty(value = "限高")
private String heighPermitted;
@ApiModelProperty(value = "出让年限")
private String remiseYears;
@ApiModelProperty(value = "出让价款起始价(万元)")
private String transferPrice;
@ApiModelProperty(value = "起始楼面价")
private String startingFloorPrice;
@ApiModelProperty(value = "竞买保证金(万元)")
private String bidMargin;
@ApiModelProperty(value = "备注(业务字段)")
private String bizRemark;
@ApiModelProperty(value = "公告日期")
private LocalDate annoDate;
@ApiModelProperty(value = "拍卖日期")
private LocalDate auctionDate;
@ApiModelProperty(value = "持证准用面积")
private String licensedArea;
@ApiModelProperty(value = "商业面积")
private String bizSpace;
@ApiModelProperty(value = "商务面积")
private String commerceSpace;
@ApiModelProperty(value = "配建-计容")
private String allocationCapacity;
@ApiModelProperty(value = "配建-不计容")
private String allocationNotCapacity;
@ApiModelProperty(value = "地质灾害")
private String geologicHazard;
@ApiModelProperty(value = "人防还建(㎡)")
private String civilAirDefence;
@ApiModelProperty(value = "特殊规划")
private String specialPlan;
@ApiModelProperty(value = "装配建筑")
private String assemblyBuilding;
@ApiModelProperty(value = "绿色建筑")
private String greenBuilding;
@ApiModelProperty(value = "其他条件")
private String otherConditions;
@ApiModelProperty(value = "成品住宅比例")
private String percentFinishedHousing;
@ApiModelProperty(value = "竞买条件")
private String biddingConditions;
@ApiModelProperty(value = "勾地形式")
private String hookForm;
@ApiModelProperty(value = "一级治理方")
private String firstGovernance;
@ApiModelProperty(value = "勾地企业")
private String landEnterprises;
@ApiModelProperty(value = "付款节奏")
private String paymentRhythm;
@ApiModelProperty(value = "出让人")
private String bargainor;
@ApiModelProperty(value = "城市")
private String city;
@ApiModelProperty(value = "行政区")
private String canton;
@ApiModelProperty(value = "特区")
private String specialZone;
@ApiModelProperty(value = "环线")
private String loopWire;
@ApiModelProperty(value = "大组团")
private String bigGroup;
@ApiModelProperty(value = "小组团")
private String smallGroup;
@ApiModelProperty(value = "奥维定位")
private String ovePosition;
@ApiModelProperty(value = "经纬度(百度BD09)")
private String lonLatBd;
@ApiModelProperty(value = "出让方式")
private String transferMode;
@ApiModelProperty(value = "受让单位")
private String assignee;
@ApiModelProperty(value = "拿地企业-简称")
private String landEnterpriseShort;
@ApiModelProperty(value = "成交价")
private String dealPrice;
@ApiModelProperty(value = "溢价率")
private String premiumRate;
@ApiModelProperty(value = "商业自持比例(%)")
private String commercialSelfRatio;
@ApiModelProperty(value = "住宅自持比例(%)")
private String homeSelfRatio;
@ApiModelProperty(value = "无偿比例(%)")
private String percentUnpaid;
@ApiModelProperty(value = "人才公寓面积")
private String talenApartmentArea;
@ApiModelProperty(value = "参拍企业")
private String participatingEnterprises;
@ApiModelProperty(value = "项目状态")
private String projectStatus;
@ApiModelProperty(value = "楼盘名称")
private String buildingName;
@ApiModelProperty(value = "项目公司")
private String projectCompany;
@ApiModelProperty(value = "确权时间")
private LocalDate confirmationTime;
@ApiModelProperty(value = "操盘企业")
private String tradingEnterprises;
@ApiModelProperty(value = "合作方")
private String partner;
@ApiModelProperty(value = "经营企业")
private String conductEnterprise;
@ApiModelProperty(value = "项目首开时间")
private LocalDate firstOpenTime;
@ApiModelProperty(value = "是否待挂牌(1:是,0:否)")
private String isToBeListed;
}

4
air/src/main/java/com/air/measuredata/dto/MeasureStatisticsDto.java → air/src/main/java/com/air/applets/dto/MeasureStatisticsDto.java

@ -1,11 +1,9 @@
package com.air.measuredata.dto;
package com.air.applets.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 测算结果统计
*

25
air/src/main/java/com/air/applets/dto/MeasureSubmitDto.java

@ -0,0 +1,25 @@
package com.air.applets.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 MeasureSubmitDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "净利率")
private BigDecimal netProfitRatio;
@ApiModelProperty(value = "溢价率")
private BigDecimal premiumRate;
}

6
air/src/main/java/com/air/measuredata/dto/MeasureTrendDto.java → air/src/main/java/com/air/applets/dto/MeasureTrendDto.java

@ -1,11 +1,9 @@
package com.air.measuredata.dto;
package com.air.applets.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 测算趋势统计
*
@ -29,6 +27,6 @@ public class MeasureTrendDto {
@ApiModelProperty(value = "我的净利率")
private double interestRate = 0;
@ApiModelProperty(value = "总宗数",hidden = true)
@ApiModelProperty(value = "总宗数", hidden = true)
private int total = 0;
}

5
air/src/main/java/com/air/measuredata/entity/MeasureData.java → air/src/main/java/com/air/applets/entity/MeasureData.java

@ -1,4 +1,4 @@
package com.air.measuredata.entity;
package com.air.applets.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@ -31,6 +31,9 @@ public class MeasureData extends Model<MeasureData> {
@ApiModelProperty(value = "已挂牌地块标识")
private String landListedId;
@ApiModelProperty(value = "拟挂牌地块序号")
private String proposedseriaId;
@ApiModelProperty(value = "土地编号")
private String annoId;

13
air/src/main/java/com/air/measuredata/mapper/MeasureDataMapper.java → air/src/main/java/com/air/applets/mapper/MeasureDataMapper.java

@ -1,7 +1,7 @@
package com.air.measuredata.mapper;
package com.air.applets.mapper;
import com.air.measuredata.dto.MeasureTrendDto;
import com.air.measuredata.entity.MeasureData;
import com.air.applets.dto.MeasureTrendDto;
import com.air.applets.entity.MeasureData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -21,20 +21,21 @@ public interface MeasureDataMapper extends BaseMapper<MeasureData> {
/**
* 统计所有误差之和
* @author peihao
* @param userId 用户id
* @date 2021/6/7
* @return
**/
@Select("select sum(error_absolute_value) from measure_data")
BigDecimal getErrorAbsoluteValueSum();
BigDecimal getErrorAbsoluteValueSum(String userId);
/**
* 测算趋势统计接口
* @author peihao
* @param startTime 开始时间
* @param endTime 结束时间
* @param userId 用户id
* @date 2021/endTime/7
* @return
**/
List<MeasureTrendDto> getTrend(@Param("startTime")String startTime, @Param("endTime") String endTime);
List<MeasureTrendDto> getTrend(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("userId") String userId);
}

12
air/src/main/java/com/air/measuredata/serivce/MeasureDataService.java → air/src/main/java/com/air/applets/serivce/MeasureDataService.java

@ -1,8 +1,8 @@
package com.air.measuredata.serivce;
package com.air.applets.serivce;
import com.air.measuredata.dto.MeasureStatisticsDto;
import com.air.measuredata.dto.MeasureTrendDto;
import com.air.measuredata.entity.MeasureData;
import com.air.applets.dto.MeasureStatisticsDto;
import com.air.applets.dto.MeasureTrendDto;
import com.air.applets.entity.MeasureData;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
@ -17,7 +17,7 @@ public interface MeasureDataService extends IService<MeasureData> {
/**
* 测算结果统计
* 查询当前用户测算结果统计
* @author peihao
* @date 2021/6/7
* @return
@ -25,7 +25,7 @@ public interface MeasureDataService extends IService<MeasureData> {
MeasureStatisticsDto statistics();
/**
* 测算趋势统计接口
* 查询当前用户测算趋势统计
* @author peihao
* @date 2021/6/7
* @return

31
air/src/main/java/com/air/measuredata/serivce/impl/MeasureDataServiceImpl.java → air/src/main/java/com/air/applets/serivce/impl/MeasureDataServiceImpl.java

@ -1,18 +1,18 @@
package com.air.measuredata.serivce.impl;
package com.air.applets.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.air.applets.dto.MeasureStatisticsDto;
import com.air.applets.dto.MeasureTrendDto;
import com.air.applets.entity.MeasureData;
import com.air.applets.mapper.MeasureDataMapper;
import com.air.applets.serivce.MeasureDataService;
import com.air.utils.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cinderella.framework.common.security.util.SecurityUtils;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -26,6 +26,7 @@ public class MeasureDataServiceImpl extends ServiceImpl<MeasureDataMapper, Measu
@Override
public MeasureStatisticsDto statistics() {
String userId = SecurityUtils.getUser().getId().toString();
MeasureStatisticsDto statisticsDto = new MeasureStatisticsDto();
//总宗数
BigDecimal totle = new BigDecimal(this.count());
@ -33,14 +34,15 @@ public class MeasureDataServiceImpl extends ServiceImpl<MeasureDataMapper, Measu
return statisticsDto;
}
//测试正确数
int precisionSum = this.count(Wrappers.<MeasureData>query().lambda().eq(MeasureData::getAccuracy, 1));
int precisionSum = this.count(Wrappers.<MeasureData>query().lambda()
.eq(MeasureData::getAccuracy, 1).eq(MeasureData::getCreateUserId, userId));
//准确率
BigDecimal precision = new BigDecimal(precisionSum).divide(totle,2, BigDecimal.ROUND_HALF_UP);
BigDecimal precision = new BigDecimal(precisionSum).divide(totle, 2, BigDecimal.ROUND_HALF_UP);
//误差之和
BigDecimal absoluteValueSum = baseMapper.getErrorAbsoluteValueSum();
if (absoluteValueSum != null){
BigDecimal absoluteValueSum = baseMapper.getErrorAbsoluteValueSum(userId);
if (absoluteValueSum != null) {
//预测误差
BigDecimal error = absoluteValueSum.divide(totle,2,BigDecimal.ROUND_HALF_UP);
BigDecimal error = absoluteValueSum.divide(totle, 2, BigDecimal.ROUND_HALF_UP);
statisticsDto.setError(error.doubleValue());
}
statisticsDto.setTotle(totle.intValue());
@ -50,17 +52,18 @@ public class MeasureDataServiceImpl extends ServiceImpl<MeasureDataMapper, Measu
@Override
public List<MeasureTrendDto> trend() {
String userId = SecurityUtils.getUser().getId().toString();
//统计时间
LocalDate now = LocalDate.now();
String startTime = DateUtil.fromString(now.minusYears(1), "yyyyMM");
String endTime = DateUtil.fromString(now, "yyyyMM");
List<MeasureTrendDto> list = baseMapper.getTrend(startTime, endTime);
List<MeasureTrendDto> list = baseMapper.getTrend(startTime, endTime, userId);
for (MeasureTrendDto trend : list) {
if (trend.getTotal() == 0) {
continue;
}
//平均差值= 溢价率差值/时间宗数
double value = new BigDecimal(trend.getPremiumSpread()).divide(new BigDecimal(trend.getTotal()),2, BigDecimal.ROUND_HALF_UP).doubleValue();
double value = new BigDecimal(trend.getPremiumSpread()).divide(new BigDecimal(trend.getTotal()), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
trend.setAverage(value);
}
return list;

43
air/src/main/java/com/air/applets/vo/LandVo.java

@ -0,0 +1,43 @@
package com.air.applets.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.time.LocalDate;
/**
* 小程序地块列表
*
* @author peihao
* @date 2021/5/18
**/
@Data
@ApiModel(value = "小程序地块列表")
public class LandVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "成交开始时间")
private String startDate;
@NotBlank(message = "成交结束时间")
private String endDate;
@NotBlank(message = "交易状态")
private String transactionStatus;
@ApiModelProperty(value = "城市")
private String city;
@ApiModelProperty(value = "行政区")
private String canton;
@ApiModelProperty(value = "测算状态")
private String measureStatus;
@JsonIgnore
@ApiModelProperty(value = "查询当前时间",hidden = true)
private String nowDate;
}

5
air/src/main/java/com/air/measuredata/vo/MeasureDataVo.java → air/src/main/java/com/air/applets/vo/MeasureDataVo.java

@ -1,4 +1,4 @@
package com.air.measuredata.vo;
package com.air.applets.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -23,6 +23,9 @@ public class MeasureDataVo {
@ApiModelProperty(value = "已挂牌地块标识")
private String landListedId;
@ApiModelProperty(value = "拟挂牌地块序号")
private String proposedseriaId;
@ApiModelProperty(value = "土地编号")
private String annoId;

22
air/src/main/java/com/air/enums/LandListStatusEnum.java

@ -8,4 +8,26 @@ package com.air.enums;
**/
public enum LandListStatusEnum {
TO_BE_LISTED("toBeListed","待挂牌"),
LISTED("listed","挂牌中"),
PASS_BY("passBy","流拍"),
DEAL_DONE("dealDone","已成交");
private final String code;
private final String name;
LandListStatusEnum(String code,String name){
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

31
air/src/main/java/com/air/enums/MeasureStatusEnum.java

@ -0,0 +1,31 @@
package com.air.enums;
/**
* 测算数据状态
*
* @author peihao
* @date 2021-05-20
**/
public enum MeasureStatusEnum {
TO_MEASURE("toMeasure","待测算"),
MEASURED("measured","已测算");
private final String code;
private final String name;
MeasureStatusEnum(String code, String name){
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

19
air/src/main/java/com/air/land/mapper/LandListedMapper.java

@ -1,5 +1,7 @@
package com.air.land.mapper;
import com.air.applets.dto.LandDto;
import com.air.applets.vo.LandVo;
import com.air.land.dto.LandListedDto;
import com.air.land.dto.LandListedStatisticsDto;
import com.air.land.entity.LandListed;
@ -20,5 +22,22 @@ public interface LandListedMapper extends BaseMapper<LandListed> {
List<LandListedDto> getLandListedByDate(Page page, @Param("param") LandListedAppletsVo appletsVo);
/**
* 按日期统计地块数量
* @author peihao
* @param appletsVo 统计参数
* @date 2021/7/9
* @return
**/
Integer statisticsListedCount(@Param("param") LandListedAppletsVo appletsVo);
/**
* 复合条件查询已挂牌列表数据
* @author peihao
* @param page 分页对象
* @param landVo 查询参数
* @date 2021/7/9
* @return
**/
List<LandDto> appletsLandListed(Page page , @Param("landVo")LandVo landVo);
}

18
air/src/main/java/com/air/land/mapper/LandToListMapper.java

@ -1,7 +1,14 @@
package com.air.land.mapper;
import com.air.applets.dto.LandDto;
import com.air.applets.dto.MeasureTrendDto;
import com.air.applets.vo.LandVo;
import com.air.land.entity.LandToList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 拟挂牌地块全部是用户手动管理的数据
@ -11,4 +18,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface LandToListMapper extends BaseMapper<LandToList> {
/**
* 查询拟挂牌数据
* @author peihao
* @param page 分页对象
* @param landVo 查询参数
* @date 2021/7/9
* @return
**/
List<LandDto> appletsLandToList(Page page , @Param("landVo") LandVo landVo);
}

4
air/src/main/java/com/air/land/service/LandAttachmentService.java

@ -18,11 +18,11 @@ public interface LandAttachmentService extends IService<LandAttachment> {
/**
* 查询已挂牌地块文件列表
*
* @param annoId 公告id
* @param landListedId 公告id
* @param fileType 文件类型
* @return
* @author peihao
* @date 2021/5/21
**/
R<List<LandAttachment>> getListAttachment(String annoId, String fileType);
R<List<LandAttachment>> getListAttachment(String landListedId, String fileType);
}

33
air/src/main/java/com/air/land/service/LandListedService.java

@ -1,5 +1,7 @@
package com.air.land.service;
import com.air.applets.dto.LandDto;
import com.air.applets.vo.LandVo;
import com.air.land.dto.LandListedDto;
import com.air.land.dto.LandListedStatisticsDto;
import com.air.land.entity.LandListed;
@ -22,9 +24,40 @@ public interface LandListedService extends IService<LandListed> {
R<Page<LandListedDto>> getLandListedByDate(QueryPage page, LandListedAppletsVo appletsVo);
/**
* 按日期统计地块数量
* @author peihao
* @param appletsVo 统计参数
* @date 2021/7/9
* @return
**/
R<LandListedStatisticsDto> appletsStatistics(LandListedAppletsVo appletsVo);
/**
* 导入已挂牌地块信息
* @author peihao
* @param file 文件
* @date 2021/7/9
* @return
**/
boolean importLandListExcel(MultipartFile file);
/**
* 通过id查询已挂牌地块数据
* @author peihao
* @param ids 已挂牌id集合
* @date 2021/7/9
* @return
**/
List<List<String>> getLandList(List<String> ids);
/**
* 复合条件查询已挂牌列表数据
* @author peihao
* @param page 分页对象
* @param landVo 查询参数
* @date 2021/7/9
* @return
**/
List<LandDto> appletsLandListed(Page page , LandVo landVo);
}

6
air/src/main/java/com/air/land/service/LandToListService.java

@ -1,6 +1,10 @@
package com.air.land.service;
import com.air.applets.dto.LandDto;
import com.air.applets.dto.MeasureTrendDto;
import com.air.applets.vo.LandVo;
import com.air.land.entity.LandToList;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cinderella.framework.common.core.util.R;
import org.springframework.web.multipart.MultipartFile;
@ -21,4 +25,6 @@ public interface LandToListService extends IService<LandToList> {
boolean importLandToListExcel(MultipartFile file);
List<LandDto> appletsLandToList(Page page ,LandVo landVo);
}

7
air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java

@ -1,5 +1,7 @@
package com.air.land.service.impl;
import com.air.applets.dto.LandDto;
import com.air.applets.vo.LandVo;
import com.air.land.dto.LandListedDto;
import com.air.land.dto.LandListedStatisticsDto;
import com.air.land.entity.LandListed;
@ -79,6 +81,11 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
return list;
}
@Override
public List<LandDto> appletsLandListed(Page page, LandVo landVo) {
return baseMapper.appletsLandListed(page,landVo);
}
/**
* 导入地块数据
*

15
air/src/main/java/com/air/land/service/impl/LandToListServiceImpl.java

@ -2,6 +2,9 @@ package com.air.land.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.air.applets.dto.LandDto;
import com.air.applets.dto.MeasureTrendDto;
import com.air.applets.vo.LandVo;
import com.air.common.Constant;
import com.air.land.entity.LandListed;
import com.air.land.entity.LandToList;
@ -10,6 +13,7 @@ import com.air.land.mapper.LandToListMapper;
import com.air.land.service.LandToListService;
import com.air.utils.DateUtil;
import com.air.utils.ExcelUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cinderella.framework.common.core.exception.BusinessException;
import com.cinderella.framework.common.core.util.R;
@ -84,9 +88,18 @@ public class LandToListServiceImpl extends ServiceImpl<LandToListMapper, LandToL
return this.saveBatch(list);
}
@Override
public List<LandDto> appletsLandToList(Page page , LandVo landVo) {
List<LandDto> landDtos = baseMapper.appletsLandToList(page, landVo);
landDtos.forEach(landDto -> {
landDto.setIsToBeListed("1");
});
return landDtos;
}
private List<String> entityToList(LandToList data) {
List<String> list = new ArrayList<>();
list.add(data.getProposedseriaId().toString());
list.add(data.getProposedseriaId());
list.add(data.getLandName());
list.add(data.getSupplyStatus());
list.add(DateUtil.fromString(data.getEstimatedListingTime(),"yyyy-MM-dd"));

98
air/src/main/java/com/air/measuredata/controller/MeasureDataController.java

@ -1,98 +0,0 @@
package com.air.measuredata.controller;
import cn.hutool.core.bean.BeanUtil;
import com.air.measuredata.dto.MeasureStatisticsDto;
import com.air.measuredata.dto.MeasureTrendDto;
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;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 测算数据
*
* @author peihao
* @date 2021-05-18 09:40:33
*/
@RestController
@AllArgsConstructor
@RequestMapping("/measuredata")
@Api(value = "measuredata", tags = "测算数据管理")
public class MeasureDataController {
private final MeasureDataService measureDataService;
/**
* 分页查询
*
* @param page 分页对象
* @param measureData 测算数据
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R getMeasureDataPage(Page page, MeasureData measureData) {
return R.ok(measureDataService.page(page, Wrappers.query(measureData)));
}
/**
* 通过id查询测算数据
*
* @param measureDataId id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{measureDataId}")
public R getById(@PathVariable("measureDataId") Long measureDataId) {
return R.ok(measureDataService.getById(measureDataId));
}
/**
* 保存测算数据
*
* @param measureDataVo 保存测算数据
* @return R
*/
@ApiOperation(value = "保存测算数据", notes = "保存测算数据")
@PostMapping
public R<Boolean> save(@RequestBody MeasureDataVo measureDataVo) {
MeasureData measureData = new MeasureData();
BeanUtil.copyProperties(measureDataVo,measureData);
return R.ok(measureDataService.saveOrUpdate(measureData));
}
@ApiOperation(value = "测算结果统计(小程序)", notes = "测算结果统计")
@GetMapping("/statistics")
public R<MeasureStatisticsDto> statistics() {
return R.ok(measureDataService.statistics());
}
@ApiOperation(value = "测算趋势统计(小程序)", notes = "测算趋势统计")
@GetMapping("/trend")
public R<List<MeasureTrendDto>> trend() {
return R.ok(measureDataService.trend());
}
/**
* 通过id删除测算数据
*
* @param measureDataId id
* @return R
*/
@ApiOperation(value = "通过id删除测算数据(通用)", notes = "通过id删除测算数据")
@DeleteMapping("/{measureDataId}")
public R<Boolean> removeById(@PathVariable Long measureDataId) {
return R.ok(measureDataService.removeById(measureDataId));
}
}

20
air/src/main/java/com/air/sysMessage/controller/SysMessageController.java

@ -1,13 +1,16 @@
package com.air.sysMessage.controller;
import com.air.enums.SysMessageStatusEnum;
import com.air.sysMessage.entity.SysMessage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cinderella.framework.common.core.util.R;
import com.air.sysMessage.service.SysMessageService;
import com.cinderella.framework.common.data.mybatis.QueryPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -19,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
*/
@RestController
@AllArgsConstructor
@RequestMapping("/message")
@RequestMapping("/applets/message")
@Api(value = "message", tags = "系统消息管理")
public class SysMessageController {
@ -28,16 +31,19 @@ public class SysMessageController {
/**
* 分页查询
* @param page 分页对象
* @param sysMessage 系统消息
* @param messageType 消息类型
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R getSysMessagePage(Page page, SysMessage sysMessage) {
return R.ok(sysMessageService.getSysMessagePage(page,sysMessage));
public R getSysMessagePage(QueryPage page, @RequestParam String messageType) {
Page<SysMessage> result = sysMessageService.page(page.toPage(), Wrappers.<SysMessage>query().lambda()
.eq(SysMessage::getMessageType, messageType)
.eq(SysMessage::getStatusCd, SysMessageStatusEnum.SYS_MESSAGE_STATUS_1000.getCode())
.orderByDesc(SysMessage::getCreateDate));
return R.ok(result);
}
/**
* 通过id查询系统消息
* @param messageId id
@ -56,7 +62,7 @@ public class SysMessageController {
*/
@ApiOperation(value = "新增系统消息", notes = "新增系统消息")
@PostMapping
public R save(@RequestBody SysMessage sysMessage) {
public R save(@RequestBody @Validated SysMessage sysMessage) {
return R.ok(sysMessageService.saveSysMessage(sysMessage));
}
@ -67,7 +73,7 @@ public class SysMessageController {
*/
@ApiOperation(value = "修改系统消息", notes = "修改系统消息")
@PutMapping
public R updateById(@RequestBody SysMessage sysMessage) {
public R updateById(@RequestBody @Validated SysMessage sysMessage) {
return R.ok(sysMessageService.updateSysMessage(sysMessage));
}

42
air/src/main/java/com/air/sysMessage/entity/SysMessage.java

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
@ -21,27 +22,42 @@ import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "系统消息")
public class SysMessage extends Model<SysMessage> {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@TableId
@ApiModelProperty(value="消息标识")
@TableId
@ApiModelProperty(value = "消息标识")
private Long messageId;
@ApiModelProperty(value="消息标题")
@ApiModelProperty(value = "消息类型",required = true)
@NotBlank(message = "消息类型不能为空")
private String messageType;
@ApiModelProperty(value = "消息标题",required = true)
@NotBlank(message = "消息标题不能为空")
private String messageTitle;
@ApiModelProperty(value="消息内容")
@ApiModelProperty(value = "消息内容",required = true)
@NotBlank(message = "消息内容不能为空")
private String messageContent;
@ApiModelProperty(value="状态")
@ApiModelProperty(value = "状态")
private String statusCd;
@ApiModelProperty(value="状态时间")
@ApiModelProperty(value = "状态时间")
private LocalDateTime statusDate;
@ApiModelProperty(value="创建人")
@ApiModelProperty(value = "创建人")
private String createUserId;
@ApiModelProperty(value="创建时间")
@ApiModelProperty(value = "创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value="修改人")
@ApiModelProperty(value = "修改人")
private String updateUserId;
@ApiModelProperty(value="修改时间")
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateDate;
@ApiModelProperty(value="备注")
@ApiModelProperty(value = "备注")
private String remark;
}
}

7
air/src/main/java/com/air/sysMessage/mapper/SysMessageMapper.java

@ -12,10 +12,5 @@ import org.apache.ibatis.annotations.Param;
* @date 2021-05-25 10:52:38
*/
public interface SysMessageMapper extends BaseMapper<SysMessage> {
/**
* get sysMessage by userId
* @param UserId
* @return
*/
Page<SysMessage> getSysMessagePage(Page page, @Param("userId")Integer UserId);
}

8
air/src/main/java/com/air/sysMessage/service/SysMessageService.java

@ -26,14 +26,6 @@ public interface SysMessageService extends IService<SysMessage> {
*/
Integer updateSysMessage(SysMessage sysMessage);
/**
* 分页查询
* @param page
* @param sysMessage
* @return
*/
Page getSysMessagePage(Page page, SysMessage sysMessage);
/**
* 删除
* @param messageId

7
air/src/main/java/com/air/sysMessage/service/impl/SysMessageServiceImpl.java

@ -44,13 +44,6 @@ public class SysMessageServiceImpl extends ServiceImpl<SysMessageMapper, SysMess
return sysMessageMapper.updateById(sysMessage);
}
@Override
public Page getSysMessagePage(Page page, SysMessage sysMessage) {
Integer userId = SecurityUtils.getUser().getId();
Page<SysMessage> messagePage = sysMessageMapper.getSysMessagePage(page,userId);
// page.setRecords(messagePage);
return messagePage;
}
@Override
public Integer deleteSysMessage(Long messageId) {

40
air/src/main/resources/mapper/LandListedMapper.xml

@ -74,4 +74,44 @@
</select>
<select id="appletsLandListed" resultType="com.air.applets.dto.LandDto">
SELECT
ll.*
FROM
land_listed ll
LEFT JOIN measure_data md ON ll.land_listed_id = md.land_listed_id
<where>
<if test='"toMeasure" == landVo.measureStatus'>
and md.measure_data_id IS NULL
</if>
<if test='"measured" == landVo.measureStatus'>
and md.measure_data_id IS not NULL
</if>
<if test='"listed" == landVo.transactionStatus'>
and date_format(ll.auction_date,'%Y-%m-%d') > #{nowDate}
</if>
<if test='"passBy" == landVo.transactionStatus'>
and date_format(ll.auction_date,'%Y-%m-%d') &lt; #{nowDate}
and ll.deal = 0
</if>
<if test='"dealDone" == landVo.transactionStatus'>
and ll.deal = 1
</if>
<if test="landVo.startDate != null and landVo.startDate != ''">
and date_format(ll.auction_date,'%Y-%m-%d') >= #{startDate}
</if>
<if test="landVo.endDate != null and landVo.endDate != ''">
and date_format(ll.auction_date,'%Y-%m-%d') &lt;= #{endDate}
</if>
<if test="landVo.city != null and landVo.city != ''">
and ll.city = #{city}
</if>
<if test="landVo.canton != null and landVo.canton != ''">
and ll.canton = #{canton}
</if>
</where>
</select>
</mapper>

24
air/src/main/resources/mapper/LandToListMapper.xml

@ -4,4 +4,28 @@
<mapper namespace="com.air.land.mapper.LandToListMapper">
<select id="appletsLandToList" resultType="com.air.applets.dto.LandDto">
SELECT
ll.proposedseria_id landListedId,
ll.*
FROM
land_to_list ll
LEFT JOIN measure_data md ON ll.proposedseria_id = md.proposedseria_id
<where>
<if test='"toMeasure" == landVo.measureStatus'>
and md.measure_data_id IS NULL
</if>
<if test='"measured" == landVo.measureStatus'>
and md.measure_data_id IS not NULL
</if>
<if test="landVo.city != null and landVo.city != ''">
and ll.city = #{city}
</if>
<if test="landVo.canton != null and landVo.canton != ''">
and ll.canton = #{canton}
</if>
</where>
</select>
</mapper>

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

@ -2,9 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.air.measuredata.mapper.MeasureDataMapper">
<mapper namespace="com.air.applets.mapper.MeasureDataMapper">
<select id="getTrend" resultType="com.air.measuredata.dto.MeasureTrendDto">
<select id="getErrorAbsoluteValueSum" resultType="java.math.BigDecimal">
select sum(error_absolute_value) from measure_data where create_user_id = #{userId}
</select>
<select id="getTrend" resultType="com.air.applets.dto.MeasureTrendDto">
SELECT
count(measure_data_id) total,
sum(forecast_net_profit_ratio) interestRate,
@ -13,10 +17,12 @@
FROM
measure_data
WHERE
DATE_FORMAT( create_date, '%Y%m' ) >= #{startTime}
create_user_id = #{userId}
and DATE_FORMAT( create_date, '%Y%m' ) >= #{startTime}
and #{endTime} >= DATE_FORMAT( create_date, '%Y%m' )
GROUP BY
DATE_FORMAT( create_date, '%Y%m' )
order by create_date asc
</select>
</mapper>

4
air/src/main/resources/mapper/SysMessageMapper.xml

@ -3,8 +3,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.air.sysMessage.mapper.SysMessageMapper">
<select id="getSysMessagePage" resultType="com.air.sysMessage.vo.SysMessageVo">
select * from sys_message msg LEFT JOIN msg_user_rel rel on msg.message_id=rel.message_id where user_id is null or user_id =#{userId}
</select>
</mapper>

Loading…
Cancel
Save