|
|
|
@@ -12,6 +12,7 @@ import com.iformall.service.ExcelService; |
|
|
|
import com.iformall.service.WxBillSettleService; |
|
|
|
import com.iformall.service.WxFlowService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@@ -20,6 +21,7 @@ import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author luozukai |
|
|
|
@@ -58,7 +60,36 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillSettleMapper.findList(record)); |
|
|
|
record.setLimitStart(0); |
|
|
|
record.setLimitEnd(Integer.MAX_VALUE); |
|
|
|
List totalList = wxBillSettleMapper.findList(record); |
|
|
|
if(CollectionUtils.isEmpty(totalList)){ |
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
PageInfo<WxBillSettle> pageInfo = new PageInfo(new ArrayList()); |
|
|
|
pageInfo.setPages(0); |
|
|
|
pageInfo.setTotal(0); |
|
|
|
PageHelper.clearPage(); |
|
|
|
return pageInfo; |
|
|
|
} |
|
|
|
|
|
|
|
int total = totalList.size(); |
|
|
|
int pages; |
|
|
|
if(total % pageSize == 0){ |
|
|
|
pages = total / pageSize; |
|
|
|
}else{ |
|
|
|
pages = total / pageSize +1; |
|
|
|
} |
|
|
|
record.setLimitStart((pageIndex -1) * pageSize); |
|
|
|
record.setLimitEnd(pageSize); |
|
|
|
List<WxBillSettle> list = wxBillSettleMapper.findList(record); |
|
|
|
|
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
PageInfo<WxBillSettle> pageInfo = new PageInfo(list); |
|
|
|
pageInfo.setPages(pages); |
|
|
|
pageInfo.setTotal(total); |
|
|
|
PageHelper.clearPage(); |
|
|
|
return pageInfo; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|