|
|
@@ -10,6 +10,7 @@
|
|
|
|
|
|
package com.yami.shop.platform.controller;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
@@ -30,6 +31,7 @@ import com.yami.shop.utils.CullenUtils;
|
|
|
import com.yami.shop.wx.service.impl.WxProviderServiceImpl;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
@@ -77,19 +79,7 @@ public class OrderController {
|
|
|
@GetMapping("/deliverList")
|
|
|
@ApiOperation("后管端-快递订单列表")
|
|
|
public R<IPage<Order>> deliverList(BackendOrderParam orderParam, PageParam<Order> page) {
|
|
|
- if (orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty()){
|
|
|
- return R.FAIL("请求参数-所属企业不允许为空");
|
|
|
- }
|
|
|
- if (orderParam.getChannelIdList().contains(0L)){
|
|
|
- Long userId = SecurityUtils.getSysUser().getUserId();
|
|
|
- List<Long> channelIdList = sysUserService.findByUserIdListId(userId);
|
|
|
- orderParam.setChannelIdList(channelIdList);
|
|
|
- if (userId != Constant.SUPER_ADMIN_ID&&(orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty())){
|
|
|
- List<Long> longs = new ArrayList<>();
|
|
|
- longs.add(0L);
|
|
|
- orderParam.setChannelIdList(longs);
|
|
|
- }
|
|
|
- }
|
|
|
+ getBackendOrderParam(orderParam);
|
|
|
IPage<Order> orderIPage = orderService.deliverList(page, orderParam);
|
|
|
return R.SUCCESS(orderIPage);
|
|
|
}
|
|
|
@@ -97,19 +87,7 @@ public class OrderController {
|
|
|
@GetMapping("/deliverListStatusNum")
|
|
|
@ApiOperation("后管端-快递订单列表-订单状态数量")
|
|
|
public R<Map<String, Integer>> deliverListStatusNum(BackendOrderParam orderParam) {
|
|
|
- if (orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty()){
|
|
|
- return R.FAIL("请求参数-所属企业不允许为空");
|
|
|
- }
|
|
|
- if (orderParam.getChannelIdList().contains(0L)){
|
|
|
- Long userId = SecurityUtils.getSysUser().getUserId();
|
|
|
- List<Long> channelIdList = sysUserService.findByUserIdListId(userId);
|
|
|
- orderParam.setChannelIdList(channelIdList);
|
|
|
- if (userId != Constant.SUPER_ADMIN_ID&&(orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty())){
|
|
|
- List<Long> longs = new ArrayList<>();
|
|
|
- longs.add(0L);
|
|
|
- orderParam.setChannelIdList(longs);
|
|
|
- }
|
|
|
- }
|
|
|
+ getBackendOrderParam(orderParam);
|
|
|
return R.SUCCESS(orderService.deliverListStatusNum(orderParam));
|
|
|
}
|
|
|
|
|
|
@@ -260,8 +238,16 @@ public class OrderController {
|
|
|
@GetMapping("/export")
|
|
|
@ApiOperation("后管端-快递订单列表导出")
|
|
|
public void export(BackendOrderParam orderParam, HttpServletResponse response) {
|
|
|
+ getBackendOrderParam(orderParam);
|
|
|
+ orderService.export(orderParam,response);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getBackendOrderParam(BackendOrderParam orderParam){
|
|
|
if (orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty()){
|
|
|
- throw new GlobalException("请求参数-所属企业不允许为空");
|
|
|
+ throw new GlobalException("请求参数-所属企业不允许为空");
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isEmpty(orderParam.getUserAttrType())){
|
|
|
+ orderParam.setUserAttrType("1");//默认查询正常人员属性
|
|
|
}
|
|
|
if (orderParam.getChannelIdList().contains(0L)){
|
|
|
Long userId = null;
|
|
|
@@ -278,7 +264,5 @@ public class OrderController {
|
|
|
orderParam.setChannelIdList(longs);
|
|
|
}
|
|
|
}
|
|
|
- orderService.export(orderParam,response);
|
|
|
}
|
|
|
-
|
|
|
}
|