Browse Source

1.0.0 修复测试后的bug

feature/v1.1.0
peihao 4 years ago
parent
commit
bba65e4c0f
  1. 4
      air/src/main/java/com/air/applets/controller/LandListedController.java
  2. 2
      air/src/main/java/com/air/applets/controller/LandToListController.java
  3. 6
      air/src/main/java/com/air/common/service/impl/SysFileUploadServiceImpl.java
  4. 12
      air/src/main/java/com/air/land/controller/LandListedController.java
  5. 6
      air/src/main/java/com/air/land/controller/LandListedLonLatController.java
  6. 8
      air/src/main/java/com/air/land/controller/LandToListController.java
  7. 7
      air/src/main/java/com/air/land/controller/LandToListLonLatController.java
  8. 2
      air/src/main/java/com/air/land/entity/LandListed.java
  9. 2
      air/src/main/java/com/air/land/service/LandListedLonLatService.java
  10. 2
      air/src/main/java/com/air/land/service/LandToListLonLatService.java
  11. 68
      air/src/main/java/com/air/land/service/impl/LandListedLonLatServiceImpl.java
  12. 14
      air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java
  13. 67
      air/src/main/java/com/air/land/service/impl/LandToListLonLatServiceImpl.java
  14. 81
      air/src/main/java/com/air/land/service/impl/LandToListSendServiceImpl.java
  15. 6
      air/src/main/java/com/air/utils/FileUtil.java
  16. 2
      air/src/main/resources/mapper/LandListedLonLatMapper.xml
  17. 2
      air/src/main/resources/mapper/LandListedMapper.xml
  18. 2
      air/src/main/resources/mapper/LandToListLonLatMapper.xml

4
air/src/main/java/com/air/applets/controller/LandListedController.java

@ -96,11 +96,11 @@ public class LandListedController {
return R.failed("landListedId不正确");
}
LocalDate localDate = LocalDate.now();
if (landListed.getDeal() == 1){
if (StrUtil.equals(landListed.getDeal(),"1")){
landListed.setTransactionStatus(LandListStatusEnum.DEAL_DONE.getCode());
}else if (localDate.isBefore(landListed.getAuctionDate())){
landListed.setTransactionStatus(LandListStatusEnum.LISTED.getCode());
}else if (!localDate.isBefore(landListed.getAuctionDate()) && landListed.getDeal() == 0){
}else if (!localDate.isBefore(landListed.getAuctionDate()) && StrUtil.equals(landListed.getDeal(),"0")){
landListed.setTransactionStatus(LandListStatusEnum.PASS_BY.getCode());
}
return R.ok(landListed);

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

@ -72,7 +72,7 @@ public class LandToListController {
.like(StringUtils.isNotEmpty(pageVo.getBigGroup()), LandToList::getBigGroup, pageVo.getBigGroup())
//小组团
.like(StringUtils.isNotEmpty(pageVo.getSmallGroup()), LandToList::getSmallGroup, pageVo.getSmallGroup())
.orderByDesc(LandToList::getUpdateDate));
.orderByDesc(LandToList::getProposedseriaId));
return R.ok(result, "查询成功");
}

6
air/src/main/java/com/air/common/service/impl/SysFileUploadServiceImpl.java

@ -10,6 +10,7 @@ import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -26,6 +27,9 @@ public class SysFileUploadServiceImpl implements SysFileUploadService {
@Autowired
private MinioTemplate minioTemplate;
@Value("${minio.down-url}")
private String minioDownUrl;
@SneakyThrows
@Override
public R upload(MultipartFile file, String bucketName) {
@ -39,7 +43,7 @@ public class SysFileUploadServiceImpl implements SysFileUploadService {
}
String objectURL = "/" + bucketName + "/" + minioFileName;
String previewUrl = minioTemplate.getObjectURL(bucketName, minioFileName, 999);
String previewUrl = minioDownUrl+objectURL;
SysFileUploadVo sysFileUploadVo = new SysFileUploadVo();
sysFileUploadVo.setFileName(file.getOriginalFilename());
sysFileUploadVo.setPath(objectURL);

12
air/src/main/java/com/air/land/controller/LandListedController.java

@ -51,8 +51,8 @@ public class LandListedController {
@Autowired
private LandListedService landListedService;
@Value("${minio.url}")
private String minioUrl;
@Value("${minio.down-url}")
private String minioDownUrl;
@Value("${template.land_listed}")
private String landListedUrl;
@ -109,7 +109,7 @@ public class LandListedController {
.eq(ObjectUtil.isNotEmpty(pageVo.getTradingEnterprises()), LandListed::getTradingEnterprises, pageVo.getTradingEnterprises())
//经营企业
.eq(StringUtils.isNotEmpty(pageVo.getConductEnterprise()), LandListed::getConductEnterprise, pageVo.getConductEnterprise())
.orderByDesc(LandListed::getUpdateDate));
.orderByDesc(LandListed::getLandListedId));
return R.ok(result, "查询成功");
}
@ -138,7 +138,7 @@ public class LandListedController {
BeanUtil.copyProperties(landListedVo, landListed);
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(),"yyyyMMdd",landListedService.selectId()));
if (landListed.getDeal() == null){
landListed.setDeal(0);
landListed.setDeal("0");
}
landListedService.save(landListed);
return R.ok(landListed.getLandListedId());
@ -156,7 +156,7 @@ public class LandListedController {
LandListed landListed = new LandListed();
BeanUtil.copyProperties(landListedVo, landListed);
if (landListed.getDeal() == null){
landListed.setDeal(0);
landListed.setDeal("0");
}
return R.ok(landListedService.updateById(landListed));
}
@ -229,7 +229,7 @@ public class LandListedController {
@ApiOperation(value = "下载已挂牌地块模板", notes = "下载已挂牌地块模板")
@GetMapping("/getTemplate")
public R<String> getLandListedTemplate() {
return R.ok(minioUrl+landListedUrl);
return R.ok(minioDownUrl+landListedUrl);
}
}

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

@ -51,7 +51,7 @@ public class LandListedLonLatController {
public R<List<LandListedLonLat>> getLandListedLonLatPage(@PathVariable String landListedId) {
List<LandListedLonLat> list = landListedLonLatService.list(Wrappers.<LandListedLonLat>query().lambda()
.eq(LandListedLonLat::getLandListedId, landListedId)
.orderByDesc(LandListedLonLat::getUpdateDate));
.orderByAsc(LandListedLonLat::getCreateDate));
return R.ok(list, "查询成功");
}
@ -118,8 +118,8 @@ public class LandListedLonLatController {
**/
@ApiOperation(value = "导入已挂牌地块经纬度数据", notes = "导入已挂牌地块经纬度数据")
@PostMapping(value = "/importLandListLatExcel")
public R importLandListLatExcel(@RequestParam(value="uploadFile") MultipartFile file){
return R.ok(landListedLonLatService.importLandListedLonLatExcel(file));
public R importLandListLatExcel(@RequestParam(value="uploadFile") MultipartFile file,String landListedId){
return R.ok(landListedLonLatService.importLandListedLonLatExcel(file,landListedId));
}
/**

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

@ -50,8 +50,8 @@ public class LandToListController {
@Autowired
private LandToListSendService landToListSendService;
@Value("${minio.url}")
private String minioUrl;
@Value("${minio.down-url}")
private String minioDownUrl;
@Value("${template.land_to_listed}")
private String landToListedUrl;
@ -95,7 +95,7 @@ public class LandToListController {
.like(StringUtils.isNotEmpty(pageVo.getBigGroup()), LandToList::getBigGroup, pageVo.getBigGroup())
//小组团
.like(StringUtils.isNotEmpty(pageVo.getSmallGroup()), LandToList::getSmallGroup, pageVo.getSmallGroup())
.orderByDesc(LandToList::getUpdateDate));
.orderByDesc(LandToList::getProposedseriaId));
return R.ok(result, "查询成功");
}
@ -209,6 +209,6 @@ public class LandToListController {
@ApiOperation(value = "下载已挂牌地块模板", notes = "下载已挂牌地块模板")
@GetMapping("/getTemplate")
public R<String> getLandListedTemplate() {
return R.ok(minioUrl+landToListedUrl);
return R.ok(minioDownUrl+landToListedUrl);
}
}

7
air/src/main/java/com/air/land/controller/LandToListLonLatController.java

@ -45,7 +45,8 @@ public class LandToListLonLatController {
@GetMapping("/list/{proposedseriaId}")
public R<List<LandToListLonLat>> getLandListedLonLatPage(@PathVariable String proposedseriaId) {
List<LandToListLonLat> list = landToListLonLatService.list(Wrappers.<LandToListLonLat>query().lambda()
.eq(LandToListLonLat::getProposedseriaId, proposedseriaId));
.eq(LandToListLonLat::getProposedseriaId, proposedseriaId)
.orderByAsc(LandToListLonLat::getCreateDate));
return R.ok(list, "查询成功");
}
@ -121,8 +122,8 @@ public class LandToListLonLatController {
**/
@ApiOperation(value = "导入拟挂牌地块经纬度数据", notes = "导入拟挂牌地块经纬度数据")
@PostMapping(value = "/importLandToListLatExcel")
public R importLandToListLatExcel(@RequestParam(value = "uploadFile") MultipartFile file) {
return R.ok(landToListLonLatService.importLandToListedLonLatExcel(file));
public R importLandToListLatExcel(@RequestParam(value = "uploadFile") MultipartFile file,@RequestParam String proposedseriaId) {
return R.ok(landToListLonLatService.importLandToListedLonLatExcel(file,proposedseriaId));
}
/**

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

@ -125,7 +125,7 @@ public class LandListed extends Model<LandListed> {
@ApiModelProperty(value = "经纬度(百度BD09)")
private String lonLatBd;
@ApiModelProperty(value = "是否成交(0:否,1:是)")
private Integer deal;
private String deal;
@ApiModelProperty(value = "出让方式(拍卖,挂牌,协议,其他)")
private String transferMode;
@ApiModelProperty(value = "受让单位")

2
air/src/main/java/com/air/land/service/LandListedLonLatService.java

@ -14,7 +14,7 @@ import java.util.List;
*/
public interface LandListedLonLatService extends IService<LandListedLonLat> {
boolean importLandListedLonLatExcel(MultipartFile file);
boolean importLandListedLonLatExcel(MultipartFile file,String landListedId);
List<LandListedLonLat> getLandListedLonLat(String landListedId);

2
air/src/main/java/com/air/land/service/LandToListLonLatService.java

@ -14,7 +14,7 @@ import java.util.List;
*/
public interface LandToListLonLatService extends IService<LandToListLonLat> {
boolean importLandToListedLonLatExcel(MultipartFile file);
boolean importLandToListedLonLatExcel(MultipartFile file,String proposedseriaId);
List<LandToListLonLat> getLandToListLonLat(String proposedseriaId);
}

68
air/src/main/java/com/air/land/service/impl/LandListedLonLatServiceImpl.java

@ -1,9 +1,11 @@
package com.air.land.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.air.land.entity.LandListed;
import com.air.land.entity.LandListedLonLat;
import com.air.land.entity.LandToListLonLat;
import com.air.land.mapper.LandListedLonLatMapper;
import com.air.land.service.LandListedLonLatService;
import com.air.utils.DateUtil;
@ -28,31 +30,18 @@ import java.util.List;
public class LandListedLonLatServiceImpl extends ServiceImpl<LandListedLonLatMapper, LandListedLonLat> implements LandListedLonLatService {
@Override
public boolean importLandListedLonLatExcel(MultipartFile file) {
List<List<String>> dataList = new ArrayList<>();
public boolean importLandListedLonLatExcel(MultipartFile file,String landListedId) {
List<List<String>> dataList;
try{
dataList = ExcelUtil.importExcel(file,0,1,0);
}catch (IOException e){
throw new BusinessException("导入已挂牌经纬度数据出错");
}
List<LandListedLonLat> list = new ArrayList<>(dataList.size());
dataList.forEach(data ->{
try {
LandListedLonLat landListedLonLat = listToEntity(data);
if(ObjectUtil.isNotEmpty(landListedLonLat)){
if(StrUtil.isNotEmpty(landListedLonLat.getLandLonLat())){
String[] split = landListedLonLat.getLandLonLat().split(";");
landListedLonLat.setLandLonLat(new StringBuffer(landListedLonLat.getLandLonLat()).append(";").append(split[0]).toString());
}
landListedLonLat.setGeom(WgsUtil.wgs84_To_Gcj02(landListedLonLat.getLandLonLat()));
list.add(landListedLonLat);
}
}catch (Exception e){
e.printStackTrace();
throw new BusinessException("导入已挂牌经纬度数据转换出错");
}
});
return this.saveBatch(list);
if (CollectionUtil.isNotEmpty(dataList)){
List<LandListedLonLat> list = listToEntity(dataList,landListedId);
return this.saveBatch(list);
}
return false;
}
@Override
@ -60,19 +49,32 @@ public class LandListedLonLatServiceImpl extends ServiceImpl<LandListedLonLatMap
return baseMapper.getLandListedLonLat(landListedId);
}
private LandListedLonLat listToEntity(List<String> data) {
LandListedLonLat landListedLonLat = new LandListedLonLat();
if (StrUtil.isNotEmpty(data.get(0))) {
landListedLonLat.setLandListedId(data.get(0));
landListedLonLat.setAnnoId(data.get(1));
landListedLonLat.setName(data.get(2));
landListedLonLat.setLandLonLat(data.get(3));
landListedLonLat.setLineWidth(data.get(4));
landListedLonLat.setLineColor(data.get(5));
landListedLonLat.setLineOpaqueness(data.get(6));
landListedLonLat.setFillColor(data.get(7));
landListedLonLat.setFillOpaqueness(data.get(8));
private List<LandListedLonLat> listToEntity(List<List<String>> dataList,String landListedId) {
List<LandListedLonLat> list = new ArrayList<>();
for(int i = 0;i<dataList.size();i++){
List<String> data = dataList.get(i);
LandListedLonLat landListedLonLat = new LandListedLonLat();
landListedLonLat.setLandListedId(landListedId);
landListedLonLat.setLandCode(Integer.valueOf(i+1).toString());
landListedLonLat.setLandLonLat(data.get(0));
landListedLonLat.setLineWidth(data.get(1));
landListedLonLat.setLineColor(data.get(2));
landListedLonLat.setLineOpaqueness(data.get(3));
landListedLonLat.setFillColor(data.get(4));
landListedLonLat.setFillOpaqueness(data.get(5));
try {
String landLonLat = landListedLonLat.getLandLonLat();
if(StrUtil.isNotEmpty(landLonLat)){
String[] split = landLonLat.split(";");
landListedLonLat.setLandLonLat(new StringBuffer(landLonLat).append(";").append(split[0]).toString());
}
landListedLonLat.setGeom(WgsUtil.wgs84_To_Gcj02(landListedLonLat.getLandLonLat()));
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException("导入拟挂牌经纬度数据转换出错");
}
list.add(landListedLonLat);
}
return landListedLonLat;
return list;
}
}

14
air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java

@ -221,9 +221,9 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
landListed.setLonLatBd(getCellStrValue(sheetRow.getCell(45)));
//成交信息
if ("是".equals(getCellStrValue(sheetRow.getCell(46)))){
landListed.setDeal(1);
landListed.setDeal("1");
}else {
landListed.setDeal(0);
landListed.setDeal("0");
}
landListed.setTransferMode(getCellStrValue(sheetRow.getCell(47)));
landListed.setAssignee(getCellStrValue(sheetRow.getCell(48)));
@ -233,11 +233,11 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
landListed.setPremiumRate(numberFormat(getCellValue(sheetRow.getCell(52)),2));
String cellStrValue = getCellStrValue(sheetRow.getCell(53));
double commercialSelfRatio = StrUtil.isNotEmpty(cellStrValue)?Double.valueOf(cellStrValue)*100 : 0;
landListed.setCommercialSelfRatio(new BigDecimal(commercialSelfRatio).setScale(2,BigDecimal.ROUND_HALF_UP));
BigDecimal year = numberFormat(getCellStrValue(sheetRow.getCell(54)),2);
landListed.setCommercialSelfRatio(new BigDecimal(commercialSelfRatio).setScale(0,BigDecimal.ROUND_HALF_UP));
BigDecimal year = numberFormat(getCellStrValue(sheetRow.getCell(54)),0);
landListed.setCommercialSelfYear(year == null? null:year.intValue());
landListed.setHomeSelfRatio(numberFormat(getCellStrValue(sheetRow.getCell(55)),0));
year = numberFormat(getCellStrValue(sheetRow.getCell(56)),2);
year = numberFormat(getCellStrValue(sheetRow.getCell(56)),0);
landListed.setHomeSelfYear(year == null? null:year.intValue());
landListed.setPercentUnpaid(numberFormat(getCellStrValue(sheetRow.getCell(57)),2));
landListed.setTalenApartmentArea(numberFormat(getCellStrValue(sheetRow.getCell(58)),2));
@ -325,7 +325,7 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
list.add(data.getOvePosition());
list.add(data.getLonLatBd());
//成交信息
list.add(data.getDeal() == 1?"是":"否");
list.add(data.getDeal().equals("1")?"是":"否");
list.add(data.getTransferMode());
list.add(data.getAssignee());
list.add(data.getLandEnterpriseShort());
@ -333,7 +333,7 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
list.add(stringFormat(data.getDealFloorPrice(),0));
list.add(strRateFormat(data.getPremiumRate()));
list.add((data.getCommercialSelfRatio() == null ?
0d:data.getCommercialSelfRatio().setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue())+"%");
0d:data.getCommercialSelfRatio().setScale(0,BigDecimal.ROUND_HALF_UP).doubleValue())+"%");
list.add(data.getCommercialSelfYear() == null?"":data.getCommercialSelfYear().toString());
list.add(strRateFormat(data.getHomeSelfRatio()));
list.add(data.getHomeSelfYear() == null?"":data.getHomeSelfYear().toString());

67
air/src/main/java/com/air/land/service/impl/LandToListLonLatServiceImpl.java

@ -1,5 +1,6 @@
package com.air.land.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.air.land.entity.LandToListLonLat;
@ -26,32 +27,18 @@ import java.util.List;
public class LandToListLonLatServiceImpl extends ServiceImpl<LandToListLonLatMapper, LandToListLonLat> implements LandToListLonLatService {
@Override
public boolean importLandToListedLonLatExcel(MultipartFile file) {
List<List<String>> dataList = new ArrayList<>();
public boolean importLandToListedLonLatExcel(MultipartFile file,String proposedseriaId) {
List<List<String>> dataList;
try {
dataList = ExcelUtil.importExcel(file, 0, 1, 0);
} catch (IOException e) {
throw new BusinessException("导入拟挂牌经纬度数据出错");
}
List<LandToListLonLat> list = new ArrayList<>(dataList.size());
dataList.forEach(data -> {
try {
LandToListLonLat landListedLonLat = listToEntity(data);
if (ObjectUtil.isNotEmpty(landListedLonLat)) {
String landLonLat = landListedLonLat.getLandLonLat();
if(StrUtil.isNotEmpty(landLonLat)){
String[] split = landLonLat.split(";");
landListedLonLat.setLandLonLat(new StringBuffer(landLonLat).append(";").append(split[0]).toString());
}
landListedLonLat.setGeom(WgsUtil.wgs84_To_Gcj02(landListedLonLat.getLandLonLat()));
list.add(landListedLonLat);
}
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException("导入拟挂牌经纬度数据转换出错");
}
});
return this.saveBatch(list);
if (CollectionUtil.isNotEmpty(dataList)){
List<LandToListLonLat> list = listToEntity(dataList,proposedseriaId);
return this.saveBatch(list);
}
return false;
}
@Override
@ -59,18 +46,32 @@ public class LandToListLonLatServiceImpl extends ServiceImpl<LandToListLonLatMap
return baseMapper.getLandToListLonLat(proposedseriaId);
}
private LandToListLonLat listToEntity(List<String> data) {
LandToListLonLat landToListLonLat = new LandToListLonLat();
if (StrUtil.isNotEmpty(data.get(0))) {
landToListLonLat.setProposedseriaId(data.get(0));
landToListLonLat.setName(data.get(1));
landToListLonLat.setLandLonLat(data.get(2));
landToListLonLat.setLineWidth(data.get(3));
landToListLonLat.setLineColor(data.get(4));
landToListLonLat.setLineOpaqueness(data.get(5));
landToListLonLat.setFillColor(data.get(6));
landToListLonLat.setFillOpaqueness(data.get(7));
private List<LandToListLonLat> listToEntity(List<List<String>> dataList,String proposedseriaId) {
List<LandToListLonLat> list = new ArrayList<>();
for(int i = 0;i<dataList.size();i++){
List<String> data = dataList.get(i);
LandToListLonLat landToListLonLat = new LandToListLonLat();
landToListLonLat.setProposedseriaId(proposedseriaId);
landToListLonLat.setLandCode(Integer.valueOf(i+1).toString());
landToListLonLat.setLandLonLat(data.get(0));
landToListLonLat.setLineWidth(data.get(1));
landToListLonLat.setLineColor(data.get(2));
landToListLonLat.setLineOpaqueness(data.get(3));
landToListLonLat.setFillColor(data.get(4));
landToListLonLat.setFillOpaqueness(data.get(5));
try {
String landLonLat = landToListLonLat.getLandLonLat();
if(StrUtil.isNotEmpty(landLonLat)){
String[] split = landLonLat.split(";");
landToListLonLat.setLandLonLat(new StringBuffer(landLonLat).append(";").append(split[0]).toString());
}
landToListLonLat.setGeom(WgsUtil.wgs84_To_Gcj02(landToListLonLat.getLandLonLat()));
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException("导入拟挂牌经纬度数据转换出错");
}
list.add(landToListLonLat);
}
return landToListLonLat;
return list;
}
}

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

@ -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);

6
air/src/main/java/com/air/utils/FileUtil.java

@ -29,8 +29,8 @@ public class FileUtil {
@Autowired
private MinioTemplate minioTemplate;
@Value("${minio.url}")
private String minioUrl;
@Value("${minio.down-url}")
private String minioDownUrl;
public String downloadFile(String bucketName, String fileName, String remoteFilePath, int time) {
URL urlfile = null;
@ -73,7 +73,7 @@ public class FileUtil {
if (StringUtils.isEmpty(innerPath)) {
return null;
}
return minioUrl + innerPath;
return minioDownUrl + innerPath;
}
public String getInnerPath(String url) {

2
air/src/main/resources/mapper/LandListedLonLatMapper.xml

@ -41,6 +41,6 @@
land_listed_lon_lat ll
WHERE
ll.land_listed_id = #{landListedId}
ORDER BY ll.create_date desc
ORDER BY ll.create_date asc
</select>
</mapper>

2
air/src/main/resources/mapper/LandListedMapper.xml

@ -39,7 +39,7 @@
and small_group = #{param.smallGroup}
</if>
</where>
order by update_date
order by anno_id desc
</select>

2
air/src/main/resources/mapper/LandToListLonLatMapper.xml

@ -40,6 +40,6 @@
land_to_list_lon_lat ll
WHERE
ll.proposedseria_id = #{proposedseriaId}
ORDER BY ll.create_date desc
ORDER BY ll.create_date asc
</select>
</mapper>

Loading…
Cancel
Save