|
|
@@ -33,9 +33,7 @@ import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.land.constant.LandConst;
|
|
|
import org.springblade.land.entity.Order;
|
|
|
-import org.springblade.land.excel.CdAcctExcel;
|
|
|
-import org.springblade.land.excel.KhAcctExcel;
|
|
|
-import org.springblade.land.excel.PtAcctExcel;
|
|
|
+import org.springblade.land.excel.*;
|
|
|
import org.springblade.land.service.IOrderService;
|
|
|
import org.springblade.land.vo.OrderAcctVO;
|
|
|
import org.springblade.land.vo.OrderVO;
|
|
|
@@ -266,7 +264,51 @@ public class OrderController extends BladeController {
|
|
|
list = BeanUtil.copy(acct, CdAcctExcel.class);
|
|
|
}
|
|
|
ExcelUtil.export(response, "陆运台账", "陆运台账", list, CdAcctExcel.class);
|
|
|
- } else {
|
|
|
+ } else if (role.contains(LandConst.ROLE_ADMIN)){
|
|
|
+ List<AllAcctExcel> list = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(acct)) {
|
|
|
+ list = BeanUtil.copy(acct, AllAcctExcel.class);
|
|
|
+ }
|
|
|
+ ExcelUtil.export(response, "陆运台账", "陆运台账", list, AllAcctExcel.class);
|
|
|
+ }else {
|
|
|
+ throw new RuntimeException("用户无导出权限");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 散货台账导出
|
|
|
+ */
|
|
|
+ @GetMapping("/bulkCargo-export")
|
|
|
+ public void bulkCargoAcctExport(OrderAcctVO acctVO, HttpServletResponse response) {
|
|
|
+ acctVO.setShippingMode("散货");
|
|
|
+ List<OrderAcctVO> acct = orderService.getAcctNoPage(acctVO);
|
|
|
+
|
|
|
+ String role = AuthUtil.getUserRole();
|
|
|
+ if (role.contains(LandConst.ROLE_KH)) {
|
|
|
+ List<bulkCargoKhExcel> list = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(acct)) {
|
|
|
+ list = BeanUtil.copy(acct, bulkCargoKhExcel.class);
|
|
|
+ }
|
|
|
+ ExcelUtil.export(response, "散货台账", "散货台账", list, bulkCargoKhExcel.class);
|
|
|
+ } else if (role.contains(LandConst.ROLE_PT)) {
|
|
|
+ List<bulkCargoPtExcel> list = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(acct)) {
|
|
|
+ list = BeanUtil.copy(acct, bulkCargoPtExcel.class);
|
|
|
+ }
|
|
|
+ ExcelUtil.export(response, "散货台账", "散货台账", list, bulkCargoPtExcel.class);
|
|
|
+ } else if (role.contains(LandConst.ROLE_CD)) {
|
|
|
+ List<bulkCargoCdExcel> list = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(acct)) {
|
|
|
+ list = BeanUtil.copy(acct, bulkCargoCdExcel.class);
|
|
|
+ }
|
|
|
+ ExcelUtil.export(response, "散货台账", "散货台账", list, bulkCargoCdExcel.class);
|
|
|
+ } else if (role.contains(LandConst.ROLE_ADMIN)){
|
|
|
+ List<bulkCargoAllExcel> list = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(acct)) {
|
|
|
+ list = BeanUtil.copy(acct, bulkCargoAllExcel.class);
|
|
|
+ }
|
|
|
+ ExcelUtil.export(response, "散货台账", "散货台账", list, bulkCargoAllExcel.class);
|
|
|
+ }else {
|
|
|
throw new RuntimeException("用户无导出权限");
|
|
|
}
|
|
|
}
|