|
@@ -3,9 +3,11 @@ package com.bz.smart_city.controller.pay;
|
|
|
import com.bz.smart_city.annotation.LogAnnotation;
|
|
|
import com.bz.smart_city.commom.model.AjaxMessage;
|
|
|
import com.bz.smart_city.commom.model.ResultStatus;
|
|
|
+import com.bz.smart_city.dto.pay.BaseWaterPropertyFormDto;
|
|
|
import com.bz.smart_city.dto.pay.PayInvoiceDto;
|
|
|
import com.bz.smart_city.dto.pay.PayTransactiondetailsDto;
|
|
|
import com.bz.smart_city.dto.pay.payfee.*;
|
|
|
+import com.bz.smart_city.service.pay.BaseWaterPropertyService;
|
|
|
import com.bz.smart_city.service.pay.PayFeeService;
|
|
|
import com.bz.smart_city.service.pay.PayPayReceivedService;
|
|
|
import com.bz.smart_city.service.pay.PayTransactiondetailsService;
|
|
@@ -13,7 +15,9 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.aspectj.weaver.loadtime.Aj;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
@@ -40,10 +44,12 @@ public class PayFeeController {
|
|
|
PayFeeService payFeeService;
|
|
|
@Autowired
|
|
|
PayTransactiondetailsService payTransactiondetailsService;
|
|
|
+ @Autowired
|
|
|
+ private BaseWaterPropertyService baseWaterPropertyService;
|
|
|
|
|
|
|
|
|
@PostMapping("/payFee")
|
|
|
- @ApiOperation(value="冲账接口,客户名称、客户编码、应收id不能同时为空")
|
|
|
+ @ApiOperation(value = "冲账接口,客户名称、客户编码、应收id不能同时为空")
|
|
|
public AjaxMessage<String> payFee(
|
|
|
@ApiParam(value = "客户编码", required = false) @RequestParam(required = false) String accountnumber,
|
|
|
@ApiParam(value = "客户名称", required = false) @RequestParam(required = false) String metercode,
|
|
@@ -54,132 +60,156 @@ public class PayFeeController {
|
|
|
@ApiParam(value = "站点ID", required = false) @RequestParam(required = false) String siteId,
|
|
|
@ApiParam(value = "水司ID", required = false) @RequestParam(required = false) String customerId,
|
|
|
@ApiParam(value = "用户ID", required = false) @RequestParam(required = false) String userId
|
|
|
- ){
|
|
|
+ ) {
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
|
|
- List<BigInteger> arrayList= null;
|
|
|
- if(StringUtils.isNotBlank(receivableIds)){
|
|
|
- arrayList= Arrays.asList(receivableIds.split(",")).stream().map(BigInteger::new).collect(Collectors.toList());
|
|
|
+ List<BigInteger> arrayList = null;
|
|
|
+ if (StringUtils.isNotBlank(receivableIds)) {
|
|
|
+ arrayList = Arrays.asList(receivableIds.split(",")).stream().map(BigInteger::new).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.payFee(accountnumber,
|
|
|
- metercode,
|
|
|
- BigDecimal.valueOf(Double.parseDouble(transAmount)),
|
|
|
- Integer.valueOf(paytype),
|
|
|
- transTime != null? LocalDateTime.parse(transTime,df): null,
|
|
|
- arrayList,
|
|
|
- siteId != null?Integer.parseInt(siteId):null,
|
|
|
- customerId != null?Integer.parseInt(customerId):null,
|
|
|
- userId != null?Integer.parseInt(userId):null)
|
|
|
- );
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.payFee(accountnumber,
|
|
|
+ metercode,
|
|
|
+ BigDecimal.valueOf(Double.parseDouble(transAmount)),
|
|
|
+ Integer.valueOf(paytype),
|
|
|
+ transTime != null ? LocalDateTime.parse(transTime, df) : null,
|
|
|
+ arrayList,
|
|
|
+ siteId != null ? Integer.parseInt(siteId) : null,
|
|
|
+ customerId != null ? Integer.parseInt(customerId) : null,
|
|
|
+ userId != null ? Integer.parseInt(userId) : null)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
|
|
|
@PostMapping("/payFeeCounter")
|
|
|
- @ApiOperation(value="柜台缴费接口")
|
|
|
+ @ApiOperation(value = "柜台缴费接口")
|
|
|
public AjaxMessage<PayfeeResult> payFeeCounter(
|
|
|
- @ApiParam(value = "客户id", required = true) @RequestParam(required = true)String accountId,
|
|
|
- @ApiParam(value = "支付方式", required = true) @RequestParam(required = true)Integer payway,
|
|
|
- @ApiParam(value = "交易金额", required = true) @RequestParam(required = true)String transAmount,
|
|
|
- @ApiParam(value = "是否转预存,0否 1是", required = true) @RequestParam(required = true)Integer balancetype
|
|
|
-
|
|
|
- ){
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) String accountId,
|
|
|
+ @ApiParam(value = "欠费金额", required = false) @RequestParam(required = false) String debt,
|
|
|
+ @ApiParam(value = "预存金额", required = false) @RequestParam(required = false) String remaining,
|
|
|
+ @ApiParam(value = "购水量", required = false) @RequestParam(required = false) String amount,
|
|
|
+ /*@ApiParam(value = "购水金额", required = false) @RequestParam(required = false)String waterAmount,*/
|
|
|
+ @ApiParam(value = "单价", required = false) @RequestParam(required = false) String price,
|
|
|
+ @ApiParam(value = "实收金额", required = true) @RequestParam(required = true) String transAmount,
|
|
|
+ @ApiParam(value = "支付方式", required = true) @RequestParam(required = true) Integer payway,
|
|
|
+ @ApiParam(value = "是否转预存,0否 1是", required = true) @RequestParam(required = true) Integer balancetype
|
|
|
+
|
|
|
+ ) {
|
|
|
//暂时先默认柜台支付为现金支付,后期区分
|
|
|
- return new AjaxMessage<>(ResultStatus.OK, payFeeService.payFeeCounter(accountId,4,new BigDecimal(transAmount),balancetype));
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.payFeeCounter(accountId, 4, new BigDecimal(transAmount), balancetype,
|
|
|
+ new BigDecimal(debt), new BigDecimal(remaining), Integer.valueOf(amount), new BigDecimal(price)));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/findPayfeeAccountInfo")
|
|
|
- @ApiOperation(value="收费界面查询客户信息,客户id是在查询出多用户时,选择某个用户")
|
|
|
+ @ApiOperation(value = "收费界面查询客户信息,客户id是在查询出多用户时,选择某个用户")
|
|
|
public AjaxMessage<List<PayfeeAccountInfoDto>> findPayfeeAccountInfo(
|
|
|
- @ApiParam(value = "开户id,查询多用户时,再次查询用id查询") @RequestParam(required = false)BigInteger id,
|
|
|
- @ApiParam(value = "查询内容,户编、户名、手机、地址") @RequestParam(required = false)String condition ){
|
|
|
+ @ApiParam(value = "开户id,查询多用户时,再次查询用id查询") @RequestParam(required = false) BigInteger id,
|
|
|
+ @ApiParam(value = "查询内容,户编、户名、手机、地址") @RequestParam(required = false) String condition) {
|
|
|
|
|
|
- return new AjaxMessage<>(ResultStatus.OK, payFeeService.findPayfeeAccountInfo(id , condition ));
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.findPayfeeAccountInfo(id, condition));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getPayfeeDetaileBill")
|
|
|
- @ApiOperation(value="查询账单详情")
|
|
|
+ @ApiOperation(value = "查询账单详情")
|
|
|
public AjaxMessage<PayfeeDetaileBill> getPayfeeDetaileBill(
|
|
|
- @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId){
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayfeeDetaileBill(accountId));
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId) {
|
|
|
+ //根据客户id查找用水性质ID
|
|
|
+ BigInteger propertyId = payFeeService.getWaterPropertyId(accountId);
|
|
|
+ BaseWaterPropertyFormDto baseWaterPropertyFormDto = new BaseWaterPropertyFormDto();
|
|
|
+ if (propertyId != null) {
|
|
|
+ //根据用水性质ID去查找对应的用水性质
|
|
|
+ baseWaterPropertyFormDto = baseWaterPropertyService.getEditPage(propertyId);
|
|
|
+ } else {
|
|
|
+ baseWaterPropertyFormDto = new BaseWaterPropertyFormDto();
|
|
|
+ }
|
|
|
+ PayfeeDetaileBill bill = payFeeService.getPayfeeDetaileBill(accountId);
|
|
|
+ bill.setSumPrice1(baseWaterPropertyFormDto.getSumPrice1());//一阶单价合计
|
|
|
+ bill.setSumPrice2(baseWaterPropertyFormDto.getSumPrice2());//二阶单价合计
|
|
|
+ bill.setSumPrice3(baseWaterPropertyFormDto.getSumPrice3());//三阶单价合计
|
|
|
+ bill.setSumPrice4(baseWaterPropertyFormDto.getSumPrice4());//四阶单价合计
|
|
|
+ bill.setProp1(baseWaterPropertyFormDto.getProp1());//一阶用水性质
|
|
|
+ bill.setProp2(baseWaterPropertyFormDto.getProp2());//二阶用水性质
|
|
|
+ bill.setProp3(baseWaterPropertyFormDto.getProp3());//三阶用水性质
|
|
|
+ bill.setProp4(baseWaterPropertyFormDto.getProp4());//四阶用水性质
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, bill);
|
|
|
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getPayfeeDetailed")
|
|
|
- @ApiOperation(value="查询本账期欠费明细")
|
|
|
+ @ApiOperation(value = "查询本账期欠费明细")
|
|
|
public AjaxMessage<PayfeeDetailed> getPayfeeDetailed(
|
|
|
- @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId ){
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayfeeDetailed(accountId));
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayfeeDetailed(accountId));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getPayreceiveDebt")
|
|
|
- @ApiOperation(value="收费页面————欠费信息")
|
|
|
+ @ApiOperation(value = "收费页面————欠费信息")
|
|
|
public AjaxMessage<List<PayfeeReceivableInfo>> getPayreceiveDebt(
|
|
|
- @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId ,
|
|
|
- @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year
|
|
|
- ){
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayreceiveDebt(accountId,year));
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
|
|
|
+ @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
|
|
|
+ ) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayreceiveDebt(accountId, year));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getPayreceiveDebtDetailed")
|
|
|
- @ApiOperation(value="收费页面————欠费信息详情")
|
|
|
+ @ApiOperation(value = "收费页面————欠费信息详情")
|
|
|
public AjaxMessage<List<PayfeeReceivableInfo>> getPayreceiveDebtDetailed(
|
|
|
- @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId,
|
|
|
- @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year,
|
|
|
- @ApiParam(value = "账期月",required = true) @RequestParam(required = true)Integer month
|
|
|
- ){
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayreceiveDebtDetailed(accountId,year,month));
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
|
|
|
+ @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year,
|
|
|
+ @ApiParam(value = "账期月", required = true) @RequestParam(required = true) Integer month
|
|
|
+ ) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayreceiveDebtDetailed(accountId, year, month));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getPayreceived")
|
|
|
- @ApiOperation(value="收费页面————实收信息")
|
|
|
+ @ApiOperation(value = "收费页面————实收信息")
|
|
|
public AjaxMessage<List<PayfeeReceivedInfo>> getPayreceived(
|
|
|
- @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId ,
|
|
|
- @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year
|
|
|
- ){
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayreceived(accountId,year));
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
|
|
|
+ @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
|
|
|
+ ) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayreceived(accountId, year));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getPayreceivedDetailed")
|
|
|
- @ApiOperation(value="收费页面————实收信息详情")
|
|
|
+ @ApiOperation(value = "收费页面————实收信息详情")
|
|
|
public AjaxMessage<List<PayfeeReceivedInfo>> getPayreceivedDetailed(
|
|
|
- @ApiParam(value = "客户id" ,required = true) @RequestParam(required = true)BigInteger accountId,
|
|
|
- @ApiParam(value = "交易流水号" ,required = true) @RequestParam(required = true)String payseriesno,
|
|
|
- @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year,
|
|
|
- @ApiParam(value = "账期月",required = true) @RequestParam(required = true)Integer month
|
|
|
- ){
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayreceivedDetailed(accountId,payseriesno,year,month));
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
|
|
|
+ @ApiParam(value = "交易流水号", required = true) @RequestParam(required = true) String payseriesno,
|
|
|
+ @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year,
|
|
|
+ @ApiParam(value = "账期月", required = true) @RequestParam(required = true) Integer month
|
|
|
+ ) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayreceivedDetailed(accountId, payseriesno, year, month));
|
|
|
}
|
|
|
|
|
|
|
|
|
@GetMapping("/getTransDetailed")
|
|
|
- @ApiOperation(value="收费页面————交易明细详情")
|
|
|
+ @ApiOperation(value = "收费页面————交易明细详情")
|
|
|
public AjaxMessage<List<PayTransactiondetailsDto>> getListByYear(
|
|
|
@ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
|
|
|
@ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
|
|
|
- ){
|
|
|
+ ) {
|
|
|
|
|
|
- PayTransactiondetailsDto payTransactiondetailsDto =new PayTransactiondetailsDto();
|
|
|
+ PayTransactiondetailsDto payTransactiondetailsDto = new PayTransactiondetailsDto();
|
|
|
payTransactiondetailsDto.setAccountId(accountId);
|
|
|
payTransactiondetailsDto.setYear(year);
|
|
|
return new AjaxMessage<>(ResultStatus.OK, payTransactiondetailsService.selectTransactionList(payTransactiondetailsDto));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getWaterusedamount")
|
|
|
- @ApiOperation(value="收费页面————水量信息")
|
|
|
+ @ApiOperation(value = "收费页面————水量信息")
|
|
|
public AjaxMessage<List<PayfeeWaterusedamount>> getWaterusedamount(
|
|
|
- @ApiParam(value = "客户id" ,required = true) @RequestParam(required = true)BigInteger id,
|
|
|
- @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year
|
|
|
- ){
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.getWaterusedamount(id,year));
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger id,
|
|
|
+ @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
|
|
|
+ ) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.getWaterusedamount(id, year));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getPayinvoiceInfo")
|
|
|
- @ApiOperation(value="收费页面————收据信息")
|
|
|
+ @ApiOperation(value = "收费页面————收据信息")
|
|
|
public AjaxMessage<List<PayInvoiceDto>> getPayinvoiceInfo(
|
|
|
- @ApiParam(value = "客户id" ,required = true) @RequestParam(required = true)BigInteger id,
|
|
|
- @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year
|
|
|
- ){
|
|
|
- return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayinvoiceInfo(id,year));
|
|
|
+ @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger id,
|
|
|
+ @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
|
|
|
+ ) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayinvoiceInfo(id, year));
|
|
|
}
|
|
|
}
|
|
|
|