Browse Source

1.0.0 修改小程序接口

feature/v1.0.0
peihao 4 years ago
parent
commit
0076c42f46
  1. 101
      air/src/main/java/com/air/applets/controller/AppletsMapController.java
  2. 14
      air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java
  3. 6
      air/src/main/resources/mapper/LandListedMapper.xml

101
air/src/main/java/com/air/applets/controller/AppletsMapController.java

@ -0,0 +1,101 @@
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.*;
import java.time.LocalDate;
import java.util.List;
/**
* 小程序地图显示
*
* @author peihao
* @date 2021-05-18 09:39:59
*/
@RequestMapping("/applets/map")
@Api(value = "appletsMap", tags = "小程序地图显示")
public class AppletsMapController {
@Autowired
private LandListedService landListedService;
@Autowired
private LandToListService landToListService;
/**
* 根据定位经纬度范围行政区数据
*
* @param queryPage 分页对象
* @param landVo 查询参数
* @return
*/
@ApiOperation(value = "根据定位经纬度范围行政区数据", notes = "根据定位经纬度范围行政区数据")
@GetMapping("getRegionByLocation")
public R<Page<LandDto>> getRegionByLocation(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), "查询成功");
}
}

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

@ -113,9 +113,17 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
public List<LandDto> appletsLandListed(Page page, LandVo landVo) {
landVo.setNowDate(cn.hutool.core.date.DateUtil.formatDate(new Date()));
List<LandDto> landDtos = baseMapper.appletsLandListed(page, landVo);
landDtos.forEach(landDto -> {
landDto.setIsToBeListed("0");
});
if(StringUtils.isEmpty(landVo.getTransactionStatus())){
landDtos.forEach(landDto -> {
landDto.setIsToBeListed("0");
});
}else {
landDtos.forEach(landDto -> {
landDto.setIsToBeListed("0");
landDto.setTransactionStatus(landVo.getTransactionStatus());
});
}
return landDtos;
}

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

@ -80,8 +80,8 @@
<if test="landVo.transactionStatus == null or landVo.transactionStatus == ''">
(
case
when date_format(ll.auction_date,'%Y-%m-%d') > '2021-07-27' then 'listed'
when date_format(ll.auction_date,'%Y-%m-%d') &lt; '2021-07-27' and ll.deal = 0 then 'passBy'
when date_format(ll.auction_date,'%Y-%m-%d') >= #{landVo.nowDate} and ll.deal = 0 then 'listed'
when date_format(ll.auction_date,'%Y-%m-%d') &lt; #{landVo.nowDate} and ll.deal = 0 then 'passBy'
when ll.deal = 1 then 'dealDone'
end
) transactionStatus ,
@ -98,7 +98,7 @@
and md.measure_data_id IS not NULL
</if>
<if test='"listed" == landVo.transactionStatus'>
and date_format(ll.auction_date,'%Y-%m-%d') > #{landVo.nowDate}
and date_format(ll.auction_date,'%Y-%m-%d') >= #{landVo.nowDate}
</if>
<if test='"passBy" == landVo.transactionStatus'>
and date_format(ll.auction_date,'%Y-%m-%d') &lt; #{landVo.nowDate}

Loading…
Cancel
Save