|
@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.idea.buildManage.constant.ConstantNodeType;
|
|
|
+import com.idea.buildManage.dto.ProjectHouseVo;
|
|
|
import com.idea.buildManage.excel.MnpBuildingExcel;
|
|
|
import com.idea.buildManage.excel.ParkRoomExcel;
|
|
|
import com.idea.buildManage.excel.WriteHandlerStrategy;
|
|
@@ -260,12 +261,12 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
|
|
|
Map<String, HouseType> houseTypesMap = houseTypes.stream()
|
|
|
.collect(Collectors.toMap(
|
|
|
HouseType::getId,
|
|
|
- HouseType->HouseType,
|
|
|
+ HouseType -> HouseType,
|
|
|
(existing, replacement) -> existing // 保留现有值
|
|
|
));
|
|
|
|
|
|
- for(ParkRoomResponse room:list){
|
|
|
- if(StringUtils.isNotEmpty(room.getHouseTypeId()) && houseTypesMap.containsKey(room.getHouseTypeId())){
|
|
|
+ for (ParkRoomResponse room : list) {
|
|
|
+ if (StringUtils.isNotEmpty(room.getHouseTypeId()) && houseTypesMap.containsKey(room.getHouseTypeId())) {
|
|
|
HouseType houseType = houseTypesMap.get(room.getHouseTypeId());
|
|
|
String str = houseType.getName() + "," + houseType.getBuildArea() + ",使用面积" + houseType.getUseArea();
|
|
|
room.setHouseTypeStr(str);
|
|
@@ -545,7 +546,7 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
|
|
|
parkRoomNode.setNodeName("预付款");
|
|
|
parkRoomNode.setBusinessType(ConstantNodeType.BUSINESS_TYPE_3);
|
|
|
parkRoomNode.setOrderNum(3);
|
|
|
- if(date != null){
|
|
|
+ if (date != null) {
|
|
|
parkRoomNode.setHandleDate(date);
|
|
|
}
|
|
|
parkRoomNodes.add(parkRoomNode);
|
|
@@ -557,14 +558,14 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
|
|
|
if (CollectionUtils.isNotEmpty(invoiceManages)) {
|
|
|
|
|
|
//查询最大开票时间
|
|
|
- Optional<InvoiceManage> max = invoiceManages.stream().filter(item->item.getInvoiceDate() !=null)
|
|
|
+ Optional<InvoiceManage> max = invoiceManages.stream().filter(item -> item.getInvoiceDate() != null)
|
|
|
.max(Comparator.comparing(InvoiceManage::getInvoiceDate));
|
|
|
InvoiceManage invoiceManage = max.orElse(null);
|
|
|
parkRoomNode = new ParkRoomNode();
|
|
|
parkRoomNode.setNodeName("开票");
|
|
|
parkRoomNode.setBusinessType(ConstantNodeType.BUSINESS_TYPE_4);
|
|
|
parkRoomNode.setOrderNum(4);
|
|
|
- if(invoiceManage != null){
|
|
|
+ if (invoiceManage != null) {
|
|
|
parkRoomNode.setHandleDate(invoiceManage.getInvoiceDate());
|
|
|
}
|
|
|
parkRoomNodes.add(parkRoomNode);
|
|
@@ -617,7 +618,7 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
|
|
|
parkRoomNode.setNodeName("回购/增购");
|
|
|
parkRoomNode.setBusinessType(ConstantNodeType.BUSINESS_TYPE_7);
|
|
|
parkRoomNode.setOrderNum(7);
|
|
|
- if(buyingMore != null){
|
|
|
+ if (buyingMore != null) {
|
|
|
parkRoomNode.setHandleDate(buyingMore.getSigningDate());
|
|
|
}
|
|
|
parkRoomNodes.add(parkRoomNode);
|
|
@@ -656,10 +657,10 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
|
|
|
.max(Comparator.comparing(ParkRoomNode::getHandleDate));
|
|
|
ParkRoomNode parkRoomNode = max.orElse(null);
|
|
|
if (parkRoomNode != null) {
|
|
|
- endDate = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm",parkRoomNode.getHandleDate());
|
|
|
+ endDate = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm", parkRoomNode.getHandleDate());
|
|
|
}
|
|
|
Date handleDate = parkRoomNodes.get(0).getHandleDate();
|
|
|
- startDate = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm",handleDate);
|
|
|
+ startDate = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm", handleDate);
|
|
|
parkRoomHistory.setStartDate(startDate);
|
|
|
parkRoomHistory.setEndDate(endDate);
|
|
|
}
|
|
@@ -667,5 +668,76 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 项目概览 房间列表
|
|
|
+ *
|
|
|
+ * @param discId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ProjectHouseVo> projectHouseVoList(String discId) {
|
|
|
+
|
|
|
+ List<ProjectHouseVo> result = new ArrayList<>();
|
|
|
+
|
|
|
+ // 已签约合同
|
|
|
+ ContractManageExample example = new ContractManageExample();
|
|
|
+ example.createCriteria().andContractStatusEqualTo(2);
|
|
|
+ List<ContractManage> contractManages = contractManageMapper.selectByExample(example);
|
|
|
+ Map<String, ContractManage> contractManageMap = contractManages.stream()
|
|
|
+ .collect(Collectors.toMap(ContractManage::getHouseId, item -> item, (existing, replacement) -> existing));
|
|
|
+
|
|
|
+ // 载体列表
|
|
|
+ MnpBuildingExample buildingExample = new MnpBuildingExample();
|
|
|
+ buildingExample.createCriteria().andDiscIdEqualTo(discId);
|
|
|
+ List<MnpBuilding> mnpBuildings = buildingService.selectByExample(buildingExample);
|
|
|
+ for (MnpBuilding mnpBuilding : mnpBuildings) {
|
|
|
+
|
|
|
+ List<ParkRoomResponse> parkRoomResponses = new ArrayList<>();
|
|
|
+
|
|
|
+ ProjectHouseVo projectHouseVo = new ProjectHouseVo();
|
|
|
+ projectHouseVo.setBuildName(mnpBuilding.getBuildNum());
|
|
|
+
|
|
|
+ // 房间列表
|
|
|
+ ParkRoomExample roomExample = new ParkRoomExample();
|
|
|
+ roomExample.createCriteria().andBuildIdEqualTo(mnpBuilding.getId());
|
|
|
+ List<ParkRoom> parkRooms = selectByExample(roomExample);
|
|
|
+ for (ParkRoom room : parkRooms) {
|
|
|
+ ParkRoomResponse roomResponse = new ParkRoomResponse();
|
|
|
+ roomResponse.setRoomNo(room.getRoomNo());
|
|
|
+ // 已选房 待售
|
|
|
+ if (room.getIsChoose() == 1 && room.getSoldStatus() == 2) {
|
|
|
+ roomResponse.setProjectStatusStr("已选房");
|
|
|
+ }
|
|
|
+ // 已签约
|
|
|
+ if (room.getSoldStatus() == 3) {
|
|
|
+ roomResponse.setProjectStatusStr("已签约");
|
|
|
+ ContractManage contractManage = contractManageMap.get(room.getId());
|
|
|
+ // 房款 已完全收款
|
|
|
+ if (contractManage != null && contractManage.getCollectionStatus() == 2) {
|
|
|
+ roomResponse.setProjectStatusStr("已收款");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 已入驻
|
|
|
+ if (room.getSoldStatus() == 7) {
|
|
|
+ roomResponse.setProjectStatusStr("已入驻");
|
|
|
+ }
|
|
|
+ // 已退房
|
|
|
+ if (room.getSoldStatus() == 4) {
|
|
|
+ roomResponse.setProjectStatusStr("已退房");
|
|
|
+ }
|
|
|
+ // 初始状态 待售
|
|
|
+ if (room.getIsChoose() == 0) {
|
|
|
+ roomResponse.setProjectStatusStr("已选房");
|
|
|
+ }
|
|
|
+ parkRoomResponses.add(roomResponse);
|
|
|
+ }
|
|
|
+
|
|
|
+ projectHouseVo.setRoomList(parkRoomResponses);
|
|
|
+ result.add(projectHouseVo);
|
|
|
+
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|