Skip to content

Commit 9839d56

Browse files
吴学文吴学文
authored andcommitted
首页开发完成待测试
1 parent f02ebf8 commit 9839d56

10 files changed

Lines changed: 122 additions & 17 deletions

File tree

Api/src/main/java/com/java110/api/listener/fee/QueryArrearsFeeListener.java

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
import com.alibaba.fastjson.JSONObject;
55
import com.java110.api.listener.AbstractServiceApiDataFlowListener;
66
import com.java110.common.constant.FeeTypeConstant;
7-
import com.java110.common.constant.ResponseConstant;
87
import com.java110.common.constant.ServiceCodeConstant;
9-
import com.java110.common.exception.ListenerExecuteException;
108
import com.java110.common.util.Assert;
119
import com.java110.common.util.BeanConvertUtil;
1210
import com.java110.common.util.DateUtil;
@@ -20,12 +18,9 @@
2018
import com.java110.core.smo.unit.IUnitInnerServiceSMO;
2119
import com.java110.dto.FeeDto;
2220
import com.java110.dto.OwnerDto;
23-
import com.java110.dto.OwnerRoomRelDto;
24-
import com.java110.dto.RoomDto;
2521
import com.java110.event.service.api.ServiceDataFlowEvent;
2622
import com.java110.vo.api.ApiArrearsFeeDataVo;
2723
import com.java110.vo.api.ApiArrearsFeeVo;
28-
import com.java110.vo.api.ApiFeeVo;
2924
import org.springframework.beans.factory.annotation.Autowired;
3025
import org.springframework.http.HttpMethod;
3126
import org.springframework.http.HttpStatus;
@@ -88,10 +83,10 @@ public void soService(ServiceDataFlowEvent event) {
8883
feeDtoParamIn.setArrearsEndTime(DateUtil.getCurrentDate());
8984

9085
//车位时处理为 查询多个
91-
if(FeeTypeConstant.FEE_TYPE_HIRE_PARKING_SPACE.equals(feeDtoParamIn.getFeeTypeCd())){
86+
if (FeeTypeConstant.FEE_TYPE_HIRE_PARKING_SPACE.equals(feeDtoParamIn.getFeeTypeCd())) {
9287
feeDtoParamIn.setFeeTypeCd("");
9388
feeDtoParamIn.setFeeTypeCds(new String[]{FeeTypeConstant.FEE_TYPE_HIRE_DOWN_PARKING_SPACE,
94-
FeeTypeConstant.FEE_TYPE_HIRE_UP_PARKING_SPACE});
89+
FeeTypeConstant.FEE_TYPE_HIRE_UP_PARKING_SPACE});
9590
}
9691

9792
int feeCount = feeInnerServiceSMOImpl.queryFeesCount(feeDtoParamIn);
@@ -115,7 +110,10 @@ public void soService(ServiceDataFlowEvent event) {
115110
List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnersByRoom(ownerDto);
116111
freshRoomAndOwnerData(apiFeeVo, ownerDtos);
117112
} else {
118-
113+
OwnerDto ownerDto = new OwnerDto();
114+
ownerDto.setRoomIds(objIds);
115+
List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnersByParkingSpace(ownerDto);
116+
freshParkingSpaceAndOwnerData(apiFeeVo, ownerDtos);
119117
}
120118

121119

@@ -129,13 +127,13 @@ public void soService(ServiceDataFlowEvent event) {
129127
* 刷新 房间号
130128
*
131129
* @param apiFeeVos 费用出参对象
132-
* @param ownerDtos 房屋信息
130+
* @param ownerDtos 房屋信息
133131
*/
134132
private void freshRoomAndOwnerData(List<ApiArrearsFeeDataVo> apiFeeVos, List<OwnerDto> ownerDtos) {
135133

136134
for (ApiArrearsFeeDataVo apiFeeVo : apiFeeVos) {
137135
for (OwnerDto ownerDto : ownerDtos) {
138-
if(apiFeeVo.getPayerObjId().equals(ownerDto.getRoomId())){
136+
if (apiFeeVo.getPayerObjId().equals(ownerDto.getRoomId())) {
139137
apiFeeVo.setNum(ownerDto.getRoomNum());
140138
apiFeeVo.setOwnerName(ownerDto.getName());
141139
apiFeeVo.setTel(ownerDto.getLink());
@@ -144,6 +142,25 @@ private void freshRoomAndOwnerData(List<ApiArrearsFeeDataVo> apiFeeVos, List<Own
144142
}
145143
}
146144

145+
/**
146+
* 刷新 车位编号
147+
*
148+
* @param apiFeeVos 费用出参对象
149+
* @param ownerDtos 房屋信息
150+
*/
151+
private void freshParkingSpaceAndOwnerData(List<ApiArrearsFeeDataVo> apiFeeVos, List<OwnerDto> ownerDtos) {
152+
153+
for (ApiArrearsFeeDataVo apiFeeVo : apiFeeVos) {
154+
for (OwnerDto ownerDto : ownerDtos) {
155+
if (apiFeeVo.getPayerObjId().equals(ownerDto.getPsId())) {
156+
apiFeeVo.setNum(ownerDto.getNum());
157+
apiFeeVo.setOwnerName(ownerDto.getName());
158+
apiFeeVo.setTel(ownerDto.getLink());
159+
}
160+
}
161+
}
162+
}
163+
147164
/**
148165
* 校验查询条件是否满足条件
149166
*
@@ -155,6 +172,11 @@ private void validateFeeData(JSONObject reqJson) {
155172

156173
}
157174

175+
/**
176+
* 查询 objIds
177+
* @param feeDtos 费用信息
178+
* @return objIds信息
179+
*/
158180
private String[] getObjIds(List<FeeDto> feeDtos) {
159181
List<String> objIds = new ArrayList<String>();
160182
for (FeeDto feeDto : feeDtos) {

UserService/src/main/java/com/java110/user/dao/IOwnerServiceDao.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,12 @@ public interface IOwnerServiceDao {
106106
*/
107107
List<Map> queryOwnersByRoom(Map info) throws DAOException;
108108

109+
/**
110+
* 根据停车位查询业主信息
111+
* @param info 查询条件
112+
* @return 业主信息
113+
* @throws DAOException 异常信息
114+
*/
115+
List<Map> queryOwnersByParkingSpace(Map info) throws DAOException;
116+
109117
}

UserService/src/main/java/com/java110/user/dao/impl/OwnerServiceDaoImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,13 @@ public List<Map> queryOwnersByRoom(Map info) throws DAOException {
185185
return businessOwnerInfos;
186186
}
187187

188+
@Override
189+
public List<Map> queryOwnersByParkingSpace(Map info) throws DAOException {
190+
logger.debug("queryOwnersByParkingSpace 入参 info : {}", info);
191+
192+
List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersByParkingSpace", info);
193+
194+
return businessOwnerInfos; }
195+
188196

189197
}

UserService/src/main/java/com/java110/user/smo/impl/OwnerInnerServiceSMOImpl.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public List<OwnerDto> queryOwners(@RequestBody OwnerDto ownerDto) {
5151
//调用 小区服务查询 小区成员业主信息
5252
CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(ownerDto, CommunityMemberDto.class);
5353
communityMemberDto.setMemberTypeCd(CommunityMemberTypeConstant.OWNER);
54-
if(StringUtils.isEmpty(communityMemberDto.getMemberId())&& !StringUtils.isEmpty(ownerDto.getOwnerId())){
54+
if (StringUtils.isEmpty(communityMemberDto.getMemberId()) && !StringUtils.isEmpty(ownerDto.getOwnerId())) {
5555
communityMemberDto.setMemberId(ownerDto.getOwnerId());
5656
}
5757
List<CommunityMemberDto> communityMemberDtos = communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto);
@@ -196,13 +196,18 @@ public List<OwnerDto> queryOwnersByCondition(@RequestBody OwnerDto ownerDto) {
196196

197197

198198
@Override
199-
public int queryNoEnterRoomOwnerCount(OwnerDto ownerDto) {
199+
public int queryNoEnterRoomOwnerCount(@RequestBody OwnerDto ownerDto) {
200200
return ownerServiceDaoImpl.queryNoEnterRoomOwnerCount(BeanConvertUtil.beanCovertMap(ownerDto));
201201
}
202202

203203
@Override
204-
public List<OwnerDto> queryOwnersByRoom(OwnerDto ownerDto) {
205-
return BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.queryOwnersByRoom(BeanConvertUtil.beanCovertMap(ownerDto)),OwnerDto.class);
204+
public List<OwnerDto> queryOwnersByRoom(@RequestBody OwnerDto ownerDto) {
205+
return BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.queryOwnersByRoom(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class);
206+
}
207+
208+
@Override
209+
public List<OwnerDto> queryOwnersByParkingSpace(@RequestBody OwnerDto ownerDto) {
210+
return BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.queryOwnersByParkingSpace(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class);
206211
}
207212

208213
public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {

WebService/src/main/resources/components/index-arrears/indexArrears.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@
1414
vc.component._listArrearsData();
1515
},
1616
_initEvent:function(){
17-
17+
vc.on("indexArrears","_listArrearsData",function(){
18+
vc.component._listArrearsData();
19+
});
1820
},
1921
methods:{
2022
_listArrearsData:function(_page,_row){
23+
if(!vc.getCurrentCommunity().hasOwnProperty('communityId')){
24+
return ;
25+
}
2126
var param = {
2227
params:{
2328
page:_page,

WebService/src/main/resources/components/index-context/indexContext.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
vc.component._queryIndexContextData();
1818
},
1919
_initEvent:function(){
20-
20+
vc.on("indexContext","_queryIndexContextData",function(){
21+
vc.component._queryIndexContextData();
22+
});
2123
},
2224
methods:{
2325
_queryIndexContextData:function(){

WebService/src/main/resources/components/nav/nav.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@
119119
vm.navCommunityInfo._currentCommunity = vm.navCommunityInfo.communityInfos[0];
120120
vc.setCurrentCommunity(vm.navCommunityInfo._currentCommunity);
121121
vc.setCommunitys(vm.navCommunityInfo.communityInfos);
122+
123+
//对首页做特殊处理,因为首页在加载数据时还没有小区信息 会报错
124+
125+
vc.emit("indexContext","_queryIndexContextData",{});
126+
vc.emit("indexArrears","_listArrearsData",{});
122127
}
123128
},function(){
124129
console.log('请求失败处理');

java110-bean/src/main/java/com/java110/dto/OwnerDto.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class OwnerDto extends PageDto implements Serializable {
2828
private String memberId;
2929
private String ownerTypeCd;
3030
private String roomNum;
31+
private String psId;
32+
private String num;
3133

3234
private String userName;
3335

@@ -151,4 +153,20 @@ public String getRoomNum() {
151153
public void setRoomNum(String roomNum) {
152154
this.roomNum = roomNum;
153155
}
156+
157+
public String getPsId() {
158+
return psId;
159+
}
160+
161+
public void setPsId(String psId) {
162+
this.psId = psId;
163+
}
164+
165+
public String getNum() {
166+
return num;
167+
}
168+
169+
public void setNum(String num) {
170+
this.num = num;
171+
}
154172
}

java110-core/src/main/java/com/java110/core/smo/owner/IOwnerInnerServiceSMO.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,14 @@ public interface IOwnerInnerServiceSMO {
8888
@RequestMapping(value = "/queryOwnersByRoom", method = RequestMethod.POST)
8989
List<OwnerDto> queryOwnersByRoom(@RequestBody OwnerDto ownerDto);
9090

91+
92+
/**
93+
* 根据停车位查询业主信息
94+
*
95+
* @param ownerDto 数据对象分享
96+
* @return 小区下的小区楼记录数
97+
*/
98+
@RequestMapping(value = "/queryOwnersByParkingSpace", method = RequestMethod.POST)
99+
List<OwnerDto> queryOwnersByParkingSpace(@RequestBody OwnerDto ownerDto);
100+
91101
}

java110-db/src/main/resources/mapper/owner/OwnerServiceDaoImplMapper.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ and t.member_id= #{memberId}
364364
AND r.`room_id` = #{roomId}
365365
</if>
366366
<if test="roomIds != null ">
367-
and t.room_id in
367+
and r.room_id in
368368
<foreach collection="roomIds" item="item" open="(" close=")" separator=",">
369369
#{item}
370370
</foreach>
@@ -374,5 +374,27 @@ and t.member_id= #{memberId}
374374
AND t.`status_cd` = '0'
375375
</select>
376376

377+
<!-- 根据停车位查询 -->
378+
<select id="queryOwnersByParkingSpace" parameterType="Map" resultType="Map">
379+
380+
select ps.num,ps.ps_id psId,t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,t.owner_id,t.owner_id ownerId,t.b_id,t.b_id bId,
381+
t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd ownerTypeCd
382+
from p_parking_space ps , owner_car oc,building_owner t
383+
where ps.ps_id = oc.ps_id
384+
and oc.owner_id = t.owner_id
385+
AND oc.`status_cd` = '0'
386+
AND ps.`status_cd` = '0'
387+
AND t.`status_cd` = '0'
388+
<if test="psIds != null ">
389+
and ps.ps_id in
390+
<foreach collection="psIds" item="item" open="(" close=")" separator=",">
391+
#{item}
392+
</foreach>
393+
</if>
394+
<if test="psId !=null and psId != ''">
395+
AND ps.`ps_id` = #{psId}
396+
</if>
397+
</select>
398+
377399

378400
</mapper>

0 commit comments

Comments
 (0)