|
@@ -1,5 +1,6 @@
|
|
|
package com.bz.smart_city.controller.pay;
|
|
|
|
|
|
+import com.bz.smart_city.commom.exception.ServiceException;
|
|
|
import com.bz.smart_city.commom.model.AjaxMessage;
|
|
|
import com.bz.smart_city.commom.model.Pagination;
|
|
|
import com.bz.smart_city.commom.model.ResultStatus;
|
|
@@ -34,8 +35,7 @@ public class PayControlRecordController {
|
|
|
@GetMapping("/findList")
|
|
|
@ApiOperation(value="查询阀控记录",notes="查询阀控记录")
|
|
|
public AjaxMessage<List<PayControlRecordDto>> findList(
|
|
|
- @ApiParam(value = "用户ID", required = false) @RequestParam(required = false) String accountId,
|
|
|
- @ApiParam(value = "水表ID", required = false) @RequestParam(required = false) String meterId,
|
|
|
+ @ApiParam(value = "水表电子号,水表档案号", required = false) @RequestParam(required = false) String meterCode,
|
|
|
@ApiParam(value = "阀控规则", required = false) @RequestParam(required = false) String controlRuleId,
|
|
|
@ApiParam(value = "操作类型 0关阀 1开阀", required = false) @RequestParam(required = false) String type,
|
|
|
@ApiParam(value = "操作结果 0执行中 1成功 2失败", required = false) @RequestParam(required = false) String result,
|
|
@@ -47,13 +47,10 @@ public class PayControlRecordController {
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
|
|
PayControlRecordDto payControlRecordDto = new PayControlRecordDto();
|
|
|
|
|
|
- if(StringUtils.isNotBlank(accountId)){
|
|
|
- payControlRecordDto.setAccountId(new BigInteger(accountId));
|
|
|
+ if(StringUtils.isNotBlank(meterCode)){
|
|
|
+ payControlRecordDto.setMeterCode(meterCode);
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.isNotBlank(meterId)){
|
|
|
- payControlRecordDto.setMeterId(new BigInteger(meterId));
|
|
|
- }
|
|
|
if(StringUtils.isNotBlank(controlRuleId)){
|
|
|
payControlRecordDto.setControlRuleId(new Integer(controlRuleId));
|
|
|
}
|
|
@@ -86,8 +83,7 @@ public class PayControlRecordController {
|
|
|
@GetMapping("/findPage")
|
|
|
@ApiOperation(value="查询阀控记录,分页",notes="查询阀控记录,分页")
|
|
|
public AjaxMessage<Pagination<PayControlRecordDto>> findPage(
|
|
|
- @ApiParam(value = "用户ID", required = false) @RequestParam(required = false) String accountId,
|
|
|
- @ApiParam(value = "水表ID", required = false) @RequestParam(required = false) String meterId,
|
|
|
+ @ApiParam(value = "水表电子号,水表档案号", required = false) @RequestParam(required = false) String meterCode,
|
|
|
@ApiParam(value = "阀控规则", required = false) @RequestParam(required = false) String controlRuleId,
|
|
|
@ApiParam(value = "操作类型 0关阀 1开阀", required = false) @RequestParam(required = false) String type,
|
|
|
@ApiParam(value = "操作结果 0执行中 1成功 2失败", required = false) @RequestParam(required = false) String result,
|
|
@@ -101,12 +97,8 @@ public class PayControlRecordController {
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
|
|
PayControlRecordDto payControlRecordDto = new PayControlRecordDto();
|
|
|
|
|
|
- if(StringUtils.isNotBlank(accountId)){
|
|
|
- payControlRecordDto.setAccountId(new BigInteger(accountId));
|
|
|
- }
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(meterId)){
|
|
|
- payControlRecordDto.setMeterId(new BigInteger(meterId));
|
|
|
+ if(StringUtils.isNotBlank(meterCode)){
|
|
|
+ payControlRecordDto.setMeterCode(meterCode);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(controlRuleId)){
|
|
|
payControlRecordDto.setControlRuleId(new Integer(controlRuleId));
|
|
@@ -137,5 +129,26 @@ public class PayControlRecordController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/findByYear")
|
|
|
+ @ApiOperation(value="查询阀控记录(按年)",notes="查询阀控记录(按年)")
|
|
|
+ public AjaxMessage<List<PayControlRecordDto>> findByYear(
|
|
|
+ @ApiParam(value = "客户编号", required = true) @RequestParam(required = true) String accountNumber,
|
|
|
+ @ApiParam(value = "年份yyyy", required = true) @RequestParam(required = true) String year
|
|
|
+ ){
|
|
|
+ try {
|
|
|
+ if(StringUtils.isBlank(accountNumber)){
|
|
|
+ new ServiceException(-99,"客户编号不能为空");
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(year)){
|
|
|
+ new ServiceException(-99,"年份不能为空");
|
|
|
+ }
|
|
|
+ List<PayControlRecordDto> payControlRecordList = payControlRecordService.findByYear(accountNumber,new Integer(year));
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK,payControlRecordList);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ return new AjaxMessage<>(-99,ex.getMessage(),null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|