Browse Source

1.0.0 修改列表接口的排序

release/v1.0.0
peihao 4 years ago
parent
commit
a428afdbd0
  1. 57
      air/src/main/java/com/air/config/MybatisPlusMetaObjectHandler.java
  2. 3
      air/src/main/java/com/air/land/controller/AuctionRecordController.java
  3. 2
      air/src/main/java/com/air/land/controller/LandListedController.java
  4. 3
      air/src/main/java/com/air/land/controller/LandListedLonLatController.java
  5. 3
      air/src/main/java/com/air/land/controller/LandToListController.java
  6. 7
      air/src/main/java/com/air/land/vo/LandListedAppletsVo.java
  7. 2
      air/src/main/resources/application.yml
  8. 1
      air/src/main/resources/mapper/LandListedMapper.xml

57
air/src/main/java/com/air/config/MybatisPlusMetaObjectHandler.java

@ -0,0 +1,57 @@
package com.air.config;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.cinderella.framework.common.security.util.SecurityUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.context.annotation.Configuration;
import java.time.LocalDateTime;
/**
* 自动填充处理器
* @author peihao
* @date 2021/6/4
**/
@Slf4j
@Configuration
@AllArgsConstructor
public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
log.info("start insert fill ....");
try {
try {
Integer userId = SecurityUtils.getUser().getId();
this.strictInsertFill(metaObject, "createStaff", Long.class, Long.valueOf(userId));
}catch (Exception e){
log.error("增强获取用户信息失败:",e);
}
this.strictInsertFill(metaObject, "createDate", String.class, LocalDateTime.now().toString());
this.strictInsertFill(metaObject, "statusDate", String.class, LocalDateTime.now().toString());
} catch (Exception e) {
log.error("增强失败:", e);
}
}
@Override
public void updateFill(MetaObject metaObject) {
log.info("start update fill ....");
try {
try {
Integer userId = SecurityUtils.getUser().getId();
this.strictInsertFill(metaObject, "updateStaff", Long.class, Long.valueOf(userId));
}catch (Exception e){
log.error("增强获取用户信息失败:",e);
}
this.strictInsertFill(metaObject, "updateDate", String.class, LocalDateTime.now().toString());
} catch (Exception e) {
log.error("增强失败:", e);
}
}
}

3
air/src/main/java/com/air/land/controller/AuctionRecordController.java

@ -40,7 +40,8 @@ public class AuctionRecordController {
@GetMapping("/list/{landListedId}")
public R<List<AuctionRecord>> getAuctionRecordPage(@PathVariable Long landListedId) {
List<AuctionRecord> list = auctionRecordService.list(Wrappers.<AuctionRecord>query().lambda()
.eq(AuctionRecord::getLandListedId, landListedId));
.eq(AuctionRecord::getLandListedId, landListedId)
.orderByDesc(AuctionRecord::getUpdateDate));
return R.ok(list, "查询成功");
}

2
air/src/main/java/com/air/land/controller/LandListedController.java

@ -72,7 +72,7 @@ public class LandListedController {
.like(StringUtils.isNotEmpty(pageVo.getBigGroup()), LandListed::getBigGroup, pageVo.getBigGroup())
.like(StringUtils.isNotEmpty(pageVo.getSmallGroup()), LandListed::getSmallGroup, pageVo.getSmallGroup())
.eq(StringUtils.isNotEmpty(pageVo.getCanton()), LandListed::getCanton, pageVo.getCanton())
.orderByDesc(LandListed::getCreateDate));
.orderByDesc(LandListed::getUpdateDate));
return R.ok(result, "查询成功");
}

3
air/src/main/java/com/air/land/controller/LandListedLonLatController.java

@ -40,7 +40,8 @@ public class LandListedLonLatController {
@GetMapping("/list/{landListedId}")
public R<List<LandListedLonLat>> getLandListedLonLatPage(@PathVariable Long landListedId) {
List<LandListedLonLat> list = landListedLonLatService.list(Wrappers.<LandListedLonLat>query().lambda()
.eq(LandListedLonLat::getLandListedId, landListedId));
.eq(LandListedLonLat::getLandListedId, landListedId)
.orderByDesc(LandListedLonLat::getUpdateDate));
return R.ok(list, "查询成功");
}

3
air/src/main/java/com/air/land/controller/LandToListController.java

@ -73,7 +73,8 @@ public class LandToListController {
.eq(ObjectUtil.isNotEmpty(pageVo.getAnnoDate()), LandToList::getAnnoDate, pageVo.getAnnoDate())
.like(StringUtils.isNotEmpty(pageVo.getBigGroup()), LandToList::getBigGroup, pageVo.getBigGroup())
.like(StringUtils.isNotEmpty(pageVo.getSmallGroup()), LandToList::getSmallGroup, pageVo.getSmallGroup())
.eq(StringUtils.isNotEmpty(pageVo.getCanton()), LandToList::getCanton, pageVo.getCanton()));
.eq(StringUtils.isNotEmpty(pageVo.getCanton()), LandToList::getCanton, pageVo.getCanton())
.orderByDesc(LandToList::getUpdateDate));
return R.ok(result, "查询成功");
}

7
air/src/main/java/com/air/land/vo/LandListedAppletsVo.java

@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 小程序地块查询参数
@ -20,15 +19,9 @@ public class LandListedAppletsVo {
@ApiModelProperty(value = "公告日期(yyyy-MM-dd,不传时分秒)")
private String annoDate;
@ApiModelProperty(value = "公告日期(结束时间)",hidden = true)
private String annoDateEnd;
@ApiModelProperty(value = "拍卖日期(yyyy-MM-dd,不传时分秒)")
private String auctionDate;
@ApiModelProperty(value = "拍卖日期(结束时间)",hidden = true)
private String auctionDateEnd;
@ApiModelProperty(value = "日期(yyyy-MM,统计地块数量时传入)")
private String date;

2
air/src/main/resources/application.yml

@ -10,7 +10,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: pUxtaIoE!1^s@vDJ
url: jdbc:mysql://139.9.239.248:4001/air?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://139.9.239.i248:4001/air?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
stat-view-servlet:
enabled: true
url-pattern: /druid/*

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

@ -36,6 +36,7 @@
and small_group = #{param.smallGroup}
</if>
</where>
order by update_date
</select>

Loading…
Cancel
Save