|
@@ -1,18 +1,28 @@
|
|
|
package com.bz.smart_city.controller.pay;
|
|
|
|
|
|
import com.bz.smart_city.commom.model.AjaxMessage;
|
|
|
+import com.bz.smart_city.commom.model.Pagination;
|
|
|
import com.bz.smart_city.commom.model.ResultStatus;
|
|
|
import com.bz.smart_city.dto.pay.ReturnPrintResultDto;
|
|
|
+import com.bz.smart_city.dto.pay.payfee.PayInvoiceSearchDto;
|
|
|
+import com.bz.smart_city.dto.pay.payfee.PayfeeInvoicePrintDto;
|
|
|
import com.bz.smart_city.service.pay.IssueElectronicInvoiceService;
|
|
|
+import com.bz.smart_city.service.pay.PrintInvoicePrintService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.math.BigInteger;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* @ClassName PayPrintInvoiceController
|
|
|
* @Description: TODO
|
|
@@ -27,6 +37,9 @@ public class PayPrintInvoiceController {
|
|
|
@Autowired
|
|
|
private IssueElectronicInvoiceService issueElectronicInvoiceService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PrintInvoicePrintService printInvoicePrintService;
|
|
|
+
|
|
|
@ApiOperation(value = "发票打印")
|
|
|
@GetMapping(value = "/InvoicePrintRequest")
|
|
|
public AjaxMessage<ReturnPrintResultDto> InvoicePrintRequest(
|
|
@@ -48,5 +61,40 @@ public class PayPrintInvoiceController {
|
|
|
ReturnPrintResultDto returnPrintResultDto = issueElectronicInvoiceService.requestPrint(siteId,customerId,"2", null, null, invoicePrintId);
|
|
|
return new AjaxMessage<>(ResultStatus.OK, returnPrintResultDto);
|
|
|
}
|
|
|
+ @ApiOperation(value = "发票列表")
|
|
|
+ @GetMapping(value = "/invoicePrintList")
|
|
|
+ public AjaxMessage<List<PayfeeInvoicePrintDto>> invoicePrintList(
|
|
|
+ @ApiParam(value = "发票id", required = false) @RequestParam(required = false) BigInteger id,
|
|
|
+ @ApiParam(value = "用户编号", required = false) @RequestParam(required = false) BigInteger accountId,
|
|
|
+ @ApiParam(value = "账期年", required = false) @RequestParam(required = false) Integer year) {
|
|
|
+ PayInvoiceSearchDto payInvoiceSearchDto=new PayInvoiceSearchDto();
|
|
|
+ payInvoiceSearchDto.setId(id);
|
|
|
+ payInvoiceSearchDto.setAccountId(accountId);
|
|
|
+ payInvoiceSearchDto.setYear(year);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, printInvoicePrintService.findList(payInvoiceSearchDto));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "发票列表分页")
|
|
|
+ @GetMapping(value = "/invoicePrintPageList")
|
|
|
+ public AjaxMessage<Pagination<PayfeeInvoicePrintDto>> invoicePrintPageList(
|
|
|
+ @ApiParam(value = "综合查询(发票号码/客户编号/客户名称)", required = false) @RequestParam(required = false) String condition,
|
|
|
+ @ApiParam(value = "发票状态", required = false) @RequestParam(required = false) Integer state,
|
|
|
+ @ApiParam(value = "开始时间yyyyMMddhhmmss", required = false) @RequestParam(required = false) String startPrintDate,
|
|
|
+ @ApiParam(value = "结束时间yyyyMMddhhmmss", required = false) @RequestParam(required = false) String endPrintDate,
|
|
|
+ @ApiParam(value = "页数,非必传,默认第一页", required = false, defaultValue = "1") @RequestParam(required = false, defaultValue = "1") int pageNum,
|
|
|
+ @ApiParam(value = "条数,非必传,默认10条", required = false, defaultValue = "10") @RequestParam(required = false, defaultValue = "10") int pageSize
|
|
|
+ ) {
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
|
|
+ PayInvoiceSearchDto payInvoiceSearchDto=new PayInvoiceSearchDto();
|
|
|
+ payInvoiceSearchDto.setCondition(condition);
|
|
|
+ payInvoiceSearchDto.setState(state);
|
|
|
+ if(StringUtils.isNotBlank(startPrintDate)){
|
|
|
+ payInvoiceSearchDto.setStartPrintDate( LocalDateTime.parse(startPrintDate,df));
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(endPrintDate)){
|
|
|
+ payInvoiceSearchDto.setEndPrintDate(LocalDateTime.parse(endPrintDate, df));
|
|
|
+ }
|
|
|
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, printInvoicePrintService.findPageList(payInvoiceSearchDto,pageNum,pageSize));
|
|
|
+ }
|
|
|
}
|