Browse Source

1.0.0 修改拟挂牌地块发送接口

release/v1.0.0
peihao 4 years ago
parent
commit
c5c62241b3
  1. 44
      air/src/main/java/com/air/common/Constant.java
  2. 6
      air/src/main/java/com/air/land/controller/LandToListController.java
  3. 3
      air/src/main/java/com/air/land/entity/LandListed.java
  4. 5
      air/src/main/java/com/air/land/entity/LandToList.java
  5. 23
      air/src/main/java/com/air/land/service/LandToListSendService.java
  6. 203
      air/src/main/java/com/air/land/service/impl/LandToListSendServiceImpl.java
  7. 3
      air/src/main/java/com/air/land/vo/LandListedVo.java
  8. 3
      air/src/main/java/com/air/land/vo/LandToListVo.java

44
air/src/main/java/com/air/common/Constant.java

@ -10,61 +10,25 @@ public class Constant {
public static final String COMMON_STATUS_1000 = "1000";
/**
* 拟挂牌地块状态 公示
* 拟挂牌地块状态 发送
**/
public static final String LAND_TO_STATUS_1000 = "1000";
/**
* 拟挂牌地块状态 公示
* 拟挂牌地块状态 发送
**/
public static final String LAND_TO_STATUS_1100 = "1100";
/**
* 拟挂牌地块状态 未公示
* 已挂牌地块状态 待处理
**/
public static final String LAND_STATUS_1000 = "1000";
/**
* 拟挂牌地块状态 已公示
* 已挂牌地块状态 已处理
**/
public static final String LAND_STATUS_1100 = "1100";
/******************************百度推送*******************************/
/**
* 内部请求结果码自定义参数用于辨识调用结果成功
*/
public static final int FLAG_INNER_REQUEST_CODE_SUCCEED = 100;
/**
* 内部请求结果码自定义参数用于辨识调用结果失败
*/
public static final int FLAG_INNER_REQUEST_CODE_FAIL = 101;
/**
* 客户端平台操作系统-Android端
*/
public static final String CLIENT_TERMINAL_OS_ANDROID = "Android";
/**
* 客户端平台操作系统-iOS端
*/
public static final String CLIENT_TERMINAL_OS_IOS = "iOS";
/**
* 操作系统类型标志Android
*/
public static final int OS_TYPE_TAG_ANDROID = 3;
/**
* 操作系统类型标志iOS
*/
public static final int OS_TYPE_TAG_IOS = 4;
public static String androidApiKey = "wpVkUOv2nwnCT2yf2g2ctXnF";
public static String androidSecretKey = "GW9NmVfS2EcbmhCDFcBGeBi7v3hsSXzZ";
public static String iOSApiKey = "CoQl1PaCMdXgY17BlYTAcPBy";
public static String iOSSecretKey = "KpQxDwXHHSIMQh9ODuZ0mQ24DDK1GTDG";
/******************************百度推送*******************************/
}

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

@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.air.common.Constant;
import com.air.land.entity.LandToList;
import com.air.land.service.LandToListSendService;
import com.air.land.service.LandToListService;
import com.air.land.vo.LandListedPageVo;
import com.air.land.vo.LandToListPageVo;
@ -46,6 +47,9 @@ public class LandToListController {
@Autowired
private LandToListService landToListService;
@Autowired
private LandToListSendService landToListSendService;
@Value("${minio.url}")
private String minioUrl;
@ -166,7 +170,7 @@ public class LandToListController {
@ApiOperation(value = "发送到已挂牌", notes = "发送到已挂牌")
@PostMapping("/sendLandList")
public R<Boolean> sendLandList(@RequestParam String proposedseriaId) {
return landToListService.sendLandList(proposedseriaId);
return landToListSendService.landToListSendLandListed(proposedseriaId);
}
/**

3
air/src/main/java/com/air/land/entity/LandListed.java

@ -236,6 +236,9 @@ public class LandListed extends Model<LandListed> {
@ApiModelProperty(value = "航拍图片")
private String aerialPhoto;
@ApiModelProperty(value = "航拍链接")
private String aerialLink;
@ApiModelProperty(value = "拍地记录")
private String recordTaken;

5
air/src/main/java/com/air/land/entity/LandToList.java

@ -48,7 +48,7 @@ public class LandToList extends Model<LandToList> {
@ApiModelProperty(value = "是否挂牌")
private String isList;
@ApiModelProperty(value = "公告id,主键,以土地网爬取数据为准,不自增")
@ApiModelProperty(value = "公告id,公告编号")
private String annoId;
@ApiModelProperty(value = "地块编号")
@ -258,6 +258,9 @@ public class LandToList extends Model<LandToList> {
@ApiModelProperty(value = "航拍图片")
private String aerialPhoto;
@ApiModelProperty(value = "航拍链接")
private String aerialLink;
@ApiModelProperty(value = "拍地记录")
private String recordTaken;

23
air/src/main/java/com/air/land/service/LandToListSendService.java

@ -0,0 +1,23 @@
package com.air.land.service;
import com.cinderella.framework.common.core.util.R;
/**
* 拟挂牌地块发送至已挂牌服务
*
* @author peihao
* @date 2021-05-18 09:40:09
*/
public interface LandToListSendService {
/**
* 拟挂牌地块数据发送到已挂牌地块
* @author peihao
* @param proposedseriaId 拟挂牌数据id
* @date 2021/6/29
* @return
**/
R<Boolean> landToListSendLandListed(String proposedseriaId);
}

203
air/src/main/java/com/air/land/service/impl/LandToListSendServiceImpl.java

@ -0,0 +1,203 @@
package com.air.land.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.air.common.Constant;
import com.air.land.entity.*;
import com.air.land.service.*;
import com.cinderella.framework.common.core.util.R;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.air.utils.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* 拟挂牌地块发送至已挂牌服务
*
* @author peihao
* @date 2021-06-28
**/
@Slf4j
@Service
@AllArgsConstructor
public class LandToListSendServiceImpl implements LandToListSendService {
private LandToListService landToListService;
private LandListedService landListedService;
private LandListedLonLatService listedLonLatService;
private LandToListAttachmentService toListAttachmentService;
private LandToListLonLatService landToListLonLatService;
private LandAttachmentService attachmentService;
private LandToListConductEnterpriseService landToListConductEnterpriseService;
private LandListedConductEnterpriseService landListedConductEnterpriseService;
private LandToListConstructionPlanService landToListConstructionPlanService;
private LandListedConstructionPlanService landListedConstructionPlanService;
@Transactional(rollbackFor = Exception.class)
@Override
public R<Boolean> landToListSendLandListed(String proposedseriaId) {
LandToList landToList = landToListService.getById(proposedseriaId);
if (null == landToList) {
return R.failed("未查询到数据");
}
//判断已挂牌是否已经存在次公告id
LandListed land = landListedService.getOne(Wrappers.<LandListed>query().lambda().eq(LandListed::getAnnoId, landToList.getAnnoId()));
LandListed landListed = new LandListed();
BeanUtil.copyProperties(landToList, landListed);
landListed.setStatusCd(Constant.LAND_STATUS_1000);
if (land == null) {
//不存在 直接copy主表及从表数据
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(), "yyyyMMddHHmmssSSS"));
landListedService.save(landListed);
//copy经纬度
saveLandListedLonLat(proposedseriaId, landListed.getLandListedId());
//copy文件信息
saveLandListAttachment(proposedseriaId, landListed.getLandListedId());
//copy地块关联经营企业
saveLandListConductEnterprise(proposedseriaId, landListed.getLandListedId());
//copy地块关联建设规划
saveLandListConstructionPlan(proposedseriaId, landListed.getLandListedId());
return R.ok();
}
//存在 判断存在的数据状态是否为已处理
if (Constant.LAND_STATUS_1100.equals(land.getStatusCd())) {
//已处理,发送失败
return R.failed("数据已处理,发送失败");
}
//待处理,更新所有已挂牌数据
landListed.setLandListedId(land.getLandListedId());
landListedService.removeById(land);
landListedService.save(landListed);
//更新经纬度数据
listedLonLatService.remove(Wrappers.<LandListedLonLat>query().lambda().eq(LandListedLonLat::getLandListedId, landListed.getLandListedId()));
saveLandListedLonLat(proposedseriaId, landListed.getLandListedId());
//更新文件信息
attachmentService.remove(Wrappers.<LandAttachment>query().lambda().eq(LandAttachment::getLandListedId, landListed.getLandListedId()));
saveLandListAttachment(proposedseriaId, landListed.getLandListedId());
//更新地块关联经营企业
landListedConductEnterpriseService.remove(Wrappers.<LandListedConductEnterprise>query().lambda().eq(LandListedConductEnterprise::getLandListedId, landListed.getLandListedId()));
saveLandListConductEnterprise(proposedseriaId, landListed.getLandListedId());
//更新地块关联建设规划
landListedConstructionPlanService.remove(Wrappers.<LandListedConstructionPlan>query().lambda().eq(LandListedConstructionPlan::getLandListedId, landListed.getLandListedId()));
saveLandListConstructionPlan(proposedseriaId, landListed.getLandListedId());
return R.ok();
}
/**
* 保存地块经纬度
* @author peihao
* @param proposedseriaId 拟挂牌地块id
* @param landListedId 已挂牌地块id
* @date 2021/6/29
* @return
**/
@Transactional(rollbackFor = Exception.class)
public boolean saveLandListedLonLat(String proposedseriaId, String landListedId) {
List<LandToListLonLat> landToListLonLats = landToListLonLatService.list(Wrappers.<LandToListLonLat>query().lambda()
.eq(LandToListLonLat::getProposedseriaId, proposedseriaId));
if (CollectionUtil.isNotEmpty(landToListLonLats)) {
List<LandListedLonLat> landListedLonLats = new ArrayList<>(landToListLonLats.size());
landToListLonLats.forEach(landToListLonLat -> {
LandListedLonLat landListedLonLat = new LandListedLonLat();
BeanUtil.copyProperties(landToListLonLat, landListedLonLat);
landListedLonLat.setLandListedId(landListedId);
landListedLonLats.add(landListedLonLat);
});
return listedLonLatService.saveBatch(landListedLonLats);
}
return true;
}
/**
* 保存地块文件信息
* @author peihao
* @param proposedseriaId 拟挂牌地块id
* @param landListedId 已挂牌地块id
* @date 2021/6/29
* @return
**/
@Transactional(rollbackFor = Exception.class)
public boolean saveLandListAttachment(String proposedseriaId, String landListedId) {
List<LandToListAttachment> toListAttachments = toListAttachmentService.list(Wrappers.<LandToListAttachment>query().lambda()
.eq(LandToListAttachment::getProposedseriaId, proposedseriaId));
if (CollectionUtil.isNotEmpty(toListAttachments)) {
List<LandAttachment> landAttachments = new ArrayList<>(toListAttachments.size());
toListAttachments.forEach(landToListAttachment -> {
LandAttachment attachment = new LandAttachment();
BeanUtil.copyProperties(landToListAttachment, attachment);
attachment.setLandListedId(landListedId);
landAttachments.add(attachment);
});
return attachmentService.saveBatch(landAttachments);
}
return true;
}
/**
* 保存地块关联经营企业
* @author peihao
* @param proposedseriaId 拟挂牌地块id
* @param landListedId 已挂牌地块id
* @date 2021/6/29
* @return
**/
@Transactional(rollbackFor = Exception.class)
public boolean saveLandListConductEnterprise(String proposedseriaId, String landListedId) {
List<LandToListConductEnterprise> landToListConductEnterprises = landToListConductEnterpriseService.list(Wrappers.<LandToListConductEnterprise>query()
.lambda().eq(LandToListConductEnterprise::getProposedseriaId, proposedseriaId));
if (CollectionUtil.isNotEmpty(landToListConductEnterprises)) {
List<LandListedConductEnterprise> landListedConductEnterprises = new ArrayList<>(landToListConductEnterprises.size());
landToListConductEnterprises.forEach(landToListConductEnterprise -> {
LandListedConductEnterprise landListedConductEnterprise = new LandListedConductEnterprise();
BeanUtil.copyProperties(landToListConductEnterprise, landListedConductEnterprise);
landListedConductEnterprise.setLandListedId(landListedId);
landListedConductEnterprises.add(landListedConductEnterprise);
});
return landListedConductEnterpriseService.saveBatch(landListedConductEnterprises);
}
return true;
}
/**
* 保存地块关联建设规划
* @author peihao
* @param proposedseriaId 拟挂牌地块id
* @param landListedId 已挂牌地块id
* @date 2021/6/29
* @return
**/
@Transactional(rollbackFor = Exception.class)
public boolean saveLandListConstructionPlan(String proposedseriaId, String landListedId) {
List<LandToListConstructionPlan> landToListConstructionPlans = landToListConstructionPlanService.list(Wrappers.<LandToListConstructionPlan>query()
.lambda().eq(LandToListConstructionPlan::getProposedseriaId, proposedseriaId));
if (CollectionUtil.isNotEmpty(landToListConstructionPlans)) {
List<LandListedConstructionPlan> landListedConstructionPlans = new ArrayList<>(landToListConstructionPlans.size());
landToListConstructionPlans.forEach(landToListConstructionPlan -> {
LandListedConstructionPlan landListedConstructionPlan = new LandListedConstructionPlan();
BeanUtil.copyProperties(landToListConstructionPlan, landListedConstructionPlan);
landListedConstructionPlan.setLandListedId(landListedId);
landListedConstructionPlans.add(landListedConstructionPlan);
});
return landListedConstructionPlanService.saveBatch(landListedConstructionPlans);
}
return true;
}
}

3
air/src/main/java/com/air/land/vo/LandListedVo.java

@ -231,6 +231,9 @@ public class LandListedVo {
@ApiModelProperty(value = "航拍图片")
private String aerialPhoto;
@ApiModelProperty(value = "航拍链接")
private String aerialLink;
@ApiModelProperty(value = "拍地记录")
private String recordTaken;

3
air/src/main/java/com/air/land/vo/LandToListVo.java

@ -244,6 +244,9 @@ public class LandToListVo {
@ApiModelProperty(value = "航拍图片")
private String aerialPhoto;
@ApiModelProperty(value = "航拍链接")
private String aerialLink;
@ApiModelProperty(value = "拍地记录")
private String recordTaken;

Loading…
Cancel
Save