|
@@ -22,11 +22,14 @@ import com.yami.shop.common.util.PageParam;
|
|
|
import com.yami.shop.common.util.R;
|
|
import com.yami.shop.common.util.R;
|
|
|
import com.yami.shop.security.comment.dao.AppConnectMapper;
|
|
import com.yami.shop.security.comment.dao.AppConnectMapper;
|
|
|
import com.yami.shop.security.comment.model.AppConnect;
|
|
import com.yami.shop.security.comment.model.AppConnect;
|
|
|
|
|
+import com.yami.shop.security.platform.util.SecurityUtils;
|
|
|
import com.yami.shop.service.*;
|
|
import com.yami.shop.service.*;
|
|
|
|
|
+import com.yami.shop.sys.service.SysUserService;
|
|
|
import com.yami.shop.utils.CullenUtils;
|
|
import com.yami.shop.utils.CullenUtils;
|
|
|
import com.yami.shop.wx.service.impl.WxProviderServiceImpl;
|
|
import com.yami.shop.wx.service.impl.WxProviderServiceImpl;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -61,7 +64,8 @@ public class OrderController {
|
|
|
private final OrderSettlementService orderSettlementService;
|
|
private final OrderSettlementService orderSettlementService;
|
|
|
private final AppConnectMapper appConnectMapper;
|
|
private final AppConnectMapper appConnectMapper;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SysUserService sysUserService;
|
|
|
/**
|
|
/**
|
|
|
* 分页获取
|
|
* 分页获取
|
|
|
*/
|
|
*/
|
|
@@ -78,6 +82,11 @@ public class OrderController {
|
|
|
if (orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty()){
|
|
if (orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty()){
|
|
|
return R.FAIL("请求参数-所属企业不允许为空");
|
|
return R.FAIL("请求参数-所属企业不允许为空");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (orderParam.getChannelIdList().contains(0L)){
|
|
|
|
|
+ Long userId = SecurityUtils.getSysUser().getUserId();
|
|
|
|
|
+ List<Long> channelIdList = sysUserService.findByUserIdListId(userId);
|
|
|
|
|
+ orderParam.setChannelIdList(channelIdList);
|
|
|
|
|
+ }
|
|
|
IPage<Order> orderIPage = orderService.deliverList(page, orderParam);
|
|
IPage<Order> orderIPage = orderService.deliverList(page, orderParam);
|
|
|
return R.SUCCESS(orderIPage);
|
|
return R.SUCCESS(orderIPage);
|
|
|
}
|
|
}
|
|
@@ -85,6 +94,11 @@ public class OrderController {
|
|
|
@GetMapping("/deliverListStatusNum")
|
|
@GetMapping("/deliverListStatusNum")
|
|
|
@ApiOperation("后管端-快递订单列表-订单状态数量")
|
|
@ApiOperation("后管端-快递订单列表-订单状态数量")
|
|
|
public R<Map<String, Integer>> deliverListStatusNum(BackendOrderParam orderParam) {
|
|
public R<Map<String, Integer>> deliverListStatusNum(BackendOrderParam orderParam) {
|
|
|
|
|
+ if (orderParam.getChannelIdList().contains(0L)){
|
|
|
|
|
+ Long userId = SecurityUtils.getSysUser().getUserId();
|
|
|
|
|
+ List<Long> channelIdList = sysUserService.findByUserIdListId(userId);
|
|
|
|
|
+ orderParam.setChannelIdList(channelIdList);
|
|
|
|
|
+ }
|
|
|
return R.SUCCESS(orderService.deliverListStatusNum(orderParam));
|
|
return R.SUCCESS(orderService.deliverListStatusNum(orderParam));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -237,6 +251,11 @@ public class OrderController {
|
|
|
public void export(BackendOrderParam orderParam, HttpServletResponse response) {
|
|
public void export(BackendOrderParam orderParam, HttpServletResponse response) {
|
|
|
if (orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty()){
|
|
if (orderParam.getChannelIdList()==null||orderParam.getChannelIdList().isEmpty()){
|
|
|
throw new GlobalException("请求参数-所属企业不允许为空");
|
|
throw new GlobalException("请求参数-所属企业不允许为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (orderParam.getChannelIdList().contains(0L)){
|
|
|
|
|
+ Long userId = SecurityUtils.getSysUser().getUserId();
|
|
|
|
|
+ List<Long> channelIdList = sysUserService.findByUserIdListId(userId);
|
|
|
|
|
+ orderParam.setChannelIdList(channelIdList);
|
|
|
}
|
|
}
|
|
|
orderService.export(orderParam,response);
|
|
orderService.export(orderParam,response);
|
|
|
}
|
|
}
|