|
|
@@ -16,22 +16,18 @@ import com.yr.warehouse.admin.driver.bo.*;
|
|
|
import com.yr.warehouse.admin.driver.data.DriverGoodsLossIntervalMain;
|
|
|
import com.yr.warehouse.admin.driver.face.DriverIntervalCargoDamageDetailSearchFace;
|
|
|
import com.yr.warehouse.admin.driver.menu.DriverOnRouteAccountRecordStatusEnum;
|
|
|
-import com.yr.warehouse.admin.driver.vo.DriverIntervalCargoDamageDetailVo;
|
|
|
-import com.yr.warehouse.admin.driver.vo.DriverIntervalCargoDamageVo;
|
|
|
-import com.yr.warehouse.admin.driver.vo.DriverRouteAccountRecordDetailVo;
|
|
|
-import com.yr.warehouse.admin.driver.vo.DriverRouteAccountRecordMainVo;
|
|
|
+import com.yr.warehouse.admin.driver.vo.*;
|
|
|
import com.yr.warehouse.admin.service.areastaff.AreaStaffService;
|
|
|
import com.yr.warehouse.admin.service.driver.*;
|
|
|
+import com.yr.warehouse.admin.service.operator.OperatorBuildService;
|
|
|
import com.yr.warehouse.admin.web.common.BaseController;
|
|
|
import com.yr.warehouse.admin.web.driver.export.DriverIntervalCargoDamageDetailExport;
|
|
|
+import com.yr.warehouse.admin.web.driver.export.DriverIntervalCargoDamageUnReplenishOrderExport;
|
|
|
import com.yr.warehouse.admin.web.driver.export.DriverRouteAccountRecordDetailExport;
|
|
|
import com.yr.warehouse.admin.web.driver.export.DriverRouteAccountRecordMainExport;
|
|
|
import com.yr.warehouse.admin.web.driver.mapstruct.DriverIntervalCargoDamageMapStruct;
|
|
|
import com.yr.warehouse.admin.web.driver.request.*;
|
|
|
-import com.yr.warehouse.admin.web.driver.response.DriverIntervalCargoDamageDetailResponse;
|
|
|
-import com.yr.warehouse.admin.web.driver.response.DriverIntervalCargoDamageResponse;
|
|
|
-import com.yr.warehouse.admin.web.driver.response.DriverRouteAccountRecordDetailResponse;
|
|
|
-import com.yr.warehouse.admin.web.driver.response.DriverRouteAccountRecordMainResponse;
|
|
|
+import com.yr.warehouse.admin.web.driver.response.*;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -68,6 +64,12 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
private DriverOnRouteAccountRecordDetailService driverOnRouteAccountRecordDetailService;
|
|
|
|
|
|
@Resource
|
|
|
+ private DriverGoodsLossStatUnReplenishSnapshotService driverGoodsLossStatUnReplenishSnapshotService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private DriverGoodsLossStatProfitLossDetailService driverGoodsLossStatProfitLossDetailService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private AreaStaffComponent areaStaffComponent;
|
|
|
|
|
|
@Resource
|
|
|
@@ -77,6 +79,9 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
private AreaStaffService areaStaffService;
|
|
|
|
|
|
@Resource
|
|
|
+ private OperatorBuildService operatorBuildService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private ExportClient exportClient;
|
|
|
|
|
|
/**
|
|
|
@@ -354,5 +359,103 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 区间货损记录未补货的补货单列表
|
|
|
+ */
|
|
|
+ @PostMapping("/unReplenish/page")
|
|
|
+ @ResponseBody
|
|
|
+ public PageResult<DriverIntervalCargoDamageUnReplenishOrderPageResponse> unReplenishPage(@Validated @RequestBody DriverIntervalCargoDamageUnReplenishOrderPageRequest request, AdminUserInfo adminUserInfo) {
|
|
|
+ DriverIntervalCargoDamageUnReplenishOrderPageBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.driverIntervalCargoDamageUnReplenishOrderPageRequestToBo(request);
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
+ Page<DriverIntervalCargoDamageUnReplenishOrderPageVo> page = driverGoodsLossStatUnReplenishSnapshotService.searchPage(bo);
|
|
|
+
|
|
|
+ PageResult<DriverIntervalCargoDamageUnReplenishOrderPageResponse> pageResult = PageResult.newPageResult(request.getPageNum(), request.getPageSize());
|
|
|
+
|
|
|
+ List<DriverIntervalCargoDamageUnReplenishOrderPageVo> driverIntervalCargoDamageUnReplenishOrderPageVos = page.getRecords();
|
|
|
+ if (null == driverIntervalCargoDamageUnReplenishOrderPageVos || driverIntervalCargoDamageUnReplenishOrderPageVos.isEmpty()) {
|
|
|
+ return pageResult.success(0, new ArrayList<>());
|
|
|
+ }
|
|
|
|
|
|
+ areaStaffService.buildAreaStaffName(driverIntervalCargoDamageUnReplenishOrderPageVos);
|
|
|
+ operatorBuildService.buildOperatorName(driverIntervalCargoDamageUnReplenishOrderPageVos);
|
|
|
+
|
|
|
+ List<DriverIntervalCargoDamageUnReplenishOrderPageResponse> driverIntervalCargoDamageUnReplenishOrderPageResponses = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.driverIntervalCargoDamageUnReplenishOrderPageVoToResponse(driverIntervalCargoDamageUnReplenishOrderPageVos);
|
|
|
+ return pageResult.success(page.getTotal(), driverIntervalCargoDamageUnReplenishOrderPageResponses);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 区间货损记录未补货的补货单列表导出
|
|
|
+ */
|
|
|
+ @PostMapping("/unReplenish/export")
|
|
|
+ @ResponseBody
|
|
|
+ public Result<String> unReplenishExport(@Validated @RequestBody DriverIntervalCargoDamageUnReplenishOrderExportRequest request, AdminUserInfo adminUserInfo) {
|
|
|
+ DriverIntervalCargoDamageUnReplenishOrderPageBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.driverIntervalCargoDamageUnReplenishOrderExportRequestToBo(request);
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
+ bo.setPageNum(1);
|
|
|
+ bo.setPageSize(1000);
|
|
|
+ List<DriverIntervalCargoDamageUnReplenishOrderPageVo> resultVos = new ArrayList<>();
|
|
|
+ while ( true) {
|
|
|
+ Page<DriverIntervalCargoDamageUnReplenishOrderPageVo> page = driverGoodsLossStatUnReplenishSnapshotService.searchPage(bo);
|
|
|
+ List<DriverIntervalCargoDamageUnReplenishOrderPageVo> driverIntervalCargoDamageUnReplenishOrderPageVos = page.getRecords();
|
|
|
+ if (null == driverIntervalCargoDamageUnReplenishOrderPageVos || driverIntervalCargoDamageUnReplenishOrderPageVos.isEmpty()) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ resultVos.addAll(driverIntervalCargoDamageUnReplenishOrderPageVos);
|
|
|
+ bo.setPageNum(bo.getPageNum() + 1);
|
|
|
+ }
|
|
|
+ if (resultVos.isEmpty()) {
|
|
|
+ return Result.fail("没有可导出的数据");
|
|
|
+ }
|
|
|
+ areaStaffService.buildAreaStaffName(resultVos);
|
|
|
+ operatorBuildService.buildOperatorName(resultVos);
|
|
|
+ List<DriverIntervalCargoDamageUnReplenishOrderExport> exports = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.driverIntervalCargoDamageUnReplenishOrderPageVoToExport(resultVos);
|
|
|
+
|
|
|
+ String uri = exportClient.export(exports, "export/driver/interval/unReplenish", "区间货损记录未补货的补货单列表" + System.currentTimeMillis());
|
|
|
+ return Result.success(uri);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 区间货损盈亏记录查询
|
|
|
+ */
|
|
|
+ @PostMapping("/goodsLossStatProfit/page")
|
|
|
+ @ResponseBody
|
|
|
+ public PageResult<DriverIntervalCargoDamageGoodsLossStatProfitPageResponse> goodsLossStatProfitPage(@Validated @RequestBody DriverIntervalCargoDamageGoodsLossStatProfitPageRequest request, AdminUserInfo adminUserInfo) {
|
|
|
+ DriverIntervalCargoDamageGoodsLossStatProfitPageBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.driverIntervalCargoDamageGoodsLossStatProfitPageRequestToBo(request);
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
+ Page<DriverIntervalCargoDamageGoodsLossStatProfitPageVo> page = driverGoodsLossStatProfitLossDetailService.searchPage(bo);
|
|
|
+ PageResult<DriverIntervalCargoDamageGoodsLossStatProfitPageResponse> pageResult = PageResult.newPageResult(request.getPageNum(), request.getPageSize());
|
|
|
+ List<DriverIntervalCargoDamageGoodsLossStatProfitPageVo> driverIntervalCargoDamageGoodsLossStatProfitPageVos = page.getRecords();
|
|
|
+ if (null == driverIntervalCargoDamageGoodsLossStatProfitPageVos || driverIntervalCargoDamageGoodsLossStatProfitPageVos.isEmpty()) {
|
|
|
+ return pageResult.success(0, new ArrayList<>());
|
|
|
+ }
|
|
|
+ List<DriverIntervalCargoDamageGoodsLossStatProfitPageResponse> responses = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.driverIntervalCargoDamageGoodsLossStatProfitPageVoToResponse(driverIntervalCargoDamageGoodsLossStatProfitPageVos);
|
|
|
+ return pageResult.success(page.getTotal(), responses);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 区间货损盈亏记录导出
|
|
|
+ */
|
|
|
+ @PostMapping("/goodsLossStatProfit/export")
|
|
|
+ @ResponseBody
|
|
|
+ public Result<String> goodsLossStatProfitExport(@Validated @RequestBody DriverIntervalCargoDamageGoodsLossStatProfitExportRequest request, AdminUserInfo adminUserInfo) {
|
|
|
+ DriverIntervalCargoDamageGoodsLossStatProfitPageBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.driverIntervalCargoDamageGoodsLossStatProfitExportRequestToBo(request);
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
+ bo.setPageNum(1);
|
|
|
+ bo.setPageSize(1000);
|
|
|
+ List<DriverIntervalCargoDamageGoodsLossStatProfitPageVo> resultVos = new ArrayList<>();
|
|
|
+ while ( true) {
|
|
|
+ Page<DriverIntervalCargoDamageGoodsLossStatProfitPageVo> page = driverGoodsLossStatProfitLossDetailService.searchPage(bo);
|
|
|
+ List<DriverIntervalCargoDamageGoodsLossStatProfitPageVo> driverIntervalCargoDamageGoodsLossStatProfitPageVos = page.getRecords();
|
|
|
+ if (null == driverIntervalCargoDamageGoodsLossStatProfitPageVos || driverIntervalCargoDamageGoodsLossStatProfitPageVos.isEmpty()) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ resultVos.addAll(driverIntervalCargoDamageGoodsLossStatProfitPageVos);
|
|
|
+ bo.setPageNum(bo.getPageNum() + 1);
|
|
|
+ }
|
|
|
+ if (resultVos.isEmpty()) {
|
|
|
+ return Result.fail("没有可导出的数据");
|
|
|
+ }
|
|
|
+ String uri = exportClient.export(resultVos, "export/driver/interval/goodsLossStatProfit", "区间货损盈亏记录" + System.currentTimeMillis());
|
|
|
+ return Result.success(uri);
|
|
|
+ }
|
|
|
}
|