|
|
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
@ -12,8 +13,10 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
|
|
import org.jeecg.modules.demo.erp.entity.StoreInfo;
|
|
|
|
|
import org.jeecg.modules.demo.erp.entity.ext.OrderDetailExt;
|
|
|
|
|
import org.jeecg.modules.demo.erp.entity.ext.OrderExt;
|
|
|
|
|
import org.jeecg.modules.demo.erp.service.IStoreInfoService;
|
|
|
|
|
import org.jeecg.modules.demo.erp.vo.OrderStateVo;
|
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
|
@ -43,7 +46,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -61,6 +63,8 @@ public class OrderController {
|
|
|
|
|
private IOrderService orderService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IOrderDetailService orderDetailService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IStoreInfoService iStoreInfoService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页列表查询
|
|
|
|
@ -82,17 +86,35 @@ public class OrderController {
|
|
|
|
|
Page<Order> page = new Page<Order>(pageNo, pageSize);
|
|
|
|
|
IPage<Order> pageList = orderService.page(page, queryWrapper);
|
|
|
|
|
|
|
|
|
|
//仓库信息
|
|
|
|
|
List<StoreInfo> storeInfoList = iStoreInfoService.list();
|
|
|
|
|
Map<Long,StoreInfo> storeInfoMap = storeInfoList
|
|
|
|
|
.stream()
|
|
|
|
|
.collect(
|
|
|
|
|
Collectors.toMap(StoreInfo::getId, Function.identity(),(k, v) -> k)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
List<OrderDetailExt> orderDetailExtList = orderDetailService.selectByMainIdExt("");
|
|
|
|
|
Map<Long, List<OrderDetailExt>> orderDetailExtMap = orderDetailExtList
|
|
|
|
|
.stream()
|
|
|
|
|
.collect(
|
|
|
|
|
Collectors.groupingBy(OrderDetailExt::getOrderId)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Page<OrderExt> pageExt = new Page<>(pageNo, pageSize);
|
|
|
|
|
List<OrderExt> records = new ArrayList<>();
|
|
|
|
|
pageList.getRecords().forEach(e ->{
|
|
|
|
|
OrderExt orderExt = new OrderExt();
|
|
|
|
|
BeanUtils.copyProperties(e,orderExt);
|
|
|
|
|
|
|
|
|
|
if(null != storeInfoMap
|
|
|
|
|
&& null != storeInfoMap.get(e.getStoreId())){
|
|
|
|
|
orderExt.setStoreAddr(storeInfoMap.get(e.getStoreId()).getAddr());
|
|
|
|
|
orderExt.setStoreContacts(storeInfoMap.get(e.getStoreId()).getContacts());
|
|
|
|
|
orderExt.setStoreName(storeInfoMap.get(e.getStoreId()).getName());
|
|
|
|
|
orderExt.setStorePhone(storeInfoMap.get(e.getStoreId()).getPhone());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(null != orderDetailExtMap
|
|
|
|
|
&& null != orderDetailExtMap.get(e.getId())){
|
|
|
|
|
orderExt.setOrderDetailList(orderDetailExtMap.get(e.getId()));
|
|
|
|
|