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 4dce705..92ec7b9 100644 --- a/air/src/main/java/com/air/land/controller/LandToListController.java +++ b/air/src/main/java/com/air/land/controller/LandToListController.java @@ -7,6 +7,7 @@ import com.air.land.entity.LandToList; import com.air.land.service.LandToListService; import com.air.land.vo.LandListedPageVo; import com.air.land.vo.LandToListVo; +import com.air.utils.DateUtil; import com.air.utils.ExcelUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -26,6 +27,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.time.LocalDateTime; import java.util.List; @@ -85,21 +87,39 @@ public class LandToListController { } /** - * 保存拟挂牌地块 + * 新增拟挂牌地块 * * @param landToListVo 拟挂牌地块 * @return R */ - @ApiOperation(value = "保存拟挂牌地块(新增,修改)", notes = "新增拟挂牌地块(传id为修改,不传为新增)") + @ApiOperation(value = "新增拟挂牌地块", notes = "新增拟挂牌地块") @PostMapping - public R savelandToList(@RequestBody @Validated LandToListVo landToListVo) { + public R addlandToList(@RequestBody LandToListVo landToListVo) { LandToList landToList = new LandToList(); BeanUtil.copyProperties(landToListVo, landToList); + landToList.setProposedseriaId(DateUtil.landListedIdfromDate(LocalDateTime.now(),"yyyyMMddHHmmssSSS")); landToList.setStatusCd(Constant.LAND_TO_STATUS_1000); - landToListService.saveOrUpdate(landToList); + landToListService.save(landToList); return R.ok(landToList.getProposedseriaId()); } + /** + * 修改拟挂牌地块 + * + * @param landToListVo 拟挂牌地块 + * @return R + */ + @ApiOperation(value = "修改拟挂牌地块", notes = "修改拟挂牌地块") + @PutMapping + public R updatelandToList(@RequestBody LandToListVo landToListVo) { + if (StringUtils.isEmpty(landToListVo.getProposedseriaId())){ + return R.failed("id不能为空"); + } + LandToList landToList = new LandToList(); + BeanUtil.copyProperties(landToListVo, landToList); + return R.ok(landToListService.updateById(landToList)); + } + /** * 通过id删除拟挂牌地块。 * diff --git a/air/src/main/java/com/air/land/entity/LandListed.java b/air/src/main/java/com/air/land/entity/LandListed.java index ed04ea5..30a6c85 100644 --- a/air/src/main/java/com/air/land/entity/LandListed.java +++ b/air/src/main/java/com/air/land/entity/LandListed.java @@ -25,7 +25,7 @@ import java.time.LocalDateTime; public class LandListed extends Model { private static final long serialVersionUID = 1L; - @TableId(type = IdType.ASSIGN_UUID) + @TableId(type = IdType.INPUT) @ApiModelProperty(value = "id(主键)") private String landListedId; diff --git a/air/src/main/java/com/air/land/entity/LandToList.java b/air/src/main/java/com/air/land/entity/LandToList.java index c26e8fc..d1a92c2 100644 --- a/air/src/main/java/com/air/land/entity/LandToList.java +++ b/air/src/main/java/com/air/land/entity/LandToList.java @@ -1,6 +1,7 @@ package com.air.land.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; @@ -27,7 +28,7 @@ public class LandToList extends Model { private static final long serialVersionUID = 1L; - @TableId(type = IdType.AUTO) + @TableId(value = "proposedseria_id",type = IdType.INPUT) @ApiModelProperty(value = "拟出让序号") private String proposedseriaId; diff --git a/air/src/main/java/com/air/land/vo/LandToListVo.java b/air/src/main/java/com/air/land/vo/LandToListVo.java index 14d9f58..9e3e3f5 100644 --- a/air/src/main/java/com/air/land/vo/LandToListVo.java +++ b/air/src/main/java/com/air/land/vo/LandToListVo.java @@ -29,7 +29,7 @@ public class LandToListVo { private String supplyStatus; @ApiModelProperty(value = "预计挂牌时间") - private String estimatedListingTime; + private LocalDate estimatedListingTime; @ApiModelProperty(value = "预计挂牌批次") private String estimatedListingBatch;