|
@@ -8,6 +8,8 @@ import com.iamberry.rst.core.tools.LogisticsInfo;
|
|
|
import com.iamberry.rst.faces.cm.SalesOrderService;
|
|
|
import com.iamberry.rst.faces.order.LogisticsInfoService;
|
|
|
import com.iamberry.rst.faces.order.OrderBatchService;
|
|
|
+import com.iamberry.rst.faces.order.OrderDepartService;
|
|
|
+import com.iamberry.rst.util.PageUtil;
|
|
|
import com.iamberry.rst.utils.AdminUtils;
|
|
|
import com.iamberry.rst.utils.StitchAttrUtil;
|
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
@@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Controller
|
|
@@ -34,6 +37,8 @@ public class AdminOrderBatchController {
|
|
|
private SalesOrderService salesOrderService;
|
|
|
@Autowired
|
|
|
private LogisticsInfoService logisticsInfoService;
|
|
|
+ @Autowired
|
|
|
+ private OrderDepartService orderDepartService;
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(AdminOrderBatchController.class);
|
|
|
|
|
|
* 批次列表
|
|
@@ -48,21 +53,34 @@ public class AdminOrderBatchController {
|
|
|
@RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
|
|
|
ModelAndView mv = new ModelAndView("order/bacth/order_batch_list");
|
|
|
|
|
|
- Admin admin = AdminUtils.getLoginAdmin();
|
|
|
- Integer identity = admin.getAdminDept();
|
|
|
- if(identity == 2){
|
|
|
- orderBatch.setSalesAdminId(admin.getAdminId());
|
|
|
- }
|
|
|
-
|
|
|
- PagedResult<OrderBatch> pagedResult = orderBatchService.listOrderBatchPage(pageNO, pageSize, orderBatch, totalNum == 0);
|
|
|
- if (totalNum != 0){
|
|
|
- pagedResult.setTotal(totalNum);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Integer[] storeIds = orderDepartService.getDepartStoreIds(AdminUtils.getLoginAdminId());
|
|
|
+ PagedResult<OrderBatch> pagedResult = null;
|
|
|
+ if(storeIds.length < 1){
|
|
|
+ pagedResult = PageUtil.getPage(new ArrayList<OrderBatch>());
|
|
|
+ pagedResult.setTotal(0);
|
|
|
+ pagedResult.setPageNo(1);
|
|
|
+ pagedResult.setPages(0);
|
|
|
+ pagedResult.setPageSize(20);
|
|
|
+ if (totalNum != 0){
|
|
|
+ pagedResult.setTotal(totalNum);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ orderBatch.setStoreIds(storeIds);
|
|
|
+ pagedResult = orderBatchService.listOrderBatchPage(pageNO, pageSize, orderBatch, totalNum == 0);
|
|
|
+ if (totalNum != 0){
|
|
|
+ pagedResult.setTotal(totalNum);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
StitchAttrUtil.getSa()
|
|
|
.addDatePro("yyyy-MM-dd HH:mm:ss","startDate","endDate")
|
|
|
.setModelAndView(orderBatch, mv, "/admin/order_batch/batch_list", pagedResult);
|
|
|
-
|
|
|
return mv;
|
|
|
}
|
|
|
|