From 412c62f75f89f82da436fecb973174867b5c87ee Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 15 Jun 2019 17:00:39 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=A7=9F=E8=B5=81=E7=89=A9=E4=B8=9A=E5=90=88?= =?UTF-8?q?=E5=90=8C][=E4=BF=AE=E6=94=B9][=E6=A0=B9=E6=8D=AEID=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxRentPropertyContractServiceImpl.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java index 03eaffbf2..e03dd767c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java @@ -6,7 +6,6 @@ import com.iformall.common.ResultData; import com.iformall.domain.po.WxPropertyContract; import com.iformall.domain.po.WxRentContract; import com.iformall.domain.vo.WxRentPropertyContractVo; -import com.iformall.enums.EnumRentContractStatus; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxRentContractMapper; import com.iformall.service.WxPropertyContractService; @@ -18,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -51,15 +51,9 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract data.put("rent", rent); WxPropertyContract wxPropertyContractQuery = new WxPropertyContract(); wxPropertyContractQuery.setRentContractId(id); - WxPropertyContract wxPropertyContract = wxPropertyContractMapper.select(wxPropertyContractQuery).parallelStream() - .filter(p -> p.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode()) || - p.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) || - p.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode())) - .findFirst().orElse(null); - data.put("property", null); - if (wxPropertyContract != null) { - Map property = wxPropertyContractService.getById(wxPropertyContract.getRentContractId()); - data.put("property", property); + List propertyContracts = wxPropertyContractMapper.select(wxPropertyContractQuery); + if (!propertyContracts.isEmpty()) { + data.put("property", propertyContracts.get(0)); } return new ResultData(data); }