QueryParkspaceFeeImpl.java
3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package com.java110.fee.bmo.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.dto.fee.FeeDetailDto;
import com.java110.dto.fee.FeeDto;
import com.java110.dto.owner.OwnerCarDto;
import com.java110.fee.bmo.IQueryParkspaceFee;
import com.java110.intf.fee.IFeeDetailInnerServiceSMO;
import com.java110.intf.fee.IFeeInnerServiceSMO;
import com.java110.intf.user.IOwnerCarInnerServiceSMO;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class QueryParkspaceFeeImpl implements IQueryParkspaceFee {
@Autowired
private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
@Autowired
private IFeeInnerServiceSMO feeInnerServiceSMOImpl;
@Autowired
private IFeeDetailInnerServiceSMO feeDetailInnerServiceSMOImpl;
@Override
public ResponseEntity<String> query(JSONObject reqJson) {
OwnerCarDto ownerCarDto = new OwnerCarDto();
ownerCarDto.setCommunityId(reqJson.getString("code"));
JSONArray data = new JSONArray();
List<OwnerCarDto> cars = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
for (OwnerCarDto carDto : cars) {
dealOwnerCar(reqJson, carDto, data);
}
return ResultVo.createResponseEntity(1, data.size(), data);
}
/**
* @param reqJson
* @param carDto
* @param data
*/
private void dealOwnerCar(JSONObject reqJson, OwnerCarDto carDto, JSONArray data) {
FeeDto feeDto = new FeeDto();
feeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_PARKING_SPACE);
feeDto.setPayerObjId(carDto.getPsId());
List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
for (FeeDto tmpFeeDto : feeDtos) {
dealFee(reqJson, carDto, data, tmpFeeDto);
}
}
/**
* 处理费用
*
* @param reqJson
* @param carDto
* @param data
* @param tmpFeeDto
*/
private void dealFee(JSONObject reqJson, OwnerCarDto carDto, JSONArray data, FeeDto tmpFeeDto) {
FeeDetailDto feeDetailDto = new FeeDetailDto();
feeDetailDto.setCommunityId(reqJson.getString("code"));
feeDetailDto.setFeeId(tmpFeeDto.getFeeId());
List<FeeDetailDto> feeDetailDtos = feeDetailInnerServiceSMOImpl.queryFeeDetails(feeDetailDto);
for (FeeDetailDto tmpFeeDetailDto : feeDetailDtos) {
dealFeeDetail(reqJson, carDto, data, tmpFeeDto, tmpFeeDetailDto);
}
}
/**
* 缴费明细
*
* @param reqJson
* @param carDto
* @param data
* @param tmpFeeDto
* @param tmpFeeDetailDto
*/
private void dealFeeDetail(JSONObject reqJson, OwnerCarDto carDto, JSONArray data, FeeDto tmpFeeDto, FeeDetailDto tmpFeeDetailDto) {
JSONObject dataObj = new JSONObject();
dataObj.put("Code", reqJson.getString("code"));
dataObj.put("serialNo", tmpFeeDetailDto.getDetailId());
dataObj.put("order", tmpFeeDetailDto.getDetailId());
dataObj.put("account", tmpFeeDto.getPayerObjId());
dataObj.put("payTime", tmpFeeDetailDto.getCreateTime());
dataObj.put("payTyte", "1");
dataObj.put("fee", tmpFeeDetailDto.getReceivedAmount());
dataObj.put("license", carDto.getCarNum());
dataObj.put("carType", carDto.getCarType());
dataObj.put("parkType", "1");
dataObj.put("carPhoto", "");
dataObj.put("update_time", tmpFeeDetailDto.getCreateTime());
data.add(dataObj);
}
}