Browse Source

merge

release/v1.0.0
yueminglinxia 4 years ago
parent
commit
9af7a5cc08
  1. 2
      air/src/main/java/com/air/common/Constant.java
  2. 5
      air/src/main/java/com/air/housing/controller/HousesController.java
  3. 4
      air/src/main/java/com/air/housing/controller/HousingEstatesController.java
  4. 5
      air/src/main/java/com/air/housing/dto/BlockListDto.java
  5. 2
      air/src/main/java/com/air/land/controller/LandToListController.java
  6. 7
      air/src/main/java/com/air/land/entity/LandToList.java
  7. 3
      air/src/main/java/com/air/land/service/LandToListService.java
  8. 32
      air/src/main/java/com/air/land/service/impl/LandToListServiceImpl.java
  9. 6
      air/src/main/java/com/air/land/vo/LandToListVo.java
  10. 3
      air/src/main/java/com/air/sysMessage/service/impl/SysMessageServiceImpl.java
  11. 11
      air/src/main/resources/mapper/BlocksMapper.xml

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

@ -8,7 +8,7 @@ package com.air.common;
*/
public class Constant {
public static final String COMMON_STATUS_1000 = "1000";
/**
* 拟挂牌地块状态 未公示
**/

5
air/src/main/java/com/air/housing/controller/HousesController.java

@ -60,7 +60,7 @@ public class HousesController {
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{blockId}")
@GetMapping("/house/{blockId}")
public R getByBlockId(Page page,@PathVariable("blockId") Long blockId) {
return R.ok(housesService.page(page,Wrappers.<Houses>lambdaQuery().eq(Houses::getBlockId,blockId)));
}
@ -72,7 +72,6 @@ public class HousesController {
*/
@ApiOperation(value = "新增房屋信息", notes = "新增房屋信息")
@PostMapping
@PreAuthorize("@pms.hasPermission('generator_houses_add')")
public R save(@RequestBody Houses houses) {
return R.ok(housesService.save(houses));
}
@ -85,7 +84,6 @@ public class HousesController {
*/
@ApiOperation(value = "修改房屋信息", notes = "修改房屋信息")
@PutMapping
@PreAuthorize("@pms.hasPermission('generator_houses_edit')")
public R updateById(@RequestBody Houses houses) {
return R.ok(housesService.updateById(houses));
}
@ -98,7 +96,6 @@ public class HousesController {
*/
@ApiOperation(value = "通过id删除房屋信息", notes = "通过id删除房屋信息")
@DeleteMapping("/{houseId}")
@PreAuthorize("@pms.hasPermission('generator_houses_del')")
public R removeById(@PathVariable Long houseId) {
return R.ok(housesService.removeById(houseId));
}

4
air/src/main/java/com/air/housing/controller/HousingEstatesController.java

@ -1,5 +1,6 @@
package com.air.housing.controller;
import com.air.common.Constant;
import com.air.housing.dto.HousingDefine;
import com.air.housing.dto.HousingEstatesQuery;
import com.air.housing.entity.HousingEstates;
@ -7,13 +8,11 @@ import com.air.housing.service.HousingEstatesService;
import com.air.housing.vo.HousingEstatesDetail;
import com.air.housing.vo.HousingEstatesName;
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.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -80,6 +79,7 @@ public class HousingEstatesController {
@ApiOperation(value = "新增楼盘(小区)", notes = "新增楼盘(小区)")
@PostMapping
public R save(@RequestBody HousingEstates housingEstates) {
housingEstates.setStatusCd(Constant.COMMON_STATUS_1000);
return R.ok(housingEstatesService.save(housingEstates));
}

5
air/src/main/java/com/air/housing/dto/BlockListDto.java

@ -1,12 +1,17 @@
package com.air.housing.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @ClassName BlockListDto
* @Author Lenovo 102306
* @Date 2021/6/9 10:40
*/
@Data
@EqualsAndHashCode
public class BlockListDto {
@ApiModelProperty(value = "楼盘id")

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

@ -132,7 +132,7 @@ public class LandToListController {
@ApiOperation(value = "导入拟挂牌地块信息", notes = "导入拟挂牌地块信息")
@PostMapping(value = "/importLandToListExcel")
public R importLandToListExcel(@RequestParam(value="uploadFile") MultipartFile file){
return R.ok();
return R.ok(landToListService.importLandToListExcel(file));
}

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

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -36,6 +37,7 @@ public class LandToList extends Model<LandToList> {
private String supplyStatus;
@ApiModelProperty(value = "预计挂牌时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd",timezone = "GMT+8")
private LocalDateTime estimatedListingTime;
@ApiModelProperty(value = "预计挂牌批次")
@ -107,8 +109,6 @@ public class LandToList extends Model<LandToList> {
@ApiModelProperty(value = "商务面积")
private String commerceSpace;
@ApiModelProperty(value = "配建-计容")
private String allocationCapacity;
@ -179,7 +179,6 @@ public class LandToList extends Model<LandToList> {
private String lonLatBd;
@ApiModelProperty(value = "出让方式")
private String transferMode;
@ -220,6 +219,7 @@ public class LandToList extends Model<LandToList> {
private String projectCompany;
@ApiModelProperty(value = "确权时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd",timezone = "GMT+8")
private LocalDateTime confirmationTime;
@ApiModelProperty(value = "操盘企业")
@ -232,6 +232,7 @@ public class LandToList extends Model<LandToList> {
private String conductEnterprise;
@ApiModelProperty(value = "项目首开时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd",timezone = "GMT+8")
private LocalDateTime firstOpenTime;
@ApiModelProperty(value = "规划条件函")

3
air/src/main/java/com/air/land/service/LandToListService.java

@ -3,6 +3,7 @@ package com.air.land.service;
import com.air.land.entity.LandToList;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cinderella.framework.common.core.util.R;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -18,4 +19,6 @@ public interface LandToListService extends IService<LandToList> {
List<List<String>> getLandList(List<Long> ids);
boolean importLandToListExcel(MultipartFile file);
}

32
air/src/main/java/com/air/land/service/impl/LandToListServiceImpl.java

@ -1,6 +1,7 @@
package com.air.land.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.air.common.Constant;
import com.air.land.entity.LandListed;
import com.air.land.entity.LandToList;
@ -8,12 +9,16 @@ import com.air.land.mapper.LandListedMapper;
import com.air.land.mapper.LandToListMapper;
import com.air.land.service.LandToListService;
import com.air.utils.DateUtil;
import com.air.utils.ExcelUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cinderella.framework.common.core.exception.BusinessException;
import com.cinderella.framework.common.core.util.R;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@ -56,6 +61,29 @@ public class LandToListServiceImpl extends ServiceImpl<LandToListMapper, LandToL
return list;
}
@Override
public boolean importLandToListExcel(MultipartFile file) {
List<List<String>> dataList = new ArrayList<>();
try{
dataList = ExcelUtil.importExcel(file);
}catch (IOException e){
new BusinessException("导入已挂牌地块数据出错");
}
List<LandToList> list = new ArrayList<>(dataList.size());
dataList.forEach(data ->{
try {
LandToList landListed = listToEntity(data);
if(ObjectUtil.isNotEmpty(landListed)){
list.add(landListed);
}
}catch (Exception e){
e.printStackTrace();
new BusinessException("导入已挂牌地块数据转换出错");
}
});
return this.saveBatch(list);
}
private List<String> entityToList(LandToList data) {
List<String> list = new ArrayList<>();
list.add(data.getProposedseriaId().toString());
@ -135,8 +163,8 @@ public class LandToListServiceImpl extends ServiceImpl<LandToListMapper, LandToL
return list;
}
private LandListed listToEntity(List<String> data) {
LandListed landListed = new LandListed();
private LandToList listToEntity(List<String> data) {
LandToList landListed = new LandToList();
landListed.setAnnoId(data.get(0));
landListed.setLandCode(data.get(1));
landListed.setLandPosition(data.get(2));

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

@ -40,12 +40,10 @@ public class LandToListVo {
@ApiModelProperty(value = "公告id,主键,以土地网爬取数据为准,不自增")
private String annoId;
@NotBlank(message = "地块编号不能为空")
@ApiModelProperty(value = "地块编号", required = true)
@ApiModelProperty(value = "地块编号")
private String landCode;
@NotBlank(message = "地块位置不能为空")
@ApiModelProperty(value = "地块位置", required = true)
@ApiModelProperty(value = "地块位置")
private String landPosition;
@ApiModelProperty(value = "土地用途")

3
air/src/main/java/com/air/sysMessage/service/impl/SysMessageServiceImpl.java

@ -46,8 +46,7 @@ public class SysMessageServiceImpl extends ServiceImpl<SysMessageMapper, SysMess
@Override
public Page getSysMessagePage(Page page, SysMessage sysMessage) {
// Integer userId = SecurityUtils.getUser().getId();
Integer userId = 1;
Integer userId = SecurityUtils.getUser().getId();
Page<SysMessage> messagePage = sysMessageMapper.getSysMessagePage(page,userId);
// page.setRecords(messagePage);
return messagePage;

11
air/src/main/resources/mapper/BlocksMapper.xml

@ -9,17 +9,20 @@
<select id="getBlocksPageByHousingEstatesId" parameterType="com.air.housing.dto.BlockListDto" resultType="com.air.housing.entity.Blocks">
select <include refid="base_block_column"/>
from BLOCKS b where b.status_cd = 1000
from blocks b
<choose>
<when test="Blocks.largeFormat !=null and Blocks.format == null">
join FORMAT f ON b.housing_estates_id = f.housing_estates_id and f.large_format = #{Blocks.largeFormat}
join `format` f ON b.housing_estates_id = f.housing_estate_id and f.large_format = #{Blocks.largeFormat} and f.status_cd=1000 and b.status_cd = 1000
</when>
<when test="Blocks.largeFormat ==null and Blocks.format != null">
join FORMAT f ON b.housing_estates_id = f.housing_estates_id and f.format = #{format}
join `format` f ON b.housing_estates_id = f.housing_estate_id and f.`format` = #{Blocks.format} and f.status_cd=1000 and b.status_cd = 1000
</when>
<when test="Blocks.largeFormat !=null and Blocks.format != null">
join FORMAT f ON b.housing_estates_id = f.housing_estates_id and f.format = #{format} and f.large_format = #{Blocks.largeFormat}
join `format` f ON b.housing_estates_id = f.housing_estate_id and f.`format` = #{Blocks.format} and f.large_format = #{Blocks.largeFormat} and f.status_cd=1000 and b.status_cd = 1000
</when>
<otherwise>
where b.status_cd = 1000
</otherwise>
</choose>
and b.housing_estates_id = #{Blocks.housingEstatesId}

Loading…
Cancel
Save