|
@@ -8,26 +8,31 @@ import com.yr.bluecat.common.entity.response.Result;
|
|
|
import com.yr.bluecat.common.entity.utils.StringUtils;
|
|
import com.yr.bluecat.common.entity.utils.StringUtils;
|
|
|
import com.yr.bluecat.common.utils.excel.ExportClient;
|
|
import com.yr.bluecat.common.utils.excel.ExportClient;
|
|
|
import com.yr.prism.auth.core.user.AdminUserInfo;
|
|
import com.yr.prism.auth.core.user.AdminUserInfo;
|
|
|
|
|
+import com.yr.warehouse.admin.common.bo.BaseIdBo;
|
|
|
import com.yr.warehouse.admin.component.areastaff.AreaStaffComponent;
|
|
import com.yr.warehouse.admin.component.areastaff.AreaStaffComponent;
|
|
|
import com.yr.warehouse.admin.component.auth.OperatorComponent;
|
|
import com.yr.warehouse.admin.component.auth.OperatorComponent;
|
|
|
import com.yr.warehouse.admin.component.auth.vo.OrgOperatorVo;
|
|
import com.yr.warehouse.admin.component.auth.vo.OrgOperatorVo;
|
|
|
import com.yr.warehouse.admin.driver.bo.*;
|
|
import com.yr.warehouse.admin.driver.bo.*;
|
|
|
import com.yr.warehouse.admin.driver.data.DriverGoodsLossIntervalMain;
|
|
import com.yr.warehouse.admin.driver.data.DriverGoodsLossIntervalMain;
|
|
|
|
|
+import com.yr.warehouse.admin.driver.face.AreaStaffNameSearchFace;
|
|
|
import com.yr.warehouse.admin.driver.face.DriverIntervalCargoDamageDetailSearchFace;
|
|
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.DriverIntervalCargoDamageDetailVo;
|
|
|
import com.yr.warehouse.admin.driver.vo.DriverIntervalCargoDamageVo;
|
|
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.service.areastaff.AreaStaffService;
|
|
import com.yr.warehouse.admin.service.areastaff.AreaStaffService;
|
|
|
-import com.yr.warehouse.admin.service.driver.DriverGoodsLossIntervalDetailService;
|
|
|
|
|
-import com.yr.warehouse.admin.service.driver.DriverGoodsLossIntervalMainService;
|
|
|
|
|
-import com.yr.warehouse.admin.service.driver.DriverOnRouteAccountRecordService;
|
|
|
|
|
|
|
+import com.yr.warehouse.admin.service.driver.*;
|
|
|
import com.yr.warehouse.admin.web.common.BaseController;
|
|
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.DriverIntervalCargoDamageDetailExport;
|
|
|
|
|
+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.mapstruct.DriverIntervalCargoDamageMapStruct;
|
|
|
import com.yr.warehouse.admin.web.driver.request.*;
|
|
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.DriverIntervalCargoDamageDetailResponse;
|
|
|
import com.yr.warehouse.admin.web.driver.response.DriverIntervalCargoDamageResponse;
|
|
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.DriverRouteAccountRecordMainResponse;
|
|
|
-import com.yr.warehouse.admin.web.driver.response.DriverRouteDetailResponse;
|
|
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -56,6 +61,12 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
private DriverOnRouteAccountRecordService driverOnRouteAccountRecordService;
|
|
private DriverOnRouteAccountRecordService driverOnRouteAccountRecordService;
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
|
|
+ private DriverOnRouteAccountRecordMainService driverOnRouteAccountRecordMainService;
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private DriverOnRouteAccountRecordDetailService driverOnRouteAccountRecordDetailService;
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
private AreaStaffComponent areaStaffComponent;
|
|
private AreaStaffComponent areaStaffComponent;
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
@@ -85,7 +96,7 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
public Result<String> generator(@Validated @RequestBody DriverIntervalCargoDamageGeneratorRequest request, AdminUserInfo adminUserInfo) {
|
|
public Result<String> generator(@Validated @RequestBody DriverIntervalCargoDamageGeneratorRequest request, AdminUserInfo adminUserInfo) {
|
|
|
DriverIntervalCargoDamageGeneratorBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.generatorRequestToBo(request);
|
|
DriverIntervalCargoDamageGeneratorBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.generatorRequestToBo(request);
|
|
|
buildUserInfo(bo, adminUserInfo);
|
|
buildUserInfo(bo, adminUserInfo);
|
|
|
-
|
|
|
|
|
|
|
+ // TODO: 区间记录生成
|
|
|
|
|
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -142,14 +153,7 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
if (null == driverIntervalCargoDamageDetailVos || driverIntervalCargoDamageDetailVos.isEmpty()) {
|
|
if (null == driverIntervalCargoDamageDetailVos || driverIntervalCargoDamageDetailVos.isEmpty()) {
|
|
|
return pageResult.success(0, new ArrayList<>());
|
|
return pageResult.success(0, new ArrayList<>());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- Map<Long, AreaStaffResponse> areaStaffMap = areaStaffService.searchAreaStaffMap(driverIntervalCargoDamageDetailVos);
|
|
|
|
|
- driverIntervalCargoDamageDetailVos.forEach(driverIntervalCargoDamageDetailVo -> {
|
|
|
|
|
- AreaStaffResponse areaStaffResponse = areaStaffMap.get(driverIntervalCargoDamageDetailVo.getAreaStaffId());
|
|
|
|
|
- if (null != areaStaffResponse) {
|
|
|
|
|
- driverIntervalCargoDamageDetailVo.setAreaStaffName(areaStaffResponse.getEmployeeName());
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ areaStaffService.buildAreaStaffName(driverIntervalCargoDamageDetailVos);
|
|
|
List<DriverIntervalCargoDamageDetailResponse> driverIntervalCargoDamageDetailResponses = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.detailVoListToDetailResponseList(driverIntervalCargoDamageDetailVos);
|
|
List<DriverIntervalCargoDamageDetailResponse> driverIntervalCargoDamageDetailResponses = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.detailVoListToDetailResponseList(driverIntervalCargoDamageDetailVos);
|
|
|
return pageResult.success(page.getTotal(), driverIntervalCargoDamageDetailResponses);
|
|
return pageResult.success(page.getTotal(), driverIntervalCargoDamageDetailResponses);
|
|
|
}
|
|
}
|
|
@@ -207,6 +211,16 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 提取区域员工名称搜索参数
|
|
|
|
|
+ */
|
|
|
|
|
+ private void extractedAreaStaffSearchParam(AreaStaffNameSearchFace bo) {
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getAreaStaffName())) {
|
|
|
|
|
+ List<AreaStaffResponse> areaStaffResponses = areaStaffComponent.searchByOperatorIdAndAreaStaffName(bo.getOperatorId(), bo.getAreaStaffName());
|
|
|
|
|
+ bo.setAreaStaffIds(areaStaffResponses.stream().map(AreaStaffResponse::getId).toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 添加司机在途核算记录
|
|
* 添加司机在途核算记录
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/routeAccountRecord/add")
|
|
@PostMapping("/routeAccountRecord/add")
|
|
@@ -227,7 +241,7 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
@GetMapping("/routeAccountRecord/cancel/{routeAccountRecordMainId}")
|
|
@GetMapping("/routeAccountRecord/cancel/{routeAccountRecordMainId}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result<String> cancelRouteAccountRecord(@PathVariable("routeAccountRecordMainId") Long routeAccountRecordMainId, AdminUserInfo adminUserInfo) {
|
|
public Result<String> cancelRouteAccountRecord(@PathVariable("routeAccountRecordMainId") Long routeAccountRecordMainId, AdminUserInfo adminUserInfo) {
|
|
|
- DriverIntervalRouteAccountRecordCancelBo bo = new DriverIntervalRouteAccountRecordCancelBo();
|
|
|
|
|
|
|
+ BaseIdBo bo = new BaseIdBo();
|
|
|
bo.setId(routeAccountRecordMainId);
|
|
bo.setId(routeAccountRecordMainId);
|
|
|
buildUserInfo(bo, adminUserInfo);
|
|
buildUserInfo(bo, adminUserInfo);
|
|
|
driverOnRouteAccountRecordService.cancel(bo);
|
|
driverOnRouteAccountRecordService.cancel(bo);
|
|
@@ -240,7 +254,27 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
@PostMapping("/routeAccountRecord/export")
|
|
@PostMapping("/routeAccountRecord/export")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result<String> exportRouteAccountRecord(@Validated @RequestBody DriverRouteAccountRecordExportRequest request, AdminUserInfo adminUserInfo) {
|
|
public Result<String> exportRouteAccountRecord(@Validated @RequestBody DriverRouteAccountRecordExportRequest request, AdminUserInfo adminUserInfo) {
|
|
|
- return null;
|
|
|
|
|
|
|
+ DriverRouteAccountRecordPageBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.routeAccountRecordExportRequestToBo(request);
|
|
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
|
|
+ bo.setPageNum(1);
|
|
|
|
|
+ bo.setPageSize(1000);
|
|
|
|
|
+ List<DriverRouteAccountRecordMainVo> all = new ArrayList<>();
|
|
|
|
|
+ while (true) {
|
|
|
|
|
+ Page<DriverRouteAccountRecordMainVo> page = driverOnRouteAccountRecordMainService.searchForPage(bo);
|
|
|
|
|
+ List<DriverRouteAccountRecordMainVo> driverRouteAccountRecordMainVos = page.getRecords();
|
|
|
|
|
+ if (null == driverRouteAccountRecordMainVos || driverRouteAccountRecordMainVos.isEmpty()) {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ all.addAll(driverRouteAccountRecordMainVos);
|
|
|
|
|
+ bo.setPageNum(bo.getPageNum() + 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ areaStaffService.buildAreaStaffName(all);
|
|
|
|
|
+ List<DriverRouteAccountRecordMainExport> driverRouteAccountRecordMainExports = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.routeAccountRecordMainVoListToRouteAccountRecordMainExportList(all);
|
|
|
|
|
+ driverRouteAccountRecordMainExports.forEach(export -> {
|
|
|
|
|
+ export.setStatus(DriverOnRouteAccountRecordStatusEnum.getDesc(export.getStatus()));
|
|
|
|
|
+ });
|
|
|
|
|
+ String uri = exportClient.export(driverRouteAccountRecordMainExports, "export/driver/interval/routeAccountRecord", "司机在途核算记录" + System.currentTimeMillis());
|
|
|
|
|
+ return Result.success(uri);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -249,7 +283,18 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
@PostMapping("/routeAccountRecord/page")
|
|
@PostMapping("/routeAccountRecord/page")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public PageResult<DriverRouteAccountRecordMainResponse> routeAccountRecordPage(@Validated @RequestBody DriverRouteAccountRecordPageRequest request, AdminUserInfo adminUserInfo) {
|
|
public PageResult<DriverRouteAccountRecordMainResponse> routeAccountRecordPage(@Validated @RequestBody DriverRouteAccountRecordPageRequest request, AdminUserInfo adminUserInfo) {
|
|
|
- return null;
|
|
|
|
|
|
|
+ DriverRouteAccountRecordPageBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.routeAccountRecordPageRequestToBo(request);
|
|
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
|
|
+ extractedAreaStaffSearchParam(bo);
|
|
|
|
|
+ Page<DriverRouteAccountRecordMainVo> page = driverOnRouteAccountRecordMainService.searchForPage(bo);
|
|
|
|
|
+ PageResult<DriverRouteAccountRecordMainResponse> pageResult = PageResult.newPageResult(request.getPageNum(), request.getPageSize());
|
|
|
|
|
+ List<DriverRouteAccountRecordMainVo> driverRouteAccountRecordMainVos = page.getRecords();
|
|
|
|
|
+ if (null == driverRouteAccountRecordMainVos || driverRouteAccountRecordMainVos.isEmpty()) {
|
|
|
|
|
+ return pageResult.success(0, new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+ areaStaffService.buildAreaStaffName(driverRouteAccountRecordMainVos);
|
|
|
|
|
+ List<DriverRouteAccountRecordMainResponse> driverRouteAccountRecordMainResponses = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.accountRecordMainVoToResponse(driverRouteAccountRecordMainVos);
|
|
|
|
|
+ return pageResult.success(page.getTotal(), driverRouteAccountRecordMainResponses);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -257,8 +302,16 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/routeAccountRecord/detail/{routeAccountRecordMainId}")
|
|
@GetMapping("/routeAccountRecord/detail/{routeAccountRecordMainId}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
- public Result<List<DriverRouteDetailResponse>> routeAccountRecordDetail(@PathVariable("routeAccountRecordMainId") Long routeAccountId, AdminUserInfo adminUserInfo) {
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ public Result<List<DriverRouteAccountRecordDetailResponse>> routeAccountRecordDetail(@PathVariable("routeAccountRecordMainId") Long routeAccountId, AdminUserInfo adminUserInfo) {
|
|
|
|
|
+ BaseIdBo bo = new BaseIdBo();
|
|
|
|
|
+ bo.setId(routeAccountId);
|
|
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
|
|
+ List<DriverRouteAccountRecordDetailVo> driverRouteDetailVos = driverOnRouteAccountRecordDetailService.searchByRouteAccountRecordMainId(bo);
|
|
|
|
|
+ if (null == driverRouteDetailVos || driverRouteDetailVos.isEmpty()) {
|
|
|
|
|
+ return Result.success(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+ List<DriverRouteAccountRecordDetailResponse> driverRouteDetailResponses = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.routeAccountRecordDetailVoToResponse(driverRouteDetailVos);
|
|
|
|
|
+ return Result.success(driverRouteDetailResponses);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -267,7 +320,10 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
@PostMapping("/routeAccountRecord/detail/edit")
|
|
@PostMapping("/routeAccountRecord/detail/edit")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result<String> editRouteAccountRecord(@Validated @RequestBody DriverIntervalRouteAccountRecordEditorRequest request, AdminUserInfo adminUserInfo) {
|
|
public Result<String> editRouteAccountRecord(@Validated @RequestBody DriverIntervalRouteAccountRecordEditorRequest request, AdminUserInfo adminUserInfo) {
|
|
|
- return null;
|
|
|
|
|
|
|
+ DriverIntervalRouteAccountRecordEditorBo bo = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.driverIntervalRouteAccountRecordEditorRequestToBo(request);
|
|
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
|
|
+ driverOnRouteAccountRecordService.edit(bo);
|
|
|
|
|
+ return Result.success("success");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -275,8 +331,17 @@ public class DriverIntervalCargoDamageController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/routeAccountRecord/detail/export/{routeAccountRecordMainId}")
|
|
@GetMapping("/routeAccountRecord/detail/export/{routeAccountRecordMainId}")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
- public Result<String> exportRouteAccountRecordDetail(@PathVariable("routeAccountRecordMainId") Long routeAccountId, AdminUserInfo adminUserInfo) {
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ public Result<String> exportRouteAccountRecordDetail(@PathVariable("routeAccountRecordMainId") Long routeAccountRecordMainId, AdminUserInfo adminUserInfo) {
|
|
|
|
|
+ BaseIdBo bo = new BaseIdBo();
|
|
|
|
|
+ bo.setId(routeAccountRecordMainId);
|
|
|
|
|
+ buildUserInfo(bo, adminUserInfo);
|
|
|
|
|
+ List<DriverRouteAccountRecordDetailVo> driverRouteDetailVos = driverOnRouteAccountRecordDetailService.searchByRouteAccountRecordMainId(bo);
|
|
|
|
|
+ if (null == driverRouteDetailVos || driverRouteDetailVos.isEmpty()) {
|
|
|
|
|
+ return Result.fail("没有可导出的数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<DriverRouteAccountRecordDetailExport> exports = DriverIntervalCargoDamageMapStruct.MAPSTRUCT.routeAccountRecordDetailVoToExport(driverRouteDetailVos);
|
|
|
|
|
+ String uri = exportClient.export(exports, "export/driver/interval/routeAccountRecordDetail", "司机在途核算明细" + System.currentTimeMillis());
|
|
|
|
|
+ return Result.success(uri);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|