Commit 69ffd7cf authored by zhouxudong's avatar zhouxudong

更新代码

parent 903a1f84
......@@ -42,4 +42,6 @@ public class CarrierPageDto {
//数据库映射字段
@ApiModelProperty(hidden = true)
private List<String> carrierType;
private Integer developmentId;
}
......@@ -27,6 +27,7 @@ import com.postcard.service.util.DataUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -42,6 +43,10 @@ import java.util.*;
@Slf4j
public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, CarrierInfo>
implements CarrierInfoService {
@Value("${development.id}")
private Integer developMentId;
@Autowired private SysDictDataService sysDictDataService;
@Autowired private ParkInfoService parkInfoService;
// 轮播图
......@@ -55,14 +60,92 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, Carri
*/
@Override
public Page<CarrierPageVo> pageList(ParamEntity<CarrierPageDto> paramEntity) {
return null;
CarrierPageDto carrierPageDto = paramEntity.getCondition();
String carrierArea = carrierPageDto.getCarrierArea();
if (StringUtils.isNotBlank(carrierArea)) {
String[] split = carrierArea.split("-");
carrierPageDto.setLowCarrierArea(Double.valueOf(split[0]));
if (split.length > 1) {
carrierPageDto.setHighCarrierArea(Double.valueOf(split[1]));
}
}
// 映射字段
String carrierType = carrierPageDto.getTypeInfo();
if (StringUtils.isNotBlank(carrierType)) {
Map<String, SysDictDataEntity> dictDataEntityMap =
this.sysDictDataService.listByCode(DictCodeEnum.CARRIER_TYPE.getCode());
SysDictDataEntity sysDictDataEntity = dictDataEntityMap.get(carrierType);
if (ObjectUtils.isNotEmpty(sysDictDataEntity)) {
String detail = sysDictDataEntity.getDetail();
carrierPageDto.setCarrierType(Arrays.asList(detail.split(",")));
}
}
Page page = CommonUtil.getPageFromEntity(paramEntity);
carrierPageDto.setDevelopmentId(developMentId);
Page<CarrierPageVo> result = this.baseMapper.pageList(page, carrierPageDto);
List<CarrierPageVo> records = result.getRecords();
if (!CollectionUtils.isEmpty(records)) {
records.forEach(
data -> {
StringJoiner sj = new StringJoiner("");
String provinceName = data.getProvinceName();
String cityName = data.getCityName();
Double area = data.getArea();
String name =
sj.add(DataUtil.dealProvince(provinceName, cityName))
.add(data.getRegionName())
.add(data.getParkName())
.add(ObjectUtils.isEmpty(area) ? "" : NumberUtil.roundStr(area, 0) + "㎡")
.add(data.getType())
.toString();
data.setName(name);
});
}
return result;
}
/**
* @description: 详情
* @date: 2023/12/16 15:05
* @param: [id]
* @return: com.postcard.service.moudle.carrier.vo.CarrierDetailVo
*/
@Override
public CarrierDetailVo detail(Integer id) {
return null;
CarrierInfo carrierInfo = this.getById(id);
CarrierDetailVo carrierDetailVo = BeanUtil.toBean(carrierInfo, CarrierDetailVo.class);
// 轮播图
ResourceVo allResource =
sysCarouselInfoService.getAllResource(CarouselTypeEnum.CARRIER.getType(), id);
// 轮播图
carrierDetailVo.setImgUrls(allResource.getImgUrlList());
// 园区信息
Integer parkId = carrierInfo.getParkId();
if (ObjectUtils.isNotEmpty(parkId)) {
ParkInfo parkInfo = parkInfoService.getById(parkId);
Optional.ofNullable(parkInfo)
.ifPresent(
data -> {
// ---产业园信息--
CarrierParkVo carrierParkVo = BeanUtil.copyProperties(data, CarrierParkVo.class);
carrierDetailVo.setCarrierParkVo(carrierParkVo);
});
}
// 设置名称
if (carrierDetailVo.getCarrierParkVo() != null) {
CarrierParkVo carrierParkVo = carrierDetailVo.getCarrierParkVo();
StringJoiner sj = new StringJoiner("");
String provinceName = carrierParkVo.getProvinceName();
String cityName = carrierParkVo.getCityName();
Double area = carrierDetailVo.getArea();
String name =
sj.add(DataUtil.dealProvince(provinceName, cityName))
.add(carrierParkVo.getRegionName())
.add(carrierParkVo.getName())
.add(ObjectUtils.isEmpty(area) ? "" : NumberUtil.roundStr(area, 0) + "㎡")
.add(carrierDetailVo.getType())
.toString();
carrierDetailVo.setName(name);
}
return carrierDetailVo;
}
}
......@@ -67,15 +67,9 @@ public class CarrierDetailVo {
@ApiModelProperty(value = "轮播图")
private List<String> imgUrls;
/** 联系人(区域负责人姓名) 园区的联系人 */
@ApiModelProperty(value = "联系人(区域负责人姓名)")
private String contactPerson;
@ApiModelProperty(value = "联系人电话")
private String phone;
@ApiModelProperty(value = "产业园信息")
private ParkDetailVo carrierParkVo;
private CarrierParkVo carrierParkVo;
}
......@@ -40,4 +40,32 @@ public class CarrierPageVo {
@ApiModelProperty(value = "纬度(坐标系gcj02)")
private BigDecimal latitude;
//园区名称
@ApiModelProperty(hidden=true)
private String parkName;
/** 省份code */
@ApiModelProperty(value = "省份code")
private String provinceCode;
/** 省份 */
@ApiModelProperty(value = "省份")
private String provinceName;
/** 城市code */
@ApiModelProperty(value = "城市code")
private String cityCode;
/** 城市 */
@ApiModelProperty(value = "城市")
private String cityName;
/** 区/县code */
@ApiModelProperty(value = "区/县code")
private String regionCode;
/** 区/县 */
@ApiModelProperty(value = "区/县")
private String regionName;
}
......@@ -10,9 +10,8 @@ import java.util.List;
/**
* @Author:zhouxudong
* @version: 1.0
* @Date: 2023/11/23 15:23
* @Description:
*
* @version: 1.0 @Date: 2023/11/23 15:23 @Description:
*/
@Getter
@Setter
......@@ -22,86 +21,54 @@ import java.util.List;
@ApiModel(value = "载体详情中的产业园")
public class CarrierParkVo {
@TableId
@ApiModelProperty(value = "主键id")
private Integer id;
@TableId
@ApiModelProperty(value = "主键id")
private Integer id;
@ApiModelProperty(value = "产业园名称")
private String name;
@ApiModelProperty(value = "产业园名称")
private String name;
/** 省份code */
@ApiModelProperty(value = "省份code")
private String provinceCode;
/** 省份code */
@ApiModelProperty(value = "省份code")
private String provinceCode;
/** 省份 */
@ApiModelProperty(value = "省份")
private String provinceName;
/** 省份 */
@ApiModelProperty(value = "省份")
private String provinceName;
/** 城市code */
@ApiModelProperty(value = "城市code")
private String cityCode;
/** 城市code */
@ApiModelProperty(value = "城市code")
private String cityCode;
/** 城市 */
@ApiModelProperty(value = "城市")
private String cityName;
/** 城市 */
@ApiModelProperty(value = "城市")
private String cityName;
/** 区/县code */
@ApiModelProperty(value = "区/县code")
private String regionCode;
/** 区/县code */
@ApiModelProperty(value = "区/县code")
private String regionCode;
/** 区/县 */
@ApiModelProperty(value = "区/县")
private String regionName;
/** 区/县 */
@ApiModelProperty(value = "区/县")
private String regionName;
@ApiModelProperty(value = "经度(坐标系gcj02)")
private BigDecimal longitude;
/** 占地面积(单位:亩) */
@ApiModelProperty(value = "占地面积(单位:亩)")
private Double coverArea;
@ApiModelProperty(value = "纬度(坐标系gcj02)")
private BigDecimal latitude;
/**
* 占地面积(单位:亩)
*/
@ApiModelProperty(value = "占地面积(单位:亩)")
private Double coverArea;
/** 园区级别名称 */
@ApiModelProperty(value = "园区级别名称")
private String levelName;
/**
* 园区级别名称
*/
@ApiModelProperty(value = "园区级别名称")
private String levelName;
@ApiModelProperty(value = "图片")
private String imgUrl;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "招商方向")
private List<String> investmentDetails;
@ApiModelProperty(value = "联系人")
private String contactPerson;
@ApiModelProperty(value = "图片")
private String imgUrl;
//-------------入驻要求-------------
@ApiModelProperty(value = "总投资额(亿元)")
private BigDecimal investmentAmountTotal;
/** 亩均产值(单位:万/亩) */
@ApiModelProperty(value = "亩均产值(单位:万/亩)")
private String averageOutputValue;
/** 投资强度(单位:万/亩) */
@ApiModelProperty(value = "投资强度(单位:万/亩)")
private String investmentStrength;
/** 税收强度(单位:万/亩) */
@ApiModelProperty(value = "税收强度(单位:万/亩)")
private String taxationStrength;
@ApiModelProperty(value = "建设周期(月)")
private Integer buildingPeriod;
/** 单位工业增加值能耗(单位:tce/万元) */
@ApiModelProperty(value = "能评要求(单位:tce/万元)")
private String valueAddedEnergy;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "联系人")
private String contactPerson;
@ApiModelProperty(value = "电话")
private String phone;
}
......@@ -31,12 +31,13 @@ public class LandInfoController {
@PostMapping("/page")
@ApiOperation(value = "土地分页信息")
public Page<LandPageVo> page(@RequestBody ParamEntity<LandPageDto> param){
return null;
return landInfoService.pageInfo(param);
}
@GetMapping("/detail/{id}")
@ApiImplicitParam(name = "id", value = "土地详情id", type = "Integer")
@ApiImplicitParam(name = "id", value = "土地详情", type = "Integer")
public LandDetailVo detail(@PathVariable Integer id){
return null;
return landInfoService.detail(id);
}
}
......@@ -22,4 +22,6 @@ public class LandPageDto {
/** 地块名称 */
@ApiModelProperty(value = "地块名称")
private String name;
//开发区id
private Integer developmentId;
}
......@@ -15,6 +15,8 @@ import org.apache.ibatis.annotations.Param;
*/
public interface LandInfoMapper extends BaseMapper<LandInfoEntity> {
Page<LandPageVo> pageInfo(Page page, @Param("param") LandPageDto condition);
}
......
......@@ -2,17 +2,35 @@ package com.postcard.service.moudle.land.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.postcard.service.domain.ParamEntity;
import com.postcard.service.moudle.land.dto.LandPageDto;
import com.postcard.service.moudle.land.entity.LandInfoEntity;
import com.postcard.service.moudle.land.vo.LandDetailVo;
import com.postcard.service.moudle.land.vo.LandPageVo;
import java.util.List;
/**
* @author: zhouxudong
* @version: 1.0
* @version: 1.0
* @createTime: 2023/11/24 15:35
* @description: 土地信息
*/
public interface LandInfoService extends IService<LandInfoEntity> {
/**
* @description: 土地分页信息
* @date: 2023/12/16 13:53
* @param: [param]
* @return:
* com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.postcard.service.moudle.land.vo.LandPageVo>
*/
Page<LandPageVo> pageInfo(ParamEntity<LandPageDto> param);
/**
* @description: 土地详情
* @date: 2023/12/16 14:22
* @param: [id]
* @return: com.postcard.service.moudle.land.vo.LandDetailVo
**/
LandDetailVo detail(Integer id);
}
package com.postcard.service.moudle.land.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.postcard.service.domain.ParamEntity;
import com.postcard.service.enums.CarouselTypeEnum;
import com.postcard.service.moudle.development.entity.DevelopmentInfo;
import com.postcard.service.moudle.development.service.DevelopmentInfoService;
import com.postcard.service.moudle.land.dto.LandPageDto;
import com.postcard.service.moudle.land.entity.LandInfoEntity;
import com.postcard.service.moudle.land.mapper.LandInfoMapper;
import com.postcard.service.moudle.land.service.LandInfoService;
import com.postcard.service.moudle.land.vo.LandDetailVo;
import com.postcard.service.moudle.land.vo.LandPageVo;
import com.postcard.service.moudle.system.service.SysCarouselInfoService;
import com.postcard.service.moudle.system.vo.ResourceVo;
import com.postcard.service.util.CommonUtil;
import com.postcard.service.util.DataUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.util.List;
import java.util.StringJoiner;
/**
* @author: zhouxudong
......@@ -20,7 +39,79 @@ import org.springframework.stereotype.Service;
@Slf4j
public class LandInfoServiceImpl extends ServiceImpl<LandInfoMapper, LandInfoEntity>
implements LandInfoService {
@Value("${development.id}")
private Integer developMentId;
@Autowired private SysCarouselInfoService sysCarouselInfoService;
@Autowired private DevelopmentInfoService developmentInfoService;
/**
* @description: 土地分页信息
* @date: 2023/12/16 13:53
* @param: [param]
* @return:
* com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.postcard.service.moudle.land.vo.LandPageVo>
*/
@Override
public Page<LandPageVo> pageInfo(ParamEntity<LandPageDto> param) {
Page page = CommonUtil.getPageFromEntity(param);
LandPageDto condition = param.getCondition();
condition.setDevelopmentId(developMentId);
Page<LandPageVo> pageVoPage = this.baseMapper.pageInfo(page, condition);
List<LandPageVo> records = pageVoPage.getRecords();
records.forEach(
data -> {
StringJoiner sj = new StringJoiner("");
String provinceName = data.getProvinceName();
String cityName = data.getCityName();
String regionName = data.getRegionName();
String developmentName = data.getDevelopmentName();
BigDecimal area1 = data.getArea();
String type = data.getType();
String address = DataUtil.dealProvince(provinceName, cityName);
data.setName(
sj.add(address)
.add(ObjectUtils.isEmpty(regionName) ? "" : regionName)
.add(ObjectUtils.isEmpty(developmentName) ? "" : developmentName)
.add(
ObjectUtils.isEmpty(area1)
? ""
: NumberUtil.roundStr(area1.doubleValue(), 0) + "亩")
.add(type)
.toString());
});
return pageVoPage;
}
/**
* @description: 土地详情
* @date: 2023/12/16 14:22
* @param: [id]
* @return: com.postcard.service.moudle.land.vo.LandDetailVo
*/
@Override
public LandDetailVo detail(Integer id) {
LandInfoEntity landInfoEntity = this.getById(id);
LandDetailVo landDetailVo = BeanUtil.toBean(landInfoEntity, LandDetailVo.class);
List<String> imgUrls = sysCarouselInfoService.getImgUrls(CarouselTypeEnum.LAND.getType(), id);
landDetailVo.setImgUrlList(imgUrls);
StringJoiner sj = new StringJoiner("");
DevelopmentInfo developmentInfo =
developmentInfoService.getById(landInfoEntity.getDevelopmentId());
String provinceName = developmentInfo.getProvinceName();
String cityName = developmentInfo.getCityName();
String regionName = developmentInfo.getRegionName();
String developmentName = developmentInfo.getName();
String address = DataUtil.dealProvince(provinceName, cityName);
BigDecimal area1 = landDetailVo.getArea();
String type = landDetailVo.getType();
landDetailVo.setName(
sj.add(address)
.add(ObjectUtils.isEmpty(regionName) ? "" : regionName)
.add(ObjectUtils.isEmpty(developmentName) ? "" : developmentName)
.add(
ObjectUtils.isEmpty(area1) ? "" : NumberUtil.roundStr(area1.doubleValue(), 0) + "亩")
.add(type)
.toString());
return landDetailVo;
}
}
package com.postcard.service.moudle.land.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* @Author:zhouxudong
*
* @version: 1.0 @Date: 2023/11/22 15:52 @Description: 土地详情中的开发区信息
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@ApiModel(value = "土地详情中的开发区信息")
public class LandDetailDevelopment {
/** id */
@ApiModelProperty(name = "id", notes = "")
private Integer id;
/** 省份 */
@ApiModelProperty(name = "省份", notes = "")
private String provinceName;
/** 省份编码 */
@ApiModelProperty(name = "省份编码", notes = "")
private String provinceCode;
/** 城市编码 */
@ApiModelProperty(name = "城市编码", notes = "")
private String cityCode;
/** 城市名称 */
@ApiModelProperty(name = "城市名称", notes = "")
private String cityName;
/** 区县编码 */
@ApiModelProperty(name = "区县编码", notes = "")
private String regionCode;
/** 区县名称 */
@ApiModelProperty(name = "区县名称", notes = "")
private String regionName;
//------------------------------------------
/** 片区名称 */
@ApiModelProperty(value = "片区名称")
private String name;
// 图片链接
@ApiModelProperty(value = "图片链接")
private String imgUrl;
/** 片区级别 */
@ApiModelProperty(value = "片区级别")
private String levelCode;
/** 片区级别 */
@ApiModelProperty(value = "片区级别名称")
private String levelName;
// 类型
@ApiModelProperty(value = "类型")
private String type;
/** 规划面积(平方公里) */
@ApiModelProperty(value = "规划面积")
private BigDecimal planArea;
@ApiModelProperty(value = "产业方向")
private List<String> developmentInvestment=new ArrayList<>();
@ApiModelProperty(value = "经度(坐标系gcj02)")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度(坐标系gcj02)")
private BigDecimal latitude;
}
......@@ -43,9 +43,6 @@ public class LandDetailVo {
@ApiModelProperty(value = "面积(亩)")
private BigDecimal area;
@ApiModelProperty(value = "产业方向")
private String industryDirection;
/** 土地现状 */
@ApiModelProperty(value = "土地现状")
private String landStatus;
......
......@@ -51,6 +51,8 @@ public class LandPageVo {
@ApiModelProperty(value = "首屏图片")
private String imgUrl;
//开发区名
private String developmentName;
@ApiModelProperty(value = "经度(坐标系gcj02)")
private BigDecimal longitude;
......
package com.postcard.service.moudle.system.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
/**
......@@ -17,7 +16,4 @@ import lombok.*;
@ToString
@ApiModel(value = "咨询列表分页查询条件", description = "")
public class InvestCluePageDto {
@ApiModelProperty(value = "主键id")
private Integer id;
}
......@@ -53,3 +53,6 @@ logging:
com.postcard.service: debug
root: info
development:
id: 284
......@@ -49,3 +49,6 @@ logging:
com.postcard.service: debug
root: info
development:
id: 284
......@@ -50,3 +50,7 @@ logging:
level:
com.postcard.service: debug
root: info
development:
id: 284
......@@ -29,39 +29,31 @@
b.name as parkName,
a.area,
a.type,
a.img_url
a.img_url,
a.structure,
b.longitude,
b.latitude
from carrier_info a
left join park_info b on a.park_id=b.id
left join development_info c on c.id=b.zone_id
<where>
1=1
<if test="param.name != null and param.name != ''">
AND CONCAT( REPLACE(b.province_name,'省',''), REPLACE(b.city_name,'市',''),b.region_name,b.name,case when a.area is null then '' else CONCAT(ROUND(a.area,0),'㎡') end ,a.type) LIKE concat('%', #{param.name}, '%')
</if>
/*载体类型*/
<if test="param.carrierType != null and param.carrierType.size() > 0">
AND a.type in
<foreach item="item" collection="param.carrierType" open="(" separator="," close=")">
#{item}
</foreach>
</if>
/*建筑结构*/
<if test="param.carrierConstruction != null and param.carrierConstruction != ''">
AND a.structure=#{param.carrierConstruction}
</if>
<if test="param.developmentId != null and param.developmentId != ''">
AND c.id=#{param.developmentId}
</if>
<if test="param.provinceName != null and param.provinceName != ''">
AND b.province_name=#{param.provinceName}
</if>
<if test="param.cityName != null and param.cityName != ''">
AND b.city_name=#{param.cityName}
</if>
<if test="param.regionName != null and param.regionName != ''">
AND b.region_name=#{param.regionName}
</if>
<if test="param.investmentDirection != null and param.investmentDirection != ''">
and (SELECT GROUP_CONCAT(c.industrial_track) from park_investment_direction_info c where c.park_id=b.id) like concat('%',#{param.investmentDirection}, '%')
</if>
/*载体面积*/
<if test="param.lowCarrierArea != null and param.lowCarrierArea != ''">
AND a.area &gt;=#{param.lowCarrierArea}
......@@ -69,27 +61,6 @@
<if test="param.highCarrierArea != null and param.highCarrierArea != ''">
AND a.area &lt;= #{param.highCarrierArea}
</if>
/*层高*/
<if test="param.lowFloorHeight != null and param.lowFloorHeight != ''">
AND a.floor_high &gt;= #{param.lowFloorHeight}
</if>
<if test="param.highFloorHeight != null and param.highFloorHeight != ''">
AND a.floor_high &lt;= #{param.highFloorHeight}
</if>
/*承重*/
<if test="param.lowLoadBearing != null and param.lowLoadBearing != ''">
AND a.weight &gt;= #{param.lowLoadBearing}
</if>
<if test="param.highLoadBearing != null and param.highLoadBearing != ''">
AND a.weight &lt;= #{param.highLoadBearing}
</if>
/*柱距*/
<if test="param.lowPillarDistance != null and param.lowPillarDistance != ''">
AND a.distance &gt;= #{param.lowPillarDistance}
</if>
<if test="param.highPillarDistance != null and param.highPillarDistance != ''">
AND a.distance &lt;= #{param.highPillarDistance}
</if>
<if test="param.parkId != null and param.parkId != ''">
AND a.park_id = #{param.parkId}
</if>
......
......@@ -45,5 +45,35 @@
output_value,invest_num,tax_revenue,construction_cycle,energy_require,version,create_by,create_time,update_by,update_time
</sql>
<select id="pageInfo" resultType="com.postcard.service.moudle.land.vo.LandPageVo">
SELECT
a.id,
a.`name`,
a.area,
a.type,
a.img_url,
b.province_code,
b.province_name,
b.name as developmentName,
b.city_code,
b.city_name,
b.region_code,
b.region_name,
b.longitude,
b.latitude
FROM
development_industrial_land_info a
LEFT JOIN development_info b ON a.development_id = b.id
WHERE
b.id = #{param.developmentId}
<if test="param.name != null and param.name != ''">
AND CONCAT( REPLACE(b.province_name,'省',''),
REPLACE(b.city_name,'市','') ,
b.region_name,
b.name,
case when a.area is null then '' else CONCAT(ROUND(a.area,0),'亩') end ,
a.type) LIKE concat('%', #{param.name}, '%')
</if>
order by a.create_time desc
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment