diff --git a/air/src/main/java/com/air/config/MybatisPlusMetaObjectHandler.java b/air/src/main/java/com/air/config/MybatisPlusMetaObjectHandler.java new file mode 100644 index 0000000..db8c896 --- /dev/null +++ b/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); + } + + } +} diff --git a/air/src/main/java/com/air/land/controller/AuctionRecordController.java b/air/src/main/java/com/air/land/controller/AuctionRecordController.java index 3f4ae70..40fb903 100644 --- a/air/src/main/java/com/air/land/controller/AuctionRecordController.java +++ b/air/src/main/java/com/air/land/controller/AuctionRecordController.java @@ -40,7 +40,8 @@ public class AuctionRecordController { @GetMapping("/list/{landListedId}") public R> getAuctionRecordPage(@PathVariable Long landListedId) { List list = auctionRecordService.list(Wrappers.query().lambda() - .eq(AuctionRecord::getLandListedId, landListedId)); + .eq(AuctionRecord::getLandListedId, landListedId) + .orderByDesc(AuctionRecord::getUpdateDate)); return R.ok(list, "查询成功"); } diff --git a/air/src/main/java/com/air/land/controller/LandListedController.java b/air/src/main/java/com/air/land/controller/LandListedController.java index e19bfec..583b942 100644 --- a/air/src/main/java/com/air/land/controller/LandListedController.java +++ b/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, "查询成功"); } diff --git a/air/src/main/java/com/air/land/controller/LandListedLonLatController.java b/air/src/main/java/com/air/land/controller/LandListedLonLatController.java index 7362e36..dcbadd7 100644 --- a/air/src/main/java/com/air/land/controller/LandListedLonLatController.java +++ b/air/src/main/java/com/air/land/controller/LandListedLonLatController.java @@ -40,7 +40,8 @@ public class LandListedLonLatController { @GetMapping("/list/{landListedId}") public R> getLandListedLonLatPage(@PathVariable Long landListedId) { List list = landListedLonLatService.list(Wrappers.query().lambda() - .eq(LandListedLonLat::getLandListedId, landListedId)); + .eq(LandListedLonLat::getLandListedId, landListedId) + .orderByDesc(LandListedLonLat::getUpdateDate)); return R.ok(list, "查询成功"); } diff --git a/air/src/main/java/com/air/land/controller/LandToListController.java b/air/src/main/java/com/air/land/controller/LandToListController.java index 79094ae..13f4fca 100644 --- a/air/src/main/java/com/air/land/controller/LandToListController.java +++ b/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, "查询成功"); } diff --git a/air/src/main/java/com/air/land/vo/LandListedAppletsVo.java b/air/src/main/java/com/air/land/vo/LandListedAppletsVo.java index 5ab371c..5be9f6a 100644 --- a/air/src/main/java/com/air/land/vo/LandListedAppletsVo.java +++ b/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; diff --git a/air/src/main/resources/application.yml b/air/src/main/resources/application.yml index a2939e2..9ca850c 100644 --- a/air/src/main/resources/application.yml +++ b/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/* diff --git a/air/src/main/resources/mapper/LandListedMapper.xml b/air/src/main/resources/mapper/LandListedMapper.xml index 35a6392..5d94818 100644 --- a/air/src/main/resources/mapper/LandListedMapper.xml +++ b/air/src/main/resources/mapper/LandListedMapper.xml @@ -36,6 +36,7 @@ and small_group = #{param.smallGroup} + order by update_date