|
|
@@ -17,23 +17,34 @@
|
|
|
package org.springblade.land.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+import org.springblade.core.excel.util.ExcelUtil;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
+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.service.IOrderService;
|
|
|
import org.springblade.land.vo.OrderAcctVO;
|
|
|
import org.springblade.land.vo.OrderVO;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 陆运订单表 控制器
|
|
|
@@ -112,6 +123,14 @@ public class OrderController extends BladeController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 变更许可
|
|
|
+ */
|
|
|
+ @GetMapping("/valid-change")
|
|
|
+ public R validChange(Long id) {
|
|
|
+ return R.status(orderService.validChange(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 变更 陆运订单表
|
|
|
*/
|
|
|
@PostMapping("/change")
|
|
|
@@ -162,4 +181,32 @@ public class OrderController extends BladeController {
|
|
|
return R.status(orderService.removeOrder(Func.toLongList(ids)));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/acct-export")
|
|
|
+ public void acctExport(OrderAcctVO acctVO, HttpServletResponse response) {
|
|
|
+ List<OrderAcctVO> acct = orderService.getAcctNoPage(acctVO);
|
|
|
+
|
|
|
+ String role = AuthUtil.getUserRole();
|
|
|
+ if (role.contains(LandConst.ROLE_KH)) {
|
|
|
+ List<KhAcctExcel> list = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(acct)) {
|
|
|
+ list = BeanUtil.copy(acct, KhAcctExcel.class);
|
|
|
+ }
|
|
|
+ ExcelUtil.export(response, "陆运台账", "陆运台账", list, KhAcctExcel.class);
|
|
|
+ } else if (role.contains(LandConst.ROLE_PT)) {
|
|
|
+ List<PtAcctExcel> list = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(acct)) {
|
|
|
+ list = BeanUtil.copy(acct, PtAcctExcel.class);
|
|
|
+ }
|
|
|
+ ExcelUtil.export(response, "陆运台账", "陆运台账", list, PtAcctExcel.class);
|
|
|
+ } else if (role.contains(LandConst.ROLE_CD)) {
|
|
|
+ List<CdAcctExcel> list = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(acct)) {
|
|
|
+ list = BeanUtil.copy(acct, CdAcctExcel.class);
|
|
|
+ }
|
|
|
+ ExcelUtil.export(response, "陆运台账", "陆运台账", list, CdAcctExcel.class);
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("用户无导出权限");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|