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

Ken

查询所有发票:
分页查询,支持查询条件:购方企业名称、销方名称、发票号码、发票状态、上传方式、发票类型、开票日期范围、上传日期范围、票面金额范围、发票实体、发票来源、验真分类、创建者、序列号
parent fa3fbe94
......@@ -6,12 +6,18 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.github.pagehelper.PageHelper;
import pwc.taxtech.atms.controller.BaseController;
import pwc.taxtech.atms.dto.OperationResultDto;
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;
import pwc.taxtech.atms.service.InvoiceManageService;
import java.math.BigDecimal;
import java.util.List;
@Controller
......@@ -24,15 +30,16 @@ public class InvoiceManageController extends BaseController {
@ResponseBody
@RequestMapping(value = "getInputInvoiceList", method = RequestMethod.POST)
public CamelPagingResultDto<InputInvoice> getInputInvoiceList(@RequestBody InputInvoiceQueryDto inputInvoiceQueryDto) {
//todo 参数校验
CamelPagingResultDto resultDto = new CamelPagingResultDto();
CamelPagingResultDto<InputInvoice> resultDto = new CamelPagingResultDto<InputInvoice>();
try {
List<InputInvoice> list = invoiceManageService.getInputInvoiceList(inputInvoiceQueryDto);
resultDto.setList(list);
CamelPagingDto camelPagingDto=inputInvoiceQueryDto.getPagingDto()==null?new CamelPagingDto():inputInvoiceQueryDto.getPagingDto();
resultDto = invoiceManageService.getInputInvoiceList(inputInvoiceQueryDto);
//todo 业务代码
} catch (Exception e) {
logger.error("getInputInvoiceList error.",e);
}
return resultDto;
}
}
package pwc.taxtech.atms.dto.input;
import java.math.BigDecimal;
import java.util.Date;
import net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveTypeAwareAssigner;
public class InputInvoiceQueryDto {
//todo 添加其他参数
//购方企业名称
private String buyerBankName;
//销方名称
private String sellerName;
//发票号码
private String invoiceNumber;
//发票状态
private Integer status;
//上传方式
private Integer uploadType;
//发票类型
private Integer invoiceType;
//开票日期范围
private Date invoiceDate;
//上传日期范围
private Date uploadDate;
//票面金额范围
private BigDecimal amount;
//发票实体
private Integer invoiceEntityType;
//发票来源
private Integer invoiceSourceType;
//验真分类
//创建者
private String staffId;
//序列号
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;
public CamelPagingDto getPagingDto() {
......@@ -11,4 +73,109 @@ public class InputInvoiceQueryDto {
public void setPagingDto(CamelPagingDto pagingDto) {
this.pagingDto = pagingDto;
}
public String getBuyerBankName() {
return buyerBankName;
}
public void setBuyerBankName(String buyerBankName) {
this.buyerBankName = buyerBankName;
}
public String getSellerName() {
return sellerName;
}
public void setSellerName(String sellerName) {
this.sellerName = sellerName;
}
public String getInvoiceNumber() {
return invoiceNumber;
}
public void setInvoiceNumber(String invoiceNumber) {
this.invoiceNumber = invoiceNumber;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getUploadType() {
return uploadType;
}
public void setUploadType(Integer uploadType) {
this.uploadType = uploadType;
}
public Integer getInvoiceType() {
return invoiceType;
}
public void setInvoiceType(Integer invoiceType) {
this.invoiceType = invoiceType;
}
public Date getInvoiceDate() {
return invoiceDate;
}
public void setInvoiceDate(Date invoiceDate) {
this.invoiceDate = invoiceDate;
}
public Date getUploadDate() {
return uploadDate;
}
public void setUploadDate(Date uploadDate) {
this.uploadDate = uploadDate;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Integer getInvoiceEntityType() {
return invoiceEntityType;
}
public void setInvoiceEntityType(Integer invoiceEntityType) {
this.invoiceEntityType = invoiceEntityType;
}
public Integer getInvoiceSourceType() {
return invoiceSourceType;
}
public void setInvoiceSourceType(Integer invoiceSourceType) {
this.invoiceSourceType = invoiceSourceType;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
}
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.input.InputInvoiceQueryDto;
import pwc.taxtech.atms.entitiy.InputInvoice;
......@@ -11,5 +12,5 @@ public interface InvoiceManageService {
* @param inputInvoiceQueryDto param
* @return list
*/
List<InputInvoice> getInputInvoiceList(InputInvoiceQueryDto inputInvoiceQueryDto);
CamelPagingResultDto<InputInvoice> getInputInvoiceList(InputInvoiceQueryDto inputInvoiceQueryDto);
}
package pwc.taxtech.atms.service.impl;
import org.apache.commons.lang.ObjectUtils.Null;
import org.aspectj.weaver.WeakClassLoaderReference;
import org.hamcrest.core.Is;
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;
import pwc.taxtech.atms.dto.input.InputInvoiceQueryDto;
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 {
@Autowired
private InputInvoiceMapper inputInvoiceMapper;
@Override
public List<InputInvoice> getInputInvoiceList(InputInvoiceQueryDto inputInvoiceQueryDto) {
return null;
public CamelPagingResultDto<InputInvoice> getInputInvoiceList(InputInvoiceQueryDto inputInvoiceQueryDto) {
InputInvoiceExample example=new InputInvoiceExample();
InputInvoiceExample.Criteria criteria=example.createCriteria();
if (inputInvoiceQueryDto.getAmount()!=null ) {
criteria.andAmountEqualTo(inputInvoiceQueryDto.getAmount());
}
if (inputInvoiceQueryDto.getBuyerBankName()!=null ) {
criteria.andBuyerBankNameEqualTo(inputInvoiceQueryDto.getBuyerBankName());
}
if (inputInvoiceQueryDto.getInvoiceDate()!=null ) {
criteria.andInvoiceDateEqualTo(inputInvoiceQueryDto.getInvoiceDate());
}
if (inputInvoiceQueryDto.getInvoiceEntityType()!=null ) {
criteria.andInvoiceEntityTypeEqualTo(inputInvoiceQueryDto.getInvoiceEntityType());
}
if (inputInvoiceQueryDto.getInvoiceNumber()!=null ) {
criteria.andInvoiceNameEqualTo(inputInvoiceQueryDto.getInvoiceNumber());
}
if (inputInvoiceQueryDto.getInvoiceSourceType()!=null ) {
criteria.andInvoiceSourceTypeEqualTo(inputInvoiceQueryDto.getInvoiceSourceType());
}
if (inputInvoiceQueryDto.getInvoiceType()!=null ) {
criteria.andInvoiceTypeEqualTo(inputInvoiceQueryDto.getInvoiceType());
}
if (inputInvoiceQueryDto.getSellerName()!=null ) {
criteria.andSellerNameEqualTo(inputInvoiceQueryDto.getSellerName());
}
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.getUploadType()!=null ) {
criteria.andUploadTypeEqualTo(inputInvoiceQueryDto.getUploadType());
}
Integer pageIndex=inputInvoiceQueryDto.getPagingDto().getPageIndex()!=null?inputInvoiceQueryDto.getPagingDto().getPageIndex():1;
Integer pageSize=inputInvoiceQueryDto.getPagingDto().getPageSize()!=null?inputInvoiceQueryDto.getPagingDto().getPageSize():10;
PageHelper.startPage(pageIndex,pageSize);
List<InputInvoice> lists = inputInvoiceMapper.selectByExample(example);
PageInfo pageInfo = new PageInfo<InputInvoice>(lists);
CamelPagingResultDto<InputInvoice> camelPagingResultDto=new CamelPagingResultDto<InputInvoice>();
camelPagingResultDto.setList(pageInfo.getList());
inputInvoiceQueryDto.getPagingDto().setTotalCount((int) pageInfo.getTotal());
InputInvoice inputInvoice=new InputInvoice();
CommonUtils.copyProperties(inputInvoiceQueryDto,inputInvoice);
camelPagingResultDto.setPageInfo(inputInvoiceQueryDto.getPagingDto());
camelPagingResultDto.setCalculateData(inputInvoice);
return camelPagingResultDto;
}
}
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- <mappers> <mapper class="org.apache.ibatis.submitted.basetest.Mapper" /> </mappers> -->
<!-- <settings> <setting name="logImpl" value="LOG4J" /> </settings> -->
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- <mappers> <mapper class="org.apache.ibatis.submitted.basetest.Mapper" /> </mappers> -->
<!-- <settings> <setting name="logImpl" value="LOG4J" /> </settings> -->
<!--使用pageHelper插件-->
<!-- <plugins>
com.github.pagehelper 为 PageHelper 类所在包名
<plugin interceptor="com.github.pagehelper.PageHelper">
设置数据库类型 Oracle,Mysql,MariaDB,SQLite,Hsqldb,PostgreSQL 六种数据库
<property name="dialect" value="mysql"/>
</plugin>
</plugins> -->
</configuration>
\ No newline at end of file
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