ky 6 years ago
parent 04adca5e75
commit c14b0c2049

@ -27,18 +27,18 @@ public class PcInvoiceController {
@PostMapping("/pcDisableInvoiceList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "待开票列表", notes = "待开票列表")
public Result pcDisableInvoiceList(Integer pageNum,Integer pageSize) {
public Result pcDisableInvoiceList(Integer pageNum,Integer pageSize,String copycatId) {
JSONObject invoiceList = invoiceService.pcDisableInvoiceList(pageNum,pageSize);
JSONObject invoiceList = invoiceService.pcDisableInvoiceList(pageNum,pageSize,copycatId);
return ResultBuilder.withPayload(invoiceList).build();
}
@PostMapping("/pcEnableInvoiceList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "已开票列表", notes = "已开票列表")
public Result pcEnableInvoiceList(Integer pageNum,Integer pageSize) {
public Result pcEnableInvoiceList(Integer pageNum,Integer pageSize,String copycatId) {
JSONObject invoiceList = invoiceService.pcEnableInvoiceList(pageNum,pageSize);
JSONObject invoiceList = invoiceService.pcEnableInvoiceList(pageNum,pageSize,copycatId);
return ResultBuilder.withPayload(invoiceList).build();
}

@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* <p>
@ -151,9 +152,23 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return invoiceHeader;
}
public JSONObject pcDisableInvoiceList(Integer pageNum,Integer pageSize){
Integer count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "disable"));
List<Invoice> invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Invoice>().eq("status_code", "disable").orderBy("create_date",false));
public JSONObject pcDisableInvoiceList(Integer pageNum, Integer pageSize, String copycatId) {
Integer count = null;
List<Invoice> invoiceList;
if (null == copycatId) {
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "disable"));
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Invoice>().eq("status_code", "disable").orderBy("create_date", false));
} else {
List<Custom> customList = customMapper.selectList(new EntityWrapper<Custom>().eq("copycat_id", copycatId));
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "disable").in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())));
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Invoice>().eq("status_code", "disable").in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())).orderBy("create_date", false));
}
for (Invoice invoice : invoiceList) {
String invoiceHeaderId = invoice.getInvoiceHeaderId();
@ -169,9 +184,22 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return jsonObject;
}
public JSONObject pcEnableInvoiceList(Integer pageNum,Integer pageSize){
Integer count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable"));
List<Invoice> invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Invoice>().eq("status_code", "enable").orderBy("create_date",false));
public JSONObject pcEnableInvoiceList(Integer pageNum, Integer pageSize, String copycatId) {
Integer count = null;
List<Invoice> invoiceList;
if (null == copycatId) {
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable"));
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Invoice>().eq("status_code", "enable").orderBy("create_date", false));
} else {
List<Custom> customList = customMapper.selectList(new EntityWrapper<Custom>().eq("copycat_id", copycatId));
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())));
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())).orderBy("create_date", false));
}
for (Invoice invoice : invoiceList) {
String invoiceHeaderId = invoice.getInvoiceHeaderId();
String customId = invoice.getCustomId();

Loading…
Cancel
Save