思路:两个接口1.首先查询出订单的列表头及id
2.根据id查询出对应数据,前端显示展示
下面部分为第一步代码实现部分,第二步不详细赘述:
public JsonResult getInComeHeader(String storeid, String operid) {
JsonResult jsonResult = storeService.payQuery(storeid, operid);
List<TableHeaderViewModel> list = new ArrayList<>();
if (JsonResult.success != jsonResult.getStatus()) {
return jsonResult;
}
List<PaymentResBean> paylist = (List<PaymentResBean>) jsonResult.getResult();
PaymentResBean payment = null;
for (int i = 0; i < paylist.size(); i++) {
payment = paylist.get(i);
list.add(new TableHeaderViewModel(payment.getId(), payment.getPaytype(), false, false));
}
List<CooperatecommodityBean> goodlist = commonService.getList("cooperatecommodity", storeid);
CooperatecommodityBean goods = null;
for (int i = 0; i < goodlist.size(); i++) {
goods = goodlist.get(i);
list.add(new TableHeaderViewModel(goods.getId(),
goods.getCommodityname() + "_" + goods.getNormal() + "(回款额:" + goods.getPercent() + "%)", false, false));
list.add(new TableHeaderViewModel(goods.getId() + "_01",
goods.getCommodityname() + "_" + goods.getNormal() + "(成交额:" + (new BigDecimal(100).subtract(goods.getPercent())) + "%)", false, false));
}
jsonResult.setStatus(JsonResult.success);
jsonResult.setResult(list);
return jsonResult;
}
```