|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import com.air.common.Constant; |
|
|
|
|
import com.air.land.entity.*; |
|
|
|
|
import com.air.land.service.*; |
|
|
|
|
import com.air.utils.WgsUtil; |
|
|
|
|
import com.cinderella.framework.common.core.util.R; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -57,47 +58,59 @@ public class LandToListSendServiceImpl implements LandToListSendService {
|
|
|
|
|
} |
|
|
|
|
//判断已挂牌是否已经存在次公告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(), "yyyyMMdd",landListedService.selectId())); |
|
|
|
|
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("数据已处理,发送失败"); |
|
|
|
|
if (land == null){ |
|
|
|
|
return R.failed("发送失败,公告序号不存在!"); |
|
|
|
|
} |
|
|
|
|
//待处理,更新所有已挂牌数据
|
|
|
|
|
landListed.setLandListedId(land.getLandListedId()); |
|
|
|
|
landListedService.removeById(land); |
|
|
|
|
landListedService.save(landListed); |
|
|
|
|
//更新已挂牌数据
|
|
|
|
|
landListedService.updateById(convertLandListed(land,landToList)); |
|
|
|
|
//更新经纬度数据
|
|
|
|
|
listedLonLatService.remove(Wrappers.<LandListedLonLat>query().lambda().eq(LandListedLonLat::getLandListedId, landListed.getLandListedId())); |
|
|
|
|
saveLandListedLonLat(proposedseriaId, landListed.getLandListedId()); |
|
|
|
|
listedLonLatService.remove(Wrappers.<LandListedLonLat>query().lambda().eq(LandListedLonLat::getLandListedId, land.getLandListedId())); |
|
|
|
|
saveLandListedLonLat(proposedseriaId, land.getLandListedId()); |
|
|
|
|
//更新文件信息
|
|
|
|
|
attachmentService.remove(Wrappers.<LandAttachment>query().lambda().eq(LandAttachment::getLandListedId, landListed.getLandListedId())); |
|
|
|
|
saveLandListAttachment(proposedseriaId, landListed.getLandListedId()); |
|
|
|
|
attachmentService.remove(Wrappers.<LandAttachment>query().lambda().eq(LandAttachment::getLandListedId, land.getLandListedId())); |
|
|
|
|
saveLandListAttachment(proposedseriaId, land.getLandListedId()); |
|
|
|
|
//更新地块关联经营企业
|
|
|
|
|
landListedConductEnterpriseService.remove(Wrappers.<LandListedConductEnterprise>query().lambda().eq(LandListedConductEnterprise::getLandListedId, landListed.getLandListedId())); |
|
|
|
|
saveLandListConductEnterprise(proposedseriaId, landListed.getLandListedId()); |
|
|
|
|
landListedConductEnterpriseService.remove(Wrappers.<LandListedConductEnterprise>query().lambda().eq(LandListedConductEnterprise::getLandListedId, land.getLandListedId())); |
|
|
|
|
saveLandListConductEnterprise(proposedseriaId, land.getLandListedId()); |
|
|
|
|
//更新地块关联建设规划
|
|
|
|
|
landListedConstructionPlanService.remove(Wrappers.<LandListedConstructionPlan>query().lambda().eq(LandListedConstructionPlan::getLandListedId, landListed.getLandListedId())); |
|
|
|
|
saveLandListConstructionPlan(proposedseriaId, landListed.getLandListedId()); |
|
|
|
|
landListedConstructionPlanService.remove(Wrappers.<LandListedConstructionPlan>query().lambda().eq(LandListedConstructionPlan::getLandListedId, land.getLandListedId())); |
|
|
|
|
saveLandListConstructionPlan(proposedseriaId, land.getLandListedId()); |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 拟挂牌地块转换已挂牌地块 |
|
|
|
|
* @author peihao |
|
|
|
|
* @param land 已挂牌地块 |
|
|
|
|
* @param landToList 拟挂牌地块 |
|
|
|
|
* @date 2021/8/30 |
|
|
|
|
* @return |
|
|
|
|
**/ |
|
|
|
|
public LandListed convertLandListed(LandListed land,LandToList landToList){ |
|
|
|
|
LandListed landListed = new LandListed(); |
|
|
|
|
BeanUtil.copyProperties(landToList,landListed); |
|
|
|
|
landListed.setLandListedId(land.getLandListedId()); |
|
|
|
|
landListed.setAnnoId(land.getAnnoId()); |
|
|
|
|
landListed.setLandCode(land.getLandCode()); |
|
|
|
|
landListed.setLandPosition(land.getLandPosition()); |
|
|
|
|
landListed.setLandUsage(land.getLandUsage()); |
|
|
|
|
landListed.setLandTransferSquare(land.getLandTransferSquare()); |
|
|
|
|
landListed.setLandTransferMu(land.getLandTransferMu()); |
|
|
|
|
landListed.setTotalConsArea(land.getTotalConsArea()); |
|
|
|
|
landListed.setPlotRatio(land.getPlotRatio()); |
|
|
|
|
landListed.setBuildingDensity(land.getBuildingDensity()); |
|
|
|
|
landListed.setHeighPermitted(land.getHeighPermitted()); |
|
|
|
|
landListed.setRemiseYears(land.getRemiseYears()); |
|
|
|
|
landListed.setTransferPrice(land.getTransferPrice()); |
|
|
|
|
landListed.setStartingFloorPrice(land.getStartingFloorPrice()); |
|
|
|
|
landListed.setBidMargin(land.getBidMargin()); |
|
|
|
|
landListed.setBizRemark(land.getBizRemark()); |
|
|
|
|
landListed.setAnnoDate(land.getAnnoDate()); |
|
|
|
|
landListed.setAnnoEndDate(land.getAnnoEndDate()); |
|
|
|
|
landListed.setAuctionDate(land.getAuctionDate()); |
|
|
|
|
landListed.setLicensedArea(land.getLicensedArea()); |
|
|
|
|
return landListed; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存地块经纬度 |
|
|
|
@ -117,6 +130,8 @@ public class LandToListSendServiceImpl implements LandToListSendService {
|
|
|
|
|
LandListedLonLat landListedLonLat = new LandListedLonLat(); |
|
|
|
|
BeanUtil.copyProperties(landToListLonLat, landListedLonLat); |
|
|
|
|
landListedLonLat.setLandListedId(landListedId); |
|
|
|
|
//转换经纬度标准格式
|
|
|
|
|
landListedLonLat.setGeom(WgsUtil.wgs84_To_Gcj02(landToListLonLat.getLandLonLat())); |
|
|
|
|
landListedLonLats.add(landListedLonLat); |
|
|
|
|
}); |
|
|
|
|
return listedLonLatService.saveBatch(landListedLonLats); |
|
|
|
|