Commit 2e648a0b784b095e81b632952f9dab3eba413a8c
1 parent
fb8b7f91
提交代码
Showing
1 changed file
with
380 additions
and
5 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/OrderManageController.java
1 | package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; | 1 | package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; |
2 | 2 | ||
3 | +import java.math.BigDecimal; | ||
4 | +import java.util.ArrayList; | ||
5 | +import java.util.Arrays; | ||
6 | +import java.util.Date; | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +import javax.servlet.http.HttpServletRequest; | ||
10 | +import javax.servlet.http.HttpServletResponse; | ||
11 | + | ||
3 | import com.alibaba.dubbo.common.utils.CollectionUtils; | 12 | import com.alibaba.dubbo.common.utils.CollectionUtils; |
4 | 13 | ||
14 | +import com.clouds.common.utils.excle.ExcelUtil; | ||
15 | +import com.clouds.common.utils.excle.ExcleFillDateManager; | ||
16 | +import com.clouds.common.utils.excle.Layouter; | ||
5 | import com.clouds.common.web.BizController; | 17 | import com.clouds.common.web.BizController; |
6 | import com.clouds.common.web.vo.BizResultVO; | 18 | import com.clouds.common.web.vo.BizResultVO; |
7 | import com.clouds.common.web.vo.EasyUIDataGridVO; | 19 | import com.clouds.common.web.vo.EasyUIDataGridVO; |
20 | +import com.xiaoleilu.hutool.date.DatePattern; | ||
21 | +import com.xiaoleilu.hutool.date.DateUtil; | ||
8 | import com.zteits.clouds.api.apibase.bean.BizResult; | 22 | import com.zteits.clouds.api.apibase.bean.BizResult; |
9 | import com.zteits.clouds.api.apibase.bean.PageBean; | 23 | import com.zteits.clouds.api.apibase.bean.PageBean; |
10 | import com.zteits.clouds.api.apibase.constants.ErrorType; | 24 | import com.zteits.clouds.api.apibase.constants.ErrorType; |
@@ -14,11 +28,16 @@ import com.zteits.clouds.api.dto.pay.param.ParkOrderByConditionQueryRequest; | @@ -14,11 +28,16 @@ import com.zteits.clouds.api.dto.pay.param.ParkOrderByConditionQueryRequest; | ||
14 | import com.zteits.clouds.api.service.pay.TdBOrderService; | 28 | import com.zteits.clouds.api.service.pay.TdBOrderService; |
15 | import io.swagger.annotations.Api; | 29 | import io.swagger.annotations.Api; |
16 | import io.swagger.annotations.ApiOperation; | 30 | import io.swagger.annotations.ApiOperation; |
31 | +import org.apache.commons.lang3.StringUtils; | ||
32 | +import org.apache.poi.xssf.usermodel.XSSFSheet; | ||
17 | import org.springframework.beans.factory.annotation.Autowired; | 33 | import org.springframework.beans.factory.annotation.Autowired; |
34 | +import org.springframework.format.annotation.DateTimeFormat; | ||
35 | +import org.springframework.stereotype.Controller; | ||
18 | import org.springframework.web.bind.annotation.PostMapping; | 36 | import org.springframework.web.bind.annotation.PostMapping; |
19 | import org.springframework.web.bind.annotation.RequestBody; | 37 | import org.springframework.web.bind.annotation.RequestBody; |
20 | import org.springframework.web.bind.annotation.RequestMapping; | 38 | import org.springframework.web.bind.annotation.RequestMapping; |
21 | -import org.springframework.web.bind.annotation.RestController; | 39 | +import org.springframework.web.bind.annotation.RequestParam; |
40 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
22 | 41 | ||
23 | /** | 42 | /** |
24 | * Copyright: Copyright (c) 2017 zteits | 43 | * Copyright: Copyright (c) 2017 zteits |
@@ -33,8 +52,8 @@ import org.springframework.web.bind.annotation.RestController; | @@ -33,8 +52,8 @@ import org.springframework.web.bind.annotation.RestController; | ||
33 | * ---------------------------------------------------------* | 52 | * ---------------------------------------------------------* |
34 | * 2017/8/24 atao v1.0.0 创建 | 53 | * 2017/8/24 atao v1.0.0 创建 |
35 | */ | 54 | */ |
36 | -@Api(value = "订单管理",description = "订单管理") | ||
37 | -@RestController | 55 | +@Api(value = "订单管理", description = "订单管理") |
56 | +@Controller | ||
38 | @RequestMapping("/order") | 57 | @RequestMapping("/order") |
39 | public class OrderManageController extends BizController { | 58 | public class OrderManageController extends BizController { |
40 | 59 | ||
@@ -43,8 +62,9 @@ public class OrderManageController extends BizController { | @@ -43,8 +62,9 @@ public class OrderManageController extends BizController { | ||
43 | 62 | ||
44 | @ApiOperation("根据查询条件查询停车订单") | 63 | @ApiOperation("根据查询条件查询停车订单") |
45 | @PostMapping("/queryParkOrderByCondition") | 64 | @PostMapping("/queryParkOrderByCondition") |
65 | + @ResponseBody | ||
46 | public BizResultVO<EasyUIDataGridVO<ParkOrderDTO>> queryParkOrderByCondition( | 66 | public BizResultVO<EasyUIDataGridVO<ParkOrderDTO>> queryParkOrderByCondition( |
47 | - @RequestBody ParkOrderByConditionQueryRequest request) throws Exception{ | 67 | + @RequestBody ParkOrderByConditionQueryRequest request) throws Exception { |
48 | if (CollectionUtils.isEmpty(request.getPlNos())) { | 68 | if (CollectionUtils.isEmpty(request.getPlNos())) { |
49 | throw new BizException(ErrorType.PARAMM_NULL, "停车场编码"); | 69 | throw new BizException(ErrorType.PARAMM_NULL, "停车场编码"); |
50 | } | 70 | } |
@@ -56,7 +76,362 @@ public class OrderManageController extends BizController { | @@ -56,7 +76,362 @@ public class OrderManageController extends BizController { | ||
56 | request.getBaseRequest().setPageSize(10); | 76 | request.getBaseRequest().setPageSize(10); |
57 | } | 77 | } |
58 | BizResult<PageBean<ParkOrderDTO>> bizResult = tdBOrderService.queryParkOrderByCondition(request); | 78 | BizResult<PageBean<ParkOrderDTO>> bizResult = tdBOrderService.queryParkOrderByCondition(request); |
59 | - return returnJqGridData(bizResult,ParkOrderDTO.class); | 79 | + return returnJqGridData(bizResult, ParkOrderDTO.class); |
80 | + } | ||
81 | + | ||
82 | + /** | ||
83 | + * 根据查询条件导出所有记录 | ||
84 | + */ | ||
85 | + @RequestMapping("/exportAllParkOrderByCondition") | ||
86 | + public void exportAllParkOrderByCondition(@RequestParam String plNos, @RequestParam(required = false) String parkStatus, | ||
87 | + @RequestParam(required = false) String payType, @RequestParam(required = false) String parkType, | ||
88 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginInTime, | ||
89 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endInTime, | ||
90 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginOutTime, | ||
91 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endOutTime, | ||
92 | + @RequestParam(required = false) String carNum, HttpServletRequest request, | ||
93 | + HttpServletResponse response) { | ||
94 | + | ||
95 | + ParkOrderByConditionQueryRequest dubboReq = new ParkOrderByConditionQueryRequest(); | ||
96 | + if (StringUtils.isNotEmpty(plNos)) { | ||
97 | + dubboReq.setPlNos(Arrays.asList(plNos.split(","))); | ||
98 | + } | ||
99 | + if (StringUtils.isNotEmpty(parkStatus)) { | ||
100 | + String[] tempStr = parkStatus.split(","); | ||
101 | + List<Integer> nums = new ArrayList<>(); | ||
102 | + for (String str : tempStr) { | ||
103 | + nums.add(Integer.valueOf(str)); | ||
104 | + } | ||
105 | + | ||
106 | + dubboReq.setParkStatus(nums); | ||
107 | + | ||
108 | + } | ||
109 | + if (StringUtils.isNotEmpty(payType)) { | ||
110 | + String[] tempStr = payType.split(","); | ||
111 | + List<Integer> nums = new ArrayList<>(); | ||
112 | + for (String str : tempStr) { | ||
113 | + nums.add(Integer.valueOf(str)); | ||
114 | + } | ||
115 | + dubboReq.setPayType(nums); | ||
116 | + | ||
117 | + } | ||
118 | + | ||
119 | + if (StringUtils.isNotEmpty(parkType)) { | ||
120 | + String[] tempStr = parkType.split(","); | ||
121 | + List<Integer> nums = new ArrayList<>(); | ||
122 | + for (String str : tempStr) { | ||
123 | + nums.add(Integer.valueOf(str)); | ||
124 | + } | ||
125 | + dubboReq.setParkType(nums); | ||
126 | + } | ||
127 | + dubboReq.setBeginInTime(beginInTime); | ||
128 | + dubboReq.setEndInTime(endInTime); | ||
129 | + dubboReq.setBeginOutTime(beginOutTime); | ||
130 | + dubboReq.setEndOutTime(endOutTime); | ||
131 | + dubboReq.setCarNum(carNum); | ||
132 | + dubboReq.setSysCode("10001"); | ||
133 | + dubboReq.getBaseRequest().setPageNum(1); | ||
134 | + dubboReq.getBaseRequest().setPageSize(0); | ||
135 | + BizResult<PageBean<ParkOrderDTO>> bizResult = tdBOrderService.queryParkOrderByCondition(dubboReq); | ||
136 | + | ||
137 | + String[] title = new String[] {"停车场", "车牌号", "车辆类型", "状态", "进场时间", "出场时间", "进口", "出口", "停车时长", "应收", "实收", | ||
138 | + "优惠券", "支付方式", "收费员", "免费理由", "总金额"}; | ||
139 | + String sheetName = "停车记录"; | ||
140 | + String fileName = "停车记录"; | ||
141 | + // 1.创建excel信息 | ||
142 | + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | ||
143 | + // 2.设置excel表头和表体 | ||
144 | + Layouter.buildReport(workSheet, title, 0, 0); | ||
145 | + //3.填充数据 | ||
146 | + List<Object[]> contentList = new ArrayList<Object[]>(); | ||
147 | + if (bizResult != null && !CollectionUtils.isEmpty(bizResult.getData().getDataList())) { | ||
148 | + List<ParkOrderDTO> list = bizResult.getData().getDataList(); | ||
149 | + for (ParkOrderDTO e : list) { | ||
150 | + if (e != null) { | ||
151 | + Object[] obj = new Object[title.length]; | ||
152 | + int index = 0; | ||
153 | + obj[index++] = e.getParkName() != null ? e.getParkName() : ""; | ||
154 | + obj[index++] = e.getCarNumber() != null ? e.getCarNumber() : ""; | ||
155 | + obj[index++] = getParkTypeStr(e.getParkType()); | ||
156 | + obj[index++] = getParkStatusStr(e.getOrderState()); | ||
157 | + obj[index++] = e.getParkInTime() != null ? DateUtil.format(e.getParkInTime(), | ||
158 | + DatePattern.NORM_DATETIME_PATTERN) : ""; | ||
159 | + obj[index++] = e.getParkOutTime() != null ? DateUtil.format(e.getParkOutTime(), | ||
160 | + DatePattern.NORM_DATETIME_FORMAT) : ""; | ||
161 | + //进口 | ||
162 | + obj[index++] = getParkInSouceCodeStr(e.getParkInSourceCode()); | ||
163 | + //出口 | ||
164 | + obj[index++] = getParkOutSourceCodeStr(e.getParkOutSourceCode()); | ||
165 | + //停车时长 | ||
166 | + obj[index++] = getParkingDurationStr(e.getParkingDuration()); | ||
167 | + //应收 | ||
168 | + obj[index++] = e.getOrderTotalFee() != null ? e.getOrderTotalFee().divide(new BigDecimal("100"), | ||
169 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
170 | + //实收 | ||
171 | + obj[index++] = e.getOrderActFee() != null ? e.getOrderActFee().divide(new BigDecimal("100"), | ||
172 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
173 | + //优惠券 | ||
174 | + obj[index++] = ""; | ||
175 | + obj[index++] = getPayTypeStr(e.getPayType()); | ||
176 | + //收费员 | ||
177 | + obj[index++] = ""; | ||
178 | + obj[index++] = getFreeReasonStr(e.getOrderType()); | ||
179 | + //总金额 | ||
180 | + obj[index++] = e.getOrderTotalFee() != null ? e.getOrderTotalFee().divide(new BigDecimal("100"), | ||
181 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
182 | + contentList.add(obj); | ||
183 | + } | ||
184 | + } | ||
185 | + } | ||
186 | + ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | ||
187 | + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | ||
188 | + // 4.excel输出配置 | ||
189 | + ExcelUtil.write(response, workSheet, fileName); | ||
190 | + | ||
191 | + } | ||
192 | + | ||
193 | + /** | ||
194 | + * 根据查询条件导出欠费记录 | ||
195 | + */ | ||
196 | + | ||
197 | + @RequestMapping("/exportArrearageParkOrderByCondition") | ||
198 | + public void exportArrearageParkOrderByCondition(@RequestParam String plNos, @RequestParam(required = false) String parkStatus, | ||
199 | + @RequestParam(required = false) String payType, @RequestParam(required = false) String parkType, | ||
200 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginInTime, | ||
201 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endInTime, | ||
202 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginOutTime, | ||
203 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endOutTime, | ||
204 | + @RequestParam(required = false) String carNum, HttpServletRequest request, | ||
205 | + HttpServletResponse response) { | ||
206 | + | ||
207 | + ParkOrderByConditionQueryRequest dubboReq = new ParkOrderByConditionQueryRequest(); | ||
208 | + if (StringUtils.isNotEmpty(plNos)) { | ||
209 | + dubboReq.setPlNos(Arrays.asList(plNos.split(","))); | ||
210 | + } | ||
211 | + if (StringUtils.isNotEmpty(parkStatus)) { | ||
212 | + String[] tempStr = parkStatus.split(","); | ||
213 | + List<Integer> nums = new ArrayList<>(); | ||
214 | + for (String str : tempStr) { | ||
215 | + nums.add(Integer.valueOf(str)); | ||
216 | + } | ||
217 | + dubboReq.setParkStatus(nums); | ||
218 | + } | ||
219 | + if (StringUtils.isNotEmpty(payType)) { | ||
220 | + String[] tempStr = payType.split(","); | ||
221 | + List<Integer> nums = new ArrayList<>(); | ||
222 | + for (String str : tempStr) { | ||
223 | + nums.add(Integer.valueOf(str)); | ||
224 | + } | ||
225 | + dubboReq.setPayType(nums); | ||
226 | + } | ||
227 | + | ||
228 | + if (StringUtils.isNotEmpty(parkType)) { | ||
229 | + String[] tempStr = parkType.split(","); | ||
230 | + List<Integer> nums = new ArrayList<>(); | ||
231 | + for (String str : tempStr) { | ||
232 | + nums.add(Integer.valueOf(str)); | ||
233 | + } | ||
234 | + dubboReq.setParkType(nums); | ||
235 | + } | ||
236 | + dubboReq.setBeginInTime(beginInTime); | ||
237 | + dubboReq.setEndInTime(endInTime); | ||
238 | + dubboReq.setBeginOutTime(beginOutTime); | ||
239 | + dubboReq.setEndOutTime(endOutTime); | ||
240 | + dubboReq.setCarNum(carNum); | ||
241 | + dubboReq.setSysCode("10001"); | ||
242 | + dubboReq.getBaseRequest().setPageNum(1); | ||
243 | + dubboReq.getBaseRequest().setPageSize(0); | ||
244 | + BizResult<PageBean<ParkOrderDTO>> bizResult = tdBOrderService.queryParkOrderByCondition(dubboReq); | ||
245 | + | ||
246 | + String[] title = new String[] {"停车场", "车牌号", "进场时间", "出场时间", "进口", "出口", "停车时长", "应收", "收费员"}; | ||
247 | + String sheetName = "停车欠费记录"; | ||
248 | + String fileName = "停车欠费记录"; | ||
249 | + // 1.创建excel信息 | ||
250 | + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | ||
251 | + // 2.设置excel表头和表体 | ||
252 | + Layouter.buildReport(workSheet, title, 0, 0); | ||
253 | + //3.填充数据 | ||
254 | + List<Object[]> contentList = new ArrayList<Object[]>(); | ||
255 | + if (bizResult != null && !CollectionUtils.isEmpty(bizResult.getData().getDataList())) { | ||
256 | + List<ParkOrderDTO> list = bizResult.getData().getDataList(); | ||
257 | + for (ParkOrderDTO e : list) { | ||
258 | + if (e != null) { | ||
259 | + Object[] obj = new Object[title.length]; | ||
260 | + int index = 0; | ||
261 | + obj[index++] = e.getParkName() != null ? e.getParkName() : ""; | ||
262 | + obj[index++] = e.getCarNumber() != null ? e.getCarNumber() : ""; | ||
263 | + obj[index++] = e.getParkInTime() != null ? DateUtil.format(e.getParkInTime(), | ||
264 | + DatePattern.NORM_DATETIME_PATTERN) : ""; | ||
265 | + obj[index++] = e.getParkOutTime() != null ? DateUtil.format(e.getParkOutTime(), | ||
266 | + DatePattern.NORM_DATETIME_FORMAT) : ""; | ||
267 | + //进口 | ||
268 | + obj[index++] = getParkInSouceCodeStr(e.getParkInSourceCode()); | ||
269 | + //出口 | ||
270 | + obj[index++] = getParkOutSourceCodeStr(e.getParkOutSourceCode()); | ||
271 | + //停车时长 | ||
272 | + obj[index++] = getParkingDurationStr(e.getParkingDuration()); | ||
273 | + //应收 | ||
274 | + obj[index++] = e.getOrderTotalFee() != null ? e.getOrderTotalFee().divide(new BigDecimal("100"), | ||
275 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
276 | + //收费员 | ||
277 | + obj[index++] = ""; | ||
278 | + contentList.add(obj); | ||
279 | + } | ||
280 | + } | ||
281 | + } | ||
282 | + ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | ||
283 | + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | ||
284 | + // 4.excel输出配置 | ||
285 | + ExcelUtil.write(response, workSheet, fileName); | ||
286 | + | ||
287 | + } | ||
288 | + | ||
289 | + /** | ||
290 | + * 根据code 获取支付方式文本 | ||
291 | + * | ||
292 | + * @param payTypeCode | ||
293 | + * @return | ||
294 | + */ | ||
295 | + private String getPayTypeStr(Integer payTypeCode) { | ||
296 | + if (payTypeCode == null) { | ||
297 | + return "未知"; | ||
298 | + } | ||
299 | + | ||
300 | + String payTypeStr; | ||
301 | + switch (payTypeCode) { | ||
302 | + case 1: | ||
303 | + payTypeStr = "支付宝"; | ||
304 | + break; | ||
305 | + case 2: | ||
306 | + payTypeStr = "微信"; | ||
307 | + break; | ||
308 | + case 3: | ||
309 | + payTypeStr = "银联"; | ||
310 | + break; | ||
311 | + case 4: | ||
312 | + payTypeStr = "微信公众号"; | ||
313 | + break; | ||
314 | + case 6: | ||
315 | + payTypeStr = "现金"; | ||
316 | + break; | ||
317 | + case 7: | ||
318 | + payTypeStr = "IC卡"; | ||
319 | + break; | ||
320 | + default: | ||
321 | + payTypeStr = "其他"; | ||
322 | + } | ||
323 | + return payTypeStr; | ||
324 | + } | ||
325 | + | ||
326 | + private String getParkTypeStr(Integer parkTypeCode) { | ||
327 | + if (parkTypeCode == null) { | ||
328 | + return ""; | ||
329 | + } | ||
330 | + String parkTypeStr; | ||
331 | + switch (parkTypeCode) { | ||
332 | + case 0: | ||
333 | + parkTypeStr = "临时车"; | ||
334 | + break; | ||
335 | + case 1: | ||
336 | + parkTypeStr = "固定车"; | ||
337 | + break; | ||
338 | + | ||
339 | + default: | ||
340 | + parkTypeStr = "其他"; | ||
341 | + } | ||
342 | + return parkTypeStr; | ||
343 | + } | ||
344 | + | ||
345 | + private String getParkStatusStr(Integer parkStatusCode) { | ||
346 | + if (parkStatusCode == null) { | ||
347 | + return ""; | ||
348 | + } | ||
349 | + String parkStatusStr; | ||
350 | + switch (parkStatusCode) { | ||
351 | + case 1: | ||
352 | + parkStatusStr = "在场"; | ||
353 | + break; | ||
354 | + case 2: | ||
355 | + parkStatusStr = "在场"; | ||
356 | + break; | ||
357 | + case 3: | ||
358 | + parkStatusStr = "在场"; | ||
359 | + break; | ||
360 | + default: | ||
361 | + parkStatusStr = "离场"; | ||
362 | + break; | ||
363 | + | ||
364 | + } | ||
365 | + return parkStatusStr; | ||
366 | + } | ||
367 | + | ||
368 | + private String getFreeReasonStr(Integer freeReasonCode) { | ||
369 | + if (freeReasonCode == null) { | ||
370 | + return ""; | ||
371 | + } | ||
372 | + | ||
373 | + String reason; | ||
374 | + switch (freeReasonCode) { | ||
375 | + case 0: | ||
376 | + reason = "短时停车免费"; | ||
377 | + break; | ||
378 | + case 5: | ||
379 | + reason = "逃逸"; | ||
380 | + break; | ||
381 | + case 7: | ||
382 | + reason = "授权车免费"; | ||
383 | + break; | ||
384 | + case 8: | ||
385 | + reason = "手动免费开闸"; | ||
386 | + break; | ||
387 | + default: | ||
388 | + reason = "未知"; | ||
389 | + } | ||
390 | + return reason; | ||
391 | + } | ||
392 | + | ||
393 | + //进口 | ||
394 | + private String getParkInSouceCodeStr(String parkInSourceCode) { | ||
395 | + if (null == parkInSourceCode) { | ||
396 | + return ""; | ||
397 | + } | ||
398 | + return ""; | ||
60 | } | 399 | } |
61 | 400 | ||
401 | + //出口 | ||
402 | + private String getParkOutSourceCodeStr(String parkOutSrouceCode) { | ||
403 | + if (null == parkOutSrouceCode) { | ||
404 | + return ""; | ||
405 | + } | ||
406 | + return ""; | ||
407 | + } | ||
408 | + | ||
409 | + //停车时长 | ||
410 | + private String getParkingDurationStr(Long parkingDuration) { | ||
411 | + if (null == parkingDuration) { | ||
412 | + return ""; | ||
413 | + } | ||
414 | + // 分 | ||
415 | + Long theTime1 = 0L; | ||
416 | + // 小时Integer | ||
417 | + Long theTime2 = 0L; | ||
418 | + // alert(theTime); | ||
419 | + if (parkingDuration > 60) { | ||
420 | + theTime1 = parkingDuration / 60; | ||
421 | + // alert(theTime1+"-"+theTime); | ||
422 | + if (theTime1 > 60) { | ||
423 | + theTime2 = (theTime1 / 60); | ||
424 | + theTime1 = theTime1 % 60; | ||
425 | + } | ||
426 | + } | ||
427 | + String result = ""; | ||
428 | + if (theTime1 > 0) { | ||
429 | + result = "" + theTime1 + "分钟" + result; | ||
430 | + } | ||
431 | + if (theTime2 > 0) { | ||
432 | + result = "" + theTime2 + "小时" + result; | ||
433 | + } | ||
434 | + return result; | ||
435 | + | ||
436 | + } | ||
62 | } | 437 | } |