|
|
@ -120,6 +120,37 @@ public class CustomerToolApportStatementDetailController { |
|
|
|
return success(result); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/pageDetail") |
|
|
|
@Operation(summary = "获得客户模具分摊对账单明细表(WMS)分页") |
|
|
|
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
|
|
|
|
public CommonResult<PageResult<CustomerToolApportStatementDetailRespVO>> getCustomerToolApportStatementDetailPageDetail(@Valid CustomerToolApportStatementDetailPageReqVO pageVO) { |
|
|
|
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailPage(pageVO); |
|
|
|
PageResult<CustomerToolApportStatementDetailRespVO> result = CustomerToolApportStatementDetailConvert.INSTANCE.convertPage(pageResult); |
|
|
|
Map<Long, String> userNicknameMap = new HashMap<>(); |
|
|
|
//收集所有需要查询的用户ID
|
|
|
|
Set<Long> userIds = new HashSet<>(); |
|
|
|
result.getList().forEach(vo -> { |
|
|
|
userIds.add(Long.valueOf(vo.getCreator())); |
|
|
|
userIds.add(Long.valueOf(vo.getUpdater())); |
|
|
|
}); |
|
|
|
if(!userIds.isEmpty()){ |
|
|
|
//批量获取用户信息
|
|
|
|
List<AdminUserRespDTO> userList = userApi.getUserList(userIds); |
|
|
|
if(!userList.isEmpty()){ |
|
|
|
userNicknameMap = userList.stream().collect(Collectors.toMap(AdminUserRespDTO::getId, AdminUserRespDTO::getNickname)); |
|
|
|
} |
|
|
|
} |
|
|
|
for(CustomerToolApportStatementDetailRespVO en:result.getList()){ |
|
|
|
if(userNicknameMap.containsKey(Long.valueOf(en.getCreator()))){ |
|
|
|
en.setCreator(userNicknameMap.get(Long.valueOf(en.getCreator()))); |
|
|
|
} |
|
|
|
if(userNicknameMap.containsKey(Long.valueOf(en.getUpdater()))){ |
|
|
|
en.setUpdater(userNicknameMap.get(Long.valueOf(en.getUpdater()))); |
|
|
|
} |
|
|
|
} |
|
|
|
return success(result); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/pageGroup") |
|
|
|
@Operation(summary = "获得客户模具分摊对账单明细分组(WMS)分页") |
|
|
|
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
|
|
|
@ -161,11 +192,92 @@ public class CustomerToolApportStatementDetailController { |
|
|
|
return success(result); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/senior") |
|
|
|
@Operation(summary = "高级搜索获得检验任务主分页") |
|
|
|
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
|
|
|
|
public CommonResult<PageResult<CustomerToolApportStatementDetailRespVO>> getCustomerToolApportStatementDetailSenior(@Valid @RequestBody CustomConditions conditions) { |
|
|
|
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSenior(conditions); |
|
|
|
PageResult<CustomerToolApportStatementDetailRespVO> result = CustomerToolApportStatementDetailConvert.INSTANCE.convertPage(pageResult); |
|
|
|
for(CustomerToolApportStatementDetailRespVO en:result.getList()){ |
|
|
|
String customerStatementNumber = en.getCustomerStatementNumber(); |
|
|
|
List<CustomerStatementMainDO> mainDOS = customerStatementMainMapper.selectList("number", customerStatementNumber); |
|
|
|
if(!mainDOS.isEmpty()){ |
|
|
|
String customerName = mainDOS.get(0).getCustomerName(); |
|
|
|
String customerCode = mainDOS.get(0).getCustomerCode(); |
|
|
|
en.setCustomerName(customerName); |
|
|
|
en.setCustomerCode(customerCode); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<Long, String> userNicknameMap = new HashMap<>(); |
|
|
|
//收集所有需要查询的用户ID
|
|
|
|
Set<Long> userIds = new HashSet<>(); |
|
|
|
result.getList().forEach(vo -> { |
|
|
|
userIds.add(Long.valueOf(vo.getCreator())); |
|
|
|
userIds.add(Long.valueOf(vo.getUpdater())); |
|
|
|
}); |
|
|
|
if(!userIds.isEmpty()){ |
|
|
|
//批量获取用户信息
|
|
|
|
List<AdminUserRespDTO> userList = userApi.getUserList(userIds); |
|
|
|
if(!userList.isEmpty()){ |
|
|
|
userNicknameMap = userList.stream().collect(Collectors.toMap(AdminUserRespDTO::getId, AdminUserRespDTO::getNickname)); |
|
|
|
} |
|
|
|
} |
|
|
|
for(CustomerToolApportStatementDetailRespVO en:result.getList()){ |
|
|
|
if(userNicknameMap.containsKey(Long.valueOf(en.getCreator()))){ |
|
|
|
en.setCreator(userApi.getUserNickname(en.getCreator())); |
|
|
|
} |
|
|
|
if(userNicknameMap.containsKey(Long.valueOf(en.getUpdater()))){ |
|
|
|
en.setUpdater(userApi.getUserNickname(en.getUpdater())); |
|
|
|
} |
|
|
|
} |
|
|
|
return success(result); |
|
|
|
} |
|
|
|
@PostMapping("/seniorDetail") |
|
|
|
@Operation(summary = "高级搜索对账单明细") |
|
|
|
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
|
|
|
|
public CommonResult<PageResult<CustomerToolApportStatementDetailRespVO>> getCustomerToolApportStatementDetailSeniorDetail(@Valid @RequestBody CustomConditions conditions) { |
|
|
|
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSenior(conditions); |
|
|
|
PageResult<CustomerToolApportStatementDetailRespVO> result = CustomerToolApportStatementDetailConvert.INSTANCE.convertPage(pageResult); |
|
|
|
for(CustomerToolApportStatementDetailRespVO en:result.getList()){ |
|
|
|
String customerStatementNumber = en.getCustomerStatementNumber(); |
|
|
|
List<CustomerStatementMainDO> mainDOS = customerStatementMainMapper.selectList("number", customerStatementNumber); |
|
|
|
if(!mainDOS.isEmpty()){ |
|
|
|
String customerName = mainDOS.get(0).getCustomerName(); |
|
|
|
String customerCode = mainDOS.get(0).getCustomerCode(); |
|
|
|
en.setCustomerName(customerName); |
|
|
|
en.setCustomerCode(customerCode); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<Long, String> userNicknameMap = new HashMap<>(); |
|
|
|
//收集所有需要查询的用户ID
|
|
|
|
Set<Long> userIds = new HashSet<>(); |
|
|
|
result.getList().forEach(vo -> { |
|
|
|
userIds.add(Long.valueOf(vo.getCreator())); |
|
|
|
userIds.add(Long.valueOf(vo.getUpdater())); |
|
|
|
}); |
|
|
|
if(!userIds.isEmpty()){ |
|
|
|
//批量获取用户信息
|
|
|
|
List<AdminUserRespDTO> userList = userApi.getUserList(userIds); |
|
|
|
if(!userList.isEmpty()){ |
|
|
|
userNicknameMap = userList.stream().collect(Collectors.toMap(AdminUserRespDTO::getId, AdminUserRespDTO::getNickname)); |
|
|
|
} |
|
|
|
} |
|
|
|
for(CustomerToolApportStatementDetailRespVO en:result.getList()){ |
|
|
|
if(userNicknameMap.containsKey(Long.valueOf(en.getCreator()))){ |
|
|
|
en.setCreator(userApi.getUserNickname(en.getCreator())); |
|
|
|
} |
|
|
|
if(userNicknameMap.containsKey(Long.valueOf(en.getUpdater()))){ |
|
|
|
en.setUpdater(userApi.getUserNickname(en.getUpdater())); |
|
|
|
} |
|
|
|
} |
|
|
|
return success(result); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/seniorGroup") |
|
|
|
@Operation(summary = "高级搜索获得检验任务主分页") |
|
|
|
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
|
|
|
|
public CommonResult<PageResult<CustomerToolApportStatementDetailRespVO>> getCustomerToolApportStatementDetailSeniorGroup(@Valid @RequestBody CustomConditions conditions) { |
|
|
|
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSenior(conditions); |
|
|
|
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSeniorGroup(conditions); |
|
|
|
PageResult<CustomerToolApportStatementDetailRespVO> result = CustomerToolApportStatementDetailConvert.INSTANCE.convertPage(pageResult); |
|
|
|
for(CustomerToolApportStatementDetailRespVO en:result.getList()){ |
|
|
|
String customerStatementNumber = en.getCustomerStatementNumber(); |
|
|
@ -217,7 +329,7 @@ public class CustomerToolApportStatementDetailController { |
|
|
|
ExcelUtils.write(response, "客户模具分摊对账单明细表(WMS).xls", "数据", CustomerToolApportStatementDetailExcelVO.class, resultList); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/export-excel-group") |
|
|
|
@GetMapping("/export-excel-detail") |
|
|
|
@Operation(summary = "模具分摊对账单记录导出客户模具分摊对账单明细表(WMS) Excel") |
|
|
|
//@PreAuthorize("@ss.hasPermission('wms:customer-statement-main:export')")
|
|
|
|
@OperateLog(type = EXPORT) |
|
|
@ -232,7 +344,27 @@ public class CustomerToolApportStatementDetailController { |
|
|
|
ExcelUtils.write(response, "客户模具分摊对账单明细表(WMS).xls", "数据", CustomerToolApportStatementRecordDetailExcelVO.class, resultList); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/export-excel-senior-group") |
|
|
|
@PostMapping("/export-excel-senior") |
|
|
|
@Operation(summary = "模具分摊对账单记录导出高级搜索Excel") |
|
|
|
//@PreAuthorize("@ss.hasPermission('wms:customer-statement-main:export')")
|
|
|
|
@OperateLog(type = EXPORT) |
|
|
|
public void exportSeniorExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException { |
|
|
|
conditions.setPageSize(Integer.MAX_VALUE); |
|
|
|
conditions.setPageNo(1); |
|
|
|
List<CustomConditions.Condition> conditionList = conditions.getFilters(); |
|
|
|
CustomConditions.Condition condition = new CustomConditions.Condition(); |
|
|
|
condition.setColumn("status");//有效数据
|
|
|
|
condition.setAction("=="); |
|
|
|
condition.setValue("0"); |
|
|
|
conditionList.add(condition); |
|
|
|
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSenior(conditions); |
|
|
|
List<CustomerToolApportStatementDetailDO> list = pageResult.getList(); |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
List<CustomerToolApportStatementRecordDetailExcelVO> resultList = this.getGroupExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "客户对账单主信息表(WMS).xls", "数据", CustomerToolApportStatementRecordDetailExcelVO.class, resultList); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/export-excel-senior-detail") |
|
|
|
@Operation(summary = "模具分摊对账单记录导出高级搜索Excel") |
|
|
|
//@PreAuthorize("@ss.hasPermission('wms:customer-statement-main:export')")
|
|
|
|
@OperateLog(type = EXPORT) |
|
|
|