|
|
|
@ -159,20 +159,22 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|
|
|
|
|
|
|
|
|
public JSONObject pcDisableInvoiceList(Integer pageNum, Integer pageSize, String copycatId) {
|
|
|
|
|
|
|
|
|
|
Integer count = null;
|
|
|
|
|
List<Invoice> invoiceList;
|
|
|
|
|
Integer count = 0;
|
|
|
|
|
List<Invoice> invoiceList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
if (customList.size() != 0) {
|
|
|
|
|
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) {
|
|
|
|
@ -182,7 +184,7 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|
|
|
|
InvoiceHeader invoiceHeader = invoiceHeaderMapper.selectById(invoiceHeaderId);
|
|
|
|
|
invoice.setCustomName(custom.getCompanyName());
|
|
|
|
|
invoice.setInvoiceHeaderName(invoiceHeader.getCompanyName());
|
|
|
|
|
if(null!=custom.getCopycatId()){
|
|
|
|
|
if (null != custom.getCopycatId()) {
|
|
|
|
|
PcUser pcUser = pcUserMapper.selectById(custom.getCopycatId());
|
|
|
|
|
invoice.setCopycatName(pcUser.getName());
|
|
|
|
|
}
|
|
|
|
@ -194,20 +196,22 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JSONObject pcEnableInvoiceList(Integer pageNum, Integer pageSize, String copycatId) {
|
|
|
|
|
Integer count = null;
|
|
|
|
|
List<Invoice> invoiceList;
|
|
|
|
|
Integer count = 0;
|
|
|
|
|
List<Invoice> invoiceList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
if (customList.size() != 0) {
|
|
|
|
|
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();
|
|
|
|
@ -216,7 +220,7 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|
|
|
|
InvoiceHeader invoiceHeader = invoiceHeaderMapper.selectById(invoiceHeaderId);
|
|
|
|
|
invoice.setCustomName(custom.getCompanyName());
|
|
|
|
|
invoice.setInvoiceHeaderName(invoiceHeader.getCompanyName());
|
|
|
|
|
if(null!=custom.getCopycatId()){
|
|
|
|
|
if (null != custom.getCopycatId()) {
|
|
|
|
|
PcUser pcUser = pcUserMapper.selectById(custom.getCopycatId());
|
|
|
|
|
invoice.setCopycatName(pcUser.getName());
|
|
|
|
|
}
|
|
|
|
|