|
|
|
@ -201,23 +201,25 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|
|
|
|
Integer count = null;
|
|
|
|
|
List<Invoice> invoiceList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
Wrapper<Invoice> invoiceWrapper = new EntityWrapper<Invoice>().eq("status_code", "enable");
|
|
|
|
|
|
|
|
|
|
if (null == copycatId) {
|
|
|
|
|
Wrapper<Custom> wrapper = new EntityWrapper<Custom>();
|
|
|
|
|
if(null!=keyword){
|
|
|
|
|
wrapper.like("company_name",keyword);
|
|
|
|
|
}
|
|
|
|
|
if(null!=beginTime){
|
|
|
|
|
wrapper.ge("create_date",new Date(beginTime));
|
|
|
|
|
invoiceWrapper.ge("create_date",new Date(beginTime));
|
|
|
|
|
}
|
|
|
|
|
if(null!=endTime){
|
|
|
|
|
wrapper.le("create_date",new Date(endTime));
|
|
|
|
|
invoiceWrapper.le("create_date",new Date(endTime));
|
|
|
|
|
}
|
|
|
|
|
List<Custom> customList = customMapper.selectList(wrapper);
|
|
|
|
|
if (customList.size() != 0) {
|
|
|
|
|
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
|
|
|
|
|
count = invoiceMapper.selectCount(invoiceWrapper.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 ->
|
|
|
|
|
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), invoiceWrapper.in("custom_id", customList.stream().map(item ->
|
|
|
|
|
item.getId()
|
|
|
|
|
).collect(Collectors.toList())).orderBy("create_date", false));
|
|
|
|
|
}
|
|
|
|
@ -228,26 +230,27 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|
|
|
|
wrapper.like("company_name",keyword);
|
|
|
|
|
}
|
|
|
|
|
if(null!=beginTime){
|
|
|
|
|
wrapper.ge("create_date",new Date(beginTime));
|
|
|
|
|
invoiceWrapper.ge("create_date",new Date(beginTime));
|
|
|
|
|
}
|
|
|
|
|
if(null!=endTime){
|
|
|
|
|
wrapper.le("create_date",new Date(endTime));
|
|
|
|
|
invoiceWrapper.le("create_date",new Date(endTime));
|
|
|
|
|
}
|
|
|
|
|
List<Custom> customList = customMapper.selectList(wrapper);
|
|
|
|
|
if (customList.size() != 0) {
|
|
|
|
|
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
|
|
|
|
|
count = invoiceMapper.selectCount(invoiceWrapper.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 ->
|
|
|
|
|
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), invoiceWrapper.in("custom_id", customList.stream().map(item ->
|
|
|
|
|
item.getId()
|
|
|
|
|
).collect(Collectors.toList())).orderBy("create_date", false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (Invoice invoice : invoiceList) {
|
|
|
|
|
String invoiceHeaderId = invoice.getInvoiceHeaderId();
|
|
|
|
|
InvoiceHeader invoiceHeader = invoiceHeaderMapper.selectById(invoiceHeaderId);
|
|
|
|
|
|
|
|
|
|
String customId = invoice.getCustomId();
|
|
|
|
|
Custom custom = customMapper.selectById(customId);
|
|
|
|
|
InvoiceHeader invoiceHeader = invoiceHeaderMapper.selectById(invoiceHeaderId);
|
|
|
|
|
invoice.setCustomName(custom.getCompanyName());
|
|
|
|
|
invoice.setInvoiceHeaderName(invoiceHeader.getCompanyName());
|
|
|
|
|
if (null != custom.getCopycatId()) {
|
|
|
|
|