Browse Source

2.0.0 新增看地计划,看地计划点位和我的收藏等模块相关借口

feature/v.2.0.0
peihao 3 years ago
parent
commit
387c967063
  1. 2
      air/src/main/java/com/air/applets/controller/AppletsMapController.java
  2. 73
      air/src/main/java/com/air/applets/controller/LandUserKeepController.java
  3. 3
      air/src/main/java/com/air/applets/controller/MeasureDataController.java
  4. 78
      air/src/main/java/com/air/applets/controller/PlanLandController.java
  5. 92
      air/src/main/java/com/air/applets/controller/PlanSpotController.java
  6. 56
      air/src/main/java/com/air/applets/entity/LandUserKeep.java
  7. 51
      air/src/main/java/com/air/applets/entity/PlanLand.java
  8. 51
      air/src/main/java/com/air/applets/entity/PlanSpot.java
  9. 47
      air/src/main/java/com/air/applets/entity/ViewLand.java
  10. 28
      air/src/main/java/com/air/applets/mapper/LandUserKeepMapper.java
  11. 14
      air/src/main/java/com/air/applets/mapper/PlanLandMapper.java
  12. 14
      air/src/main/java/com/air/applets/mapper/PlanSpotMapper.java
  13. 12
      air/src/main/java/com/air/applets/mapper/ViewLandMapper.java
  14. 2
      air/src/main/java/com/air/applets/service/AppletsMapService.java
  15. 25
      air/src/main/java/com/air/applets/service/LandUserKeepService.java
  16. 2
      air/src/main/java/com/air/applets/service/MeasureDataService.java
  17. 26
      air/src/main/java/com/air/applets/service/PlanLandService.java
  18. 43
      air/src/main/java/com/air/applets/service/PlanSpotService.java
  19. 12
      air/src/main/java/com/air/applets/service/ViewLandService.java
  20. 4
      air/src/main/java/com/air/applets/service/impl/AppletsMapServiceImpl.java
  21. 33
      air/src/main/java/com/air/applets/service/impl/LandUserKeepServiceImpl.java
  22. 4
      air/src/main/java/com/air/applets/service/impl/MeasureDataServiceImpl.java
  23. 34
      air/src/main/java/com/air/applets/service/impl/PlanLandServiceImpl.java
  24. 103
      air/src/main/java/com/air/applets/service/impl/PlanSpotServiceImpl.java
  25. 19
      air/src/main/java/com/air/applets/service/impl/ViewLandServiceImpl.java
  26. 26
      air/src/main/java/com/air/applets/vo/PlanLandSpotVo.java
  27. 36
      air/src/main/java/com/air/applets/vo/PlanLandVo.java
  28. 32
      air/src/main/java/com/air/applets/vo/PlanSpotVo.java
  29. 16
      air/src/main/resources/mapper/LandUserKeepMapper.xml

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

@ -1,7 +1,7 @@
package com.air.applets.controller;
import com.air.applets.dto.LandLonLatDto;
import com.air.applets.serivce.AppletsMapService;
import com.air.applets.service.AppletsMapService;
import com.cinderella.framework.common.core.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

73
air/src/main/java/com/air/applets/controller/LandUserKeepController.java

@ -0,0 +1,73 @@
package com.air.applets.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.air.applets.entity.LandUserKeep;
import com.air.applets.entity.ViewLand;
import com.air.applets.service.LandUserKeepService;
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.*;
import java.util.List;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
@RestController
@AllArgsConstructor
@RequestMapping("/landUserKeep")
@Api(value = "landUserKeep", tags = "用户地块收藏管理")
public class LandUserKeepController {
private final LandUserKeepService userKeepService;
/**
* 分页查询
*
* @param page 分页对象
* @param landUserKeep
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R<IPage<ViewLand>> getLandUserKeepPage(QueryPage page, LandUserKeep landUserKeep) {
return R.ok(userKeepService.getLandUserKeepPage(page.toPage(), landUserKeep));
}
/**
* 新增用户收藏地块
*
* @param landUserKeep
* @return R
*/
@ApiOperation(value = "新增用户收藏地块", notes = "新增用户收藏地块")
@PostMapping
public R<Boolean> save(@RequestBody @Validated LandUserKeep landUserKeep) {
List<LandUserKeep> list = userKeepService.list(Wrappers.<LandUserKeep>query().lambda().eq(LandUserKeep::getLandId, landUserKeep.getLandId())
.eq(LandUserKeep::getUserId, landUserKeep.getUserId()).eq(LandUserKeep::getLandType, landUserKeep.getLandType()));
if (CollectionUtil.isNotEmpty(list)) {
return R.failed("该地块已收藏,无需再次收藏");
}
return R.ok(userKeepService.save(landUserKeep));
}
/**
* 通过id批量删除
*
* @param ids ids
* @return R
*/
@ApiOperation(value = "通过id批量删除", notes = "通过id批量删除")
@DeleteMapping("removeByIds")
public R<Boolean> removeByIds(@RequestParam List<Integer> ids) {
return R.ok(userKeepService.removeByIds(ids), "删除成功");
}
}

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

@ -6,9 +6,8 @@ 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.service.MeasureDataService;
import com.air.applets.vo.MeasureDataVo;
import com.air.enums.MeasureStatusEnum;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

78
air/src/main/java/com/air/applets/controller/PlanLandController.java

@ -0,0 +1,78 @@
package com.air.applets.controller;
import com.air.applets.entity.PlanLand;
import com.air.applets.service.PlanLandService;
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.web.bind.annotation.*;
import java.util.List;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
@RestController
@AllArgsConstructor
@RequestMapping("/planLand")
@Api(value = "planLand", tags = "看地计划管理")
public class PlanLandController {
private final PlanLandService planLandService;
/**
* 分页查询
*
* @param page 分页对象
* @param planLand
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R<IPage<PlanLand>> getPlanLandPage(QueryPage page, PlanLand planLand) {
return R.ok(planLandService.page(page.toPage(), Wrappers.query(planLand).lambda().orderByDesc(PlanLand::getCreateDate)));
}
/**
* 通过id查询
*
* @param id id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{id}")
public R<PlanLand> getById(@PathVariable("id") Long id) {
return R.ok(planLandService.getById(id));
}
/**
* 修改计划
*
* @param planLand
* @return R
*/
@ApiOperation(value = "修改计划", notes = "修改计划")
@PutMapping
public R<Boolean> updateById(@RequestBody PlanLand planLand) {
return R.ok(planLandService.updateById(planLand));
}
/**
* 通过id删除
*
* @param ids ids
* @return R
*/
@ApiOperation(value = "通过id删除", notes = "通过id删除")
@DeleteMapping("removeByIds")
public R<Boolean> removesPlanAndSpotByIds(@RequestParam List<Integer> ids) {
return R.ok(planLandService.removesPlanAndSpotByIds(ids), "删除成功");
}
}

92
air/src/main/java/com/air/applets/controller/PlanSpotController.java

@ -0,0 +1,92 @@
package com.air.applets.controller;
import com.air.applets.entity.PlanSpot;
import com.air.applets.service.PlanSpotService;
import com.air.applets.vo.PlanLandSpotVo;
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.*;
import java.util.List;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
@RestController
@AllArgsConstructor
@RequestMapping("/planSpot")
@Api(value = "planSpot", tags = "看地计划点位管理")
public class PlanSpotController {
private final PlanSpotService planSpotService;
/**
* 分页查询
*
* @param page 分页对象
* @param planSpot
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R<IPage<PlanSpot>> getPlanSpotPage(QueryPage page, PlanSpot planSpot) {
return R.ok(planSpotService.page(page.toPage(), Wrappers.query(planSpot)));
}
/**
* 通过计划id查询详情
*
* @param planId planId
* @return R
*/
@ApiOperation(value = "通过计划id查询详情", notes = "通过计划id查询详情")
@GetMapping("/{planId}")
public R<PlanLandSpotVo> getSpotListByPlanId(@PathVariable("planId") Integer planId) {
return R.ok(planSpotService.getSpotListByPlanId(planId), "查询成功");
}
/**
* 新增计划详情包含点位和计划基础信息
*
* @param planLandSpotVo
* @return R
*/
@ApiOperation(value = "新增计划详情(包含点位和计划基础信息)", notes = "新增计划详情(包含点位和计划基础信息)")
@PostMapping
public R<Boolean> save(@RequestBody @Validated PlanLandSpotVo planLandSpotVo) {
return R.ok(planSpotService.savePlanSpot(planLandSpotVo), "保存成功");
}
/**
* 修改计划详情包含点位和计划基础信息
*
* @param planLandSpotVo
* @return R
*/
@ApiOperation(value = "修改计划详情(包含点位和计划基础信息)", notes = "修改计划详情(包含点位和计划基础信息)")
@PutMapping
public R<Boolean> updateById(@RequestBody @Validated PlanLandSpotVo planLandSpotVo) {
return R.ok(planSpotService.updatePlanSpot(planLandSpotVo), "保存成功");
}
/**
* 通过点位id批量删除
*
* @param ids ids
* @return R
*/
@ApiOperation(value = "通过点位id批量删除", notes = "通过点位id批量删除")
@DeleteMapping("removeByIds")
public R<Boolean> removeByIds(@RequestParam List<Integer> ids) {
return R.ok(planSpotService.removeByIds(ids));
}
}

56
air/src/main/java/com/air/applets/entity/LandUserKeep.java

@ -0,0 +1,56 @@
package com.air.applets.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
*
* 用户看地收藏
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Data
@TableName("land_user_keep")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "")
public class LandUserKeep extends Model<LandUserKeep> {
private static final long serialVersionUID = 1L;
@TableId
@ApiModelProperty(value="主键")
private Integer id;
@NotNull(message = "用户id不能为空")
@ApiModelProperty(value="用户id")
private Integer userId;
@NotBlank(message = "地块id不能为空")
@ApiModelProperty(value="地块id")
private String landId;
@NotNull(message = "地块类型不能为空")
@ApiModelProperty(value="地块类型(0:待挂牌,1:已挂牌)")
private Integer landType;
@ApiModelProperty(value="状态")
private String statusCd;
@ApiModelProperty(value="状态时间")
private LocalDateTime statusDate;
@ApiModelProperty(value="创建人")
private String createUserId;
@ApiModelProperty(value="创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value="修改人")
private String updateUserId;
@ApiModelProperty(value="修改时间")
private LocalDateTime updateDate;
@ApiModelProperty(value="备注")
private String remark;
}

51
air/src/main/java/com/air/applets/entity/PlanLand.java

@ -0,0 +1,51 @@
package com.air.applets.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 看地计划
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Data
@TableName("plan_land")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "")
public class PlanLand extends Model<PlanLand> {
private static final long serialVersionUID = 1L;
@TableId
@ApiModelProperty(value="主键")
private Integer id;
@ApiModelProperty(value="计划名称")
private String planName;
@ApiModelProperty(value="计划点位数量")
private Integer planPointNum;
@ApiModelProperty(value="计划里程")
private BigDecimal planMileage;
@ApiModelProperty(value="计划时间")
private String planTime;
@ApiModelProperty(value="状态")
private String statusCd;
@ApiModelProperty(value="状态时间")
private LocalDateTime statusDate;
@ApiModelProperty(value="创建人")
private String createUserId;
@ApiModelProperty(value="创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value="修改人")
private String updateUserId;
@ApiModelProperty(value="修改时间")
private LocalDateTime updateDate;
@ApiModelProperty(value="备注")
private String remark;
}

51
air/src/main/java/com/air/applets/entity/PlanSpot.java

@ -0,0 +1,51 @@
package com.air.applets.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 看地计划点位
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Data
@TableName("plan_spot")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "")
public class PlanSpot extends Model<PlanSpot> {
private static final long serialVersionUID = 1L;
@TableId
@ApiModelProperty(value="主键")
private Integer id;
@ApiModelProperty(value="计划id")
private Integer planId;
@ApiModelProperty(value="计划点位名称")
private String spotName;
@ApiModelProperty(value="点位顺序")
private String spotSort;
@ApiModelProperty(value="经纬度")
private String spotLonLat;
@ApiModelProperty(value="状态")
private String statusCd;
@ApiModelProperty(value="状态时间")
private LocalDateTime statusDate;
@ApiModelProperty(value="创建人")
private String createUserId;
@ApiModelProperty(value="创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value="修改人")
private String updateUserId;
@ApiModelProperty(value="修改时间")
private LocalDateTime updateDate;
@ApiModelProperty(value="备注")
private String remark;
}

47
air/src/main/java/com/air/applets/entity/ViewLand.java

@ -0,0 +1,47 @@
package com.air.applets.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 地块视图包含待挂牌和已挂牌
*
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Data
@TableName("view_land")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "地块视图(包含待挂牌和已挂牌)")
public class ViewLand extends Model<ViewLand> {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键,自增")
private String landListedId;
@ApiModelProperty(value = "特征名字")
private String characteristicName;
@ApiModelProperty(value = "土地出让面积(㎡)")
private BigDecimal landTransferSquare;
@ApiModelProperty(value = "出让价款起始价(万元)")
private BigDecimal transferPrice;
@ApiModelProperty(value = "起始楼面价(元/㎡)")
private BigDecimal startingFloorPrice;
@ApiModelProperty(value = "土地类型(0:待挂牌,1:已挂牌)")
private Integer landType;
@ApiModelProperty(value = "城市")
private String city;
@ApiModelProperty(value = "交易状态")
private String transactionStatus;
@TableField(exist = false)
@ApiModelProperty(value = "用户收藏id")
private Integer landUserkeepId;
}

28
air/src/main/java/com/air/applets/mapper/LandUserKeepMapper.java

@ -0,0 +1,28 @@
package com.air.applets.mapper;
import com.air.applets.entity.LandUserKeep;
import com.air.applets.entity.ViewLand;
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;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
public interface LandUserKeepMapper extends BaseMapper<LandUserKeep> {
/**
* 查询用户地块收藏列表
* @author peihao
* @param page 分页对象
* @param param 查询参数
* @date 2021/11/26
* @return
**/
List<ViewLand> getLandUserKeepPage(Page page,@Param("param") LandUserKeep param);
}

14
air/src/main/java/com/air/applets/mapper/PlanLandMapper.java

@ -0,0 +1,14 @@
package com.air.applets.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.air.applets.entity.PlanLand;
/**
*
*
* @author peihao
* @date 2021-11-25 15:47:04
*/
public interface PlanLandMapper extends BaseMapper<PlanLand> {
}

14
air/src/main/java/com/air/applets/mapper/PlanSpotMapper.java

@ -0,0 +1,14 @@
package com.air.applets.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.air.applets.entity.PlanSpot;
/**
*
*
* @author peihao
* @date 2021-11-25 15:47:04
*/
public interface PlanSpotMapper extends BaseMapper<PlanSpot> {
}

12
air/src/main/java/com/air/applets/mapper/ViewLandMapper.java

@ -0,0 +1,12 @@
package com.air.applets.mapper;
import com.air.applets.entity.ViewLand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
public interface ViewLandMapper extends BaseMapper<ViewLand> {
}

2
air/src/main/java/com/air/applets/serivce/AppletsMapService.java → air/src/main/java/com/air/applets/service/AppletsMapService.java

@ -1,4 +1,4 @@
package com.air.applets.serivce;
package com.air.applets.service;
import com.air.applets.dto.LandLonLatDto;
import com.air.applets.entity.*;

25
air/src/main/java/com/air/applets/service/LandUserKeepService.java

@ -0,0 +1,25 @@
package com.air.applets.service;
import com.air.applets.entity.LandUserKeep;
import com.air.applets.entity.ViewLand;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
public interface LandUserKeepService extends IService<LandUserKeep> {
/**
* 查询用户地块收藏列表
* @author peihao
* @param page 分页对象
* @param landUserKeep 查询参数
* @date 2021/11/26
* @return
**/
IPage<ViewLand> getLandUserKeepPage(Page page, LandUserKeep landUserKeep);
}

2
air/src/main/java/com/air/applets/serivce/MeasureDataService.java → air/src/main/java/com/air/applets/service/MeasureDataService.java

@ -1,4 +1,4 @@
package com.air.applets.serivce;
package com.air.applets.service;
import com.air.applets.dto.MeasureStatisticsDto;
import com.air.applets.dto.MeasureTrendDto;

26
air/src/main/java/com/air/applets/service/PlanLandService.java

@ -0,0 +1,26 @@
package com.air.applets.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.air.applets.entity.PlanLand;
import java.util.List;
/**
*
*
* @author peihao
* @date 2021-11-25 15:47:04
*/
public interface PlanLandService extends IService<PlanLand> {
/**
* 批量删除看地计划和计划点位
* @author peihao
* @param ids id
* @date 2021/11/26
* @return
**/
boolean removesPlanAndSpotByIds(List<Integer> ids);
}

43
air/src/main/java/com/air/applets/service/PlanSpotService.java

@ -0,0 +1,43 @@
package com.air.applets.service;
import com.air.applets.vo.PlanLandSpotVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.air.applets.entity.PlanSpot;
/**
*
*
* @author peihao
* @date 2021-11-25 15:47:04
*/
public interface PlanSpotService extends IService<PlanSpot> {
/**
* 新增计划点位信息
* @author peihao
* @param planLandSpotVo
* @date 2021/11/26
* @return
**/
boolean savePlanSpot(PlanLandSpotVo planLandSpotVo);
/**
* 修改计划点位信息
* @author peihao
* @param planLandSpotVo
* @date 2021/11/26
* @return
**/
boolean updatePlanSpot(PlanLandSpotVo planLandSpotVo);
/**
* 通过计划id查询看地计划基础信息和计划点位信息
* @author peihao
* @param planId
* @date 2021/11/26
* @return
**/
PlanLandSpotVo getSpotListByPlanId(Integer planId);
}

12
air/src/main/java/com/air/applets/service/ViewLandService.java

@ -0,0 +1,12 @@
package com.air.applets.service;
import com.air.applets.entity.ViewLand;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
public interface ViewLandService extends IService<ViewLand> {
}

4
air/src/main/java/com/air/applets/serivce/impl/AppletsMapServiceImpl.java → air/src/main/java/com/air/applets/service/impl/AppletsMapServiceImpl.java

@ -1,4 +1,4 @@
package com.air.applets.serivce.impl;
package com.air.applets.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
@ -6,7 +6,7 @@ import com.air.applets.convert.LandLonLatConvert;
import com.air.applets.dto.LandLonLatDto;
import com.air.applets.entity.*;
import com.air.applets.mapper.AppletsMapMapper;
import com.air.applets.serivce.AppletsMapService;
import com.air.applets.service.AppletsMapService;
import com.air.cityarea.entity.Dazutuan;
import com.air.cityarea.entity.Huanxian;
import com.air.cityarea.entity.Xiaozutuan;

33
air/src/main/java/com/air/applets/service/impl/LandUserKeepServiceImpl.java

@ -0,0 +1,33 @@
package com.air.applets.service.impl;
import com.air.applets.entity.LandUserKeep;
import com.air.applets.entity.ViewLand;
import com.air.applets.mapper.LandUserKeepMapper;
import com.air.applets.service.LandUserKeepService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cinderella.framework.common.security.util.SecurityUtils;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Service
@AllArgsConstructor
public class LandUserKeepServiceImpl extends ServiceImpl<LandUserKeepMapper, LandUserKeep> implements LandUserKeepService {
@Override
public IPage<ViewLand> getLandUserKeepPage(Page page, LandUserKeep landUserKeep) {
if (null == landUserKeep.getUserId()){
landUserKeep.setUserId(SecurityUtils.getUser().getId());
}
List<ViewLand> landUserKeepPage = this.baseMapper.getLandUserKeepPage(page, landUserKeep);
return page.setRecords(landUserKeepPage);
}
}

4
air/src/main/java/com/air/applets/serivce/impl/MeasureDataServiceImpl.java → air/src/main/java/com/air/applets/service/impl/MeasureDataServiceImpl.java

@ -1,10 +1,10 @@
package com.air.applets.serivce.impl;
package com.air.applets.service.impl;
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.applets.service.MeasureDataService;
import com.air.utils.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

34
air/src/main/java/com/air/applets/service/impl/PlanLandServiceImpl.java

@ -0,0 +1,34 @@
package com.air.applets.service.impl;
import com.air.applets.entity.PlanSpot;
import com.air.applets.service.PlanSpotService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.air.applets.entity.PlanLand;
import com.air.applets.mapper.PlanLandMapper;
import com.air.applets.service.PlanLandService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
*
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Service
@AllArgsConstructor
public class PlanLandServiceImpl extends ServiceImpl<PlanLandMapper, PlanLand> implements PlanLandService {
private PlanSpotService planSpotService;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean removesPlanAndSpotByIds(List<Integer> ids) {
this.removeByIds(ids);
return planSpotService.remove(Wrappers.<PlanSpot>query().lambda().in(PlanSpot::getPlanId,ids));
}
}

103
air/src/main/java/com/air/applets/service/impl/PlanSpotServiceImpl.java

@ -0,0 +1,103 @@
package com.air.applets.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.air.applets.entity.PlanLand;
import com.air.applets.mapper.PlanLandMapper;
import com.air.applets.service.PlanLandService;
import com.air.applets.vo.PlanLandSpotVo;
import com.air.applets.vo.PlanLandVo;
import com.air.applets.vo.PlanSpotVo;
import com.air.utils.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.air.applets.entity.PlanSpot;
import com.air.applets.mapper.PlanSpotMapper;
import com.air.applets.service.PlanSpotService;
import com.cinderella.framework.common.core.exception.BusinessException;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
/**
*
*
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Service
@AllArgsConstructor
public class PlanSpotServiceImpl extends ServiceImpl<PlanSpotMapper, PlanSpot> implements PlanSpotService {
private PlanLandMapper planLandMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean savePlanSpot(PlanLandSpotVo planLandSpotVo) {
PlanLandVo planLandVo = planLandSpotVo.getPlanLandVo();
PlanLand planLand = new PlanLand();
BeanUtil.copyProperties(planLandVo,planLand);
planLand.setPlanName(DateUtil.fromString(LocalDate.now(),"yyyy-MM-dd")+" 看地计划");
planLandMapper.insert(planLand);
List<PlanSpot> planSpots = planLandSpotVo.getPlanSpotVos().stream().map(e -> {
PlanSpot planSpot = new PlanSpot();
BeanUtil.copyProperties(e, planSpot);
planSpot.setPlanId(planLand.getId());
return planSpot;
}).collect(Collectors.toList());
return this.saveBatch(planSpots);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updatePlanSpot(PlanLandSpotVo planLandSpotVo) {
PlanLandVo planLandVo = planLandSpotVo.getPlanLandVo();
if (planLandVo.getId() == null){
throw new BusinessException("计划id不能为空");
}
PlanLand planLand = new PlanLand();
BeanUtil.copyProperties(planLandVo,planLand);
planLandMapper.updateById(planLand);
List<PlanSpot> planSpots = planLandSpotVo.getPlanSpotVos().stream().map(e -> {
if (null == e.getPlanId()){
throw new BusinessException("计划id不能为空");
}
PlanSpot planSpot = new PlanSpot();
BeanUtil.copyProperties(e, planSpot);
return planSpot;
}).collect(Collectors.toList());
this.remove(Wrappers.<PlanSpot>query().lambda().eq(PlanSpot::getPlanId,planLand.getId()));
return this.saveBatch(planSpots);
}
@Override
public PlanLandSpotVo getSpotListByPlanId(Integer planId) {
PlanLand plan = planLandMapper.selectById(planId);
if (null == plan){
throw new BusinessException("计划id有误,未查询到数据");
}
List<PlanSpot> planSpots = this.list(Wrappers.<PlanSpot>query().lambda()
.eq(PlanSpot::getPlanId, planId).orderByAsc(PlanSpot::getSpotSort));
PlanLandSpotVo planLandSpotVo = new PlanLandSpotVo();
PlanLandVo planLandVo = new PlanLandVo();
BeanUtil.copyProperties(plan,planLandVo);
planLandSpotVo.setPlanLandVo(planLandVo);
if (CollectionUtil.isNotEmpty(planSpots)){
List<PlanSpotVo> planSpotVos = planSpots.stream().map(e -> {
PlanSpotVo planSpotVo = new PlanSpotVo();
BeanUtil.copyProperties(e, planSpotVo);
return planSpotVo;
}).collect(Collectors.toList());
planLandSpotVo.setPlanSpotVos(planSpotVos);
}
return planLandSpotVo;
}
}

19
air/src/main/java/com/air/applets/service/impl/ViewLandServiceImpl.java

@ -0,0 +1,19 @@
package com.air.applets.service.impl;
import com.air.applets.entity.ViewLand;
import com.air.applets.mapper.ViewLandMapper;
import com.air.applets.service.ViewLandService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Service
@AllArgsConstructor
public class ViewLandServiceImpl extends ServiceImpl<ViewLandMapper, ViewLand> implements ViewLandService {
}

26
air/src/main/java/com/air/applets/vo/PlanLandSpotVo.java

@ -0,0 +1,26 @@
package com.air.applets.vo;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
import java.util.List;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Data
public class PlanLandSpotVo extends Model<PlanLandSpotVo> {
private static final long serialVersionUID = 1L;
@Valid
@ApiModelProperty("计划信息")
private PlanLandVo planLandVo;
@Valid
@ApiModelProperty("计划点位信息")
private List<PlanSpotVo> planSpotVos;
}

36
air/src/main/java/com/air/applets/vo/PlanLandVo.java

@ -0,0 +1,36 @@
package com.air.applets.vo;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Data
@ApiModel(value = "")
public class PlanLandVo extends Model<PlanLandVo> {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "计划名称")
private String planName;
@NotNull(message = "计划点位数量不能为空")
@ApiModelProperty(value = "计划点位数量",required = true)
private Integer planPointNum;
@NotNull(message = "计划里程不能为空")
@ApiModelProperty(value = "计划里程",required = true)
private BigDecimal planMileage;
@NotBlank(message = "计划耗时时间不能为空")
@ApiModelProperty(value = "计划耗时时间",required = true)
private String planTime;
}

32
air/src/main/java/com/air/applets/vo/PlanSpotVo.java

@ -0,0 +1,32 @@
package com.air.applets.vo;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author peihao
* @date 2021-11-25 15:47:04
*/
@Data
public class PlanSpotVo extends Model<PlanSpotVo> {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Integer id;
@ApiModelProperty(value = "计划id")
private Integer planId;
@NotBlank(message = "计划点位名称不能为空")
@ApiModelProperty(value = "计划点位名称",required = true)
private String spotName;
@NotNull(message = "点位顺序不能为空")
@ApiModelProperty(value = "点位顺序",required = true)
private Integer spotSort;
@NotBlank(message = "经纬度不能为空")
@ApiModelProperty(value = "经纬度",required = true)
private String spotLonLat;
}

16
air/src/main/resources/mapper/LandUserKeepMapper.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.air.applets.mapper.LandUserKeepMapper">
<select id="getLandUserKeepPage" resultType="com.air.applets.entity.ViewLand">
select vl.*,lu.id landUserkeepId from land_user_keep lu join view_land vl on vl.land_listed_id = lu.land_id
<where>
lu.user_id = #{param.userId}
<if test="param.landType != null">
and lu.land_type = #{param.landType}
</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save