Commit a8ebb8bb authored by ken.q.you's avatar ken.q.you

Ken 发票导出

parent fd860975
......@@ -10,3 +10,4 @@ rebel.xml
/atms-web/src/main/webapp/node_modules
**/*.iml
**/.idea/
/bin/
......@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.github.pagehelper.PageHelper;
import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.controller.BaseController;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.input.CamelPagingDto;
......@@ -27,13 +28,14 @@ public class InvoiceManageController extends BaseController {
@Autowired
private InvoiceManageService invoiceManageService;
@ApiOperation(value = "查询所有发票")
@ResponseBody
@RequestMapping(value = "getInputInvoiceList", method = RequestMethod.POST)
public CamelPagingResultDto<InputInvoice> getInputInvoiceList(@RequestBody InputInvoiceQueryDto inputInvoiceQueryDto) {
CamelPagingResultDto<InputInvoice> resultDto = new CamelPagingResultDto<InputInvoice>();
try {
CamelPagingDto camelPagingDto=inputInvoiceQueryDto.getPagingDto()==null?new CamelPagingDto():inputInvoiceQueryDto.getPagingDto();
resultDto = invoiceManageService.getInputInvoiceList(inputInvoiceQueryDto);
//todo 业务代码
} catch (Exception e) {
......@@ -42,4 +44,13 @@ public class InvoiceManageController extends BaseController {
return resultDto;
}
@ApiOperation(value = "导出所有关联发票")
@ResponseBody
@RequestMapping(value = "exportInvoiceAllInfoList", method = RequestMethod.POST)
public String exportInvoiceAllInfoList(@RequestBody InputInvoiceQueryDto inputInvoiceQueryDto,String filename) {
String filePath=invoiceManageService.exportInvoiceAllInfoList(inputInvoiceQueryDto, inputInvoiceQueryDto.getPagingDto(), filename);
return null;
}
}
......@@ -2,13 +2,21 @@ package pwc.taxtech.atms.dto.input;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
public class CamelPagingResultDto<T> {
@JSONField(name="List")
private List<T> list;
@JSONField(name="PageInfo")
private CamelPagingDto pageInfo;
private T calculateData;
public CamelPagingResultDto() {
super();
}
public List<T> getList() {
return list;
}
......
......@@ -20,48 +20,28 @@ public class InputInvoiceQueryDto {
//发票类型
private Integer invoiceType;
//开票日期范围
private Date invoiceDate;
private Date invoiceDateForm;
private Date invoiceDateTo;
//上传日期范围
private Date uploadDate;
private Date uploadDateForm;
private Date uploadDateTo;
//票面金额范围
private BigDecimal amount;
private BigDecimal amountForm;
private BigDecimal amountTo;
//发票实体
private Integer invoiceEntityType;
//发票来源
private Integer invoiceSourceType;
//验真分类
private Integer verifyType;
//创建者
private String staffId;
private String createBy;
//序列号
private String serialNo;
// private String buyerAddress;
//
// private String buyerBankAccountNumber;
//
// private String buyerName;
//
// private String buyerPhone;
//
// private String buyerTaxNumber;
//
// private String checkCode;
//
// private String createBy;
//
// private Date createTime;
@Override
public String toString() {
return "InputInvoiceQueryDto [buyerBankName=" + buyerBankName + ", sellerName=" + sellerName
+ ", invoiceNumber=" + invoiceNumber + ", status=" + status + ", uploadType=" + uploadType
+ ", invoiceType=" + invoiceType + ", invoiceDate=" + invoiceDate + ", uploadDate=" + uploadDate
+ ", amount=" + amount + ", invoiceEntityType=" + invoiceEntityType + ", invoiceSourceType="
+ invoiceSourceType + ", staffId=" + staffId + ", serialNo=" + serialNo + ", pagingDto=" + pagingDto
+ "]";
}
private CamelPagingDto pagingDto;
......@@ -122,28 +102,71 @@ public class InputInvoiceQueryDto {
this.invoiceType = invoiceType;
}
public Date getInvoiceDate() {
return invoiceDate;
public Date getInvoiceDateForm() {
return invoiceDateForm;
}
public void setInvoiceDateForm(Date invoiceDateForm) {
this.invoiceDateForm = invoiceDateForm;
}
public Date getInvoiceDateTo() {
return invoiceDateTo;
}
public void setInvoiceDateTo(Date invoiceDateTo) {
this.invoiceDateTo = invoiceDateTo;
}
public Date getUploadDateForm() {
return uploadDateForm;
}
public void setInvoiceDate(Date invoiceDate) {
this.invoiceDate = invoiceDate;
public void setUploadDateForm(Date uploadDateForm) {
this.uploadDateForm = uploadDateForm;
}
public Date getUploadDate() {
return uploadDate;
public Date getUploadDateTo() {
return uploadDateTo;
}
public void setUploadDate(Date uploadDate) {
this.uploadDate = uploadDate;
public void setUploadDateTo(Date uploadDateTo) {
this.uploadDateTo = uploadDateTo;
}
public BigDecimal getAmount() {
return amount;
public BigDecimal getAmountForm() {
return amountForm;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
public void setAmountForm(BigDecimal amountForm) {
this.amountForm = amountForm;
}
public BigDecimal getAmountTo() {
return amountTo;
}
public void setAmountTo(BigDecimal amountTo) {
this.amountTo = amountTo;
}
public Integer getVerifyType() {
return verifyType;
}
public void setVerifyType(Integer verifyType) {
this.verifyType = verifyType;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Integer getInvoiceEntityType() {
......@@ -162,13 +185,7 @@ public class InputInvoiceQueryDto {
this.invoiceSourceType = invoiceSourceType;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getSerialNo() {
return serialNo;
......
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.input.CamelPagingDto;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.input.InputInvoiceQueryDto;
import pwc.taxtech.atms.entitiy.InputInvoice;
......@@ -13,4 +14,14 @@ public interface InvoiceManageService {
* @return list
*/
CamelPagingResultDto<InputInvoice> getInputInvoiceList(InputInvoiceQueryDto inputInvoiceQueryDto);
/**
* 导出所有关联发票
* @param inputInvoiceQueryDto
* @param pagingDto
* @param fileName
* @return
*/
String exportInvoiceAllInfoList(InputInvoiceQueryDto inputInvoiceQueryDto, CamelPagingDto pagingDto, String fileName);
}
package pwc.taxtech.atms.service.impl;
import org.apache.commons.lang.ObjectUtils.Null;
import org.aspectj.weaver.WeakClassLoaderReference;
import org.hamcrest.core.Is;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.sf.jsqlparser.statement.select.Select;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dao.CustomerMapper;
import pwc.taxtech.atms.dao.InputInvoiceMapper;
import pwc.taxtech.atms.dto.input.CamelPagingDto;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
......@@ -21,11 +17,6 @@ import pwc.taxtech.atms.entitiy.InputInvoice;
import pwc.taxtech.atms.entitiy.InputInvoiceExample;
import pwc.taxtech.atms.service.InvoiceManageService;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
public class InvoiceManageServiceImpl extends BaseService implements InvoiceManageService {
......@@ -37,14 +28,20 @@ public class InvoiceManageServiceImpl extends BaseService implements InvoiceMana
InputInvoiceExample example=new InputInvoiceExample();
InputInvoiceExample.Criteria criteria=example.createCriteria();
if (inputInvoiceQueryDto.getAmount()!=null ) {
criteria.andAmountEqualTo(inputInvoiceQueryDto.getAmount());
if (inputInvoiceQueryDto.getAmountForm()!=null ) {
criteria.andAmountGreaterThanOrEqualTo(inputInvoiceQueryDto.getAmountForm());
}
if (inputInvoiceQueryDto.getAmountTo()!=null ) {
criteria.andAmountLessThanOrEqualTo(inputInvoiceQueryDto.getAmountTo());
}
if (inputInvoiceQueryDto.getBuyerBankName()!=null ) {
criteria.andBuyerBankNameEqualTo(inputInvoiceQueryDto.getBuyerBankName());
}
if (inputInvoiceQueryDto.getInvoiceDate()!=null ) {
criteria.andInvoiceDateEqualTo(inputInvoiceQueryDto.getInvoiceDate());
if (inputInvoiceQueryDto.getInvoiceDateForm()!=null ) {
criteria.andInvoiceDateGreaterThanOrEqualTo(inputInvoiceQueryDto.getInvoiceDateForm());
}
if (inputInvoiceQueryDto.getInvoiceDateTo()!=null ) {
criteria.andInvoiceDateLessThanOrEqualTo(inputInvoiceQueryDto.getInvoiceDateTo());
}
if (inputInvoiceQueryDto.getInvoiceEntityType()!=null ) {
criteria.andInvoiceEntityTypeEqualTo(inputInvoiceQueryDto.getInvoiceEntityType());
......@@ -64,18 +61,25 @@ public class InvoiceManageServiceImpl extends BaseService implements InvoiceMana
if (inputInvoiceQueryDto.getSerialNo()!=null ) {
criteria.andSerialNoEqualTo(inputInvoiceQueryDto.getSerialNo());
}
if (inputInvoiceQueryDto.getStaffId()!=null ) {
criteria.andStaffIdEqualTo(inputInvoiceQueryDto.getStaffId());
}
if (inputInvoiceQueryDto.getStatus()!=null ) {
criteria.andStatusEqualTo(inputInvoiceQueryDto.getStatus());
}
if (inputInvoiceQueryDto.getUploadDate()!=null ) {
criteria.andUploadDateEqualTo(inputInvoiceQueryDto.getUploadDate());
if (inputInvoiceQueryDto.getUploadDateForm()!=null ) {
criteria.andUploadDateGreaterThanOrEqualTo(inputInvoiceQueryDto.getUploadDateForm());
}
if (inputInvoiceQueryDto.getUploadDateTo()!=null ) {
criteria.andUploadDateLessThanOrEqualTo(inputInvoiceQueryDto.getUploadDateTo());
}
if (inputInvoiceQueryDto.getUploadType()!=null ) {
criteria.andUploadTypeEqualTo(inputInvoiceQueryDto.getUploadType());
}
if (inputInvoiceQueryDto.getVerifyType()!=null ) {
criteria.andVerifyTypeEqualTo(inputInvoiceQueryDto.getVerifyType());
}
if(inputInvoiceQueryDto.getCreateBy()!=null) {
criteria.andCreateByEqualTo(inputInvoiceQueryDto.getCreateBy());
}
Integer pageIndex=inputInvoiceQueryDto.getPagingDto().getPageIndex()!=null?inputInvoiceQueryDto.getPagingDto().getPageIndex():1;
Integer pageSize=inputInvoiceQueryDto.getPagingDto().getPageSize()!=null?inputInvoiceQueryDto.getPagingDto().getPageSize():10;
......@@ -94,4 +98,11 @@ public class InvoiceManageServiceImpl extends BaseService implements InvoiceMana
camelPagingResultDto.setCalculateData(inputInvoice);
return camelPagingResultDto;
}
@Override
public String exportInvoiceAllInfoList(InputInvoiceQueryDto inputInvoiceQueryDto, CamelPagingDto pagingDto,
String fileName) {
// TODO Auto-generated method stub
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment