Browse Source

Merge remote-tracking branch 'origin/master'

master
陈薪名 2 years ago
parent
commit
fc44f5df53
  1. 24
      win-module-system/win-module-system-biz/src/main/java/com/win/module/system/service/serialnumber/SerialNumberServiceImpl.java
  2. 16
      win-module-wms/win-module-wms-api/src/main/java/com/win/module/wms/enums/ErrorCodeConstants.java
  3. 43
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/configurationsetting/ConfigurationsettingController.java
  4. 118
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/DeliverPlanMainController.java
  5. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanDetailBaseVO.java
  6. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanDetailExcelVO.java
  7. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanDetailExportReqVO.java
  8. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanDetailPageReqVO.java
  9. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanMainBaseVO.java
  10. 45
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanMainExcelVO.java
  11. 13
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanMainImportVO.java
  12. 11
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inspectJob/InspectJobMainController.java
  13. 6
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inspectRecord/InspectRecordMainController.java
  14. 55
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inspectRequest/InspectRequestMainController.java
  15. 8
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventoryinitRequest/vo/InventoryinitRequestMainUpdateReqVO.java
  16. 16
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/InventorymoveRequestMainController.java
  17. 6
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestDetailBaseVO.java
  18. 13
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainBaseVO.java
  19. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainExcelVO.java
  20. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainExportReqVO.java
  21. 46
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainImportVO.java
  22. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainPageReqVO.java
  23. 8
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainUpdateReqVO.java
  24. 34
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/paramsetting/ParamsettingController.java
  25. 20
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptJob/PurchasereceiptJobMainController.java
  26. 6
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/PurchasereceiptRecordMainController.java
  27. 31
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRequest/PurchasereceiptRequestMainController.java
  28. 95
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayJob/PutawayJobDetailController.java
  29. 181
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayJob/PutawayJobMainController.java
  30. 125
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayJob/vo/PutawayJobMainExcelVO.java
  31. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayJob/vo/PutawayJobMainUpdateReqVO.java
  32. 106
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRecord/PutawayRecordDetailController.java
  33. 139
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRecord/PutawayRecordMainController.java
  34. 105
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRecord/vo/PutawayRecordMainExcelVO.java
  35. 64
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRequest/PutawayRequestDetailController.java
  36. 153
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRequest/PutawayRequestMainController.java
  37. 91
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRequest/vo/PutawayRequestMainExcelVO.java
  38. 10
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/rule/RuleController.java
  39. 13
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/deliverPlan/DeliverPlanMainConvert.java
  40. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/inventoryinitRequest/InventoryinitRequestDetailConvert.java
  41. 18
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/inventoryinitRequest/InventoryinitRequestMainConvert.java
  42. 8
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/inventorymoveRequest/InventorymoveRequestDetailConvert.java
  43. 19
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/inventorymoveRequest/InventorymoveRequestMainConvert.java
  44. 10
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/putawayJob/PutawayJobDetailConvert.java
  45. 21
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/putawayJob/PutawayJobMainConvert.java
  46. 20
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/putawayRecord/PutawayRecordMainConvert.java
  47. 16
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/putawayRequest/PutawayRequestMainConvert.java
  48. 5
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/deliverPlan/DeliverPlanDetailDO.java
  49. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/inventorymoveRequest/InventorymoveRequestMainDO.java
  50. 5
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/configurationsetting/ConfigurationsettingMapper.java
  51. 6
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/deliverPlan/DeliverPlanDetailMapper.java
  52. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/deliverPlan/DeliverPlanMainMapper.java
  53. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/deliverRequest/DeliverRequestMainMapper.java
  54. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/inventorymoveRequest/InventorymoveRequestMainMapper.java
  55. 5
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/paramsetting/ParamsettingMapper.java
  56. 11
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayJob/PutawayJobDetailMapper.java
  57. 33
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayJob/PutawayJobMainMapper.java
  58. 11
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayRecord/PutawayRecordDetailMapper.java
  59. 11
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayRecord/PutawayRecordMainMapper.java
  60. 13
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayRequest/PutawayRequestDetailMapper.java
  61. 19
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayRequest/PutawayRequestMainMapper.java
  62. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/rule/RuleMapper.java
  63. 6
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/enums/request/RequestStatusState.java
  64. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/configurationsetting/ConfigurationsettingService.java
  65. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/configurationsetting/ConfigurationsettingServiceImpl.java
  66. 1
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/deliverPlan/DeliverPlanDetailService.java
  67. 37
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/deliverPlan/DeliverPlanDetailServiceImpl.java
  68. 65
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/deliverPlan/DeliverPlanMainService.java
  69. 242
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/deliverPlan/DeliverPlanMainServiceImpl.java
  70. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectJob/InspectJobMainService.java
  71. 7
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectJob/InspectJobMainServiceImpl.java
  72. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRecord/InspectRecordMainService.java
  73. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestDetailService.java
  74. 6
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestDetailServiceImpl.java
  75. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestMainService.java
  76. 31
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestMainServiceImpl.java
  77. 279
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inventoryinitRequest/InventoryinitRequestMainServiceImpl.java
  78. 86
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inventorymoveRequest/InventorymoveRequestDetailServiceImpl.java
  79. 327
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inventorymoveRequest/InventorymoveRequestMainServiceImpl.java
  80. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/paramsetting/ParamsettingService.java
  81. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/paramsetting/ParamsettingServiceImpl.java
  82. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productputawayRequest/ProductputawayRequestMainServiceImpl.java
  83. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptJob/PurchasereceiptJobMainService.java
  84. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptJob/PurchasereceiptJobMainServiceImpl.java
  85. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRequest/PurchasereceiptRequestMainServiceImpl.java
  86. 63
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayJob/PutawayJobDetailService.java
  87. 65
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayJob/PutawayJobDetailServiceImpl.java
  88. 71
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayJob/PutawayJobMainService.java
  89. 237
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayJob/PutawayJobMainServiceImpl.java
  90. 55
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRecord/PutawayRecordDetailService.java
  91. 53
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRecord/PutawayRecordDetailServiceImpl.java
  92. 58
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRecord/PutawayRecordMainService.java
  93. 65
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRecord/PutawayRecordMainServiceImpl.java
  94. 16
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestDetailService.java
  95. 20
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestDetailServiceImpl.java
  96. 71
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestMainService.java
  97. 283
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestMainServiceImpl.java
  98. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/requestsetting/RequestsettingServiceImpl.java
  99. 8
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/rule/RuleService.java
  100. 5
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/rule/RuleServiceImpl.java

24
win-module-system/win-module-system-biz/src/main/java/com/win/module/system/service/serialnumber/SerialNumberServiceImpl.java

@ -114,21 +114,25 @@ public class SerialNumberServiceImpl implements SerialNumberService {
pattern = currentDate.format(DateTimeFormatter.ofPattern(encodedRule.getPattern().replace("m", "M"))); pattern = currentDate.format(DateTimeFormatter.ofPattern(encodedRule.getPattern().replace("m", "M")));
} }
long millMinutes = 0; long millMinutes = 0;
if(encodedRule.getPattern().toLowerCase().indexOf("d") > 0) { //包含日 if(encodedRule.getPattern() != null && !encodedRule.getPattern().isEmpty()) {
LocalDateTime midnight = LocalDateTime.now().plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(1); if (encodedRule.getPattern().toLowerCase().indexOf("d") > 0) { //包含日
millMinutes = ChronoUnit.MINUTES.between(LocalDateTime.now(), midnight); LocalDateTime midnight = LocalDateTime.now().plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(1);
} else if(encodedRule.getPattern().toLowerCase().indexOf("m") > 0) { //包含月 millMinutes = ChronoUnit.MINUTES.between(LocalDateTime.now(), midnight);
LocalDateTime midnight = LocalDateTime.now().plusMonths(1).plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(1); } else if (encodedRule.getPattern().toLowerCase().indexOf("m") > 0) { //包含月
millMinutes = ChronoUnit.MONTHS.between(LocalDateTime.now(), midnight); LocalDateTime midnight = LocalDateTime.now().plusMonths(1).plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(1);
} else if(encodedRule.getPattern().toLowerCase().indexOf("y") > 0) { millMinutes = ChronoUnit.MONTHS.between(LocalDateTime.now(), midnight);
LocalDateTime midnight = LocalDateTime.now().plusYears(1).plusMonths(1).plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(1); } else if (encodedRule.getPattern().toLowerCase().indexOf("y") > 0) {
millMinutes = ChronoUnit.YEARS.between(LocalDateTime.now(), midnight); LocalDateTime midnight = LocalDateTime.now().plusYears(1).plusMonths(1).plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(1);
millMinutes = ChronoUnit.YEARS.between(LocalDateTime.now(), midnight);
}
} }
StringBuilder code = new StringBuilder(); StringBuilder code = new StringBuilder();
Long increment = redisCache.incr(encodedRule.getRuleCode() + pattern, millMinutes); Long increment = redisCache.incr(encodedRule.getRuleCode() + pattern, millMinutes);
code.append(encodedRule.getPrefix()); code.append(encodedRule.getPrefix());
code.append(pattern); code.append(pattern);
code.append(encodedRule.getSeparator()); if(encodedRule.getSeparator() != null && !encodedRule.getSeparator().isEmpty()) {
code.append(encodedRule.getSeparator());
}
String incrementStr = increment.toString(); String incrementStr = increment.toString();
if (incrementStr.length() <= encodedRule.getLength()) { if (incrementStr.length() <= encodedRule.getLength()) {
code.append(String.format("%0" + encodedRule.getLength() + "d", increment)); code.append(String.format("%0" + encodedRule.getLength() + "d", increment));

16
win-module-wms/win-module-wms-api/src/main/java/com/win/module/wms/enums/ErrorCodeConstants.java

@ -474,14 +474,22 @@ public interface ErrorCodeConstants {
//上架申请子ErrorCode //上架申请子ErrorCode
ErrorCode PUTAWAY_REQUEST_DETAIL_NOT_EXISTS = new ErrorCode(1_000_081_001, "上架申请子不存在"); ErrorCode PUTAWAY_REQUEST_DETAIL_NOT_EXISTS = new ErrorCode(1_000_081_001, "上架申请子不存在");
ErrorCode PUTAWAY_REQUEST_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_081_002, "上架申请导入数据不能为空"); ErrorCode PUTAWAY_REQUEST_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_081_002, "上架申请导入数据不能为空");
ErrorCode PUTAWAY_REQUEST_JOB_EXISTS = new ErrorCode(1_000_081_003, "到货检验申请存在采购收货任务单");
ErrorCode PUTAWAY_REQUEST_CANNOT_CLOSE = new ErrorCode(1_000_081_004, "到货检验申请状态不支持关闭");
ErrorCode PUTAWAY_REQUEST_CANNOT_SUBMIT = new ErrorCode(1_000_081_005, "到货检验申请状态不支持提交");
ErrorCode PUTAWAY_REQUEST_CANNOT_AGREE = new ErrorCode(1_000_081_006, "到货检验申请状态不支持审批同意");
ErrorCode PUTAWAY_REQUEST_CANNOT_HANDLE = new ErrorCode(1_000_081_007, "到货检验申请状态不支持处理");
ErrorCode PUTAWAY_REQUEST_CANNOT_ABORT = new ErrorCode(1_000_081_008, "到货检验申请状态不支持审批拒绝");
//上架任务主ErrorCode //上架任务主ErrorCode
ErrorCode PUTAWAY_JOB_MAIN_NOT_EXISTS = new ErrorCode(1_000_082_000, "上架任务主不存在"); ErrorCode PUTAWAY_JOB_MAIN_NOT_EXISTS = new ErrorCode(1_000_082_000, "上架任务主不存在");
ErrorCode PUTAWAY_JOB_MAIN_STATUS_ERROR = new ErrorCode(1_000_082_001, "上架任务状态错误");
//上架任务子ErrorCode //上架任务子ErrorCode
ErrorCode PUTAWAY_JOB_DETAIL_NOT_EXISTS = new ErrorCode(1_000_083_001, "上架任务子不存在"); ErrorCode PUTAWAY_JOB_DETAIL_NOT_EXISTS = new ErrorCode(1_000_083_001, "上架任务子不存在");
//上架记录主ErrorCode //上架记录主ErrorCode
ErrorCode PUTAWAY_RECORD_MAIN_NOT_EXISTS = new ErrorCode(1_000_084_000, "上架记录主不存在"); ErrorCode PUTAWAY_RECORD_MAIN_NOT_EXISTS = new ErrorCode(1_000_084_000, "上架记录主不存在");
//上架记录子ErrorCode //上架记录子ErrorCode
ErrorCode PUTAWAY_RECORD_DETAIL_NOT_EXISTS = new ErrorCode(1_000_084_001, "上架记录子不存在"); ErrorCode PUTAWAY_RECORD_DETAIL_NOT_EXISTS = new ErrorCode(1_000_084_001, "上架记录子不存在");
//备料计划主ErrorCode //备料计划主ErrorCode
ErrorCode PREPARETOISSUE_MAIN_NOT_EXISTS = new ErrorCode(1_000_085_000, "备料计划主不存在"); ErrorCode PREPARETOISSUE_MAIN_NOT_EXISTS = new ErrorCode(1_000_085_000, "备料计划主不存在");
//备料计划子ErrorCode //备料计划子ErrorCode
@ -695,6 +703,14 @@ public interface ErrorCodeConstants {
ErrorCode DELIVER_PLAN_MAIN_NOT_EXISTS = new ErrorCode(1_000_118_000, "发货计划主不存在"); ErrorCode DELIVER_PLAN_MAIN_NOT_EXISTS = new ErrorCode(1_000_118_000, "发货计划主不存在");
ErrorCode DELIVER_PLAN_DETAIL_NOT_EXISTS = new ErrorCode(1_000_118_001, "发货计划子不存在"); ErrorCode DELIVER_PLAN_DETAIL_NOT_EXISTS = new ErrorCode(1_000_118_001, "发货计划子不存在");
ErrorCode DELIVER_PLAN_STATUS_NOT_NEW = new ErrorCode(1_000_118_002, "发货计划不是新增状态"); ErrorCode DELIVER_PLAN_STATUS_NOT_NEW = new ErrorCode(1_000_118_002, "发货计划不是新增状态");
ErrorCode DELIVER_PLAN_REQUEST_EXISTS = new ErrorCode(1_000_118_003, "发货计划存在成品发货申请");
ErrorCode DELIVER_PLAN_CANNOT_CLOSE = new ErrorCode(1_000_118_004, "发货计划状态不支持关闭");
ErrorCode DELIVER_PLAN_CANNOT_SUBMIT = new ErrorCode(1_000_118_005, "发货计划状态不支持提交");
ErrorCode DELIVER_PLAN_CANNOT_AGREE = new ErrorCode(1_000_118_006, "发货计划状态不支持审批同意");
ErrorCode DELIVER_PLAN_CANNOT_REFUSE = new ErrorCode(1_000_118_007, "发货计划状态不支持审批驳回");
ErrorCode DELIVER_PLAN_CANNOT_PUBLISH = new ErrorCode(1_000_118_008, "发货计划状态不支持发布");
ErrorCode DELIVER_PLAN_CANNOT_OPEN = new ErrorCode(1_000_118_009, "发货计划状态不支持打开");
ErrorCode DELIVER_PLAN_CANNOT_RESETTING = new ErrorCode(1_000_118_010, "发货计划状态不支持重置");
//发货申请ErrorCode //发货申请ErrorCode
ErrorCode DELIVER_REQUEST_MAIN_NOT_EXISTS = new ErrorCode(1_000_119_000, "发货申请主不存在"); ErrorCode DELIVER_REQUEST_MAIN_NOT_EXISTS = new ErrorCode(1_000_119_000, "发货申请主不存在");
ErrorCode DELIVER_REQUEST_NOT_EXISTS = new ErrorCode(1_000_119_000, "发货申请不存在"); ErrorCode DELIVER_REQUEST_NOT_EXISTS = new ErrorCode(1_000_119_000, "发货申请不存在");

43
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/configurationsetting/ConfigurationsettingController.java

@ -10,8 +10,11 @@ import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.configurationsetting.vo.ConfigurationsettingRespVO; import com.win.module.wms.controller.configurationsetting.vo.ConfigurationsettingRespVO;
import com.win.module.wms.controller.configurationsetting.vo.*; import com.win.module.wms.controller.configurationsetting.vo.*;
import com.win.module.wms.controller.itembasic.vo.ItembasicExcelVO;
import com.win.module.wms.convert.configurationsetting.ConfigurationsettingConvert; import com.win.module.wms.convert.configurationsetting.ConfigurationsettingConvert;
import com.win.module.wms.convert.itembasic.ItembasicConvert;
import com.win.module.wms.dal.dataobject.configurationsetting.ConfigurationsettingDO; import com.win.module.wms.dal.dataobject.configurationsetting.ConfigurationsettingDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.enums.DictTypeConstants; import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.configurationsetting.ConfigurationsettingService; import com.win.module.wms.service.configurationsetting.ConfigurationsettingService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -79,15 +82,6 @@ public class ConfigurationsettingController {
return success(ConfigurationsettingConvert.INSTANCE.convert(configurationsetting)); return success(ConfigurationsettingConvert.INSTANCE.convert(configurationsetting));
} }
@GetMapping("/list")
@Operation(summary = "获得配置设置列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:query')")
public CommonResult<List<ConfigurationsettingRespVO>> getConfigurationsettingList(@RequestParam("ids") Collection<Long> ids) {
List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(ids);
return success(ConfigurationsettingConvert.INSTANCE.convertList(list));
}
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得配置设置分页") @Operation(summary = "获得配置设置分页")
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:query')") @PreAuthorize("@ss.hasPermission('wms:configurationsetting:query')")
@ -115,22 +109,37 @@ public class ConfigurationsettingController {
public void exportConfigurationsettingExcel(@Valid ConfigurationsettingExportReqVO exportReqVO, public void exportConfigurationsettingExcel(@Valid ConfigurationsettingExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(exportReqVO); List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(exportReqVO);
// 导出 Excel
List<ConfigurationsettingExcelVO> datas = ConfigurationsettingConvert.INSTANCE.convertList02(list);
for(ConfigurationsettingExcelVO vo : datas) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<ConfigurationsettingExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "配置设置.xlsx", "数据", ConfigurationsettingExcelVO.class, resultList, mapDropDown);
}
@PostMapping("/export-excel-senior")
@Operation(summary = "导出配置设置 Excel")
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:export')")
@OperateLog(type = EXPORT)
public void exportConfigurationsettingExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<ConfigurationsettingExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "配置设置.xlsx", "数据", ConfigurationsettingExcelVO.class, resultList, mapDropDown);
}
private List<ConfigurationsettingExcelVO> getExcelVo(List<ConfigurationsettingDO> list, Map<Integer, String[]> mapDropDown) {
String[] strategyType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.STRATEGY_TYPE); String[] strategyType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.STRATEGY_TYPE);
mapDropDown.put(0, strategyType); mapDropDown.put(0, strategyType);
String[] isRequired = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); String[] isRequired = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(3, isRequired); mapDropDown.put(3, isRequired);
String[] dataType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.DATA_TYPE); String[] dataType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.DATA_TYPE);
mapDropDown.put(4, dataType); mapDropDown.put(4, dataType);
ExcelUtils.write(response, "配置设置.xls", "数据", ConfigurationsettingExcelVO.class, datas,mapDropDown); // 导出 Excel
List<ConfigurationsettingExcelVO> resultList = ConfigurationsettingConvert.INSTANCE.convertList02(list);
for(ConfigurationsettingExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}
return resultList;
} }
@GetMapping("/get-import-template") @GetMapping("/get-import-template")
@Operation(summary = "获得导入配置模板") @Operation(summary = "获得导入配置模板")
public void importTemplate(HttpServletResponse response) throws IOException { public void importTemplate(HttpServletResponse response) throws IOException {

118
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/DeliverPlanMainController.java

@ -3,14 +3,22 @@ package com.win.module.wms.controller.deliverPlan;
import com.win.framework.common.pojo.CommonResult; import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.framework.excel.core.util.ConvertUtil; import com.win.framework.excel.core.util.ConvertUtil;
import com.win.framework.excel.core.util.ExcelUtils; import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog; import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.deliverPlan.vo.*; import com.win.module.wms.controller.deliverPlan.vo.*;
import com.win.module.wms.controller.purchasereceiptRequest.vo.PurchasereceiptRequestMainExcelVO;
import com.win.module.wms.convert.deliverPlan.DeliverPlanMainConvert; import com.win.module.wms.convert.deliverPlan.DeliverPlanMainConvert;
import com.win.module.wms.convert.purchasereceiptRequest.PurchasereceiptRequestMainConvert;
import com.win.module.wms.dal.dataobject.deliverPlan.DeliverPlanDetailDO;
import com.win.module.wms.dal.dataobject.deliverPlan.DeliverPlanMainDO; import com.win.module.wms.dal.dataobject.deliverPlan.DeliverPlanMainDO;
import com.win.module.wms.dal.dataobject.purchasereceiptRequest.PurchasereceiptRequestDetailDO;
import com.win.module.wms.dal.dataobject.purchasereceiptRequest.PurchasereceiptRequestMainDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.deliverPlan.DeliverPlanDetailService;
import com.win.module.wms.service.deliverPlan.DeliverPlanMainService; import com.win.module.wms.service.deliverPlan.DeliverPlanMainService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@ -41,6 +49,8 @@ public class DeliverPlanMainController {
@Resource @Resource
private DeliverPlanMainService deliverPlanMainService; private DeliverPlanMainService deliverPlanMainService;
@Resource @Resource
private DeliverPlanDetailService deliverPlanDetailService;
@Resource
private AdminUserApi userApi; private AdminUserApi userApi;
@PostMapping("/create") @PostMapping("/create")
@ -58,6 +68,62 @@ public class DeliverPlanMainController {
return success(true); return success(true);
} }
@PutMapping("/close")
@Operation(summary = "关闭发货计划主")
@PreAuthorize("@ss.hasPermission('wms:deliver-plan-main:close')")
public CommonResult<Boolean> closeDeliverPlanMain(@RequestParam("id") Long id) {
deliverPlanMainService.closeDeliverPlanMain(id);
return success(true);
}
@PutMapping("/open")
@Operation(summary = "打开发货计划主")
@PreAuthorize("@ss.hasPermission('wms:deliver-plan-main:open')")
public CommonResult<Boolean> openDeliverPlanMain(@RequestParam("id") Long id) {
deliverPlanMainService.openDeliverPlanMain(id);
return success(true);
}
@PutMapping("/submit")
@Operation(summary = "提交发货计划主")
@PreAuthorize("@ss.hasPermission('wms:deliver-plan-main:submit')")
public CommonResult<Boolean> submitDeliverPlanMain(@RequestParam("id") Long id) {
deliverPlanMainService.submitDeliverPlanMain(id);
return success(true);
}
@PutMapping("/agree")
@Operation(summary = "审批通过发货计划主")
@PreAuthorize("@ss.hasPermission('wms:deliver-plan-main:agree')")
public CommonResult<Boolean> agreeDeliverPlanMain(@RequestParam("id") Long id) {
deliverPlanMainService.agreeDeliverPlanMain(id);
return success(true);
}
@PutMapping("/refies")
@Operation(summary = "审批驳回发货计划主")
@PreAuthorize("@ss.hasPermission('wms:deliver-plan-main:refies')")
public CommonResult<Boolean> refiesDeliverPlanMain(@RequestParam("id") Long id) {
deliverPlanMainService.refiesDeliverPlanMain(id);
return success(true);
}
@PutMapping("/publish")
@Operation(summary = "发布发货计划主")
@PreAuthorize("@ss.hasPermission('wms:deliver-plan-main:publish')")
public CommonResult<Boolean> publishDeliverPlanMain(@RequestParam("id") Long id) {
deliverPlanMainService.publishDeliverPlanMain(id);
return success(true);
}
@PutMapping("/resetting")
@Operation(summary = "重置发货计划主")
@PreAuthorize("@ss.hasPermission('wms:deliver-plan-main:resetting')")
public CommonResult<Boolean> resettingDeliverPlanMain(@RequestParam("id") Long id) {
deliverPlanMainService.resettingDeliverPlanMain(id);
return success(true);
}
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除发货计划主") @Operation(summary = "删除发货计划主")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@ -101,7 +167,8 @@ public class DeliverPlanMainController {
for(DeliverPlanMainRespVO vo : result.getList()) { for(DeliverPlanMainRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段 //后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname()); vo.setCreator(userApi.getUser(Long.valueOf(vo.getCreator())).getNickname());
vo.setUpdater(userApi.getUser(Long.valueOf(vo.getUpdater())).getNickname());
} }
return success(result); return success(result);
} }
@ -114,12 +181,49 @@ public class DeliverPlanMainController {
List<DeliverPlanMainDO> list = deliverPlanMainService.getDeliverPlanMainList(exportReqVO); List<DeliverPlanMainDO> list = deliverPlanMainService.getDeliverPlanMainList(exportReqVO);
// 导出 Excel // 导出 Excel
List<DeliverPlanMainExcelVO> datas = DeliverPlanMainConvert.INSTANCE.convertList02(list); List<DeliverPlanMainExcelVO> datas = DeliverPlanMainConvert.INSTANCE.convertList02(list);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<DeliverPlanMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
for(DeliverPlanMainExcelVO vo : datas) { for(DeliverPlanMainExcelVO vo : datas) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段 //后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname()); vo.setCreator(user.getNickname());
} }
ExcelUtils.write(response, "发货计划主.xls", "数据", DeliverPlanMainExcelVO.class, datas); ExcelUtils.write(response, "发货计划主.xls", "数据", DeliverPlanMainExcelVO.class, resultList,mapDropDown);
}
@PostMapping("/export-excel-senior")
@Operation(summary = "导出发货计划主 Excel")
@PreAuthorize("@ss.hasPermission('wms:deliver-plan-main:export')")
@OperateLog(type = EXPORT)
public void exportPurchasereceiptRequestMainSeniorExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<DeliverPlanMainDO> list = deliverPlanMainService.getDeliverPlanMainList(conditions);
//组装vo
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<DeliverPlanMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
// 导出 Excel
ExcelUtils.write(response, "采购收货申请主.xlsx", "数据", DeliverPlanMainExcelVO.class, resultList, mapDropDown);
}
private List<DeliverPlanMainExcelVO> getExcelVo(List<DeliverPlanMainDO> list, Map<Integer, String[]> mapDropDown) {
String[] status = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PLAN_STATUS);
mapDropDown.put(9, status);
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(12, available);
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
mapDropDown.put(21, uom);
mapDropDown.put(22, available);
List<DeliverPlanMainExcelVO> resultList = new ArrayList<>();
// 导出
for(DeliverPlanMainDO mainDO : list) {
List<DeliverPlanDetailDO> subList = deliverPlanDetailService.selectListByID(mainDO.getId());
for(DeliverPlanDetailDO detailDO : subList) {
DeliverPlanMainExcelVO vo = DeliverPlanMainConvert.INSTANCE.convert(mainDO, detailDO);
AdminUserRespDTO user = userApi.getUser(Long.valueOf(mainDO.getCreator()));
vo.setCreator(user.getNickname());
resultList.add(vo);
}
}
return resultList;
} }
@GetMapping("/get-import-template") @GetMapping("/get-import-template")
@ -128,10 +232,12 @@ public class DeliverPlanMainController {
// 手动创建导出 demo // 手动创建导出 demo
List<DeliverPlanMainImportVO> list = new ArrayList<>(); List<DeliverPlanMainImportVO> list = new ArrayList<>();
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
// String[] purchaseReturnReason = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PURCHASE_RETURN_REASON); String[] status = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PLAN_STATUS);
// mapDropDown.put(16, purchaseReturnReason); mapDropDown.put(9, status);
// String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM); String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
// mapDropDown.put(25, uom); mapDropDown.put(12, available);
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
mapDropDown.put(12, uom);
// 输出 // 输出
ExcelUtils.write(response, "发货计划信息导入模板.xlsx", "发货计划信息列表", DeliverPlanMainImportVO.class, list, mapDropDown); ExcelUtils.write(response, "发货计划信息导入模板.xlsx", "发货计划信息列表", DeliverPlanMainImportVO.class, list, mapDropDown);
} }

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanDetailBaseVO.java

@ -52,6 +52,9 @@ public class DeliverPlanDetailBaseVO {
@Schema(description = "计划数量") @Schema(description = "计划数量")
private BigDecimal planQty; private BigDecimal planQty;
@Schema(description = "发货数量")
private BigDecimal shippedQty;
@Schema(description = "计量单位") @Schema(description = "计量单位")
private String uom; private String uom;

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanDetailExcelVO.java

@ -50,6 +50,9 @@ public class DeliverPlanDetailExcelVO {
@ExcelProperty("计划数量") @ExcelProperty("计划数量")
private BigDecimal planQty; private BigDecimal planQty;
@ExcelProperty("发货数量")
private BigDecimal shippedQty;
@ExcelProperty(value = "计量单位", converter = DictConvert.class) @ExcelProperty(value = "计量单位", converter = DictConvert.class)
@DictFormat("uom") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat("uom") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String uom; private String uom;

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanDetailExportReqVO.java

@ -46,6 +46,9 @@ public class DeliverPlanDetailExportReqVO {
@Schema(description = "计划数量") @Schema(description = "计划数量")
private BigDecimal planQty; private BigDecimal planQty;
@Schema(description = "发货数量")
private BigDecimal shippedQty;
@Schema(description = "计量单位") @Schema(description = "计量单位")
private String uom; private String uom;

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanDetailPageReqVO.java

@ -48,6 +48,9 @@ public class DeliverPlanDetailPageReqVO extends PageParam {
@Schema(description = "计划数量") @Schema(description = "计划数量")
private BigDecimal planQty; private BigDecimal planQty;
@Schema(description = "发货数量")
private BigDecimal shippedQty;
@Schema(description = "计量单位") @Schema(description = "计量单位")
private String uom; private String uom;

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanMainBaseVO.java

@ -1,5 +1,6 @@
package com.win.module.wms.controller.deliverPlan.vo; package com.win.module.wms.controller.deliverPlan.vo;
import com.win.framework.excel.core.annotations.OnlyOne;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -23,6 +24,7 @@ public class DeliverPlanMainBaseVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime planDate; private LocalDateTime planDate;
@OnlyOne
@Schema(description = "单据号") @Schema(description = "单据号")
private String number; private String number;

45
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanMainExcelVO.java

@ -1,7 +1,10 @@
package com.win.module.wms.controller.deliverPlan.vo; package com.win.module.wms.controller.deliverPlan.vo;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -26,9 +29,11 @@ public class DeliverPlanMainExcelVO {
private String customerCode; private String customerCode;
@ExcelProperty("计划日期") @ExcelProperty("计划日期")
@ColumnWidth(value = 21)
private LocalDateTime planDate; private LocalDateTime planDate;
@ExcelProperty("单据号") @ExcelProperty("单据号")
@ColumnWidth(value = 20)
private String number; private String number;
@ExcelProperty("业务类型") @ExcelProperty("业务类型")
@ -38,15 +43,18 @@ public class DeliverPlanMainExcelVO {
private String remark; private String remark;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
@ColumnWidth(value = 21)
private LocalDateTime createTime; private LocalDateTime createTime;
@ExcelProperty("创建者用户名") @ExcelProperty("创建者用户名")
private String creator; private String creator;
@ExcelProperty("开始时间") @ExcelProperty("开始时间")
@ColumnWidth(value = 21)
private LocalDateTime beginTime; private LocalDateTime beginTime;
@ExcelProperty("结束时间") @ExcelProperty("结束时间")
@ColumnWidth(value = 21)
private LocalDateTime endTime; private LocalDateTime endTime;
@ExcelProperty(value = "状态", converter = DictConvert.class) @ExcelProperty(value = "状态", converter = DictConvert.class)
@ -54,12 +62,47 @@ public class DeliverPlanMainExcelVO {
private String status; private String status;
@ExcelProperty("最后更新时间") @ExcelProperty("最后更新时间")
@ColumnWidth(value = 21)
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ExcelProperty("最后更新者用户名") @ExcelProperty("最后更新者用户名")
private String updater; private String updater;
@ExcelProperty("是否可用") @ExcelProperty(value = "是否可用", converter = DictConvert.class)
@DictFormat("true_false")
private String available; private String available;
//子表导出字段
@ExcelProperty("销售订单号")
private String soNumber;
@ExcelProperty("销售订单行")
private String soLine;
@ExcelProperty("客户月台")
private String customerDockCode;
@ExcelProperty("项目")
private String project;
@ExcelProperty("物品代码")
@ColumnWidth(value = 15)
private String itemCode;
@ExcelProperty("备注")
private String remarkDetail;
@ExcelProperty("计划数量")
private BigDecimal planQty;
@ExcelProperty("发货数量")
private BigDecimal shippedQty;
@ExcelProperty(value = "计量单位", converter = DictConvert.class)
@DictFormat("uom") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String uom;
@ExcelProperty("是否可用")
private String availableDetail;
} }

13
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/deliverPlan/vo/DeliverPlanMainImportVO.java

@ -13,7 +13,7 @@ import java.math.BigDecimal;
/** /**
* 采购索赔申请子 Excel VO * 发货计划申请 Excel VO
* *
* @author 超级管理员 * @author 超级管理员
*/ */
@ -32,19 +32,30 @@ public class DeliverPlanMainImportVO {
@ExcelProperty("计划日期") @ExcelProperty("计划日期")
private String planDate; private String planDate;
@ExcelProperty("开始日期")
private String beginTime;
@ExcelProperty("结束日期")
private String endTime;
//子表数据 //子表数据
@ExcelProperty("销售订单号") @ExcelProperty("销售订单号")
private String soNumber; private String soNumber;
@ExcelProperty("销售订单行") @ExcelProperty("销售订单行")
private BigDecimal soLine; private BigDecimal soLine;
@ExcelProperty("物品代码") @ExcelProperty("物品代码")
private String itemCode; private String itemCode;
@ExcelProperty("计划数量") @ExcelProperty("计划数量")
private BigDecimal qty; private BigDecimal qty;
@ExcelProperty(value = "计量单位", converter = DictConvert.class) @ExcelProperty(value = "计量单位", converter = DictConvert.class)
@DictFormat(DictTypeConstants.UOM) @DictFormat(DictTypeConstants.UOM)
private String uom; private String uom;
@ExcelProperty("客户月台代码")
private String customerDockCode;
} }

11
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inspectJob/InspectJobMainController.java

@ -82,10 +82,10 @@ public class InspectJobMainController {
List<InspectJobMainDO> list = inspectJobMainService.getInspectJobMainList(exportReqVO); List<InspectJobMainDO> list = inspectJobMainService.getInspectJobMainList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<InspectJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<InspectJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "检验任务主.xls", "数据", InspectJobMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "检验任务主.xls", "检验任务数据", InspectJobMainExcelVO.class, resultList, mapDropDown);
} }
@GetMapping("/export-excel-senior") @PostMapping("/export-excel-senior")
@Operation(summary = "导出检验任务主 Excel") @Operation(summary = "导出检验任务主 Excel")
@PreAuthorize("@ss.hasPermission('wms:inspect-job-main:export')") @PreAuthorize("@ss.hasPermission('wms:inspect-job-main:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
@ -93,11 +93,10 @@ public class InspectJobMainController {
List<InspectJobMainDO> list = inspectJobMainService.getInspectJobMainList(conditions); List<InspectJobMainDO> list = inspectJobMainService.getInspectJobMainList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<InspectJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<InspectJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "检验任务主.xls", "数据", InspectJobMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "检验任务主.xls", "检验任务数据", InspectJobMainExcelVO.class, resultList, mapDropDown);
} }
private List<InspectJobMainExcelVO> getExcelVo(List<InspectJobMainDO> list, Map<Integer, String[]> mapDropDown) { private List<InspectJobMainExcelVO> getExcelVo(List<InspectJobMainDO> list, Map<Integer, String[]> mapDropDown) {
//组装vo
String[] status = JobStatusEnum.getStatusNameArray(); String[] status = JobStatusEnum.getStatusNameArray();
mapDropDown.put(6, status); mapDropDown.put(6, status);
String[] transferMode = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRANSFER_MODE); String[] transferMode = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRANSFER_MODE);
@ -210,8 +209,8 @@ public class InspectJobMainController {
@Operation(summary = "执行任务") @Operation(summary = "执行任务")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:inspect-job-main:execute')") @PreAuthorize("@ss.hasPermission('wms:inspect-job-main:execute')")
public CommonResult<Boolean> excuteInspectJobMain(@Valid @RequestBody InspectJobMainUpdateReqVO updateReqVO) { public CommonResult<Boolean> executeInspectJobMain(@Valid @RequestBody InspectJobMainUpdateReqVO updateReqVO) {
Integer count = inspectJobMainService.excuteInspectJobMain(updateReqVO); Integer count = inspectJobMainService.executeInspectJobMain(updateReqVO);
return success(count > 0); return success(count > 0);
} }

6
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inspectRecord/InspectRecordMainController.java

@ -80,10 +80,10 @@ public class InspectRecordMainController {
List<InspectRecordMainDO> list = inspectRecordMainService.getInspectRecordMainList(exportReqVO); List<InspectRecordMainDO> list = inspectRecordMainService.getInspectRecordMainList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<InspectRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<InspectRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "检验记录主.xls", "数据", InspectRecordMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "检验记录主.xls", "检验记录数据", InspectRecordMainExcelVO.class, resultList, mapDropDown);
} }
@GetMapping("/export-excel-senior") @PostMapping("/export-excel-senior")
@Operation(summary = "导出检验记录主 Excel") @Operation(summary = "导出检验记录主 Excel")
@PreAuthorize("@ss.hasPermission('wms:inspect-record-main:export')") @PreAuthorize("@ss.hasPermission('wms:inspect-record-main:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
@ -91,7 +91,7 @@ public class InspectRecordMainController {
List<InspectRecordMainDO> list = inspectRecordMainService.getInspectRecordMainList(conditions); List<InspectRecordMainDO> list = inspectRecordMainService.getInspectRecordMainList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<InspectRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<InspectRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "检验记录主.xls", "数据", InspectRecordMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "检验记录主.xls", "检验记录数据", InspectRecordMainExcelVO.class, resultList, mapDropDown);
} }
private List<InspectRecordMainExcelVO> getExcelVo(List<InspectRecordMainDO> list, Map<Integer, String[]> mapDropDown) { private List<InspectRecordMainExcelVO> getExcelVo(List<InspectRecordMainDO> list, Map<Integer, String[]> mapDropDown) {

55
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inspectRequest/InspectRequestMainController.java

@ -10,6 +10,7 @@ import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.inspectRequest.vo.*; import com.win.module.wms.controller.inspectRequest.vo.*;
import com.win.module.wms.convert.inspectRequest.InspectRequestDetailConvert;
import com.win.module.wms.convert.inspectRequest.InspectRequestMainConvert; import com.win.module.wms.convert.inspectRequest.InspectRequestMainConvert;
import com.win.module.wms.dal.dataobject.inspectRequest.InspectRequestDetailDO; import com.win.module.wms.dal.dataobject.inspectRequest.InspectRequestDetailDO;
import com.win.module.wms.dal.dataobject.inspectRequest.InspectRequestMainDO; import com.win.module.wms.dal.dataobject.inspectRequest.InspectRequestMainDO;
@ -31,7 +32,10 @@ import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneOffset; import java.time.ZoneOffset;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.win.framework.common.pojo.CommonResult.success; import static com.win.framework.common.pojo.CommonResult.success;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@ -82,15 +86,6 @@ public class InspectRequestMainController {
return success(InspectRequestMainConvert.INSTANCE.convert(inspectRequestMain)); return success(InspectRequestMainConvert.INSTANCE.convert(inspectRequestMain));
} }
@GetMapping("/list")
@Operation(summary = "获得检验申请主列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:inspect-request-main:query')")
public CommonResult<List<InspectRequestMainRespVO>> getInspectRequestMainList(@RequestParam("ids") Collection<Long> ids) {
List<InspectRequestMainDO> list = inspectRequestMainService.getInspectRequestMainList(ids);
return success(InspectRequestMainConvert.INSTANCE.convertList(list));
}
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得检验申请主分页") @Operation(summary = "获得检验申请主分页")
@PreAuthorize("@ss.hasPermission('wms:inspect-request-main:query')") @PreAuthorize("@ss.hasPermission('wms:inspect-request-main:query')")
@ -120,10 +115,10 @@ public class InspectRequestMainController {
List<InspectRequestMainDO> list = inspectRequestMainService.getInspectRequestMainList(exportReqVO); List<InspectRequestMainDO> list = inspectRequestMainService.getInspectRequestMainList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<InspectRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<InspectRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "到货检验申请主.xls", "检验申请信息列表", InspectRequestMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "到货检验申请主.xls", "检验申请信息", InspectRequestMainExcelVO.class, resultList, mapDropDown);
} }
@GetMapping("/export-excel-senior") @PostMapping("/export-excel-senior")
@Operation(summary = "导出检验申请主 Excel") @Operation(summary = "导出检验申请主 Excel")
@PreAuthorize("@ss.hasPermission('wms:inspect-request-main:export')") @PreAuthorize("@ss.hasPermission('wms:inspect-request-main:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
@ -131,7 +126,7 @@ public class InspectRequestMainController {
List<InspectRequestMainDO> list = inspectRequestMainService.getInspectRequestMainList(conditions); List<InspectRequestMainDO> list = inspectRequestMainService.getInspectRequestMainList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<InspectRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<InspectRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "到货检验申请主.xls", "检验申请信息列表", InspectRequestMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "到货检验申请主.xls", "检验申请信息", InspectRequestMainExcelVO.class, resultList, mapDropDown);
} }
private List<InspectRequestMainExcelVO> getExcelVo(List<InspectRequestMainDO> list, Map<Integer, String[]> mapDropDown) { private List<InspectRequestMainExcelVO> getExcelVo(List<InspectRequestMainDO> list, Map<Integer, String[]> mapDropDown) {
@ -170,12 +165,22 @@ public class InspectRequestMainController {
// 手动创建导出 demo // 手动创建导出 demo
List<InspectRequestImportVO> list = new ArrayList<>(); List<InspectRequestImportVO> list = new ArrayList<>();
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
String[] locationType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.LOCATION_TYPE);
mapDropDown.put(6, locationType);
String[] requestStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.REQUEST_STATUS);
mapDropDown.put(11, requestStatus);
String[] inspectType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INSPECT_TYPE);
mapDropDown.put(15, inspectType);
String[] nextAction = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.NEXT_ACTION);
mapDropDown.put(16, nextAction);
String[] sampleMethod = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.SAMPLE_METHOD);
mapDropDown.put(17, sampleMethod);
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM); String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
mapDropDown.put(8, uom); mapDropDown.put(18, uom);
String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS); String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS);
mapDropDown.put(9, inventoryStatus); mapDropDown.put(28, inventoryStatus);
// 输出 // 输出
ExcelUtils.write(response, "检验申请信息导入模板.xlsx", "检验申请信息列表", InspectRequestImportVO.class, list, mapDropDown); ExcelUtils.write(response, "检验申请信息导入模板.xlsx", "检验申请信息", InspectRequestImportVO.class, list, mapDropDown);
} }
@ -249,4 +254,22 @@ public class InspectRequestMainController {
return success(count > 0); return success(count > 0);
} }
@GetMapping("/getInspectRequestById")
@Operation(summary = "APP获得检验申请主子表明细列表")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('wms:inspect-request-main:query')")
public CommonResult<InspectRequestMainRespVO> getInspectRequestById(@RequestParam("id") Long id) {
InspectRequestMainDO inspectRequestMain = inspectRequestMainService.getInspectRequestMain(id);
InspectRequestMainRespVO result = InspectRequestMainConvert.INSTANCE.convert(inspectRequestMain);
if (result == null) {
return success(result);
}
InspectRequestDetailExportReqVO reqVO = new InspectRequestDetailExportReqVO();
reqVO.setMasterId(result.getId());
List<InspectRequestDetailDO> list = inspectRequestDetailService.getInspectRequestDetailList(reqVO);
List<InspectRequestDetailExcelVO> vos = InspectRequestDetailConvert.INSTANCE.convertList02(list);
result.setSubList(vos);
return success(result);
}
} }

8
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventoryinitRequest/vo/InventoryinitRequestMainUpdateReqVO.java

@ -1,12 +1,18 @@
package com.win.module.wms.controller.inventoryinitRequest.vo; package com.win.module.wms.controller.inventoryinitRequest.vo;
import com.win.framework.excel.core.annotations.SubObject;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestDetailUpdateReqVO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.List;
@Schema(description = "管理后台 - 库存初始化申请主更新 Request VO") @Schema(description = "管理后台 - 库存初始化申请主更新 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InventoryinitRequestMainUpdateReqVO extends InventoryinitRequestMainBaseVO { public class InventoryinitRequestMainUpdateReqVO extends InventoryinitRequestMainBaseVO {
@SubObject
@Schema(description = "子表数据")
private List<InventoryinitRequestDetailUpdateReqVO> subList;
} }

16
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/InventorymoveRequestMainController.java

@ -3,6 +3,7 @@ package com.win.module.wms.controller.inventorymoveRequest;
import com.win.framework.common.pojo.CommonResult; import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.framework.excel.core.util.ConvertUtil; import com.win.framework.excel.core.util.ConvertUtil;
import com.win.framework.excel.core.util.ExcelUtils; import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog; import com.win.framework.operatelog.core.annotations.OperateLog;
@ -11,6 +12,7 @@ import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.inventorymoveRequest.vo.*; import com.win.module.wms.controller.inventorymoveRequest.vo.*;
import com.win.module.wms.convert.inventorymoveRequest.InventorymoveRequestMainConvert; import com.win.module.wms.convert.inventorymoveRequest.InventorymoveRequestMainConvert;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO; import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.inventorymoveRequest.InventorymoveRequestMainService; import com.win.module.wms.service.inventorymoveRequest.InventorymoveRequestMainService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@ -125,21 +127,19 @@ public class InventorymoveRequestMainController {
} }
@GetMapping("/get-import-template") @GetMapping("/get-import-template")
@Operation(summary = "获得导入发货计划信息模板") @Operation(summary = "获得导入库存转移信息模板")
public void importTemplate(HttpServletResponse response) throws IOException { public void importTemplate(HttpServletResponse response) throws IOException {
// 手动创建导出 demo // 手动创建导出 demo
List<InventorymoveRequestMainImportVO> list = new ArrayList<>(); List<InventorymoveRequestMainImportVO> list = new ArrayList<>();
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
// String[] purchaseReturnReason = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PURCHASE_RETURN_REASON); String[] fromInventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS);
// mapDropDown.put(16, purchaseReturnReason); mapDropDown.put(5, fromInventoryStatus);
// String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
// mapDropDown.put(25, uom);
// 输出 // 输出
ExcelUtils.write(response, "发货计划信息导入模板.xlsx", "发货计划信息列表", InventorymoveRequestMainImportVO.class, list, mapDropDown); ExcelUtils.write(response, "库存转移信息导入模板.xlsx", "库存转移信息列表", InventorymoveRequestMainImportVO.class, list, mapDropDown);
} }
@PostMapping("/import") @PostMapping("/import")
@Operation(summary = "导入发货计划") @Operation(summary = "导入库存转移")
@Parameters({ @Parameters({
@Parameter(name = "file", description = "Excel 文件", required = true), @Parameter(name = "file", description = "Excel 文件", required = true),
@Parameter(name = "mode", description = "导入模式1更新2追加3覆盖", example = "1"), @Parameter(name = "mode", description = "导入模式1更新2追加3覆盖", example = "1"),
@ -157,7 +157,7 @@ public class InventorymoveRequestMainController {
Map<String, Object> returnMap = new HashMap<>(); Map<String, Object> returnMap = new HashMap<>();
returnMap.put("errorCount", errorList.size()); returnMap.put("errorCount", errorList.size());
if(!errorList.isEmpty()) { if(!errorList.isEmpty()) {
String url = ExcelUtils.writeLocalFile("发货计划基本信息导入错误数据" + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) + ".xlsx", "错误列表", errorList); String url = ExcelUtils.writeLocalFile("库存转移基本信息导入错误数据" + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) + ".xlsx", "错误列表", errorList);
returnMap.put("errorFile", url); returnMap.put("errorFile", url);
} }
return success(returnMap); return success(returnMap);

6
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestDetailBaseVO.java

@ -47,14 +47,12 @@ public class InventorymoveRequestDetailBaseVO {
private String toOwnerCode; private String toOwnerCode;
@Schema(description = "到包装号", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "到包装号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "到包装号不能为空")
private String toPackingNumber; private String toPackingNumber;
@Schema(description = "到器具号") @Schema(description = "到器具号")
private String toContainerNumber; private String toContainerNumber;
@Schema(description = "到批次", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "到批次", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "到批次不能为空")
private String toBatch; private String toBatch;
@Schema(description = "到库位代码", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "到库位代码", requiredMode = Schema.RequiredMode.REQUIRED)
@ -62,7 +60,6 @@ public class InventorymoveRequestDetailBaseVO {
private String toLocationCode; private String toLocationCode;
@Schema(description = "到库存状态", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "到库存状态", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "到库存状态不能为空")
private String toInventoryStatus; private String toInventoryStatus;
@Schema(description = "单据号") @Schema(description = "单据号")
@ -72,7 +69,6 @@ public class InventorymoveRequestDetailBaseVO {
private String remark; private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "创建时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTime; private LocalDateTime createTime;
@ -108,4 +104,6 @@ public class InventorymoveRequestDetailBaseVO {
@NotNull(message = "物品代码不能为空") @NotNull(message = "物品代码不能为空")
private String itemCode; private String itemCode;
@Schema(description = "master_id", example = "master_id")
private Long masterId;
} }

13
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainBaseVO.java

@ -1,5 +1,6 @@
package com.win.module.wms.controller.inventorymoveRequest.vo; package com.win.module.wms.controller.inventorymoveRequest.vo;
import com.win.framework.excel.core.annotations.OnlyOne;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
@ -23,18 +24,16 @@ public class InventorymoveRequestMainBaseVO {
private Long id; private Long id;
@Schema(description = "单据号", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "单据号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "单据号不能为空") @OnlyOne
private String number; private String number;
@Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "业务类型不能为空")
private String businessType; private String businessType;
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "创建时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTime; private LocalDateTime createTime;
@ -50,7 +49,6 @@ public class InventorymoveRequestMainBaseVO {
private LocalDateTime dueTime; private LocalDateTime dueTime;
@Schema(description = "部门", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "部门", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "部门不能为空")
private String departmentCode; private String departmentCode;
@Schema(description = "状态") @Schema(description = "状态")
@ -64,23 +62,18 @@ public class InventorymoveRequestMainBaseVO {
private String updater; private String updater;
@Schema(description = "从仓库代码", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "从仓库代码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "从仓库代码不能为空") private String fromWarehouseCode;
private String fromWarehouseOde;
@Schema(description = "从库位类型范围", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "从库位类型范围", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "从库位类型范围不能为空")
private String fromLocationTypes; private String fromLocationTypes;
@Schema(description = "从库区代码范围", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "从库区代码范围", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "从库区代码范围不能为空")
private String fromAreaCodes; private String fromAreaCodes;
@Schema(description = "到仓库代码", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "到仓库代码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "到仓库代码不能为空")
private String toWarehouseCode; private String toWarehouseCode;
@Schema(description = "到库位类型范围", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "到库位类型范围", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "到库位类型范围不能为空")
private String toLocationTypes; private String toLocationTypes;
@Schema(description = "到库区代码范围") @Schema(description = "到库区代码范围")

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainExcelVO.java

@ -56,7 +56,7 @@ public class InventorymoveRequestMainExcelVO {
private String updater; private String updater;
@ExcelProperty("从仓库代码") @ExcelProperty("从仓库代码")
private String fromWarehouseOde; private String fromWarehouseCode;
@ExcelProperty(value = "从库位类型范围", converter = DictConvert.class) @ExcelProperty(value = "从库位类型范围", converter = DictConvert.class)
@DictFormat("location_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat("location_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainExportReqVO.java

@ -51,7 +51,7 @@ public class InventorymoveRequestMainExportReqVO {
private String updater; private String updater;
@Schema(description = "从仓库代码") @Schema(description = "从仓库代码")
private String fromWarehouseOde; private String fromWarehouseCode;
@Schema(description = "从库位类型范围") @Schema(description = "从库位类型范围")
private String fromLocationTypes; private String fromLocationTypes;

46
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainImportVO.java

@ -2,6 +2,9 @@ package com.win.module.wms.controller.inventorymoveRequest.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.win.framework.excel.core.annotations.DictFormat;
import com.win.framework.excel.core.convert.DictConvert;
import com.win.module.wms.enums.DictTypeConstants;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -23,42 +26,31 @@ import java.time.LocalDateTime;
public class InventorymoveRequestMainImportVO { public class InventorymoveRequestMainImportVO {
//主表数据 //主表数据
@ExcelProperty("订单类型")
private String type;
@ExcelProperty("单据号") @ExcelProperty("单据号")
private String number; private String number;
@ExcelProperty("行号")
private String hang;
@ExcelProperty("供应商代码") //子表数据
private String supplierCode; @ExcelProperty("物品代码")
private String itemCode;
@ExcelProperty("联系人姓名") @ExcelProperty("从包装号")
private String contactName; private String fromPackingNumber;
@ExcelProperty("联系人电话") @ExcelProperty("从器具号")
@ColumnWidth(value = 16) private String fromContainerNumber;
private String contactPhone;
@ExcelProperty("联系人电子邮件") @ExcelProperty("从批次")
@ColumnWidth(value = 16) private String fromBatch;
private String contactEmail;
@ExcelProperty("是否寄存订单") @ExcelProperty(value = "从库存状态", converter = DictConvert.class)
private String isConsignment; @DictFormat(DictTypeConstants.INVENTORY_STATUS)
private String fromInventoryStatus;
@ExcelProperty("截止日期") @ExcelProperty("从库位代码")
private LocalDateTime dueDate; private String fromLocationCode;
//子表数据 @ExcelProperty("到库位代码")
@ExcelProperty("物品代码") private String toLocationCode;
private String itemCode;
@ExcelProperty("数量")
private BigDecimal orderQty;
@ExcelProperty("计量单位")
private String uom;
@ExcelProperty("超收百分比")
private BigDecimal overReceivingPercent;
} }

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainPageReqVO.java

@ -53,7 +53,7 @@ public class InventorymoveRequestMainPageReqVO extends PageParam {
private String updater; private String updater;
@Schema(description = "从仓库代码") @Schema(description = "从仓库代码")
private String fromWarehouseOde; private String fromWarehouseCode;
@Schema(description = "从库位类型范围") @Schema(description = "从库位类型范围")
private String fromLocationTypes; private String fromLocationTypes;

8
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inventorymoveRequest/vo/InventorymoveRequestMainUpdateReqVO.java

@ -1,12 +1,20 @@
package com.win.module.wms.controller.inventorymoveRequest.vo; package com.win.module.wms.controller.inventorymoveRequest.vo;
import com.win.framework.excel.core.annotations.SubObject;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestDetailUpdateReqVO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.List;
@Schema(description = "管理后台 - 库存转移申请主更新 Request VO") @Schema(description = "管理后台 - 库存转移申请主更新 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class InventorymoveRequestMainUpdateReqVO extends InventorymoveRequestMainBaseVO { public class InventorymoveRequestMainUpdateReqVO extends InventorymoveRequestMainBaseVO {
@SubObject
@Schema(description = "子表数据")
private List<InventorymoveRequestDetailUpdateReqVO> subList;
} }

34
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/paramsetting/ParamsettingController.java

@ -8,8 +8,11 @@ import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog; import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.itembasic.vo.ItembasicExcelVO;
import com.win.module.wms.controller.paramsetting.vo.*; import com.win.module.wms.controller.paramsetting.vo.*;
import com.win.module.wms.convert.itembasic.ItembasicConvert;
import com.win.module.wms.convert.paramsetting.ParamsettingConvert; import com.win.module.wms.convert.paramsetting.ParamsettingConvert;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.paramsetting.ParamsettingDO; import com.win.module.wms.dal.dataobject.paramsetting.ParamsettingDO;
import com.win.module.wms.enums.DictTypeConstants; import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.paramsetting.ParamsettingService; import com.win.module.wms.service.paramsetting.ParamsettingService;
@ -78,15 +81,6 @@ public class ParamsettingController {
return success(ParamsettingConvert.INSTANCE.convert(paramsetting)); return success(ParamsettingConvert.INSTANCE.convert(paramsetting));
} }
@GetMapping("/list")
@Operation(summary = "获得参数设置列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:paramsetting:query')")
public CommonResult<List<ParamsettingRespVO>> getParamsettingList(@RequestParam("ids") Collection<Long> ids) {
List<ParamsettingDO> list = paramsettingService.getParamsettingList(ids);
return success(ParamsettingConvert.INSTANCE.convertList(list));
}
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得参数设置分页") @Operation(summary = "获得参数设置分页")
@PreAuthorize("@ss.hasPermission('wms:paramsetting:query')") @PreAuthorize("@ss.hasPermission('wms:paramsetting:query')")
@ -102,15 +96,31 @@ public class ParamsettingController {
public void exportParamsettingExcel(@Valid ParamsettingExportReqVO exportReqVO, public void exportParamsettingExcel(@Valid ParamsettingExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<ParamsettingDO> list = paramsettingService.getParamsettingList(exportReqVO); List<ParamsettingDO> list = paramsettingService.getParamsettingList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<ParamsettingExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "参数设置.xlsx", "数据", ParamsettingExcelVO.class, resultList, mapDropDown);
}
@PostMapping("/export-excel-senior")
@Operation(summary = "导出参数设置 Excel")
@PreAuthorize("@ss.hasPermission('wms:paramsetting:export')")
@OperateLog(type = EXPORT)
public void exportParamsettingExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<ParamsettingDO> list = paramsettingService.getParamsettingList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<ParamsettingExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "参数设置.xlsx", "数据", ParamsettingExcelVO.class, resultList, mapDropDown);
}
private List<ParamsettingExcelVO> getExcelVo(List<ParamsettingDO> list, Map<Integer, String[]> mapDropDown) {
// 导出 Excel // 导出 Excel
List<ParamsettingExcelVO> datas = ParamsettingConvert.INSTANCE.convertList02(list); List<ParamsettingExcelVO> resultList = ParamsettingConvert.INSTANCE.convertList02(list);
for(ParamsettingExcelVO vo : datas) { for(ParamsettingExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段 //后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname()); vo.setCreator(user.getNickname());
} }
ExcelUtils.write(response, "参数设置.xls", "数据", ParamsettingExcelVO.class, datas); return resultList;
} }
@GetMapping("/get-import-template") @GetMapping("/get-import-template")
@Operation(summary = "获得导入参数设置模板") @Operation(summary = "获得导入参数设置模板")
public void importTemplate(HttpServletResponse response) throws IOException { public void importTemplate(HttpServletResponse response) throws IOException {

20
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptJob/PurchasereceiptJobMainController.java

@ -84,15 +84,14 @@ public class PurchasereceiptJobMainController {
@Operation(summary = "导出采购收货任务主 Excel") @Operation(summary = "导出采购收货任务主 Excel")
@PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:export')") @PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportPurchasereceiptJobMainExcel(@Valid PurchasereceiptJobMainExportReqVO exportReqVO, public void exportPurchasereceiptJobMainExcel(@Valid PurchasereceiptJobMainExportReqVO exportReqVO, HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<PurchasereceiptJobMainDO> list = purchasereceiptJobMainService.getPurchasereceiptJobMainList(exportReqVO); List<PurchasereceiptJobMainDO> list = purchasereceiptJobMainService.getPurchasereceiptJobMainList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PurchasereceiptJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<PurchasereceiptJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "采购收货任务主.xlsx", "数据", PurchasereceiptJobMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "采购收货任务主.xlsx", "采购收货任务数据", PurchasereceiptJobMainExcelVO.class, resultList, mapDropDown);
} }
@GetMapping("/export-excel-senior") @PostMapping("/export-excel-senior")
@Operation(summary = "导出采购收货任务主 Excel") @Operation(summary = "导出采购收货任务主 Excel")
@PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:export')") @PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
@ -100,18 +99,14 @@ public class PurchasereceiptJobMainController {
List<PurchasereceiptJobMainDO> list = purchasereceiptJobMainService.getPurchasereceiptJobMainList(conditions); List<PurchasereceiptJobMainDO> list = purchasereceiptJobMainService.getPurchasereceiptJobMainList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PurchasereceiptJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<PurchasereceiptJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "采购收货任务主.xlsx", "数据", PurchasereceiptJobMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "采购收货任务主.xlsx", "采购收货任务数据", PurchasereceiptJobMainExcelVO.class, resultList, mapDropDown);
} }
private List<PurchasereceiptJobMainExcelVO> getExcelVo(List<PurchasereceiptJobMainDO> list, Map<Integer, String[]> mapDropDown) { private List<PurchasereceiptJobMainExcelVO> getExcelVo(List<PurchasereceiptJobMainDO> list, Map<Integer, String[]> mapDropDown) {
//组装vo
String[] transferMode = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRANSFER_MODE); String[] transferMode = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRANSFER_MODE);
mapDropDown.put(6, transferMode); mapDropDown.put(6, transferMode);
String[] status = JobStatusEnum.getStatusNameArray(); String[] status = JobStatusEnum.getStatusNameArray();
mapDropDown.put(12, status); mapDropDown.put(12, status);
String[] locationType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.LOCATION_TYPE);
mapDropDown.put(22, locationType);
mapDropDown.put(23, locationType);
String[] trueFalse = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); String[] trueFalse = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(27, trueFalse); mapDropDown.put(27, trueFalse);
mapDropDown.put(30, trueFalse); mapDropDown.put(30, trueFalse);
@ -123,6 +118,9 @@ public class PurchasereceiptJobMainController {
mapDropDown.put(36, trueFalse); mapDropDown.put(36, trueFalse);
mapDropDown.put(37, trueFalse); mapDropDown.put(37, trueFalse);
mapDropDown.put(38, trueFalse); mapDropDown.put(38, trueFalse);
String[] locationType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.LOCATION_TYPE);
mapDropDown.put(22, locationType);
mapDropDown.put(23, locationType);
String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS); String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS);
mapDropDown.put(46, inventoryStatus); mapDropDown.put(46, inventoryStatus);
String[] packUnit = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PACK_UNIT); String[] packUnit = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PACK_UNIT);
@ -193,8 +191,8 @@ public class PurchasereceiptJobMainController {
@Operation(summary = "执行采购收货任务主") @Operation(summary = "执行采购收货任务主")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:execute')") @PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:execute')")
public CommonResult<Boolean> excutePurchasereceiptJobMain(@Valid @RequestBody PurchasereceiptJobMainUpdateReqVO updateReqVO) { public CommonResult<Boolean> executePurchasereceiptJobMain(@Valid @RequestBody PurchasereceiptJobMainUpdateReqVO updateReqVO) {
Integer count = purchasereceiptJobMainService.excutePurchasereceiptJobMain(updateReqVO); Integer count = purchasereceiptJobMainService.executePurchasereceiptJobMain(updateReqVO);
return success(count > 0); return success(count > 0);
} }

6
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/PurchasereceiptRecordMainController.java

@ -80,10 +80,10 @@ public class PurchasereceiptRecordMainController {
List<PurchasereceiptRecordMainDO> list = purchasereceiptRecordMainService.getPurchasereceiptRecordMainList(exportReqVO); List<PurchasereceiptRecordMainDO> list = purchasereceiptRecordMainService.getPurchasereceiptRecordMainList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PurchasereceiptRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<PurchasereceiptRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "采购收货记录主.xls", "数据", PurchasereceiptRecordMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "采购收货记录主.xls", "采购收货记录数据", PurchasereceiptRecordMainExcelVO.class, resultList, mapDropDown);
} }
@GetMapping("/export-excel-senior") @PostMapping("/export-excel-senior")
@Operation(summary = "导出采购收货记录主 Excel") @Operation(summary = "导出采购收货记录主 Excel")
@PreAuthorize("@ss.hasPermission('wms:purchasereceipt-record-main:export')") @PreAuthorize("@ss.hasPermission('wms:purchasereceipt-record-main:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
@ -91,7 +91,7 @@ public class PurchasereceiptRecordMainController {
List<PurchasereceiptRecordMainDO> list = purchasereceiptRecordMainService.getPurchasereceiptRecordMainList(conditions); List<PurchasereceiptRecordMainDO> list = purchasereceiptRecordMainService.getPurchasereceiptRecordMainList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PurchasereceiptRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<PurchasereceiptRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "采购收货记录主.xls", "数据", PurchasereceiptRecordMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "采购收货记录主.xls", "采购收货记录数据", PurchasereceiptRecordMainExcelVO.class, resultList, mapDropDown);
} }
private List<PurchasereceiptRecordMainExcelVO> getExcelVo(List<PurchasereceiptRecordMainDO> list, Map<Integer, String[]> mapDropDown) { private List<PurchasereceiptRecordMainExcelVO> getExcelVo(List<PurchasereceiptRecordMainDO> list, Map<Integer, String[]> mapDropDown) {

31
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRequest/PurchasereceiptRequestMainController.java

@ -65,15 +65,6 @@ public class PurchasereceiptRequestMainController {
return success(result > 0); return success(result > 0);
} }
// @DeleteMapping("/delete")
// @Operation(summary = "删除采购收货申请主")
// @Parameter(name = "id", description = "编号", required = true)
// @PreAuthorize("@ss.hasPermission('wms:purchasereceipt-request-main:delete')")
// public CommonResult<Boolean> deletePurchasereceiptRequestMain(@RequestParam("id") Long id) {
// Integer result = purchasereceiptRequestMainService.deletePurchasereceiptRequestMain(id);
// return success(result > 0);
// }
@PostMapping("/senior") @PostMapping("/senior")
@Operation(summary = "高级搜索获得物品基本信息分页") @Operation(summary = "高级搜索获得物品基本信息分页")
@PreAuthorize("@ss.hasPermission('wms:purchasereceipt-request-main:query')") @PreAuthorize("@ss.hasPermission('wms:purchasereceipt-request-main:query')")
@ -124,7 +115,7 @@ public class PurchasereceiptRequestMainController {
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PurchasereceiptRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<PurchasereceiptRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
// 导出 Excel // 导出 Excel
ExcelUtils.write(response, "采购收货申请主.xlsx", "数据", PurchasereceiptRequestMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "采购收货申请主.xlsx", "采购收货申请数据", PurchasereceiptRequestMainExcelVO.class, resultList, mapDropDown);
} }
@PostMapping("/export-excel-senior") @PostMapping("/export-excel-senior")
@ -137,7 +128,7 @@ public class PurchasereceiptRequestMainController {
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PurchasereceiptRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<PurchasereceiptRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
// 导出 Excel // 导出 Excel
ExcelUtils.write(response, "采购收货申请主.xlsx", "数据", PurchasereceiptRequestMainExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "采购收货申请主.xlsx", "采购收货申请数据", PurchasereceiptRequestMainExcelVO.class, resultList, mapDropDown);
} }
private List<PurchasereceiptRequestMainExcelVO> getExcelVo(List<PurchasereceiptRequestMainDO> list, Map<Integer, String[]> mapDropDown) { private List<PurchasereceiptRequestMainExcelVO> getExcelVo(List<PurchasereceiptRequestMainDO> list, Map<Integer, String[]> mapDropDown) {
@ -175,10 +166,20 @@ public class PurchasereceiptRequestMainController {
// 手动创建导出 demo // 手动创建导出 demo
List<PurchasereceiptRequestMainImportVO> list = new ArrayList<>(); List<PurchasereceiptRequestMainImportVO> list = new ArrayList<>();
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
// String[] purchaseReturnReason = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PURCHASE_RETURN_REASON); String[] transferMode = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRANSFER_MODE);
// mapDropDown.put(16, purchaseReturnReason); mapDropDown.put(4, transferMode);
// String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM); String[] locationType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.LOCATION_TYPE);
// mapDropDown.put(25, uom); mapDropDown.put(7, locationType);
mapDropDown.put(8, locationType);
String[] requestStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.REQUEST_STATUS);
mapDropDown.put(18, requestStatus);
String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS);
mapDropDown.put(31, inventoryStatus);
String[] packUnit = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PACK_UNIT);
mapDropDown.put(36, packUnit);
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
mapDropDown.put(38, uom);
mapDropDown.put(47, uom);
// 输出 // 输出
ExcelUtils.write(response, "采购收货申请信息导入模板.xlsx", "采购收货申请信息列表", PurchasereceiptRequestMainImportVO.class, list, mapDropDown); ExcelUtils.write(response, "采购收货申请信息导入模板.xlsx", "采购收货申请信息列表", PurchasereceiptRequestMainImportVO.class, list, mapDropDown);
} }

95
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayJob/PutawayJobDetailController.java

@ -1,36 +1,26 @@
package com.win.module.wms.controller.putawayJob; package com.win.module.wms.controller.putawayJob;
import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.putawayJob.vo.*; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailPageReqVO;
import org.springframework.web.bind.annotation.*; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailRespVO;
import javax.annotation.Resource; import com.win.module.wms.convert.putawayJob.PutawayJobDetailConvert;
import org.springframework.validation.annotation.Validated; import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import org.springframework.security.access.prepost.PreAuthorize; import com.win.module.wms.service.putawayJob.PutawayJobDetailService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.*; import javax.annotation.Resource;
import javax.servlet.http.*; import javax.validation.Valid;
import java.util.*;
import java.io.IOException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.pojo.CommonResult;
import static com.win.framework.common.pojo.CommonResult.success; import static com.win.framework.common.pojo.CommonResult.success;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.win.module.wms.controller.putawayJob.vo.*;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import com.win.module.wms.convert.putawayJob.PutawayJobDetailConvert;
import com.win.module.wms.service.putawayJob.PutawayJobDetailService;
@Tag(name = "管理后台 - 上架任务子") @Tag(name = "管理后台 - 上架任务子")
@RestController @RestController
@RequestMapping("/wms/putaway-job-detail") @RequestMapping("/wms/putaway-job-detail")
@ -43,48 +33,6 @@ public class PutawayJobDetailController {
@Resource @Resource
private AdminUserApi userApi; private AdminUserApi userApi;
@PostMapping("/create")
@Operation(summary = "创建上架任务子")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:create')")
public CommonResult<Long> createPutawayJobDetail(@Valid @RequestBody PutawayJobDetailCreateReqVO createReqVO) {
return success(putawayJobDetailService.createPutawayJobDetail(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新上架任务子")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:update')")
public CommonResult<Boolean> updatePutawayJobDetail(@Valid @RequestBody PutawayJobDetailUpdateReqVO updateReqVO) {
putawayJobDetailService.updatePutawayJobDetail(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除上架任务子")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:delete')")
public CommonResult<Boolean> deletePutawayJobDetail(@RequestParam("id") Long id) {
putawayJobDetailService.deletePutawayJobDetail(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得上架任务子")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:query')")
public CommonResult<PutawayJobDetailRespVO> getPutawayJobDetail(@RequestParam("id") Long id) {
PutawayJobDetailDO putawayJobDetail = putawayJobDetailService.getPutawayJobDetail(id);
return success(PutawayJobDetailConvert.INSTANCE.convert(putawayJobDetail));
}
@GetMapping("/list")
@Operation(summary = "获得上架任务子列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:query')")
public CommonResult<List<PutawayJobDetailRespVO>> getPutawayJobDetailList(@RequestParam("ids") Collection<Long> ids) {
List<PutawayJobDetailDO> list = putawayJobDetailService.getPutawayJobDetailList(ids);
return success(PutawayJobDetailConvert.INSTANCE.convertList(list));
}
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得上架任务子分页") @Operation(summary = "获得上架任务子分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:query')") @PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:query')")
@ -92,6 +40,7 @@ public class PutawayJobDetailController {
PageResult<PutawayJobDetailDO> pageResult = putawayJobDetailService.getPutawayJobDetailPage(pageVO); PageResult<PutawayJobDetailDO> pageResult = putawayJobDetailService.getPutawayJobDetailPage(pageVO);
return success(PutawayJobDetailConvert.INSTANCE.convertPage(pageResult)); return success(PutawayJobDetailConvert.INSTANCE.convertPage(pageResult));
} }
@PostMapping("/senior") @PostMapping("/senior")
@Operation(summary = "高级搜索获得物品基本信息分页") @Operation(summary = "高级搜索获得物品基本信息分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:query')") @PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:query')")
@ -105,21 +54,5 @@ public class PutawayJobDetailController {
} }
return success(result); return success(result);
} }
@GetMapping("/export-excel")
@Operation(summary = "导出上架任务子 Excel")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-detail:export')")
@OperateLog(type = EXPORT)
public void exportPutawayJobDetailExcel(@Valid PutawayJobDetailExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<PutawayJobDetailDO> list = putawayJobDetailService.getPutawayJobDetailList(exportReqVO);
// 导出 Excel
List<PutawayJobDetailExcelVO> datas = PutawayJobDetailConvert.INSTANCE.convertList02(list);
for(PutawayJobDetailExcelVO vo : datas) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}
ExcelUtils.write(response, "上架任务子.xls", "数据", PutawayJobDetailExcelVO.class, datas);
}
} }

181
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayJob/PutawayJobMainController.java

@ -1,38 +1,41 @@
package com.win.module.wms.controller.putawayJob; package com.win.module.wms.controller.putawayJob;
import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.putawayJob.vo.*; import com.win.module.wms.controller.putawayJob.vo.*;
import com.win.module.wms.convert.putawayJob.PutawayJobDetailConvert; import com.win.module.wms.convert.putawayJob.PutawayJobDetailConvert;
import com.win.module.wms.convert.putawayJob.PutawayJobMainConvert;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO; import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.enums.job.JobStatusEnum;
import com.win.module.wms.service.putawayJob.PutawayJobDetailService; import com.win.module.wms.service.putawayJob.PutawayJobDetailService;
import com.win.module.wms.service.putawayJob.PutawayJobMainService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jodd.util.StringUtil; import jodd.util.StringUtil;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated;
import io.swagger.v3.oas.annotations.Parameter; import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.*; import javax.annotation.Resource;
import javax.servlet.http.*; import javax.servlet.http.HttpServletResponse;
import java.util.*; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.pojo.CommonResult;
import static com.win.framework.common.pojo.CommonResult.success; import static com.win.framework.common.pojo.CommonResult.success;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import com.win.module.wms.convert.putawayJob.PutawayJobMainConvert;
import com.win.module.wms.service.putawayJob.PutawayJobMainService;
@Tag(name = "管理后台 - 上架任务主") @Tag(name = "管理后台 - 上架任务主")
@RestController @RestController
@ -42,19 +45,19 @@ public class PutawayJobMainController {
@Resource @Resource
private PutawayJobMainService putawayJobMainService; private PutawayJobMainService putawayJobMainService;
@Resource @Resource
private PutawayJobDetailService putawayJobDetailService; private PutawayJobDetailService putawayJobDetailService;
@Resource @Resource
private AdminUserApi userApi; private AdminUserApi userApi;
@PostMapping("/create") @GetMapping("/page")
@Operation(summary = "创建上架任务主") @Operation(summary = "获得上架任务主分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-main:create')") @PreAuthorize("@ss.hasPermission('wms:putaway-job-main:query')")
public CommonResult<Long> createPutawayJobMain(@Valid @RequestBody PutawayJobMainCreateReqVO createReqVO) { public CommonResult<PageResult<PutawayJobMainRespVO>> getPutawayJobMainPage(@Valid PutawayJobMainPageReqVO pageVO) {
return success(putawayJobMainService.createPutawayJobMain(createReqVO)); PageResult<PutawayJobMainDO> pageResult = putawayJobMainService.getPutawayJobMainPage(pageVO);
return success(PutawayJobMainConvert.INSTANCE.convertPage(pageResult));
} }
@PostMapping("/senior") @PostMapping("/senior")
@Operation(summary = "高级搜索获得物品基本信息分页") @Operation(summary = "高级搜索获得物品基本信息分页")
@PreAuthorize("@ss.hasPermission('wms:PutawayJobMain:query')") @PreAuthorize("@ss.hasPermission('wms:PutawayJobMain:query')")
@ -68,64 +71,61 @@ public class PutawayJobMainController {
} }
return success(result); return success(result);
} }
@PutMapping("/update")
@Operation(summary = "更新上架任务主")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-main:update')")
public CommonResult<Boolean> updatePutawayJobMain(@Valid @RequestBody PutawayJobMainUpdateReqVO updateReqVO) {
putawayJobMainService.updatePutawayJobMain(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除上架任务主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-job-main:delete')")
public CommonResult<Boolean> deletePutawayJobMain(@RequestParam("id") Long id) {
putawayJobMainService.deletePutawayJobMain(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得上架任务主")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-main:query')")
public CommonResult<PutawayJobMainRespVO> getPutawayJobMain(@RequestParam("id") Long id) {
PutawayJobMainDO putawayJobMain = putawayJobMainService.getPutawayJobMain(id);
return success(PutawayJobMainConvert.INSTANCE.convert(putawayJobMain));
}
@GetMapping("/list")
@Operation(summary = "获得上架任务主列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-main:query')")
public CommonResult<List<PutawayJobMainRespVO>> getPutawayJobMainList(@RequestParam("ids") Collection<Long> ids) {
List<PutawayJobMainDO> list = putawayJobMainService.getPutawayJobMainList(ids);
return success(PutawayJobMainConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得上架任务主分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-main:query')")
public CommonResult<PageResult<PutawayJobMainRespVO>> getPutawayJobMainPage(@Valid PutawayJobMainPageReqVO pageVO) {
PageResult<PutawayJobMainDO> pageResult = putawayJobMainService.getPutawayJobMainPage(pageVO);
return success(PutawayJobMainConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出上架任务主 Excel") @Operation(summary = "导出上架任务主 Excel")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-main:export')") @PreAuthorize("@ss.hasPermission('wms:putaway-job-main:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportPutawayJobMainExcel(@Valid PutawayJobMainExportReqVO exportReqVO, public void exportPutawayJobMainExcel(@Valid PutawayJobMainExportReqVO exportReqVO, HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<PutawayJobMainDO> list = putawayJobMainService.getPutawayJobMainList(exportReqVO); List<PutawayJobMainDO> list = putawayJobMainService.getPutawayJobMainList(exportReqVO);
// 导出 Excel Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PutawayJobMainExcelVO> datas = PutawayJobMainConvert.INSTANCE.convertList02(list); List<PutawayJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
for(PutawayJobMainExcelVO vo : datas) { ExcelUtils.write(response, "上架任务主.xls", "上架任务数据", PutawayJobMainExcelVO.class, resultList, mapDropDown);
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); }
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname()); @PostMapping("/export-excel-senior")
@Operation(summary = "导出上架任务主 Excel")
@PreAuthorize("@ss.hasPermission('wms:putaway-job-main:export')")
@OperateLog(type = EXPORT)
public void exportPutawayJobMainSeniorExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<PutawayJobMainDO> list = putawayJobMainService.getPutawayJobMainList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PutawayJobMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "上架任务主.xls", "上架任务数据", PutawayJobMainExcelVO.class, resultList, mapDropDown);
}
private List<PutawayJobMainExcelVO> getExcelVo(List<PutawayJobMainDO> list, Map<Integer, String[]> mapDropDown) {
//组装vo
String[] status = JobStatusEnum.getStatusNameArray();
mapDropDown.put(5, status);
String[] locationType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.LOCATION_TYPE);
mapDropDown.put(15, locationType);
mapDropDown.put(16, locationType);
String[] trueFalse = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(22, trueFalse);
mapDropDown.put(23, trueFalse);
mapDropDown.put(24, trueFalse);
mapDropDown.put(25, trueFalse);
mapDropDown.put(26, trueFalse);
mapDropDown.put(27, trueFalse);
mapDropDown.put(28, trueFalse);
mapDropDown.put(29, trueFalse);
mapDropDown.put(30, trueFalse);
mapDropDown.put(31, trueFalse);
String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS);
mapDropDown.put(35, inventoryStatus);
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
mapDropDown.put(46, uom);
List<PutawayJobMainExcelVO> resultList = new ArrayList<>();
// 导出
for(PutawayJobMainDO mainDO : list) {
List<PutawayJobDetailDO> subList = putawayJobDetailService.selectList(mainDO.getId());
for(PutawayJobDetailDO detailDO : subList) {
PutawayJobMainExcelVO vo = PutawayJobMainConvert.INSTANCE.convert(mainDO, detailDO);
resultList.add(vo);
}
} }
ExcelUtils.write(response, "上架任务主.xls", "数据", PutawayJobMainExcelVO.class, datas); return resultList;
} }
@GetMapping("/getPutawayJobById") @GetMapping("/getPutawayJobById")
@ -172,4 +172,29 @@ public class PutawayJobMainController {
return success(countByStatus); return success(countByStatus);
} }
@Operation(summary = "承接任务")
@PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:accept')")
@PostMapping(value = "/accept/{id}")
public CommonResult<Boolean> acceptPutawayJobMain(@PathVariable("id") Long id) {
int result = putawayJobMainService.acceptPutawayJobMain(id);
return success(result > 0);
}
@Operation(summary = "取消承接任务")
@PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:cancel-accept')")
@PostMapping(value = "/cancelAccept/{id}")
public CommonResult<Boolean> cancelAcceptPutawayJobMain(@PathVariable("id") Long id) {
int result = putawayJobMainService.cancelAcceptPutawayJobMain(id);
return success(result > 0);
}
@PutMapping("/execute")
@Operation(summary = "执行采购收货任务主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:purchasereceipt-job-main:execute')")
public CommonResult<Boolean> executePutawayJobMain(@Valid @RequestBody PutawayJobMainUpdateReqVO updateReqVO) {
Integer count = putawayJobMainService.executePutawayJobMain(updateReqVO);
return success(count > 0);
}
} }

125
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayJob/vo/PutawayJobMainExcelVO.java

@ -1,19 +1,14 @@
package com.win.module.wms.controller.putawayJob.vo; package com.win.module.wms.controller.putawayJob.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.win.framework.excel.core.annotations.DictFormat; import com.win.framework.excel.core.annotations.DictFormat;
import com.win.framework.excel.core.convert.DictConvert; import com.win.framework.excel.core.convert.DictConvert;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.enums.job.JobStatusConverter;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/** /**
@ -39,26 +34,15 @@ public class PutawayJobMainExcelVO {
@ExcelProperty("要求截止时间") @ExcelProperty("要求截止时间")
private LocalDateTime requestDueTime; private LocalDateTime requestDueTime;
@ExcelProperty(value = "状态", converter = DictConvert.class) @ExcelProperty(value = "状态", converter = JobStatusConverter.class)
@DictFormat("job_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String status; private String status;
@ExcelProperty("过期时间") @ExcelProperty("过期时间")
private LocalDateTime expiredTime; private LocalDateTime expiredTime;
@ExcelProperty("最后更新时间")
private LocalDateTime updateTime;
@ExcelProperty("最后更新者Id")
private String updater;
@ExcelProperty("并发乐观锁") @ExcelProperty("并发乐观锁")
private String concurrencyStamp; private String concurrencyStamp;
@ExcelProperty(value = "状态", converter = DictConvert.class)
@DictFormat("job_stage_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String jobStageStatus;
@ExcelProperty("优先级") @ExcelProperty("优先级")
private Integer priority; private Integer priority;
@ -81,11 +65,11 @@ public class PutawayJobMainExcelVO {
private LocalDateTime completeTime; private LocalDateTime completeTime;
@ExcelProperty(value = "从库位类型范围", converter = DictConvert.class) @ExcelProperty(value = "从库位类型范围", converter = DictConvert.class)
@DictFormat("location_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.LOCATION_TYPE)
private String fromLocationTypes; private String fromLocationTypes;
@ExcelProperty(value = "到库位类型范围", converter = DictConvert.class) @ExcelProperty(value = "到库位类型范围", converter = DictConvert.class)
@DictFormat("location_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.LOCATION_TYPE)
private String toLocationTypes; private String toLocationTypes;
@ExcelProperty("单据号") @ExcelProperty("单据号")
@ -94,15 +78,6 @@ public class PutawayJobMainExcelVO {
@ExcelProperty("业务类型") @ExcelProperty("业务类型")
private String businessType; private String businessType;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("创建者id")
private String creator;
@ExcelProperty("到仓库代码") @ExcelProperty("到仓库代码")
private String toWarehouseCode; private String toWarehouseCode;
@ -113,43 +88,105 @@ public class PutawayJobMainExcelVO {
private String toAreaCodes; private String toAreaCodes;
@ExcelProperty(value = "自动完成", converter = DictConvert.class) @ExcelProperty(value = "自动完成", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String autoComplete; private String autoComplete;
@ExcelProperty(value = "允许修改库位", converter = DictConvert.class) @ExcelProperty(value = "允许修改库位", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowModifyLocation; private String allowModifyLocation;
@ExcelProperty(value = "允许修改数量", converter = DictConvert.class) @ExcelProperty(value = "允许修改数量", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowModifyQty; private String allowModifyQty;
@ExcelProperty(value = "允许大于推荐数量", converter = DictConvert.class) @ExcelProperty(value = "允许大于推荐数量", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowBiggerQty; private String allowBiggerQty;
@ExcelProperty(value = "允许小于推荐数量", converter = DictConvert.class) @ExcelProperty(value = "允许小于推荐数量", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowSmallerQty; private String allowSmallerQty;
@ExcelProperty(value = "允许修改库存状态", converter = DictConvert.class) @ExcelProperty(value = "允许修改库存状态", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowModifyInventoryStatus; private String allowModifyInventoryStatus;
@ExcelProperty(value = "允许连续扫描", converter = DictConvert.class) @ExcelProperty(value = "允许连续扫描", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowContinuousScanning; private String allowContinuousScanning;
@ExcelProperty(value = "允许部分完成", converter = DictConvert.class) @ExcelProperty(value = "允许部分完成", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowPartialComplete; private String allowPartialComplete;
@ExcelProperty(value = "允许修改批次", converter = DictConvert.class) @ExcelProperty(value = "允许修改批次", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowModifyBatch; private String allowModifyBatch;
@ExcelProperty(value = "允许修改箱码", converter = DictConvert.class) @ExcelProperty(value = "允许修改箱码", converter = DictConvert.class)
@DictFormat("true_false") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.TRUE_FALSE)
private String allowModifyPackingNumber; private String allowModifyPackingNumber;
@ExcelProperty("包装号")
private String packingNumber;
@ExcelProperty("器具号")
private String containerNumber;
@ExcelProperty("批次")
private String batch;
@ExcelProperty(value = "库存状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.INVENTORY_STATUS)
private String inventoryStatus;
@ExcelProperty("订单号")
private String poNumber;
@ExcelProperty("订单行")
private String poLine;
@ExcelProperty("从库位代码")
private String fromLocationCode;
@ExcelProperty("到库位代码")
private String toLocationCode;
@ExcelProperty("物品代码")
private String itemCode;
@ExcelProperty("物品名称")
private String itemName;
@ExcelProperty("物品描述1")
private String itemDesc1;
@ExcelProperty("物品描述2")
private String itemdesc2;
@ExcelProperty("项目代码")
private String projectCode;
@ExcelProperty("数量")
private BigDecimal qty;
@ExcelProperty(value = "计量单位", converter = DictConvert.class)
@DictFormat(DictTypeConstants.UOM)
private String uom;
@ExcelProperty("从货主代码")
private String fromOwnerCode;
@ExcelProperty("到货主代码")
private String toOwnerCode;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("创建者Id")
private String creator;
} }

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayJob/vo/PutawayJobMainUpdateReqVO.java

@ -1,7 +1,12 @@
package com.win.module.wms.controller.putawayJob.vo; package com.win.module.wms.controller.putawayJob.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.Valid;
import java.util.List;
@Schema(description = "管理后台 - 上架任务主更新 Request VO") @Schema(description = "管理后台 - 上架任务主更新 Request VO")
@Data @Data
@ -9,4 +14,6 @@ import lombok.*;
@ToString(callSuper = true) @ToString(callSuper = true)
public class PutawayJobMainUpdateReqVO extends PutawayJobMainBaseVO { public class PutawayJobMainUpdateReqVO extends PutawayJobMainBaseVO {
@Schema(description = "子表数据")
private List<@Valid PutawayJobDetailUpdateReqVO> subList;
} }

106
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRecord/PutawayRecordDetailController.java

@ -1,35 +1,26 @@
package com.win.module.wms.controller.putawayRecord; package com.win.module.wms.controller.putawayRecord;
import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import org.springframework.web.bind.annotation.*; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailPageReqVO;
import javax.annotation.Resource; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailRespVO;
import org.springframework.validation.annotation.Validated; import com.win.module.wms.convert.putawayRecord.PutawayRecordDetailConvert;
import org.springframework.security.access.prepost.PreAuthorize; import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO;
import io.swagger.v3.oas.annotations.tags.Tag; import com.win.module.wms.service.putawayRecord.PutawayRecordDetailService;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.*; import javax.annotation.Resource;
import javax.servlet.http.*; import javax.validation.Valid;
import java.util.*;
import java.io.IOException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.pojo.CommonResult;
import static com.win.framework.common.pojo.CommonResult.success; import static com.win.framework.common.pojo.CommonResult.success;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.win.module.wms.controller.putawayRecord.vo.*;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO;
import com.win.module.wms.convert.putawayRecord.PutawayRecordDetailConvert;
import com.win.module.wms.service.putawayRecord.PutawayRecordDetailService;
@Tag(name = "管理后台 - 上架记录子") @Tag(name = "管理后台 - 上架记录子")
@RestController @RestController
@RequestMapping("/wms/putaway-record-detail") @RequestMapping("/wms/putaway-record-detail")
@ -42,29 +33,14 @@ public class PutawayRecordDetailController {
@Resource @Resource
private AdminUserApi userApi; private AdminUserApi userApi;
@PostMapping("/create") @GetMapping("/page")
@Operation(summary = "创建上架记录子") @Operation(summary = "获得上架记录子分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:create')") @PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:query')")
public CommonResult<Long> createPutawayRecordDetail(@Valid @RequestBody PutawayRecordDetailCreateReqVO createReqVO) { public CommonResult<PageResult<PutawayRecordDetailRespVO>> getPutawayRecordDetailPage(@Valid PutawayRecordDetailPageReqVO pageVO) {
return success(putawayRecordDetailService.createPutawayRecordDetail(createReqVO)); PageResult<PutawayRecordDetailDO> pageResult = putawayRecordDetailService.getPutawayRecordDetailPage(pageVO);
} return success(PutawayRecordDetailConvert.INSTANCE.convertPage(pageResult));
@PutMapping("/update")
@Operation(summary = "更新上架记录子")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:update')")
public CommonResult<Boolean> updatePutawayRecordDetail(@Valid @RequestBody PutawayRecordDetailUpdateReqVO updateReqVO) {
putawayRecordDetailService.updatePutawayRecordDetail(updateReqVO);
return success(true);
} }
@DeleteMapping("/delete")
@Operation(summary = "删除上架记录子")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:delete')")
public CommonResult<Boolean> deletePutawayRecordDetail(@RequestParam("id") Long id) {
putawayRecordDetailService.deletePutawayRecordDetail(id);
return success(true);
}
@PostMapping("/senior") @PostMapping("/senior")
@Operation(summary = "高级搜索获得物品基本信息分页") @Operation(summary = "高级搜索获得物品基本信息分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:query')") @PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:query')")
@ -79,48 +55,4 @@ public class PutawayRecordDetailController {
return success(result); return success(result);
} }
@GetMapping("/get")
@Operation(summary = "获得上架记录子")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:query')")
public CommonResult<PutawayRecordDetailRespVO> getPutawayRecordDetail(@RequestParam("id") Long id) {
PutawayRecordDetailDO putawayRecordDetail = putawayRecordDetailService.getPutawayRecordDetail(id);
return success(PutawayRecordDetailConvert.INSTANCE.convert(putawayRecordDetail));
}
@GetMapping("/list")
@Operation(summary = "获得上架记录子列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:query')")
public CommonResult<List<PutawayRecordDetailRespVO>> getPutawayRecordDetailList(@RequestParam("ids") Collection<Long> ids) {
List<PutawayRecordDetailDO> list = putawayRecordDetailService.getPutawayRecordDetailList(ids);
return success(PutawayRecordDetailConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得上架记录子分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:query')")
public CommonResult<PageResult<PutawayRecordDetailRespVO>> getPutawayRecordDetailPage(@Valid PutawayRecordDetailPageReqVO pageVO) {
PageResult<PutawayRecordDetailDO> pageResult = putawayRecordDetailService.getPutawayRecordDetailPage(pageVO);
return success(PutawayRecordDetailConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出上架记录子 Excel")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-detail:export')")
@OperateLog(type = EXPORT)
public void exportPutawayRecordDetailExcel(@Valid PutawayRecordDetailExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<PutawayRecordDetailDO> list = putawayRecordDetailService.getPutawayRecordDetailList(exportReqVO);
// 导出 Excel
List<PutawayRecordDetailExcelVO> datas = PutawayRecordDetailConvert.INSTANCE.convertList02(list);
for(PutawayRecordDetailExcelVO vo : datas) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}
ExcelUtils.write(response, "上架记录子.xls", "数据", PutawayRecordDetailExcelVO.class, datas);
}
} }

139
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRecord/PutawayRecordMainController.java

@ -1,34 +1,40 @@
package com.win.module.wms.controller.putawayRecord; package com.win.module.wms.controller.putawayRecord;
import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.putawayRecord.vo.*; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExcelVO;
import org.springframework.web.bind.annotation.*; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExportReqVO;
import javax.annotation.Resource; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainPageReqVO;
import org.springframework.validation.annotation.Validated; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainRespVO;
import org.springframework.security.access.prepost.PreAuthorize; import com.win.module.wms.convert.putawayRecord.PutawayRecordMainConvert;
import io.swagger.v3.oas.annotations.tags.Tag; import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO;
import io.swagger.v3.oas.annotations.Parameter; import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.putawayRecord.PutawayRecordDetailService;
import com.win.module.wms.service.putawayRecord.PutawayRecordMainService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.*; import javax.annotation.Resource;
import javax.servlet.http.*; import javax.servlet.http.HttpServletResponse;
import java.util.*; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.pojo.CommonResult;
import static com.win.framework.common.pojo.CommonResult.success; import static com.win.framework.common.pojo.CommonResult.success;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO;
import com.win.module.wms.convert.putawayRecord.PutawayRecordMainConvert;
import com.win.module.wms.service.putawayRecord.PutawayRecordMainService;
@Tag(name = "管理后台 - 上架记录主") @Tag(name = "管理后台 - 上架记录主")
@RestController @RestController
@ -38,51 +44,12 @@ public class PutawayRecordMainController {
@Resource @Resource
private PutawayRecordMainService putawayRecordMainService; private PutawayRecordMainService putawayRecordMainService;
@Resource @Resource
private AdminUserApi userApi; private PutawayRecordDetailService putawayRecordDetailService;
@PostMapping("/create")
@Operation(summary = "创建上架记录主")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-main:create')")
public CommonResult<Long> createPutawayRecordMain(@Valid @RequestBody PutawayRecordMainCreateReqVO createReqVO) {
return success(putawayRecordMainService.createPutawayRecordMain(createReqVO));
}
@PutMapping("/update") @Resource
@Operation(summary = "更新上架记录主") private AdminUserApi userApi;
@PreAuthorize("@ss.hasPermission('wms:putaway-record-main:update')")
public CommonResult<Boolean> updatePutawayRecordMain(@Valid @RequestBody PutawayRecordMainUpdateReqVO updateReqVO) {
putawayRecordMainService.updatePutawayRecordMain(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除上架记录主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-record-main:delete')")
public CommonResult<Boolean> deletePutawayRecordMain(@RequestParam("id") Long id) {
putawayRecordMainService.deletePutawayRecordMain(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得上架记录主")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-main:query')")
public CommonResult<PutawayRecordMainRespVO> getPutawayRecordMain(@RequestParam("id") Long id) {
PutawayRecordMainDO putawayRecordMain = putawayRecordMainService.getPutawayRecordMain(id);
return success(PutawayRecordMainConvert.INSTANCE.convert(putawayRecordMain));
}
@GetMapping("/list")
@Operation(summary = "获得上架记录主列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-main:query')")
public CommonResult<List<PutawayRecordMainRespVO>> getPutawayRecordMainList(@RequestParam("ids") Collection<Long> ids) {
List<PutawayRecordMainDO> list = putawayRecordMainService.getPutawayRecordMainList(ids);
return success(PutawayRecordMainConvert.INSTANCE.convertList(list));
}
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得上架记录主分页") @Operation(summary = "获得上架记录主分页")
@ -91,6 +58,7 @@ public class PutawayRecordMainController {
PageResult<PutawayRecordMainDO> pageResult = putawayRecordMainService.getPutawayRecordMainPage(pageVO); PageResult<PutawayRecordMainDO> pageResult = putawayRecordMainService.getPutawayRecordMainPage(pageVO);
return success(PutawayRecordMainConvert.INSTANCE.convertPage(pageResult)); return success(PutawayRecordMainConvert.INSTANCE.convertPage(pageResult));
} }
@PostMapping("/senior") @PostMapping("/senior")
@Operation(summary = "高级搜索获得物品基本信息分页") @Operation(summary = "高级搜索获得物品基本信息分页")
@PreAuthorize("@ss.hasPermission('wms:PutawayRecordMain:query')") @PreAuthorize("@ss.hasPermission('wms:PutawayRecordMain:query')")
@ -109,17 +77,44 @@ public class PutawayRecordMainController {
@Operation(summary = "导出上架记录主 Excel") @Operation(summary = "导出上架记录主 Excel")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-main:export')") @PreAuthorize("@ss.hasPermission('wms:putaway-record-main:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportPutawayRecordMainExcel(@Valid PutawayRecordMainExportReqVO exportReqVO, public void exportPutawayRecordMainExcel(@Valid PutawayRecordMainExportReqVO exportReqVO, HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<PutawayRecordMainDO> list = putawayRecordMainService.getPutawayRecordMainList(exportReqVO); List<PutawayRecordMainDO> list = putawayRecordMainService.getPutawayRecordMainList(exportReqVO);
// 导出 Excel Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PutawayRecordMainExcelVO> datas = PutawayRecordMainConvert.INSTANCE.convertList02(list); List<PutawayRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
for(PutawayRecordMainExcelVO vo : datas) { ExcelUtils.write(response, "上架记录主.xls", "上架记录数据", PutawayRecordMainExcelVO.class, resultList, mapDropDown);
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); }
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname()); @PostMapping("/export-excel-senior")
@Operation(summary = "导出上架记录主 Excel")
@PreAuthorize("@ss.hasPermission('wms:putaway-record-main:export')")
@OperateLog(type = EXPORT)
public void exportPutawayRecordMainSeniorExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<PutawayRecordMainDO> list = putawayRecordMainService.getPutawayRecordMainList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PutawayRecordMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "上架记录主.xls", "上架记录数据", PutawayRecordMainExcelVO.class, resultList, mapDropDown);
}
private List<PutawayRecordMainExcelVO> getExcelVo(List<PutawayRecordMainDO> list, Map<Integer, String[]> mapDropDown) {
String[] interfaceType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INTERFACE_TYPE);
mapDropDown.put(10, interfaceType);
String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS);
mapDropDown.put(25, inventoryStatus);
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
mapDropDown.put(42, uom);
List<PutawayRecordMainExcelVO> resultList = new ArrayList<>();
// 导出
for(PutawayRecordMainDO mainDO : list) {
List<PutawayRecordDetailDO> subList = putawayRecordDetailService.selectList(mainDO.getId());
for(PutawayRecordDetailDO detailDO : subList) {
PutawayRecordMainExcelVO vo = PutawayRecordMainConvert.INSTANCE.convert(mainDO, detailDO);
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
resultList.add(vo);
}
} }
ExcelUtils.write(response, "上架记录主.xls", "数据", PutawayRecordMainExcelVO.class, datas); return resultList;
} }
} }

105
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRecord/vo/PutawayRecordMainExcelVO.java

@ -1,17 +1,13 @@
package com.win.module.wms.controller.putawayRecord.vo; package com.win.module.wms.controller.putawayRecord.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.win.framework.excel.core.annotations.DictFormat; import com.win.framework.excel.core.annotations.DictFormat;
import com.win.framework.excel.core.convert.DictConvert; import com.win.framework.excel.core.convert.DictConvert;
import com.win.module.wms.enums.DictTypeConstants;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/** /**
@ -53,7 +49,7 @@ public class PutawayRecordMainExcelVO {
private String departmentCode; private String departmentCode;
@ExcelProperty(value = "接口类型", converter = DictConvert.class) @ExcelProperty(value = "接口类型", converter = DictConvert.class)
@DictFormat("interface_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.INTERFACE_TYPE)
private String interfaceType; private String interfaceType;
@ExcelProperty("单据号") @ExcelProperty("单据号")
@ -65,12 +61,6 @@ public class PutawayRecordMainExcelVO {
@ExcelProperty("备注") @ExcelProperty("备注")
private String remark; private String remark;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("创建者Id")
private String creator;
@ExcelProperty("代码") @ExcelProperty("代码")
private String code; private String code;
@ -95,4 +85,87 @@ public class PutawayRecordMainExcelVO {
@ExcelProperty("是否可用") @ExcelProperty("是否可用")
private String available; private String available;
@ExcelProperty("从包装号")
private String fromPackingNumber;
@ExcelProperty("到包装号")
private String toPackingNumber;
@ExcelProperty("从批次")
private String fromBatch;
@ExcelProperty(value = "库存状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.INVENTORY_STATUS)
private String inventoryStatus;
@ExcelProperty("订单号")
private String poNumber;
@ExcelProperty("订单行")
private String poLine;
@ExcelProperty("从货主代码")
private String fromOwnerCode;
@ExcelProperty("从库位代码")
private String fromLocationCode;
@ExcelProperty("从库位组代码")
private String fromLocationGroupCode;
@ExcelProperty("从库区代码")
private String fromAreaCode;
@ExcelProperty("到货主代码")
private String toOwnerCode;
@ExcelProperty("到库位代码")
private String toLocationCode;
@ExcelProperty("到库位组代码")
private String toLocationGroupCode;
@ExcelProperty("到库区代码")
private String toAreaCode;
@ExcelProperty("物品代码")
private String itemCode;
@ExcelProperty("物品名称")
private String itemName;
@ExcelProperty("物品描述1")
private String itemDesc1;
@ExcelProperty("物品描述2")
private String itemDesc2;
@ExcelProperty("项目代码")
private String projectCode;
@ExcelProperty("数量")
private BigDecimal qty;
@ExcelProperty(value = "计量单位", converter = DictConvert.class)
@DictFormat(DictTypeConstants.UOM)
private String uom;
@ExcelProperty("任务明细ID")
private String jobDetailId;
@ExcelProperty("从器具号")
private String fromContainerNumber;
@ExcelProperty("到器具号")
private String toContainerNumber;
@ExcelProperty("到批次")
private String toBatch;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("创建者Id")
private String creator;
} }

64
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRequest/PutawayRequestDetailController.java

@ -1,35 +1,29 @@
package com.win.module.wms.controller.putawayRequest; package com.win.module.wms.controller.putawayRequest;
import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import org.springframework.web.bind.annotation.*; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailCreateReqVO;
import javax.annotation.Resource; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailPageReqVO;
import org.springframework.validation.annotation.Validated; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailRespVO;
import org.springframework.security.access.prepost.PreAuthorize; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailUpdateReqVO;
import io.swagger.v3.oas.annotations.tags.Tag; import com.win.module.wms.convert.putawayRequest.PutawayRequestDetailConvert;
import io.swagger.v3.oas.annotations.Parameter; import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import com.win.module.wms.service.putawayRequest.PutawayRequestDetailService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.*; import javax.annotation.Resource;
import javax.servlet.http.*; import javax.validation.Valid;
import java.util.*;
import java.io.IOException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.pojo.CommonResult;
import static com.win.framework.common.pojo.CommonResult.success; import static com.win.framework.common.pojo.CommonResult.success;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.win.module.wms.controller.putawayRequest.vo.*;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import com.win.module.wms.convert.putawayRequest.PutawayRequestDetailConvert;
import com.win.module.wms.service.putawayRequest.PutawayRequestDetailService;
@Tag(name = "管理后台 - 上架申请子") @Tag(name = "管理后台 - 上架申请子")
@RestController @RestController
@RequestMapping("/wms/putaway-request-detail") @RequestMapping("/wms/putaway-request-detail")
@ -75,15 +69,6 @@ public class PutawayRequestDetailController {
return success(PutawayRequestDetailConvert.INSTANCE.convert(putawayRequestDetail)); return success(PutawayRequestDetailConvert.INSTANCE.convert(putawayRequestDetail));
} }
@GetMapping("/list")
@Operation(summary = "获得上架申请子列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:putaway-request-detail:query')")
public CommonResult<List<PutawayRequestDetailRespVO>> getPutawayRequestDetailList(@RequestParam("ids") Collection<Long> ids) {
List<PutawayRequestDetailDO> list = putawayRequestDetailService.getPutawayRequestDetailList(ids);
return success(PutawayRequestDetailConvert.INSTANCE.convertList(list));
}
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得上架申请子分页") @Operation(summary = "获得上架申请子分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-request-detail:query')") @PreAuthorize("@ss.hasPermission('wms:putaway-request-detail:query')")
@ -91,6 +76,7 @@ public class PutawayRequestDetailController {
PageResult<PutawayRequestDetailDO> pageResult = putawayRequestDetailService.getPutawayRequestDetailPage(pageVO); PageResult<PutawayRequestDetailDO> pageResult = putawayRequestDetailService.getPutawayRequestDetailPage(pageVO);
return success(PutawayRequestDetailConvert.INSTANCE.convertPage(pageResult)); return success(PutawayRequestDetailConvert.INSTANCE.convertPage(pageResult));
} }
@PostMapping("/senior") @PostMapping("/senior")
@Operation(summary = "高级搜索获得上架申请子信息分页") @Operation(summary = "高级搜索获得上架申请子信息分页")
@PreAuthorize("@ss.hasPermission('wms:putaway-request-detail:query')") @PreAuthorize("@ss.hasPermission('wms:putaway-request-detail:query')")
@ -104,21 +90,5 @@ public class PutawayRequestDetailController {
} }
return success(result); return success(result);
} }
@GetMapping("/export-excel")
@Operation(summary = "导出上架申请子 Excel")
@PreAuthorize("@ss.hasPermission('wms:putaway-request-detail:export')")
@OperateLog(type = EXPORT)
public void exportPutawayRequestDetailExcel(@Valid PutawayRequestDetailExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<PutawayRequestDetailDO> list = putawayRequestDetailService.getPutawayRequestDetailList(exportReqVO);
// 导出 Excel
List<PutawayRequestDetailExcelVO> datas = PutawayRequestDetailConvert.INSTANCE.convertList02(list);
for(PutawayRequestDetailExcelVO vo : datas) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}
ExcelUtils.write(response, "上架申请子.xls", "数据", PutawayRequestDetailExcelVO.class, datas);
}
} }

153
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRequest/PutawayRequestMainController.java

@ -1,39 +1,44 @@
package com.win.module.wms.controller.putawayRequest; package com.win.module.wms.controller.putawayRequest;
import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.dict.core.util.DictFrameworkUtils; import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.framework.excel.core.util.ConvertUtil; import com.win.framework.excel.core.util.ConvertUtil;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.system.api.user.AdminUserApi; import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO; import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.putawayRequest.vo.*; import com.win.module.wms.controller.putawayRequest.vo.*;
import com.win.module.wms.enums.DictTypeConstants;
import io.swagger.v3.oas.annotations.Parameters;
import com.win.module.wms.convert.putawayRequest.PutawayRequestDetailConvert; import com.win.module.wms.convert.putawayRequest.PutawayRequestDetailConvert;
import com.win.module.wms.convert.putawayRequest.PutawayRequestMainConvert;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO; import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.putawayRequest.PutawayRequestDetailService; import com.win.module.wms.service.putawayRequest.PutawayRequestDetailService;
import com.win.module.wms.service.putawayRequest.PutawayRequestMainService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize; import javax.validation.Valid;
import io.swagger.v3.oas.annotations.tags.Tag; import java.io.IOException;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.*;
import javax.servlet.http.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneOffset; import java.time.ZoneOffset;
import java.util.*; import java.util.ArrayList;
import java.io.IOException; import java.util.HashMap;
import com.win.framework.common.pojo.PageResult; import java.util.List;
import com.win.framework.common.pojo.CommonResult; import java.util.Map;
import static com.win.framework.common.pojo.CommonResult.success; import static com.win.framework.common.pojo.CommonResult.success;
import com.win.framework.excel.core.util.ExcelUtils; import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
import com.win.framework.operatelog.core.annotations.OperateLog;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import com.win.module.wms.convert.putawayRequest.PutawayRequestMainConvert;
import com.win.module.wms.service.putawayRequest.PutawayRequestMainService;
import org.springframework.web.multipart.MultipartFile;
@Tag(name = "管理后台 - 上架申请主") @Tag(name = "管理后台 - 上架申请主")
@RestController @RestController
@ -94,14 +99,6 @@ public class PutawayRequestMainController {
} }
return success(result); return success(result);
} }
@GetMapping("/list")
@Operation(summary = "获得上架申请主列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:putaway-request-main:query')")
public CommonResult<List<PutawayRequestMainRespVO>> getPutawayRequestMainList(@RequestParam("ids") Collection<Long> ids) {
List<PutawayRequestMainDO> list = putawayRequestMainService.getPutawayRequestMainList(ids);
return success(PutawayRequestMainConvert.INSTANCE.convertList(list));
}
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得上架申请主分页") @Operation(summary = "获得上架申请主分页")
@ -118,19 +115,50 @@ public class PutawayRequestMainController {
public void exportPutawayRequestMainExcel(@Valid PutawayRequestMainExportReqVO exportReqVO, public void exportPutawayRequestMainExcel(@Valid PutawayRequestMainExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<PutawayRequestMainDO> list = putawayRequestMainService.getPutawayRequestMainList(exportReqVO); List<PutawayRequestMainDO> list = putawayRequestMainService.getPutawayRequestMainList(exportReqVO);
// 导出 Excel
List<PutawayRequestMainExcelVO> datas = PutawayRequestMainConvert.INSTANCE.convertList02(list);
for(PutawayRequestMainExcelVO vo : datas) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS); List<PutawayRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
mapDropDown.put(8, inventoryStatus); ExcelUtils.write(response, "上架申请主.xls", "上架申请数据", PutawayRequestMainExcelVO.class, resultList, mapDropDown);
}
@GetMapping("/export-excel-senior")
@Operation(summary = "导出上架申请主 Excel")
@PreAuthorize("@ss.hasPermission('wms:putaway-request-main:export')")
@OperateLog(type = EXPORT)
public void exportPutawayRequestMainSeniorExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<PutawayRequestMainDO> list = putawayRequestMainService.getPutawayRequestMainList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<PutawayRequestMainExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "上架申请主.xls", "上架申请数据", PutawayRequestMainExcelVO.class, resultList, mapDropDown);
}
private List<PutawayRequestMainExcelVO> getExcelVo(List<PutawayRequestMainDO> list, Map<Integer, String[]> mapDropDown) {
String[] locationType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.LOCATION_TYPE);
mapDropDown.put(6, locationType);
String[] requestStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.REQUEST_STATUS);
mapDropDown.put(11, requestStatus);
String[] inspectType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INSPECT_TYPE);
mapDropDown.put(15, inspectType);
String[] nextAction = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.NEXT_ACTION);
mapDropDown.put(16, nextAction);
String[] sampleMethod = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.SAMPLE_METHOD);
mapDropDown.put(17, sampleMethod);
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM); String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
mapDropDown.put(10, uom); mapDropDown.put(18, uom);
ExcelUtils.write(response, "上架申请主.xls", "数据", PutawayRequestMainExcelVO.class, datas,mapDropDown); String[] inventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS);
mapDropDown.put(28, inventoryStatus);
// 导出 Excel
List<PutawayRequestMainExcelVO> resultList = new ArrayList<>();
for(PutawayRequestMainDO mainDO : list) {
List<PutawayRequestDetailDO> subList = putawayRequestDetailService.selectList(mainDO.getId());
for(PutawayRequestDetailDO detailDO : subList) {
PutawayRequestMainExcelVO vo = PutawayRequestMainConvert.INSTANCE.convert(mainDO, detailDO);
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
resultList.add(vo);
}
}
return resultList;
} }
@GetMapping("/get-import-template") @GetMapping("/get-import-template")
@ -165,7 +193,6 @@ public class PutawayRequestMainController {
return success(result); return success(result);
} }
@PostMapping("/import") @PostMapping("/import")
@Operation(summary = "导入上架申请基本信息") @Operation(summary = "导入上架申请基本信息")
@Parameters({ @Parameters({
@ -190,4 +217,50 @@ public class PutawayRequestMainController {
} }
return success(returnMap); return success(returnMap);
} }
@PutMapping("/close")
@Operation(summary = "关闭上架申请主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-request-main:close')")
public CommonResult<Boolean> closePutawayRequestMain(@RequestParam("id") Long id) {
Integer count = putawayRequestMainService.closePutawayRequestMain(id);
return success(count > 0);
}
@PutMapping("/submit")
@Operation(summary = "提交上架申请主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-request-main:submit')")
public CommonResult<Boolean> submitPutawayRequestMain(@RequestParam("id") Long id) {
Integer count = putawayRequestMainService.submitPutawayRequestMain(id);
return success(count > 0);
}
@PutMapping("/agree")
@Operation(summary = "审批通过上架申请主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-request-main:agree')")
public CommonResult<Boolean> agreePutawayRequestMain(@RequestParam("id") Long id) {
Integer count = putawayRequestMainService.agreePutawayRequestMain(id);
return success(count > 0);
}
@PutMapping("/handle")
@Operation(summary = "执行上架申请主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-request-main:handle')")
public CommonResult<Boolean> handlePutawayRequestMain(@RequestParam("id") Long id) {
Integer count = putawayRequestMainService.handlePutawayRequestMain(id);
return success(count > 0);
}
@PutMapping("/abort")
@Operation(summary = "审批拒绝上架申请主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:putaway-request-main:abort')")
public CommonResult<Boolean> abortPutawayRequestMain(@RequestParam("id") Long id) {
Integer count = putawayRequestMainService.abortPutawayRequestMain(id);
return success(count > 0);
}
} }

91
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRequest/vo/PutawayRequestMainExcelVO.java

@ -1,17 +1,13 @@
package com.win.module.wms.controller.putawayRequest.vo; package com.win.module.wms.controller.putawayRequest.vo;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.win.framework.excel.core.annotations.DictFormat; import com.win.framework.excel.core.annotations.DictFormat;
import com.win.framework.excel.core.convert.DictConvert; import com.win.framework.excel.core.convert.DictConvert;
import com.win.module.wms.enums.DictTypeConstants;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/** /**
@ -29,7 +25,7 @@ public class PutawayRequestMainExcelVO {
private String fromWarehouseCode; private String fromWarehouseCode;
@ExcelProperty(value = "从库位类型范围", converter = DictConvert.class) @ExcelProperty(value = "从库位类型范围", converter = DictConvert.class)
@DictFormat("location_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.LOCATION_TYPE)
private String fromLocationTypes; private String fromLocationTypes;
@ExcelProperty("从库区代码范围") @ExcelProperty("从库区代码范围")
@ -44,13 +40,6 @@ public class PutawayRequestMainExcelVO {
@ExcelProperty("备注") @ExcelProperty("备注")
private String remark; private String remark;
@ExcelProperty("创建时间")
@ColumnWidth(value = 16)
private LocalDateTime createTime;
@ExcelProperty("创建者用户名")
private String creator;
@ExcelProperty("申请时间") @ExcelProperty("申请时间")
private LocalDateTime requestTime; private LocalDateTime requestTime;
@ -61,20 +50,14 @@ public class PutawayRequestMainExcelVO {
private String departmentCode; private String departmentCode;
@ExcelProperty(value = "状态", converter = DictConvert.class) @ExcelProperty(value = "状态", converter = DictConvert.class)
@DictFormat("request_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.REQUEST_STATUS)
private String status; private String status;
@ExcelProperty("最后更新时间")
private LocalDateTime updateTime;
@ExcelProperty("最后更新者用户名")
private String updater;
@ExcelProperty("到仓库代码") @ExcelProperty("到仓库代码")
private String toWarehouseCode; private String toWarehouseCode;
@ExcelProperty(value = "到库位类型范围", converter = DictConvert.class) @ExcelProperty(value = "到库位类型范围", converter = DictConvert.class)
@DictFormat("location_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat(DictTypeConstants.LOCATION_TYPE)
private String toLocationTypes; private String toLocationTypes;
@ExcelProperty("到库区代码范围") @ExcelProperty("到库区代码范围")
@ -92,8 +75,66 @@ public class PutawayRequestMainExcelVO {
@ExcelProperty("直接生成记录") @ExcelProperty("直接生成记录")
private String directCreateRecord; private String directCreateRecord;
@ExcelProperty("包装号")
private String packingNumber;
@ExcelProperty("器具号")
private String containerNumber;
@ExcelProperty("批次")
private String batch;
@ExcelProperty(value = "库存状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.INVENTORY_STATUS)
private String inventoryStatus;
@ExcelProperty("订单号")
private String poNumber;
@ExcelProperty("订单行")
private String poLine;
@ExcelProperty("从库位代码")
private String fromLocationCode;
@ExcelProperty("物品代码")
private String itemCode;
@ExcelProperty("物品名称")
private String itemName;
@ExcelProperty("物品描述1")
private String itemDesc1;
@ExcelProperty("物品描述2")
private String itemDesc2;
@ExcelProperty("项目代码")
private String projectCode;
@ExcelProperty("数量")
private BigDecimal qty;
@ExcelProperty(value = "计量单位", converter = DictConvert.class)
@DictFormat(DictTypeConstants.UOM)
private String uom;
@ExcelProperty("从货主代码")
private String fromOwnerCode;
@ExcelProperty("到货主代码")
private String toOwnerCode;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("创建者用户名")
private String creator;
@ExcelProperty("最后更新时间")
private LocalDateTime updateTime;
@ExcelProperty("最后更新者用户名")
private String updater;
} }

10
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/rule/RuleController.java

@ -120,6 +120,16 @@ public class RuleController {
List<RuleExcelVO> resultList = this.getExcelVo(list, mapDropDown); List<RuleExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "物品基本信息.xlsx", "数据", RuleExcelVO.class, resultList, mapDropDown); ExcelUtils.write(response, "物品基本信息.xlsx", "数据", RuleExcelVO.class, resultList, mapDropDown);
} }
@PostMapping("/export-excel-senior")
@Operation(summary = "导出规则配置 Excel")
@PreAuthorize("@ss.hasPermission('wms:rule:export')")
@OperateLog(type = EXPORT)
public void exportItembasicExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<RuleDO> list = ruleService.getRuleList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<RuleExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "物品基本信息.xlsx", "数据", RuleExcelVO.class, resultList, mapDropDown);
}
private List<RuleExcelVO> getExcelVo(List<RuleDO> list, Map<Integer, String[]> mapDropDown) { private List<RuleExcelVO> getExcelVo(List<RuleDO> list, Map<Integer, String[]> mapDropDown) {
// 导出 Excel // 导出 Excel

13
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/deliverPlan/DeliverPlanMainConvert.java

@ -42,5 +42,16 @@ public interface DeliverPlanMainConvert {
}) })
DeliverPlanMainImportErrorVO convert(DeliverPlanMainCreateReqVO mainVo, DeliverPlanDetailDO detailDo); DeliverPlanMainImportErrorVO convert(DeliverPlanMainCreateReqVO mainVo, DeliverPlanDetailDO detailDo);
@Mappings({
@Mapping(source = "mainDO.number", target = "number"),
@Mapping(source = "mainDO.remark", target = "remark"),
@Mapping(source = "mainDO.createTime", target = "createTime"),
@Mapping(source = "mainDO.creator", target = "creator"),
@Mapping(source = "mainDO.updateTime", target = "updateTime"),
@Mapping(source = "mainDO.updater", target = "updater"),
@Mapping(source = "mainDO.available", target = "available"),
@Mapping(source = "detailDO.remark", target = "remarkDetail"),
@Mapping(source = "detailDO.available", target = "availableDetail"),
})
DeliverPlanMainExcelVO convert(DeliverPlanMainDO mainDO, DeliverPlanDetailDO detailDO);
} }

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/inventoryinitRequest/InventoryinitRequestDetailConvert.java

@ -3,6 +3,7 @@ package com.win.module.wms.convert.inventoryinitRequest;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.inventoryinitRequest.vo.*; import com.win.module.wms.controller.inventoryinitRequest.vo.*;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayImportErrorVO; import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayImportErrorVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestDetailUpdateReqVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainCreateReqVO; import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainCreateReqVO;
import com.win.module.wms.controller.purchaseclaimRequest.vo.PurchaseclaimRequestDetailExcelVO; import com.win.module.wms.controller.purchaseclaimRequest.vo.PurchaseclaimRequestDetailExcelVO;
import com.win.module.wms.dal.dataobject.inventoryinitRequest.InventoryinitRequestDetailDO; import com.win.module.wms.dal.dataobject.inventoryinitRequest.InventoryinitRequestDetailDO;
@ -50,6 +51,8 @@ public interface InventoryinitRequestDetailConvert {
List<InventoryinitRequestDetailRespVO> convertList(List<InventoryinitRequestDetailDO> list); List<InventoryinitRequestDetailRespVO> convertList(List<InventoryinitRequestDetailDO> list);
List<InventoryinitRequestDetailDO> convertList05(List<InventoryinitRequestDetailUpdateReqVO> list);
PageResult<InventoryinitRequestDetailRespVO> convertPage(PageResult<InventoryinitRequestDetailDO> page); PageResult<InventoryinitRequestDetailRespVO> convertPage(PageResult<InventoryinitRequestDetailDO> page);
List<InventoryinitRequestDetailExcelVO> convertList02(List<InventoryinitRequestDetailDO> list); List<InventoryinitRequestDetailExcelVO> convertList02(List<InventoryinitRequestDetailDO> list);

18
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/inventoryinitRequest/InventoryinitRequestMainConvert.java

@ -4,11 +4,15 @@ import java.util.*;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.inventoryinitRequest.vo.InventoryinitRequestMainCreateReqVO; import com.win.module.wms.controller.inventoryinitRequest.vo.*;
import com.win.module.wms.controller.inventoryinitRequest.vo.InventoryinitRequestMainExcelVO; import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainUpdateReqVO;
import com.win.module.wms.controller.inventoryinitRequest.vo.InventoryinitRequestMainRespVO; import com.win.module.wms.controller.purchasereceiptRequest.vo.PurchasereceiptRequestMainCreateReqVO;
import com.win.module.wms.controller.inventoryinitRequest.vo.InventoryinitRequestMainUpdateReqVO; import com.win.module.wms.controller.purchasereceiptRequest.vo.PurchasereceiptRequestMainImportErrorVO;
import com.win.module.wms.dal.dataobject.inventoryinitRequest.InventoryinitRequestDetailDO;
import com.win.module.wms.dal.dataobject.purchasereceiptRequest.PurchasereceiptRequestDetailDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import com.win.module.wms.dal.dataobject.inventoryinitRequest.InventoryinitRequestMainDO; import com.win.module.wms.dal.dataobject.inventoryinitRequest.InventoryinitRequestMainDO;
@ -25,9 +29,15 @@ public interface InventoryinitRequestMainConvert {
InventoryinitRequestMainDO convert(InventoryinitRequestMainCreateReqVO bean); InventoryinitRequestMainDO convert(InventoryinitRequestMainCreateReqVO bean);
InventoryinitRequestMainDO convert(InventoryinitRequestMainUpdateReqVO bean); InventoryinitRequestMainDO convert(InventoryinitRequestMainUpdateReqVO bean);
@Mappings({
@Mapping(source = "mainVo.number", target = "number"),
})
InventoryinitRequestMainImportErrorVO convert(InventoryinitRequestMainCreateReqVO mainVo, InventoryinitRequestDetailDO detailDo);
InventoryinitRequestMainRespVO convert(InventoryinitRequestMainDO bean); InventoryinitRequestMainRespVO convert(InventoryinitRequestMainDO bean);
InventoryinitRequestMainDO convert1(InventoryinitRequestMainUpdateReqVO bean);
List<InventoryinitRequestMainRespVO> convertList(List<InventoryinitRequestMainDO> list); List<InventoryinitRequestMainRespVO> convertList(List<InventoryinitRequestMainDO> list);
PageResult<InventoryinitRequestMainRespVO> convertPage(PageResult<InventoryinitRequestMainDO> page); PageResult<InventoryinitRequestMainRespVO> convertPage(PageResult<InventoryinitRequestMainDO> page);

8
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/inventorymoveRequest/InventorymoveRequestDetailConvert.java

@ -2,8 +2,12 @@ package com.win.module.wms.convert.inventorymoveRequest;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.inventorymoveRequest.vo.*; import com.win.module.wms.controller.inventorymoveRequest.vo.*;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestDetailUpdateReqVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainBaseVO;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestDetailDO; import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestDetailDO;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO; import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestDetailDO;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestMainDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mapping; import org.mapstruct.Mapping;
import org.mapstruct.Mappings; import org.mapstruct.Mappings;
@ -23,8 +27,12 @@ public interface InventorymoveRequestDetailConvert {
InventorymoveRequestDetailDO convert(InventorymoveRequestDetailCreateReqVO bean); InventorymoveRequestDetailDO convert(InventorymoveRequestDetailCreateReqVO bean);
InventorymoveRequestDetailDO convert(InventorymoveRequestDetailBaseVO bean);
InventorymoveRequestDetailDO convert(InventorymoveRequestDetailUpdateReqVO bean); InventorymoveRequestDetailDO convert(InventorymoveRequestDetailUpdateReqVO bean);
List<InventorymoveRequestDetailDO> convertList05(List<InventorymoveRequestDetailUpdateReqVO> list);
InventorymoveRequestDetailRespVO convert(InventorymoveRequestDetailDO bean); InventorymoveRequestDetailRespVO convert(InventorymoveRequestDetailDO bean);
List<InventorymoveRequestDetailRespVO> convertList(List<InventorymoveRequestDetailDO> list); List<InventorymoveRequestDetailRespVO> convertList(List<InventorymoveRequestDetailDO> list);

19
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/inventorymoveRequest/InventorymoveRequestMainConvert.java

@ -4,11 +4,16 @@ import java.util.*;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.inventorymoveRequest.vo.InventorymoveRequestMainCreateReqVO; import com.win.module.wms.controller.inventorymoveRequest.vo.*;
import com.win.module.wms.controller.inventorymoveRequest.vo.InventorymoveRequestMainExcelVO; import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayImportErrorVO;
import com.win.module.wms.controller.inventorymoveRequest.vo.InventorymoveRequestMainRespVO; import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainBaseVO;
import com.win.module.wms.controller.inventorymoveRequest.vo.InventorymoveRequestMainUpdateReqVO; import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainCreateReqVO;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestDetailDO;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestDetailDO;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestMainDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO; import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO;
@ -22,6 +27,8 @@ public interface InventorymoveRequestMainConvert {
InventorymoveRequestMainConvert INSTANCE = Mappers.getMapper(InventorymoveRequestMainConvert.class); InventorymoveRequestMainConvert INSTANCE = Mappers.getMapper(InventorymoveRequestMainConvert.class);
InventorymoveRequestMainDO convert( InventorymoveRequestMainBaseVO bean);
InventorymoveRequestMainDO convert(InventorymoveRequestMainCreateReqVO bean); InventorymoveRequestMainDO convert(InventorymoveRequestMainCreateReqVO bean);
InventorymoveRequestMainDO convert(InventorymoveRequestMainUpdateReqVO bean); InventorymoveRequestMainDO convert(InventorymoveRequestMainUpdateReqVO bean);
@ -33,5 +40,9 @@ public interface InventorymoveRequestMainConvert {
PageResult<InventorymoveRequestMainRespVO> convertPage(PageResult<InventorymoveRequestMainDO> page); PageResult<InventorymoveRequestMainRespVO> convertPage(PageResult<InventorymoveRequestMainDO> page);
List<InventorymoveRequestMainExcelVO> convertList02(List<InventorymoveRequestMainDO> list); List<InventorymoveRequestMainExcelVO> convertList02(List<InventorymoveRequestMainDO> list);
@Mappings({
@Mapping(source = "mainVo.number", target = "number"),
})
InventorymoveRequestMainImportErrorVO convert(InventorymoveRequestMainCreateReqVO mainVo, InventorymoveRequestDetailDO detailDo);
} }

10
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/putawayJob/PutawayJobDetailConvert.java

@ -1,16 +1,16 @@
package com.win.module.wms.convert.putawayJob; package com.win.module.wms.convert.putawayJob;
import java.util.*;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailCreateReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailCreateReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailExcelVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailExcelVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailRespVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailRespVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailUpdateReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailUpdateReqVO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import java.util.List;
/** /**
* 上架任务子 Convert * 上架任务子 Convert
@ -34,4 +34,6 @@ public interface PutawayJobDetailConvert {
List<PutawayJobDetailExcelVO> convertList02(List<PutawayJobDetailDO> list); List<PutawayJobDetailExcelVO> convertList02(List<PutawayJobDetailDO> list);
PutawayJobDetailDO convert(PutawayRequestDetailDO bean);
} }

21
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/putawayJob/PutawayJobMainConvert.java

@ -1,16 +1,19 @@
package com.win.module.wms.convert.putawayJob; package com.win.module.wms.convert.putawayJob;
import java.util.*;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainCreateReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainCreateReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainExcelVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainExcelVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainRespVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainRespVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainUpdateReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainUpdateReqVO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import java.util.List;
/** /**
* 上架任务主 Convert * 上架任务主 Convert
@ -34,4 +37,14 @@ public interface PutawayJobMainConvert {
List<PutawayJobMainExcelVO> convertList02(List<PutawayJobMainDO> list); List<PutawayJobMainExcelVO> convertList02(List<PutawayJobMainDO> list);
PutawayJobMainDO convert(PutawayRequestMainDO mainDO);
@Mappings({
@Mapping(source = "mainDO.number", target = "number"),
@Mapping(source = "mainDO.remark", target = "remark"),
@Mapping(source = "mainDO.createTime", target = "createTime"),
@Mapping(source = "mainDO.creator", target = "creator"),
})
PutawayJobMainExcelVO convert(PutawayJobMainDO mainDO, PutawayJobDetailDO detailDO);
} }

20
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/putawayRecord/PutawayRecordMainConvert.java

@ -1,16 +1,18 @@
package com.win.module.wms.convert.putawayRecord; package com.win.module.wms.convert.putawayRecord;
import java.util.*;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainCreateReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainCreateReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExcelVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExcelVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainRespVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainRespVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainUpdateReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainUpdateReqVO;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO;
import java.util.List;
/** /**
* 上架记录主 Convert * 上架记录主 Convert
@ -34,4 +36,14 @@ public interface PutawayRecordMainConvert {
List<PutawayRecordMainExcelVO> convertList02(List<PutawayRecordMainDO> list); List<PutawayRecordMainExcelVO> convertList02(List<PutawayRecordMainDO> list);
@Mappings({
@Mapping(source = "mainDO.number", target = "number"),
@Mapping(source = "mainDO.remark", target = "remark"),
@Mapping(source = "mainDO.code", target = "code"),
@Mapping(source = "mainDO.interfaceType", target = "interfaceType"),
@Mapping(source = "mainDO.createTime", target = "createTime"),
@Mapping(source = "mainDO.creator", target = "creator"),
})
PutawayRecordMainExcelVO convert(PutawayRecordMainDO mainDO, PutawayRecordDetailDO detailDO);
} }

16
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/putawayRequest/PutawayRequestMainConvert.java

@ -1,16 +1,15 @@
package com.win.module.wms.convert.putawayRequest; package com.win.module.wms.convert.putawayRequest;
import java.util.*;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayRequest.vo.*; import com.win.module.wms.controller.putawayRequest.vo.*;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO; import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mapping; import org.mapstruct.Mapping;
import org.mapstruct.Mappings; import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import java.util.List;
/** /**
* 上架申请主 Convert * 上架申请主 Convert
@ -39,4 +38,13 @@ public interface PutawayRequestMainConvert {
@Mapping(source = "createReqVO.number", target = "number"), @Mapping(source = "createReqVO.number", target = "number"),
}) })
PutawayRequestImportErrorVO convert(PutawayRequestMainCreateReqVO createReqVO, PutawayRequestDetailDO detailDO); PutawayRequestImportErrorVO convert(PutawayRequestMainCreateReqVO createReqVO, PutawayRequestDetailDO detailDO);
@Mappings({
@Mapping(source = "mainDO.number", target = "number"),
@Mapping(source = "mainDO.remark", target = "remark"),
@Mapping(source = "mainDO.createTime", target = "createTime"),
@Mapping(source = "mainDO.creator", target = "creator"),
@Mapping(source = "mainDO.updateTime", target = "updateTime"),
@Mapping(source = "mainDO.updater", target = "updater"),
})
PutawayRequestMainExcelVO convert(PutawayRequestMainDO mainDO, PutawayRequestDetailDO detailDO);
} }

5
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/deliverPlan/DeliverPlanDetailDO.java

@ -1,5 +1,6 @@
package com.win.module.wms.dal.dataobject.deliverPlan; package com.win.module.wms.dal.dataobject.deliverPlan;
import com.sun.xml.bind.v2.TODO;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -67,6 +68,10 @@ public class DeliverPlanDetailDO extends BaseDO {
* 计划数量 * 计划数量
*/ */
private BigDecimal planQty; private BigDecimal planQty;
/**
* 发货数量
*/
private BigDecimal shippedQty;
/** /**
* 计量单位 * 计量单位
* *

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/inventorymoveRequest/InventorymoveRequestMainDO.java

@ -77,7 +77,7 @@ public class InventorymoveRequestMainDO extends BaseDO {
/** /**
* 从仓库代码 * 从仓库代码
*/ */
private String fromWarehouseOde; private String fromWarehouseCode;
/** /**
* 从库位类型范围 * 从库位类型范围
* *

5
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/configurationsetting/ConfigurationsettingMapper.java

@ -11,6 +11,7 @@ import com.win.module.wms.controller.configurationsetting.vo.Configurationsettin
import com.win.module.wms.controller.configurationsetting.vo.ConfigurationsettingPageReqVO; import com.win.module.wms.controller.configurationsetting.vo.ConfigurationsettingPageReqVO;
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO; import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO;
import com.win.module.wms.dal.dataobject.configurationsetting.ConfigurationsettingDO; import com.win.module.wms.dal.dataobject.configurationsetting.ConfigurationsettingDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
@ -48,5 +49,7 @@ public interface ConfigurationsettingMapper extends BaseMapperX<Configurationset
.eqIfPresent(ConfigurationsettingDO::getIsRequired, reqVO.getIsRequired()) .eqIfPresent(ConfigurationsettingDO::getIsRequired, reqVO.getIsRequired())
.orderByDesc(ConfigurationsettingDO::getId)); .orderByDesc(ConfigurationsettingDO::getId));
} }
default List<ConfigurationsettingDO> selectSeniorList(CustomConditions conditions) {
return selectList(QueryWrapperUtils.structure(conditions));
}
} }

6
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/deliverPlan/DeliverPlanDetailMapper.java

@ -32,6 +32,7 @@ public interface DeliverPlanDetailMapper extends BaseMapperX<DeliverPlanDetailDO
.betweenIfPresent(DeliverPlanDetailDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(DeliverPlanDetailDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(DeliverPlanDetailDO::getCreator, reqVO.getCreator()) .eqIfPresent(DeliverPlanDetailDO::getCreator, reqVO.getCreator())
.eqIfPresent(DeliverPlanDetailDO::getPlanQty, reqVO.getPlanQty()) .eqIfPresent(DeliverPlanDetailDO::getPlanQty, reqVO.getPlanQty())
.eqIfPresent(DeliverPlanDetailDO::getShippedQty, reqVO.getShippedQty())
.eqIfPresent(DeliverPlanDetailDO::getUom, reqVO.getUom()) .eqIfPresent(DeliverPlanDetailDO::getUom, reqVO.getUom())
.betweenIfPresent(DeliverPlanDetailDO::getUpdateTime, reqVO.getUpdateTime()) .betweenIfPresent(DeliverPlanDetailDO::getUpdateTime, reqVO.getUpdateTime())
.eqIfPresent(DeliverPlanDetailDO::getUpdater, reqVO.getUpdater()) .eqIfPresent(DeliverPlanDetailDO::getUpdater, reqVO.getUpdater())
@ -53,6 +54,7 @@ public interface DeliverPlanDetailMapper extends BaseMapperX<DeliverPlanDetailDO
.betweenIfPresent(DeliverPlanDetailDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(DeliverPlanDetailDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(DeliverPlanDetailDO::getCreator, reqVO.getCreator()) .eqIfPresent(DeliverPlanDetailDO::getCreator, reqVO.getCreator())
.eqIfPresent(DeliverPlanDetailDO::getPlanQty, reqVO.getPlanQty()) .eqIfPresent(DeliverPlanDetailDO::getPlanQty, reqVO.getPlanQty())
.eqIfPresent(DeliverPlanDetailDO::getShippedQty, reqVO.getShippedQty())
.eqIfPresent(DeliverPlanDetailDO::getUom, reqVO.getUom()) .eqIfPresent(DeliverPlanDetailDO::getUom, reqVO.getUom())
.betweenIfPresent(DeliverPlanDetailDO::getUpdateTime, reqVO.getUpdateTime()) .betweenIfPresent(DeliverPlanDetailDO::getUpdateTime, reqVO.getUpdateTime())
.eqIfPresent(DeliverPlanDetailDO::getUpdater, reqVO.getUpdater()) .eqIfPresent(DeliverPlanDetailDO::getUpdater, reqVO.getUpdater())
@ -60,4 +62,8 @@ public interface DeliverPlanDetailMapper extends BaseMapperX<DeliverPlanDetailDO
.orderByDesc(DeliverPlanDetailDO::getId)); .orderByDesc(DeliverPlanDetailDO::getId));
} }
default List<DeliverPlanDetailDO> selectList(Long masterId){
return selectList(new LambdaQueryWrapperX<DeliverPlanDetailDO>().eq(DeliverPlanDetailDO::getMasterId,masterId));
}
} }

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/deliverPlan/DeliverPlanMainMapper.java

@ -61,4 +61,7 @@ public interface DeliverPlanMainMapper extends BaseMapperX<DeliverPlanMainDO> {
.orderByDesc(DeliverPlanMainDO::getId)); .orderByDesc(DeliverPlanMainDO::getId));
} }
default List<DeliverPlanMainDO> selectSeniorList(CustomConditions conditions){
return selectList(QueryWrapperUtils.structure(conditions));
}
} }

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/deliverRequest/DeliverRequestMainMapper.java

@ -11,6 +11,8 @@ import com.win.module.wms.controller.deliverRequest.vo.DeliverRequestMainExportR
import com.win.module.wms.controller.deliverRequest.vo.DeliverRequestMainPageReqVO; import com.win.module.wms.controller.deliverRequest.vo.DeliverRequestMainPageReqVO;
import com.win.module.wms.dal.dataobject.deliverRequest.DeliverRequestMainDO; import com.win.module.wms.dal.dataobject.deliverRequest.DeliverRequestMainDO;
import com.win.module.wms.dal.dataobject.issueRequest.IssueRequestMainDO; import com.win.module.wms.dal.dataobject.issueRequest.IssueRequestMainDO;
import com.win.module.wms.dal.dataobject.purchasereceiptJob.PurchasereceiptJobMainDO;
import com.win.module.wms.enums.order.OrderStatusEnum;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
@ -57,6 +59,13 @@ public interface DeliverRequestMainMapper extends BaseMapperX<DeliverRequestMain
default PageResult<DeliverRequestMainDO> selectSenior(CustomConditions conditions) { default PageResult<DeliverRequestMainDO> selectSenior(CustomConditions conditions) {
return selectPage(conditions, QueryWrapperUtils.structure(conditions)); return selectPage(conditions, QueryWrapperUtils.structure(conditions));
} }
default Long selectByDeliverPlanNumber(String deliverPlanNumber) {
return selectCount(new LambdaQueryWrapperX<DeliverRequestMainDO>()
.eq(DeliverRequestMainDO::getDeliverPlanNumber, deliverPlanNumber)
.ne(DeliverRequestMainDO::getStatus, OrderStatusEnum.CLOSED.getCode()));
}
default List<DeliverRequestMainDO> selectList(DeliverRequestMainExportReqVO reqVO) { default List<DeliverRequestMainDO> selectList(DeliverRequestMainExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<DeliverRequestMainDO>() return selectList(new LambdaQueryWrapperX<DeliverRequestMainDO>()
.eqIfPresent(DeliverRequestMainDO::getDeliverPlanNumber, reqVO.getDeliverPlanNumber()) .eqIfPresent(DeliverRequestMainDO::getDeliverPlanNumber, reqVO.getDeliverPlanNumber())

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/inventorymoveRequest/InventorymoveRequestMainMapper.java

@ -33,7 +33,7 @@ public interface InventorymoveRequestMainMapper extends BaseMapperX<Inventorymov
.eqIfPresent(InventorymoveRequestMainDO::getStatus, reqVO.getStatus()) .eqIfPresent(InventorymoveRequestMainDO::getStatus, reqVO.getStatus())
.betweenIfPresent(InventorymoveRequestMainDO::getUpdateTime, reqVO.getUpdateTime()) .betweenIfPresent(InventorymoveRequestMainDO::getUpdateTime, reqVO.getUpdateTime())
.eqIfPresent(InventorymoveRequestMainDO::getUpdater, reqVO.getUpdater()) .eqIfPresent(InventorymoveRequestMainDO::getUpdater, reqVO.getUpdater())
.eqIfPresent(InventorymoveRequestMainDO::getFromWarehouseOde, reqVO.getFromWarehouseOde()) .eqIfPresent(InventorymoveRequestMainDO::getFromWarehouseCode, reqVO.getFromWarehouseCode())
.eqIfPresent(InventorymoveRequestMainDO::getFromLocationTypes, reqVO.getFromLocationTypes()) .eqIfPresent(InventorymoveRequestMainDO::getFromLocationTypes, reqVO.getFromLocationTypes())
.eqIfPresent(InventorymoveRequestMainDO::getFromAreaCodes, reqVO.getFromAreaCodes()) .eqIfPresent(InventorymoveRequestMainDO::getFromAreaCodes, reqVO.getFromAreaCodes())
.eqIfPresent(InventorymoveRequestMainDO::getToWarehouseCode, reqVO.getToWarehouseCode()) .eqIfPresent(InventorymoveRequestMainDO::getToWarehouseCode, reqVO.getToWarehouseCode())
@ -62,7 +62,7 @@ public interface InventorymoveRequestMainMapper extends BaseMapperX<Inventorymov
.eqIfPresent(InventorymoveRequestMainDO::getStatus, reqVO.getStatus()) .eqIfPresent(InventorymoveRequestMainDO::getStatus, reqVO.getStatus())
.betweenIfPresent(InventorymoveRequestMainDO::getUpdateTime, reqVO.getUpdateTime()) .betweenIfPresent(InventorymoveRequestMainDO::getUpdateTime, reqVO.getUpdateTime())
.eqIfPresent(InventorymoveRequestMainDO::getUpdater, reqVO.getUpdater()) .eqIfPresent(InventorymoveRequestMainDO::getUpdater, reqVO.getUpdater())
.eqIfPresent(InventorymoveRequestMainDO::getFromWarehouseOde, reqVO.getFromWarehouseOde()) .eqIfPresent(InventorymoveRequestMainDO::getFromWarehouseCode, reqVO.getFromWarehouseCode())
.eqIfPresent(InventorymoveRequestMainDO::getFromLocationTypes, reqVO.getFromLocationTypes()) .eqIfPresent(InventorymoveRequestMainDO::getFromLocationTypes, reqVO.getFromLocationTypes())
.eqIfPresent(InventorymoveRequestMainDO::getFromAreaCodes, reqVO.getFromAreaCodes()) .eqIfPresent(InventorymoveRequestMainDO::getFromAreaCodes, reqVO.getFromAreaCodes())
.eqIfPresent(InventorymoveRequestMainDO::getToWarehouseCode, reqVO.getToWarehouseCode()) .eqIfPresent(InventorymoveRequestMainDO::getToWarehouseCode, reqVO.getToWarehouseCode())

5
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/paramsetting/ParamsettingMapper.java

@ -7,6 +7,7 @@ import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.util.QueryWrapperUtils; import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.paramsetting.vo.ParamsettingExportReqVO; import com.win.module.wms.controller.paramsetting.vo.ParamsettingExportReqVO;
import com.win.module.wms.controller.paramsetting.vo.ParamsettingPageReqVO; import com.win.module.wms.controller.paramsetting.vo.ParamsettingPageReqVO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.paramsetting.ParamsettingDO; import com.win.module.wms.dal.dataobject.paramsetting.ParamsettingDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -51,5 +52,7 @@ public interface ParamsettingMapper extends BaseMapperX<ParamsettingDO> {
.eqIfPresent(ParamsettingDO::getIsRequired, reqVO.getIsRequired()) .eqIfPresent(ParamsettingDO::getIsRequired, reqVO.getIsRequired())
.orderByDesc(ParamsettingDO::getId)); .orderByDesc(ParamsettingDO::getId));
} }
default List<ParamsettingDO> selectSeniorList(CustomConditions conditions) {
return selectList(QueryWrapperUtils.structure(conditions));
}
} }

11
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayJob/PutawayJobDetailMapper.java

@ -1,17 +1,17 @@
package com.win.module.wms.dal.mysql.putawayJob; package com.win.module.wms.dal.mysql.putawayJob;
import java.util.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.mapper.BaseMapperX; import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.util.QueryWrapperUtils; import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailExportReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailExportReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailPageReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailPageReqVO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO; import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* 上架任务子 Mapper * 上架任务子 Mapper
* *
@ -75,4 +75,9 @@ public interface PutawayJobDetailMapper extends BaseMapperX<PutawayJobDetailDO>
.orderByDesc(PutawayJobDetailDO::getId)); .orderByDesc(PutawayJobDetailDO::getId));
} }
default List<PutawayJobDetailDO> selectList(Long masterId) {
return selectList(new LambdaQueryWrapperX<PutawayJobDetailDO>()
.eq(PutawayJobDetailDO::getMasterId, masterId));
}
} }

33
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayJob/PutawayJobMainMapper.java

@ -1,18 +1,19 @@
package com.win.module.wms.dal.mysql.putawayJob; package com.win.module.wms.dal.mysql.putawayJob;
import java.util.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.mapper.BaseMapperX; import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.util.QueryWrapperUtils; import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainExportReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainExportReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainPageReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainPageReqVO;
import com.win.module.wms.dal.dataobject.purchasereturnJob.PurchasereturnJobMainDO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO; import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import com.win.module.wms.enums.order.OrderStatusEnum;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.List;
/** /**
* 上架任务主 Mapper * 上架任务主 Mapper
* *
@ -64,9 +65,17 @@ public interface PutawayJobMainMapper extends BaseMapperX<PutawayJobMainDO> {
.eqIfPresent(PutawayJobMainDO::getAllowModifyPackingNumber, reqVO.getAllowModifyPackingNumber()) .eqIfPresent(PutawayJobMainDO::getAllowModifyPackingNumber, reqVO.getAllowModifyPackingNumber())
.orderByDesc(PutawayJobMainDO::getId)); .orderByDesc(PutawayJobMainDO::getId));
} }
default PageResult<PutawayJobMainDO> selectSenior(CustomConditions conditions) { default PageResult<PutawayJobMainDO> selectSenior(CustomConditions conditions) {
return selectPage(conditions, QueryWrapperUtils.structure(conditions)); return selectPage(conditions, QueryWrapperUtils.structure(conditions));
} }
default Long selectByRequestNumber(String requestNumber) {
return selectCount(new LambdaQueryWrapperX<PutawayJobMainDO>()
.eq(PutawayJobMainDO::getRequestNumber, requestNumber)
.ne(PutawayJobMainDO::getStatus, OrderStatusEnum.CLOSED.getCode()));
}
default List<PutawayJobMainDO> selectList(PutawayJobMainExportReqVO reqVO) { default List<PutawayJobMainDO> selectList(PutawayJobMainExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PutawayJobMainDO>() return selectList(new LambdaQueryWrapperX<PutawayJobMainDO>()
.eqIfPresent(PutawayJobMainDO::getRequestNumber, reqVO.getRequestNumber()) .eqIfPresent(PutawayJobMainDO::getRequestNumber, reqVO.getRequestNumber())
@ -121,4 +130,20 @@ public interface PutawayJobMainMapper extends BaseMapperX<PutawayJobMainDO> {
} }
default List<PutawayJobMainDO> selectList(CustomConditions conditions) {
return selectList(QueryWrapperUtils.structure(conditions));
}
/**
* 根据类型数和申请单号组查询任务数量
* @param types
* @param requestNumber
* @return
*/
default Long selectListCount(Collection<String> types, String requestNumber) {
return selectCount(new LambdaQueryWrapperX<PutawayJobMainDO>()
.in(PutawayJobMainDO::getStatus, types)
.eq(PutawayJobMainDO::getRequestNumber, requestNumber));
}
} }

11
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayRecord/PutawayRecordDetailMapper.java

@ -1,17 +1,17 @@
package com.win.module.wms.dal.mysql.putawayRecord; package com.win.module.wms.dal.mysql.putawayRecord;
import java.util.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.mapper.BaseMapperX; import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.util.QueryWrapperUtils; import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailExportReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailExportReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailPageReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailPageReqVO;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO; import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* 上架记录子 Mapper * 上架记录子 Mapper
* *
@ -94,4 +94,9 @@ public interface PutawayRecordDetailMapper extends BaseMapperX<PutawayRecordDeta
.orderByDesc(PutawayRecordDetailDO::getId)); .orderByDesc(PutawayRecordDetailDO::getId));
} }
default List<PutawayRecordDetailDO> selectList(Long masterId) {
return selectList(new LambdaQueryWrapperX<PutawayRecordDetailDO>()
.eq(PutawayRecordDetailDO::getMasterId, masterId));
}
} }

11
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayRecord/PutawayRecordMainMapper.java

@ -1,17 +1,17 @@
package com.win.module.wms.dal.mysql.putawayRecord; package com.win.module.wms.dal.mysql.putawayRecord;
import java.util.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.mapper.BaseMapperX; import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.util.QueryWrapperUtils; import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExportReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExportReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainPageReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainPageReqVO;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO; import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* 上架记录主 Mapper * 上架记录主 Mapper
* *
@ -52,6 +52,7 @@ public interface PutawayRecordMainMapper extends BaseMapperX<PutawayRecordMainDO
default PageResult<PutawayRecordMainDO> selectSenior(CustomConditions conditions) { default PageResult<PutawayRecordMainDO> selectSenior(CustomConditions conditions) {
return selectPage(conditions, QueryWrapperUtils.structure(conditions)); return selectPage(conditions, QueryWrapperUtils.structure(conditions));
} }
default List<PutawayRecordMainDO> selectList(PutawayRecordMainExportReqVO reqVO) { default List<PutawayRecordMainDO> selectList(PutawayRecordMainExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PutawayRecordMainDO>() return selectList(new LambdaQueryWrapperX<PutawayRecordMainDO>()
.eqIfPresent(PutawayRecordMainDO::getRequestNumber, reqVO.getRequestNumber()) .eqIfPresent(PutawayRecordMainDO::getRequestNumber, reqVO.getRequestNumber())
@ -81,4 +82,8 @@ public interface PutawayRecordMainMapper extends BaseMapperX<PutawayRecordMainDO
.orderByDesc(PutawayRecordMainDO::getId)); .orderByDesc(PutawayRecordMainDO::getId));
} }
default List<PutawayRecordMainDO> selectSeniorList(CustomConditions conditions) {
return selectList(QueryWrapperUtils.structure(conditions));
}
} }

13
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayRequest/PutawayRequestDetailMapper.java

@ -1,17 +1,17 @@
package com.win.module.wms.dal.mysql.putawayRequest; package com.win.module.wms.dal.mysql.putawayRequest;
import java.util.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.mapper.BaseMapperX; import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.util.QueryWrapperUtils; import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailExportReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailExportReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailPageReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailPageReqVO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO; import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* 上架申请子 Mapper * 上架申请子 Mapper
* *
@ -46,9 +46,11 @@ public interface PutawayRequestDetailMapper extends BaseMapperX<PutawayRequestDe
.eqIfPresent(PutawayRequestDetailDO::getToOwnerCode, reqVO.getToOwnerCode()) .eqIfPresent(PutawayRequestDetailDO::getToOwnerCode, reqVO.getToOwnerCode())
.orderByDesc(PutawayRequestDetailDO::getId)); .orderByDesc(PutawayRequestDetailDO::getId));
} }
default PageResult<PutawayRequestDetailDO> selectSenior(CustomConditions conditions) { default PageResult<PutawayRequestDetailDO> selectSenior(CustomConditions conditions) {
return selectPage(conditions, QueryWrapperUtils.structure(conditions)); return selectPage(conditions, QueryWrapperUtils.structure(conditions));
} }
default List<PutawayRequestDetailDO> selectList(PutawayRequestDetailExportReqVO reqVO) { default List<PutawayRequestDetailDO> selectList(PutawayRequestDetailExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PutawayRequestDetailDO>() return selectList(new LambdaQueryWrapperX<PutawayRequestDetailDO>()
.eqIfPresent(PutawayRequestDetailDO::getMasterId, reqVO.getMasterId()) .eqIfPresent(PutawayRequestDetailDO::getMasterId, reqVO.getMasterId())
@ -77,4 +79,9 @@ public interface PutawayRequestDetailMapper extends BaseMapperX<PutawayRequestDe
.orderByDesc(PutawayRequestDetailDO::getId)); .orderByDesc(PutawayRequestDetailDO::getId));
} }
default List<PutawayRequestDetailDO> selectList(Long masterId) {
return selectList(new LambdaQueryWrapperX<PutawayRequestDetailDO>()
.eq(PutawayRequestDetailDO::getMasterId, masterId));
}
} }

19
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/putawayRequest/PutawayRequestMainMapper.java

@ -1,17 +1,17 @@
package com.win.module.wms.dal.mysql.putawayRequest; package com.win.module.wms.dal.mysql.putawayRequest;
import java.util.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.mapper.BaseMapperX; import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.util.QueryWrapperUtils; import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestMainExportReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestMainExportReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestMainPageReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestMainPageReqVO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO; import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* 上架申请主 Mapper * 上架申请主 Mapper
* *
@ -54,9 +54,11 @@ public interface PutawayRequestMainMapper extends BaseMapperX<PutawayRequestMain
.eqIfPresent(PutawayRequestMainDO::getDirectCreateRecord, reqVO.getDirectCreateRecord()) .eqIfPresent(PutawayRequestMainDO::getDirectCreateRecord, reqVO.getDirectCreateRecord())
.orderByDesc(PutawayRequestMainDO::getId)); .orderByDesc(PutawayRequestMainDO::getId));
} }
default PageResult<PutawayRequestMainDO> selectSenior(CustomConditions conditions) { default PageResult<PutawayRequestMainDO> selectSenior(CustomConditions conditions) {
return selectPage(conditions, QueryWrapperUtils.structure(conditions)); return selectPage(conditions, QueryWrapperUtils.structure(conditions));
} }
default List<PutawayRequestMainDO> selectList(PutawayRequestMainExportReqVO reqVO) { default List<PutawayRequestMainDO> selectList(PutawayRequestMainExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PutawayRequestMainDO>() return selectList(new LambdaQueryWrapperX<PutawayRequestMainDO>()
.eqIfPresent(PutawayRequestMainDO::getSupplierCode, reqVO.getSupplierCode()) .eqIfPresent(PutawayRequestMainDO::getSupplierCode, reqVO.getSupplierCode())
@ -92,7 +94,12 @@ public interface PutawayRequestMainMapper extends BaseMapperX<PutawayRequestMain
.orderByDesc(PutawayRequestMainDO::getId)); .orderByDesc(PutawayRequestMainDO::getId));
} }
default PutawayRequestMainDO selectSupplierCode(String supplierCode){ default List<PutawayRequestMainDO> selectSeniorList(CustomConditions conditions) {
return selectOne(PutawayRequestMainDO::getSupplierCode,supplierCode); return selectList(QueryWrapperUtils.structure(conditions));
}; }
default PutawayRequestMainDO selectByNumber(String number) {
return selectOne(PutawayRequestMainDO::getNumber, number);
}
} }

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/rule/RuleMapper.java

@ -45,5 +45,8 @@ public interface RuleMapper extends BaseMapperX<RuleDO> {
.eqIfPresent(RuleDO::getConfiguration, reqVO.getConfiguration()) .eqIfPresent(RuleDO::getConfiguration, reqVO.getConfiguration())
.orderByDesc(RuleDO::getId)); .orderByDesc(RuleDO::getId));
} }
default List<RuleDO> selectSeniorList(CustomConditions conditions) {
return selectList(QueryWrapperUtils.structure(conditions));
}
} }

6
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/enums/request/RequestStatusState.java

@ -109,9 +109,9 @@ public class RequestStatusState {
* 驳回 * 驳回
* @return * @return
*/ */
public boolean reject() { public boolean refused() {
if(this.requestStatusEnum.getCode().equals(RequestStatusEnum.REVIEWING.getCode())) { if(this.requestStatusEnum.getCode().equals(RequestStatusEnum.REVIEWING.getCode())) {
this.requestStatusEnum = RequestStatusEnum.AGREED; this.requestStatusEnum = RequestStatusEnum.REFUSED;
return Boolean.TRUE; return Boolean.TRUE;
} else { } else {
return Boolean.FALSE; return Boolean.FALSE;
@ -124,7 +124,7 @@ public class RequestStatusState {
*/ */
public boolean close() { public boolean close() {
if(this.requestStatusEnum.getCode().equals(RequestStatusEnum.NEW.getCode()) || this.requestStatusEnum.getCode().equals(RequestStatusEnum.REVIEWING.getCode()) || this.requestStatusEnum.getCode().equals(RequestStatusEnum.AGREED.getCode())) { if(this.requestStatusEnum.getCode().equals(RequestStatusEnum.NEW.getCode()) || this.requestStatusEnum.getCode().equals(RequestStatusEnum.REVIEWING.getCode()) || this.requestStatusEnum.getCode().equals(RequestStatusEnum.AGREED.getCode())) {
this.requestStatusEnum = RequestStatusEnum.AGREED; this.requestStatusEnum = RequestStatusEnum.CLOSED;
return Boolean.TRUE; return Boolean.TRUE;
} else { } else {
return Boolean.FALSE; return Boolean.FALSE;

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/configurationsetting/ConfigurationsettingService.java

@ -49,10 +49,10 @@ public interface ConfigurationsettingService {
/** /**
* 获得配置设置列表 * 获得配置设置列表
* *
* @param ids 编号 * @param conditions 编号
* @return 配置设置列表 * @return 配置设置列表
*/ */
List<ConfigurationsettingDO> getConfigurationsettingList(Collection<Long> ids); List<ConfigurationsettingDO> getConfigurationsettingList(CustomConditions conditions);
/** /**
* 获得配置设置分页 * 获得配置设置分页

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/configurationsetting/ConfigurationsettingServiceImpl.java

@ -77,8 +77,8 @@ public class ConfigurationsettingServiceImpl implements ConfigurationsettingServ
} }
@Override @Override
public List<ConfigurationsettingDO> getConfigurationsettingList(Collection<Long> ids) { public List<ConfigurationsettingDO> getConfigurationsettingList(CustomConditions conditions) {
return configurationsettingMapper.selectBatchIds(ids); return configurationsettingMapper.selectSeniorList(conditions);
} }
@Override @Override

1
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/deliverPlan/DeliverPlanDetailService.java

@ -79,4 +79,5 @@ public interface DeliverPlanDetailService {
*/ */
List<DeliverPlanDetailDO> getDeliverPlanDetailList(DeliverPlanDetailExportReqVO exportReqVO); List<DeliverPlanDetailDO> getDeliverPlanDetailList(DeliverPlanDetailExportReqVO exportReqVO);
List<DeliverPlanDetailDO> selectListByID(Long id);
} }

37
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/deliverPlan/DeliverPlanDetailServiceImpl.java

@ -1,10 +1,15 @@
package com.win.module.wms.service.deliverPlan; package com.win.module.wms.service.deliverPlan;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.infra.api.trends.TrendsApi;
import com.win.module.infra.enums.TrendsTypeEnum;
import com.win.module.wms.controller.deliverPlan.vo.DeliverPlanDetailCreateReqVO; import com.win.module.wms.controller.deliverPlan.vo.DeliverPlanDetailCreateReqVO;
import com.win.module.wms.controller.deliverPlan.vo.DeliverPlanDetailExportReqVO; import com.win.module.wms.controller.deliverPlan.vo.DeliverPlanDetailExportReqVO;
import com.win.module.wms.controller.deliverPlan.vo.DeliverPlanDetailPageReqVO; import com.win.module.wms.controller.deliverPlan.vo.DeliverPlanDetailPageReqVO;
import com.win.module.wms.controller.deliverPlan.vo.DeliverPlanDetailUpdateReqVO; import com.win.module.wms.controller.deliverPlan.vo.DeliverPlanDetailUpdateReqVO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.service.deliverJob.DeliverJobMainService;
import com.win.module.wms.service.itembasic.ItembasicService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -31,12 +36,19 @@ public class DeliverPlanDetailServiceImpl implements DeliverPlanDetailService {
@Resource @Resource
private DeliverPlanDetailMapper deliverPlanDetailMapper; private DeliverPlanDetailMapper deliverPlanDetailMapper;
@Resource
private ItembasicService itembasicService;
@Resource
private DeliverJobMainService deliverJobMainService;
@Resource
private TrendsApi trendsApi;
@Override @Override
public Long createDeliverPlanDetail(DeliverPlanDetailCreateReqVO createReqVO) { public Long createDeliverPlanDetail(DeliverPlanDetailCreateReqVO createReqVO) {
// 插入 // 插入
DeliverPlanDetailDO deliverPlanDetail = DeliverPlanDetailConvert.INSTANCE.convert(createReqVO); DeliverPlanDetailDO deliverPlanDetail = DeliverPlanDetailConvert.INSTANCE.convert(createReqVO);
validateDetailCreate(deliverPlanDetail);
deliverPlanDetailMapper.insert(deliverPlanDetail); deliverPlanDetailMapper.insert(deliverPlanDetail);
trendsApi.createTrends(deliverPlanDetail.getId(), "DeliverPlanDetail", "增加了发货计划子表", TrendsTypeEnum.CREATE);
// 返回 // 返回
return deliverPlanDetail.getId(); return deliverPlanDetail.getId();
} }
@ -47,6 +59,7 @@ public class DeliverPlanDetailServiceImpl implements DeliverPlanDetailService {
validateDeliverPlanDetailExists(updateReqVO.getId()); validateDeliverPlanDetailExists(updateReqVO.getId());
// 更新 // 更新
DeliverPlanDetailDO updateObj = DeliverPlanDetailConvert.INSTANCE.convert(updateReqVO); DeliverPlanDetailDO updateObj = DeliverPlanDetailConvert.INSTANCE.convert(updateReqVO);
trendsApi.createTrends(updateObj.getId(), "DeliverPlanDetail", "修改了发货计划子表", TrendsTypeEnum.UPDATE);
deliverPlanDetailMapper.updateById(updateObj); deliverPlanDetailMapper.updateById(updateObj);
} }
@ -87,4 +100,26 @@ public class DeliverPlanDetailServiceImpl implements DeliverPlanDetailService {
return deliverPlanDetailMapper.selectList(exportReqVO); return deliverPlanDetailMapper.selectList(exportReqVO);
} }
@Override
public List<DeliverPlanDetailDO> selectListByID(Long masterId){
return deliverPlanDetailMapper.selectList(masterId);
}
//校验子表公共方法(适用于新增/修改)
private void validateDetailCreate(DeliverPlanDetailDO deliverPlanDetailDO) {
ItembasicDO itembasicDO = this.validatorItembasic(deliverPlanDetailDO.getItemCode());
if ( !deliverPlanDetailDO.getUom().equals(itembasicDO.getUom())) {
throw exception(UOM_ERROR, deliverPlanDetailDO.getUom());
}
//TODO 暂时注释
//this.validatorDetailExist(deliverPlanDetailDO.getSoNumber(), deliverPlanDetailDO.getSoLine(), deliverPlanDetailDO.getItemCode());
}
private ItembasicDO validatorItembasic(String itemCode) {
return itembasicService.selectItembasic(itemCode);
}
//子表校验客户代码
private void validatorDetailExist(String soNumber, String soLine, String itemCode) {
deliverJobMainService.saleDetailExist(soNumber, soLine, itemCode);
}
} }

65
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/deliverPlan/DeliverPlanMainService.java

@ -6,6 +6,7 @@ import com.win.module.wms.controller.deliverPlan.vo.*;
import com.win.module.wms.dal.dataobject.deliverPlan.DeliverPlanMainDO; import com.win.module.wms.dal.dataobject.deliverPlan.DeliverPlanMainDO;
import javax.validation.Valid; import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -77,6 +78,14 @@ public interface DeliverPlanMainService {
*/ */
List<DeliverPlanMainDO> getDeliverPlanMainList(DeliverPlanMainExportReqVO exportReqVO); List<DeliverPlanMainDO> getDeliverPlanMainList(DeliverPlanMainExportReqVO exportReqVO);
/**
* 获得发货计划主列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 发货计划主列表
*/
List<DeliverPlanMainDO> getDeliverPlanMainList(CustomConditions conditions);
/** /**
* 批量导入采购索赔申请主信息 * 批量导入采购索赔申请主信息
* @param datas 导入采购索赔申请主信息列表 * @param datas 导入采购索赔申请主信息列表
@ -86,4 +95,60 @@ public interface DeliverPlanMainService {
*/ */
public List<DeliverPlanMainImportErrorVO> importDeliverPlanMainList(List<DeliverPlanMainCreateReqVO> datas, Integer mode, boolean updatePart); public List<DeliverPlanMainImportErrorVO> importDeliverPlanMainList(List<DeliverPlanMainCreateReqVO> datas, Integer mode, boolean updatePart);
/**
* 更新发货计划的已发货数量
* @param pnumber
* @param pitemCode
* @param pshippedQty
*/
public void updatePlanDeliveShippedQty(String pnumber, String pitemCode, BigDecimal pshippedQty);
/**
* 关闭
* @param id
* @return
*/
public Integer closeDeliverPlanMain(Long id);
/**
* 打开
* @param id
* @return
*/
public Integer openDeliverPlanMain(Long id);
/**
* 提交审批
* @param id
* @return
*/
public Integer submitDeliverPlanMain(Long id);
/**
* 审批通过
* @param id
* @return
*/
public Integer agreeDeliverPlanMain(Long id);
/**
* 审批驳回
* @param id
* @return
*/
public Integer refiesDeliverPlanMain(Long id);
/**
* 发布
* @param id
* @return
*/
public Integer publishDeliverPlanMain(Long id);
/**
* 重置
* @param id
* @return
*/
public Integer resettingDeliverPlanMain(Long id);
} }

242
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/deliverPlan/DeliverPlanMainServiceImpl.java

@ -1,12 +1,14 @@
package com.win.module.wms.service.deliverPlan; package com.win.module.wms.service.deliverPlan;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.win.framework.common.exception.ServiceException; import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.module.infra.api.trends.TrendsApi; import com.win.module.infra.api.trends.TrendsApi;
import com.win.module.infra.enums.TrendsTypeEnum; import com.win.module.infra.enums.TrendsTypeEnum;
import com.win.module.system.api.dict.DictDataApi;
import com.win.module.system.api.dict.dto.DictDataRespDTO;
import com.win.module.system.api.serialnumber.SerialNumberApi; import com.win.module.system.api.serialnumber.SerialNumberApi;
import com.win.module.system.enums.serialNumber.RuleCodeEnum; import com.win.module.system.enums.serialNumber.RuleCodeEnum;
import com.win.module.wms.controller.deliverPlan.vo.*; import com.win.module.wms.controller.deliverPlan.vo.*;
@ -18,11 +20,11 @@ import com.win.module.wms.dal.dataobject.deliverPlan.DeliverPlanDetailDO;
import com.win.module.wms.dal.dataobject.deliverPlan.DeliverPlanMainDO; import com.win.module.wms.dal.dataobject.deliverPlan.DeliverPlanMainDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO; import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO;
import com.win.module.wms.dal.dataobject.sale.SaleDetailDO;
import com.win.module.wms.dal.mysql.deliverPlan.DeliverPlanDetailMapper; import com.win.module.wms.dal.mysql.deliverPlan.DeliverPlanDetailMapper;
import com.win.module.wms.dal.mysql.deliverPlan.DeliverPlanMainMapper; import com.win.module.wms.dal.mysql.deliverPlan.DeliverPlanMainMapper;
import com.win.module.wms.enums.DictTypeConstants; import com.win.module.wms.dal.mysql.deliverRequest.DeliverRequestMainMapper;
import com.win.module.wms.enums.request.RequestStatusEnum; import com.win.module.wms.enums.plan.PlanStatusEnum;
import com.win.module.wms.enums.plan.PlanStatusState;
import com.win.module.wms.service.businesstype.BusinesstypeService; import com.win.module.wms.service.businesstype.BusinesstypeService;
import com.win.module.wms.service.customer.CustomerService; import com.win.module.wms.service.customer.CustomerService;
import com.win.module.wms.service.deliverJob.DeliverJobMainService; import com.win.module.wms.service.deliverJob.DeliverJobMainService;
@ -33,9 +35,11 @@ import com.win.module.wms.service.shift.ShiftService;
import com.win.module.wms.service.supplieritem.SupplieritemService; import com.win.module.wms.service.supplieritem.SupplieritemService;
import com.win.module.wms.util.JobUtils; import com.win.module.wms.util.JobUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -57,6 +61,8 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
@Resource @Resource
private DeliverPlanDetailMapper deliverPlanDetailMapper; private DeliverPlanDetailMapper deliverPlanDetailMapper;
@Resource @Resource
private DeliverRequestMainMapper deliverRequestMainMapper;
@Resource
private ItembasicService itembasicService; private ItembasicService itembasicService;
@Resource @Resource
private JobUtils jobUtils; private JobUtils jobUtils;
@ -78,30 +84,28 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
private TrendsApi trendsApi; private TrendsApi trendsApi;
@Resource @Resource
private RequestsettingService requestsettingService; private RequestsettingService requestsettingService;
@Resource
private DictDataApi dictDataApi;
@Override @Override
public Long createDeliverPlanMain(DeliverPlanMainCreateReqVO createReqVO) { public Long createDeliverPlanMain(DeliverPlanMainCreateReqVO createReqVO) {
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("DeliverPlan"); RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("DeliverPlan");
DeliverPlanMainDO deliverPlanMainDO = validatorToCreate(createReqVO); DeliverPlanMainDO deliverPlanMainDO = validatorToCreate(createReqVO);
//调用自动执行方法 trendsApi.createTrends(requestsettingDO.getId(), "DeliverPlanMain", "增加了发货计划", TrendsTypeEnum.CREATE);
if(RequestStatusEnum.HANDLING.getCode().equals(deliverPlanMainDO.getStatus())) {
}
trendsApi.createTrends(requestsettingDO.getId(), "DeliverPlan", "增加了发货计划", TrendsTypeEnum.CREATE);
return deliverPlanMainDO.getId(); return deliverPlanMainDO.getId();
} }
@Override @Override
@Transactional
public void updateDeliverPlanMain(DeliverPlanMainUpdateReqVO updateReqVO) { public void updateDeliverPlanMain(DeliverPlanMainUpdateReqVO updateReqVO) {
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("DeliverPlan");
// 校验存在 // 校验存在
validateDeliverPlanMainExists(updateReqVO.getId()); DeliverPlanMainDO deliverPlanMainDO = validateDeliverPlanMainExists(updateReqVO.getId());
DeliverPlanMainDO deliverPlanMainDO = validatorToUpdate(updateReqVO); if(!PlanStatusEnum.NEW.getCode().equals(deliverPlanMainDO.getStatus())) {
if(RequestStatusEnum.HANDLING.getCode().equals(deliverPlanMainDO.getStatus())) { throw exception(DELIVER_PLAN_STATUS_NOT_NEW);
} }
trendsApi.createTrends(requestsettingDO.getId(), "DeliverPlan", "修改了发货计划", TrendsTypeEnum.CREATE); deliverPlanMainMapper.updateById(deliverPlanMainDO);
trendsApi.createTrends(updateReqVO.getId(), "DeliverPlanMain", deliverPlanMainDO.toString(), TrendsTypeEnum.UPDATE);
} }
@Override @Override
@ -112,10 +116,169 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
deliverPlanMainMapper.deleteById(id); deliverPlanMainMapper.deleteById(id);
} }
private void validateDeliverPlanMainExists(Long id) { private DeliverPlanMainDO validateDeliverPlanMainExists(Long id) {
if (deliverPlanMainMapper.selectById(id) == null) { DeliverPlanMainDO deliverPlanMainDO = deliverPlanMainMapper.selectById(id);
if (deliverPlanMainDO == null) {
throw exception(DELIVER_PLAN_MAIN_NOT_EXISTS); throw exception(DELIVER_PLAN_MAIN_NOT_EXISTS);
} }
return deliverPlanMainDO;
}
/**
* 更新发货计划的已发货数量
* @param pnumber
* @param pitemCode
* @param pshippedQty
*/
@Override
public void updatePlanDeliveShippedQty(String pnumber, String pitemCode, BigDecimal pshippedQty){
QueryWrapper<DeliverPlanMainDO> mainDOQueryWrapper = new QueryWrapper<>();
DeliverPlanDetailDO deliverPlanDetailDO = null;
mainDOQueryWrapper.eq("number",pnumber);
mainDOQueryWrapper.eq("status","6");
DeliverPlanMainDO deliverPlanMainDO = deliverPlanMainMapper.selectOne(mainDOQueryWrapper);
if(deliverPlanMainDO != null){
QueryWrapper<DeliverPlanDetailDO> detailDOQueryWrapper = new QueryWrapper<>();
detailDOQueryWrapper.eq("number",pnumber);
detailDOQueryWrapper.eq("itembasic",pitemCode);
detailDOQueryWrapper.eq("available","TRUE");
deliverPlanDetailDO = deliverPlanDetailMapper.selectOne(detailDOQueryWrapper);
deliverPlanDetailDO.setShippedQty(pshippedQty);
if(deliverPlanDetailDO.getPlanQty() == deliverPlanDetailDO.getShippedQty()){
deliverPlanDetailDO.setAvailable("FALSE");
}
}
ifDetailAllFinish(deliverPlanMainDO);
}
//判断如果主表下子表状态全为FALSE 则修改计划状态为完成
private void ifDetailAllFinish(DeliverPlanMainDO deliverPlanMainDO){
QueryWrapper<DeliverPlanDetailDO> detailDOQueryWrapper = new QueryWrapper<>();
detailDOQueryWrapper.eq("master_id",deliverPlanMainDO.getId());
List<DeliverPlanDetailDO> deliverPlanDetailDOS = deliverPlanDetailMapper.selectList(detailDOQueryWrapper);
Integer count = 0;
for (DeliverPlanDetailDO deliverPlanDetailDO : deliverPlanDetailDOS) {
if("TRUE".equals(deliverPlanDetailDO.getAvailable())){
count++;
}
}
if(count <= 0){
deliverPlanMainDO.setStatus("7");
}
}
@Override
@Transactional
public Integer closeDeliverPlanMain(Long id) {
// 校验存在存在下级单据
DeliverPlanMainDO mainDO = validateDeliverPlanMainExists(id);
Long count = deliverRequestMainMapper.selectByDeliverPlanNumber(mainDO.getNumber());
if(count > 0) {
throw new ServiceException(DELIVER_PLAN_REQUEST_EXISTS);
}
PlanStatusState planStatusState = new PlanStatusState(mainDO.getStatus());
boolean flag = planStatusState.close();
if(!flag) {
throw new ServiceException(DELIVER_PLAN_CANNOT_CLOSE);
}
mainDO.setStatus(planStatusState.getState().getCode());//增加操作记录
trendsApi.createTrends(id, "deliverPlan", "关闭了发货计划", TrendsTypeEnum.UPDATE);
return deliverPlanMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer openDeliverPlanMain(Long id) {
// 校验存在存在下级单据
DeliverPlanMainDO mainDO = validateDeliverPlanMainExists(id);
Long count = deliverRequestMainMapper.selectByDeliverPlanNumber(mainDO.getNumber());
if(count > 0) {
throw new ServiceException(DELIVER_PLAN_REQUEST_EXISTS);
}
PlanStatusState planStatusState = new PlanStatusState(mainDO.getStatus());
boolean flag = planStatusState.open();
if(!flag) {
throw new ServiceException(DELIVER_PLAN_CANNOT_OPEN);
}
mainDO.setStatus(planStatusState.getState().getCode());//增加操作记录
trendsApi.createTrends(id, "deliverPlan", "打开了发货计划", TrendsTypeEnum.UPDATE);
return deliverPlanMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer submitDeliverPlanMain(Long id) {
// 校验存在存在下级单据
DeliverPlanMainDO mainDO = validateDeliverPlanMainExists(id);
PlanStatusState planStatusState = new PlanStatusState(mainDO.getStatus());
boolean flag = planStatusState.submit();
if(!flag) {
throw new ServiceException(DELIVER_PLAN_CANNOT_SUBMIT);
}
mainDO.setStatus(planStatusState.getState().getCode());//增加操作记录
trendsApi.createTrends(id, "deliverPlan", "提交了发货计划", TrendsTypeEnum.UPDATE);
return deliverPlanMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer agreeDeliverPlanMain(Long id) {
// 校验存在存在下级单据
DeliverPlanMainDO mainDO = validateDeliverPlanMainExists(id);
PlanStatusState planStatusState = new PlanStatusState(mainDO.getStatus());
boolean flag = planStatusState.agree();
if(!flag) {
throw new ServiceException(DELIVER_PLAN_CANNOT_AGREE);
}
mainDO.setStatus(planStatusState.getState().getCode());//增加操作记录
trendsApi.createTrends(id, "deliverPlan", "审批通过了发货计划", TrendsTypeEnum.UPDATE);
return deliverPlanMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer refiesDeliverPlanMain(Long id) {
// 校验存在存在下级单据
DeliverPlanMainDO mainDO = validateDeliverPlanMainExists(id);
PlanStatusState planStatusState = new PlanStatusState(mainDO.getStatus());
boolean flag = planStatusState.reject();
if(!flag) {
throw new ServiceException(DELIVER_PLAN_CANNOT_REFUSE);
}
mainDO.setStatus(planStatusState.getState().getCode());//增加操作记录
trendsApi.createTrends(id, "deliverPlan", "审批驳回了发货计划", TrendsTypeEnum.UPDATE);
return deliverPlanMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer publishDeliverPlanMain(Long id) {
// 校验存在存在下级单据
DeliverPlanMainDO mainDO = validateDeliverPlanMainExists(id);
PlanStatusState planStatusState = new PlanStatusState(mainDO.getStatus());
boolean flag = planStatusState.execute();
if(!flag) {
throw new ServiceException(DELIVER_PLAN_CANNOT_PUBLISH);
}
mainDO.setStatus(planStatusState.getState().getCode());//增加操作记录
trendsApi.createTrends(id, "deliverPlan", "发布了发货计划", TrendsTypeEnum.UPDATE);
return deliverPlanMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer resettingDeliverPlanMain(Long id) {
// 校验存在存在下级单据
DeliverPlanMainDO mainDO = validateDeliverPlanMainExists(id);
PlanStatusState planStatusState = new PlanStatusState(mainDO.getStatus());
boolean flag = planStatusState.resetting();
if(!flag) {
throw new ServiceException(DELIVER_PLAN_CANNOT_RESETTING);
}
mainDO.setStatus(planStatusState.getState().getCode());//增加操作记录
trendsApi.createTrends(id, "deliverPlan", "重置了发货计划", TrendsTypeEnum.UPDATE);
return deliverPlanMainMapper.updateById(mainDO);
} }
@Override @Override
@ -143,6 +306,11 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
return deliverPlanMainMapper.selectList(exportReqVO); return deliverPlanMainMapper.selectList(exportReqVO);
} }
@Override
public List<DeliverPlanMainDO> getDeliverPlanMainList(CustomConditions conditions) {
return deliverPlanMainMapper.selectSeniorList(conditions);
}
@Override @Override
public List<DeliverPlanMainImportErrorVO> importDeliverPlanMainList(List<DeliverPlanMainCreateReqVO> datas, Integer mode, boolean updatePart) { public List<DeliverPlanMainImportErrorVO> importDeliverPlanMainList(List<DeliverPlanMainCreateReqVO> datas, Integer mode, boolean updatePart) {
if (CollUtil.isEmpty(datas)) { if (CollUtil.isEmpty(datas)) {
@ -150,7 +318,7 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
} }
List<DeliverPlanMainImportErrorVO> errorList = new ArrayList<>(); List<DeliverPlanMainImportErrorVO> errorList = new ArrayList<>();
datas.forEach(createReqVO -> { datas.forEach(createReqVO -> {
BusinesstypeDO businesstypeDO = new BusinesstypeDO(); BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("DeliverPlan");
DeliverPlanMainDO mainDo = DeliverPlanMainConvert.INSTANCE.convert(createReqVO); DeliverPlanMainDO mainDo = DeliverPlanMainConvert.INSTANCE.convert(createReqVO);
String messageMain = validateDeliverPlanMainImport(mainDo, businesstypeDO); String messageMain = validateDeliverPlanMainImport(mainDo, businesstypeDO);
List<DeliverPlanDetailCreateReqVO> subList = createReqVO.getSubList(); List<DeliverPlanDetailCreateReqVO> subList = createReqVO.getSubList();
@ -170,8 +338,7 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
} }
//写入数据 //写入数据
if (flag) { if (flag) {
mainDo.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增")); mainDo.setStatus(PlanStatusEnum.NEW.getCode());
businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("DeliverRequestRequest");
if (businesstypeDO != null) { if (businesstypeDO != null) {
mainDo.setBusinessType(businesstypeDO.getCode()); mainDo.setBusinessType(businesstypeDO.getCode());
} }
@ -181,7 +348,6 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
for (DeliverPlanDetailDO detailDO : subDOList) { for (DeliverPlanDetailDO detailDO : subDOList) {
detailDO.setNumber(mainDo.getNumber()); detailDO.setNumber(mainDo.getNumber());
detailDO.setMasterId(mainDo.getId()); detailDO.setMasterId(mainDo.getId());
detailDO.setCustomerDockCode(null);
} }
deliverPlanDetailMapper.insertBatch(subDOList); deliverPlanDetailMapper.insertBatch(subDOList);
} }
@ -211,7 +377,6 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
} }
//校验业务类型相关属性 //校验业务类型相关属性
try { try {
businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("DeliverPlan");
if (businesstypeDO != null) { if (businesstypeDO != null) {
mainDo.setBusinessType(businesstypeDO.getCode()); mainDo.setBusinessType(businesstypeDO.getCode());
} }
@ -238,13 +403,13 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
} catch (ServiceException ex) { } catch (ServiceException ex) {
messageDetail += ex.getMessage() + ","; messageDetail += ex.getMessage() + ",";
} }
//TODO 滞后
// 校验物品标包信息 // 校验物品标包信息
try { // try {
SaleDetailDO saleDetailDO = deliverJobMainService.saleDetailExist(detailDo.getSoNumber(), detailDo.getSoLine(), detailDo.getItemCode()); // deliverJobMainService.saleDetailExist(detailDo.getSoNumber(), detailDo.getSoLine(), detailDo.getItemCode());
} catch (ServiceException ex) { // } catch (ServiceException ex) {
messageDetail += ex.getMessage() + ","; // messageDetail += ex.getMessage() + ",";
} // }
return messageDetail; return messageDetail;
} }
@ -260,6 +425,7 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
} }
String number = serialNumberApi.generateCode(RuleCodeEnum.SUPPLIER_DELIVER_REQUEST.getCode()); String number = serialNumberApi.generateCode(RuleCodeEnum.SUPPLIER_DELIVER_REQUEST.getCode());
deliverPlanMainDO.setNumber(number); deliverPlanMainDO.setNumber(number);
deliverPlanMainDO.setStatus(PlanStatusEnum.NEW.getCode());
deliverPlanMainMapper.insert(deliverPlanMainDO); deliverPlanMainMapper.insert(deliverPlanMainDO);
for (DeliverPlanDetailDO deliverPlanDetailDO : subDOList) { for (DeliverPlanDetailDO deliverPlanDetailDO : subDOList) {
deliverPlanDetailDO.setNumber(deliverPlanMainDO.getNumber()); deliverPlanDetailDO.setNumber(deliverPlanMainDO.getNumber());
@ -270,21 +436,6 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
return deliverPlanMainDO; return deliverPlanMainDO;
} }
//修改方法(主和子)
private DeliverPlanMainDO validatorToUpdate(DeliverPlanMainUpdateReqVO updateReqVO) {
BusinesstypeDO businesstypeDO = new BusinesstypeDO();
DeliverPlanMainDO deliverPlanMainDO = validateMainMethod(updateReqVO,businesstypeDO);
//子表校验
List<DeliverPlanDetailUpdateReqVO> subList = updateReqVO.getSubList();
List<DeliverPlanDetailDO> subDOList = DeliverPlanDetailConvert.INSTANCE.convertList05(subList);
for (DeliverPlanDetailDO deliverPlanDetailDO : subDOList) {
validateDetailMethod(deliverPlanDetailDO);
}
deliverPlanMainMapper.updateById(deliverPlanMainDO);
deliverPlanDetailMapper.updateBatch(subDOList);
return deliverPlanMainDO;
}
//校验主表公共方法(适用于新增/修改) //校验主表公共方法(适用于新增/修改)
private DeliverPlanMainDO validateMainMethod(DeliverPlanMainBaseVO baseVO, BusinesstypeDO businesstypeDO){ private DeliverPlanMainDO validateMainMethod(DeliverPlanMainBaseVO baseVO, BusinesstypeDO businesstypeDO){
DeliverPlanMainDO deliverPlanMainDO = DeliverPlanMainConvert.INSTANCE.convert(baseVO); DeliverPlanMainDO deliverPlanMainDO = DeliverPlanMainConvert.INSTANCE.convert(baseVO);
@ -297,9 +448,10 @@ public class DeliverPlanMainServiceImpl implements DeliverPlanMainService {
private void validateDetailMethod(DeliverPlanDetailDO deliverPlanDetailDO) { private void validateDetailMethod(DeliverPlanDetailDO deliverPlanDetailDO) {
ItembasicDO itembasicDO = this.validatorItembasic(deliverPlanDetailDO.getItemCode()); ItembasicDO itembasicDO = this.validatorItembasic(deliverPlanDetailDO.getItemCode());
if ( !deliverPlanDetailDO.getUom().equals(itembasicDO.getUom())) { if ( !deliverPlanDetailDO.getUom().equals(itembasicDO.getUom())) {
throw exception(UOM_ERROR, deliverPlanDetailDO.getUom()); String label = dictDataApi.selectDictValue(itembasicDO.getUom()).getLabel();
throw exception(UOM_ERROR, label);
} }
this.validatorDetailExist(deliverPlanDetailDO.getSoNumber(), deliverPlanDetailDO.getSoLine(), deliverPlanDetailDO.getItemCode()); //this.validatorDetailExist(deliverPlanDetailDO.getSoNumber(), deliverPlanDetailDO.getSoLine(), deliverPlanDetailDO.getItemCode());
} }
//主表校验客户代码 //主表校验客户代码

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectJob/InspectJobMainService.java

@ -69,7 +69,7 @@ public interface InspectJobMainService {
* @param pstatus 状态 * @param pstatus 状态
* @return 采购订单主列表 * @return 采购订单主列表
*/ */
public InspectJobMainDO inspectJobMainDoStatusRight(String pnumber, String pstatus); InspectJobMainDO inspectJobMainDoStatusRight(String pnumber, String pstatus);
/** /**
* 高级搜索不分页 * 高级搜索不分页
@ -104,6 +104,6 @@ public interface InspectJobMainService {
* @param inspectJobMainUpdateReqVO * @param inspectJobMainUpdateReqVO
* @return * @return
*/ */
Integer excuteInspectJobMain(InspectJobMainUpdateReqVO inspectJobMainUpdateReqVO); Integer executeInspectJobMain(InspectJobMainUpdateReqVO inspectJobMainUpdateReqVO);
} }

7
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectJob/InspectJobMainServiceImpl.java

@ -128,14 +128,13 @@ public class InspectJobMainServiceImpl implements InspectJobMainService {
return map; return map;
} }
@Override @Override
@Transactional @Transactional
public Integer acceptInspectJobMain(Long id) { public Integer acceptInspectJobMain(Long id) {
InspectJobMainDO inspectJobMainDO = this.validateInspectJobMainExists(id); InspectJobMainDO inspectJobMainDO = this.validateInspectJobMainExists(id);
JobStatusState jobStatusState = new JobStatusState(inspectJobMainDO.getStatus()); JobStatusState jobStatusState = new JobStatusState(inspectJobMainDO.getStatus());
if(!jobStatusState.accept()) { if(!jobStatusState.accept()) {
throw exception(PURCHASERECEIPT_JOB_MAIN_STATUS_ERROR); throw exception(INSPECT_JOB_MAIN_STATUS_ERROR);
} }
Long userId = getLoginUserId(); Long userId = getLoginUserId();
AdminUserRespDTO userRespDTO = userApi.getUser(userId); AdminUserRespDTO userRespDTO = userApi.getUser(userId);
@ -153,7 +152,7 @@ public class InspectJobMainServiceImpl implements InspectJobMainService {
InspectJobMainDO inspectJobMainDO = this.validateInspectJobMainExists(id); InspectJobMainDO inspectJobMainDO = this.validateInspectJobMainExists(id);
JobStatusState jobStatusState = new JobStatusState(inspectJobMainDO.getStatus()); JobStatusState jobStatusState = new JobStatusState(inspectJobMainDO.getStatus());
if(!jobStatusState.cancelAccept()) { if(!jobStatusState.cancelAccept()) {
throw exception(PURCHASERECEIPT_JOB_MAIN_STATUS_ERROR); throw exception(INSPECT_JOB_MAIN_STATUS_ERROR);
} }
inspectJobMainDO.setStatus(jobStatusState.getState().getCode()); inspectJobMainDO.setStatus(jobStatusState.getState().getCode());
inspectJobMainDO.setAcceptUserId(null); inspectJobMainDO.setAcceptUserId(null);
@ -165,7 +164,7 @@ public class InspectJobMainServiceImpl implements InspectJobMainService {
@Override @Override
@Transactional @Transactional
public Integer excuteInspectJobMain(InspectJobMainUpdateReqVO inspectJobMainUpdateReqVO) { public Integer executeInspectJobMain(InspectJobMainUpdateReqVO inspectJobMainUpdateReqVO) {
//查询数据 //查询数据
InspectJobMainDO inspectJobMainDO = this.validateInspectJobMainExists(inspectJobMainUpdateReqVO.getId()); InspectJobMainDO inspectJobMainDO = this.validateInspectJobMainExists(inspectJobMainUpdateReqVO.getId());
JobStatusState jobStatusState = new JobStatusState(inspectJobMainDO.getStatus()); JobStatusState jobStatusState = new JobStatusState(inspectJobMainDO.getStatus());

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRecord/InspectRecordMainService.java

@ -2,7 +2,6 @@ package com.win.module.wms.service.inspectRecord;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.inspectJob.vo.InspectJobMainUpdateReqVO;
import com.win.module.wms.controller.inspectRecord.vo.InspectRecordMainExportReqVO; import com.win.module.wms.controller.inspectRecord.vo.InspectRecordMainExportReqVO;
import com.win.module.wms.controller.inspectRecord.vo.InspectRecordMainPageReqVO; import com.win.module.wms.controller.inspectRecord.vo.InspectRecordMainPageReqVO;
import com.win.module.wms.dal.dataobject.inspectRecord.InspectRecordMainDO; import com.win.module.wms.dal.dataobject.inspectRecord.InspectRecordMainDO;
@ -44,7 +43,7 @@ public interface InspectRecordMainService {
* 获得检验记录主列表, 用于 Excel 导出 * 获得检验记录主列表, 用于 Excel 导出
* *
* @param conditions 查询条件 * @param conditions 查询条件
* @return 采购收货申请主列表 * @return 检验记录主列表
*/ */
List<InspectRecordMainDO> getInspectRecordMainList(CustomConditions conditions); List<InspectRecordMainDO> getInspectRecordMainList(CustomConditions conditions);

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestDetailService.java

@ -3,6 +3,7 @@ package com.win.module.wms.service.inspectRequest;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailCreateReqVO; import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailCreateReqVO;
import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailExportReqVO;
import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailPageReqVO; import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailPageReqVO;
import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailUpdateReqVO; import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailUpdateReqVO;
import com.win.module.wms.dal.dataobject.inspectRequest.InspectRequestDetailDO; import com.win.module.wms.dal.dataobject.inspectRequest.InspectRequestDetailDO;
@ -71,4 +72,6 @@ public interface InspectRequestDetailService {
*/ */
PageResult<InspectRequestDetailDO> getInspectRequestDetailSenior(CustomConditions conditions); PageResult<InspectRequestDetailDO> getInspectRequestDetailSenior(CustomConditions conditions);
List<InspectRequestDetailDO> getInspectRequestDetailList(InspectRequestDetailExportReqVO exportReqVO);
} }

6
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestDetailServiceImpl.java

@ -8,6 +8,7 @@ import com.win.module.infra.enums.TrendsTypeEnum;
import com.win.module.system.api.dict.DictDataApi; import com.win.module.system.api.dict.DictDataApi;
import com.win.module.system.api.dict.dto.DictDataRespDTO; import com.win.module.system.api.dict.dto.DictDataRespDTO;
import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailCreateReqVO; import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailCreateReqVO;
import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailExportReqVO;
import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailPageReqVO; import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailPageReqVO;
import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailUpdateReqVO; import com.win.module.wms.controller.inspectRequest.vo.InspectRequestDetailUpdateReqVO;
import com.win.module.wms.convert.inspectRequest.InspectRequestDetailConvert; import com.win.module.wms.convert.inspectRequest.InspectRequestDetailConvert;
@ -165,4 +166,9 @@ public class InspectRequestDetailServiceImpl implements InspectRequestDetailServ
jobUtils.selectlocationReturnManagementAccuracy(itemCode, packingNumber, batch, fromLocationCode, inventoryStatus); jobUtils.selectlocationReturnManagementAccuracy(itemCode, packingNumber, batch, fromLocationCode, inventoryStatus);
} }
@Override
public List<InspectRequestDetailDO> getInspectRequestDetailList(InspectRequestDetailExportReqVO exportReqVO) {
return inspectRequestDetailMapper.selectList(exportReqVO);
}
} }

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestMainService.java

@ -7,7 +7,6 @@ import com.win.module.wms.dal.dataobject.inspectRequest.InspectRequestMainDO;
import javax.validation.Valid; import javax.validation.Valid;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -48,14 +47,6 @@ public interface InspectRequestMainService {
*/ */
InspectRequestMainDO getInspectRequestMain(Long id); InspectRequestMainDO getInspectRequestMain(Long id);
/**
* 获得检验申请主列表
*
* @param ids 编号
* @return 检验申请主列表
*/
List<InspectRequestMainDO> getInspectRequestMainList(Collection<Long> ids);
/** /**
* 获得检验申请主分页 * 获得检验申请主分页
* *

31
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestMainServiceImpl.java

@ -61,7 +61,6 @@ import javax.annotation.Resource;
import javax.validation.Validator; import javax.validation.Validator;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -169,11 +168,6 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService
return inspectRequestMainMapper.selectById(id); return inspectRequestMainMapper.selectById(id);
} }
@Override
public List<InspectRequestMainDO> getInspectRequestMainList(Collection<Long> ids) {
return inspectRequestMainMapper.selectBatchIds(ids);
}
@Override @Override
public PageResult<InspectRequestMainDO> getInspectRequestMainPage(InspectRequestMainPageReqVO pageReqVO) { public PageResult<InspectRequestMainDO> getInspectRequestMainPage(InspectRequestMainPageReqVO pageReqVO) {
return inspectRequestMainMapper.selectPage(pageReqVO); return inspectRequestMainMapper.selectPage(pageReqVO);
@ -337,7 +331,7 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService
// 校验存在 // 校验存在
InspectRequestMainDO mainDO = validateInspectRequestMainExists(id); InspectRequestMainDO mainDO = validateInspectRequestMainExists(id);
RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus()); RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus());
boolean flag = requestStatusState.reject(); boolean flag = requestStatusState.refused();
if(!flag) { if(!flag) {
throw new ServiceException(INSPECT_REQUEST_CANNOT_ABORT); throw new ServiceException(INSPECT_REQUEST_CANNOT_ABORT);
} }
@ -573,23 +567,22 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService
*/ */
private String validatorInspectRequestDetailImport(InspectRequestDetailDO detailDo, InspectRequestMainDO mainDo, BusinesstypeDO businesstypeDO) { private String validatorInspectRequestDetailImport(InspectRequestDetailDO detailDo, InspectRequestMainDO mainDo, BusinesstypeDO businesstypeDO) {
StringBuilder message = new StringBuilder(); StringBuilder message = new StringBuilder();
ItembasicDO itembasicDO = null;
try { try {
itembasicDO = validatorItembasic(detailDo.getItemCode()); ItembasicDO itembasicDO = validatorItembasic(detailDo.getItemCode());
detailDo.setItemDesc1(itembasicDO.getDesc1()); detailDo.setItemDesc1(itembasicDO.getDesc1());
detailDo.setItemDesc2(itembasicDO.getDesc2()); detailDo.setItemDesc2(itembasicDO.getDesc2());
detailDo.setItemName(itembasicDO.getName()); detailDo.setItemName(itembasicDO.getName());
detailDo.setProjectCode(itembasicDO.getProject()); detailDo.setProjectCode(itembasicDO.getProject());
} catch (Exception ex) { try {
message.append(ex.getMessage()).append(","); this.ifUomSuccess(itembasicDO.getUom(), detailDo.getUom());
} } catch (Exception ex) {
try { message.append(ex.getMessage()).append(",");
this.ifUomSuccess(itembasicDO.getUom(), detailDo.getUom()); }
} catch (Exception ex) { try{
message.append(ex.getMessage()).append(","); validatorIfInType(itembasicDO.getType(), businesstypeDO);
} }catch (Exception ex) {
try { message.append(ex.getMessage()).append(",");
validatorIfInType(itembasicDO.getType(), businesstypeDO); }
} catch (Exception ex) { } catch (Exception ex) {
message.append(ex.getMessage()).append(","); message.append(ex.getMessage()).append(",");
} }

279
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inventoryinitRequest/InventoryinitRequestMainServiceImpl.java

@ -1,17 +1,31 @@
package com.win.module.wms.service.inventoryinitRequest; package com.win.module.wms.service.inventoryinitRequest;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.win.framework.common.util.validation.ValidationUtils;
import com.win.framework.dict.core.util.DictFrameworkUtils; import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.module.infra.api.trends.TrendsApi;
import com.win.module.infra.enums.TrendsTypeEnum;
import com.win.module.system.api.serialnumber.SerialNumberApi; import com.win.module.system.api.serialnumber.SerialNumberApi;
import com.win.module.system.enums.serialNumber.RuleCodeEnum; import com.win.module.system.enums.serialNumber.RuleCodeEnum;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayImportErrorVO; import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayImportErrorVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestDetailUpdateReqVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainUpdateReqVO;
import com.win.module.wms.controller.purchaseclaimRequest.vo.PurchaseclaimRequestDetailCreateReqVO; import com.win.module.wms.controller.purchaseclaimRequest.vo.PurchaseclaimRequestDetailCreateReqVO;
import com.win.module.wms.controller.purchaseclaimRequest.vo.PurchaseclaimRequestImportErrorVO; import com.win.module.wms.controller.purchaseclaimRequest.vo.PurchaseclaimRequestImportErrorVO;
import com.win.module.wms.controller.purchasereceiptRequest.vo.PurchasereceiptRequestMainImportErrorVO;
import com.win.module.wms.convert.productputawayRequest.ProductputawayRequestDetailConvert; import com.win.module.wms.convert.productputawayRequest.ProductputawayRequestDetailConvert;
import com.win.module.wms.convert.productputawayRequest.ProductputawayRequestMainConvert;
import com.win.module.wms.convert.purchaseclaimRequest.PurchaseclaimRequestDetailConvert; import com.win.module.wms.convert.purchaseclaimRequest.PurchaseclaimRequestDetailConvert;
import com.win.module.wms.convert.purchasereceiptRequest.PurchasereceiptRequestDetailConvert;
import com.win.module.wms.convert.purchasereceiptRequest.PurchasereceiptRequestMainConvert;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestDetailDO;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestMainDO;
import com.win.module.wms.dal.dataobject.purchaseclaimRequest.PurchaseclaimRequestMainDO; import com.win.module.wms.dal.dataobject.purchaseclaimRequest.PurchaseclaimRequestMainDO;
import com.win.module.wms.dal.dataobject.purchasereceiptRequest.PurchasereceiptRequestDetailDO;
import com.win.module.wms.dal.dataobject.purchasereceiptRequest.PurchasereceiptRequestMainDO;
import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO; import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO;
import com.win.module.wms.enums.DictTypeConstants; import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.enums.request.RequestStatusEnum;
import com.win.module.wms.util.*; import com.win.module.wms.util.*;
import com.win.module.wms.service.requestsetting.*; import com.win.module.wms.service.requestsetting.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
@ -33,6 +47,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Validator;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import com.win.module.wms.service.itembasic.*; import com.win.module.wms.service.itembasic.*;
import com.win.module.wms.service.location.*; import com.win.module.wms.service.location.*;
@ -53,10 +69,14 @@ public class InventoryinitRequestMainServiceImpl implements InventoryinitRequest
@Resource @Resource
private InventoryinitRequestMainMapper inventoryinitRequestMainMapper; private InventoryinitRequestMainMapper inventoryinitRequestMainMapper;
@Resource
private TrendsApi trendsApi;
@Resource @Resource
private SerialNumberApi serialNumberApi; private SerialNumberApi serialNumberApi;
@Resource
private Validator validator;
@Resource @Resource
private RequestsettingService requestsettingService; private RequestsettingService requestsettingService;
@ -80,21 +100,73 @@ public class InventoryinitRequestMainServiceImpl implements InventoryinitRequest
@Override @Override
public Long createInventoryinitRequestMain(InventoryinitRequestMainCreateReqVO createReqVO) { public Long createInventoryinitRequestMain(InventoryinitRequestMainCreateReqVO createReqVO) {
// 插入 // 插入
InventoryinitRequestMainDO inventoryinitRequestMain = InventoryinitRequestMainConvert.INSTANCE.convert(createReqVO); RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("TransferDeliverRequest");
inventoryinitRequestMainMapper.insert(inventoryinitRequestMain); InventoryinitRequestMainDO mainDO = InventoryinitRequestMainConvert.INSTANCE.convert(createReqVO);
this.validateInventoryinitRequestMainCreate(mainDO);
List<InventoryinitRequestDetailDO> subDOList = InventoryinitRequestDetailConvert.INSTANCE.convertList03(createReqVO.getSubList());
for (InventoryinitRequestDetailDO detailDO : subDOList) {
this.validatePurchasereceiptRequestDetailCreate(detailDO);
}
String number = serialNumberApi.generateCode(RuleCodeEnum.PURCHASE_RECEIPT_REQUEST.getCode());
mainDO.setNumber(number);
inventoryinitRequestMainMapper.insert(mainDO);
for (InventoryinitRequestDetailDO detailDO : subDOList) {
detailDO.setMasterId(mainDO.getId());
detailDO.setNumber(number);
}
inventoryinitRequestDetailMapper.insertBatch(subDOList);
trendsApi.createTrends(requestsettingDO.getId(), "inventoryinitRequestMain", "增加了库存初始化申请", TrendsTypeEnum.CREATE);
// 返回 // 返回
return inventoryinitRequestMain.getId(); return mainDO.getId();
} }
private InventoryinitRequestMainDO validateInventoryinitRequestMainCreate(InventoryinitRequestMainDO mainDo) {
mainDo.setCreateTime(LocalDateTime.now());
validaterequestsetting(mainDo);
validateBusinesstype(mainDo);
return mainDo;
}
private void validatePurchasereceiptRequestDetailCreate(InventoryinitRequestDetailDO detailDo) {
detailDo = validateItem(detailDo);
detailDo = validateLocation(detailDo);
detailDo = validitempackaging(detailDo);
}
@Override @Override
public void updateInventoryinitRequestMain(InventoryinitRequestMainUpdateReqVO updateReqVO) { public void updateInventoryinitRequestMain(InventoryinitRequestMainUpdateReqVO updateReqVO) {
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("TransferDeliverRequest");
// 校验存在 // 校验存在
validateInventoryinitRequestMainExists(updateReqVO.getId()); validateInventoryinitRequestMainExists(updateReqVO.getId());
// 更新 // 更新
InventoryinitRequestMainDO updateObj = InventoryinitRequestMainConvert.INSTANCE.convert(updateReqVO); InventoryinitRequestMainDO inventoryinitRequestMainDO = validatorToUpdate(updateReqVO, requestsettingDO);
inventoryinitRequestMainMapper.updateById(updateObj);
if(RequestStatusEnum.HANDLING.getCode().equals(inventoryinitRequestMainDO.getStatus())) {
}
trendsApi.createTrends(requestsettingDO.getId(), "InventoryinitRequest", "增加了库存初始化申请", TrendsTypeEnum.CREATE);
}
private InventoryinitRequestMainDO validatorToUpdate(InventoryinitRequestMainUpdateReqVO updateReqVO, RequestsettingDO requestsettingDO) {
InventoryinitRequestMainDO mainDo = InventoryinitRequestMainConvert.INSTANCE.convert1(updateReqVO);
mainDo = validateInventoryinitRequestMainCreate(mainDo);
List<InventoryinitRequestDetailUpdateReqVO> subList = updateReqVO.getSubList();
if(!subList.isEmpty()) {
List<InventoryinitRequestDetailDO> subDOList = InventoryinitRequestDetailConvert.INSTANCE.convertList05(subList);
for (InventoryinitRequestDetailDO inventoryinitRequestDetailDO : subDOList) {
validatePurchasereceiptRequestDetailCreate(inventoryinitRequestDetailDO);
}
inventoryinitRequestDetailMapper.updateBatch(subDOList);
}
inventoryinitRequestMainMapper.updateById(mainDo);
return mainDo;
} }
@Override @Override
public void deleteInventoryinitRequestMain(Long id) { public void deleteInventoryinitRequestMain(Long id) {
// 校验存在 // 校验存在
@ -140,9 +212,86 @@ public class InventoryinitRequestMainServiceImpl implements InventoryinitRequest
public List<InventoryinitRequestMainDO> getInventoryinitRequestMainList(InventoryinitRequestMainExportReqVO exportReqVO) { public List<InventoryinitRequestMainDO> getInventoryinitRequestMainList(InventoryinitRequestMainExportReqVO exportReqVO) {
return inventoryinitRequestMainMapper.selectList(exportReqVO); return inventoryinitRequestMainMapper.selectList(exportReqVO);
} }
private String validatePurchasereceiptRequestDetailImport(InventoryinitRequestMainDO mainDo, InventoryinitRequestDetailDO detailDo){
StringBuilder message = new StringBuilder();
try {
detailDo.setCreateTime(LocalDateTime.now());
detailDo = this.validateItem(detailDo);
} catch (Exception e) {
message.append(e.getMessage()).append(",");
}
try {
detailDo = this.validateLocation(detailDo);
} catch (Exception e) {
message.append(e.getMessage()).append(",");
}
try {
this.validitempackaging(detailDo);
} catch (Exception e) {
message.append(e.getMessage()).append(",");
}
return message.toString();
}
private InventoryinitRequestDetailDO validateLocation(InventoryinitRequestDetailDO detailDo) {
LocationDO location = locationService.selectLocation(detailDo.getLocationCode());
detailDo.setAreaCode(location.getAreaCode());
detailDo.setLocationCode(location.getCode());
detailDo.setLocationGroupCode(location.getLocationGroupCode());
return detailDo;
}
private InventoryinitRequestDetailDO validitempackaging(InventoryinitRequestDetailDO detailDo){
ItempackagingDO itempackaging = itempackagingService.selectItemPackagingExist(detailDo.getItemCode());
detailDo.setStdPackUnit(itempackaging.getStdPackUnit());
detailDo.setStdPackQty(itempackaging.getStdPackQty());
return detailDo;
}
private InventoryinitRequestDetailDO validateItem(InventoryinitRequestDetailDO detailDo) {
ItembasicDO itembasicDO = itembasicService.selectItembasic(detailDo.getItemCode());
detailDo.setItemName(itembasicDO.getName());
detailDo.setItemDesc1(itembasicDO.getDesc1());
detailDo.setItemDesc2(itembasicDO.getDesc2());
detailDo.setProjectCode(itembasicDO.getProject());
return detailDo;
}
private InventoryinitRequestMainDO validateBusinesstype( InventoryinitRequestMainDO mainDo) {
BusinesstypeDO businesstype = jobUtils.selectDocumentSettingFromBusinessType("InventoryInitialRequest");
mainDo.setBusinessType(businesstype.getCode());
return mainDo;
}
private InventoryinitRequestMainDO validaterequestsetting(InventoryinitRequestMainDO mainDo){
RequestsettingDO requestsetting = requestsettingService.selectRequestsettingExist("TransferDeliverRequest");
mainDo.setAutoAgree(requestsetting.getAutoAgree());
mainDo.setAutoCommit(requestsetting.getAutoCommit());
mainDo.setAutoExecute(requestsetting.getAutoExecute());
mainDo.setDirectCreateRecord(requestsetting.getDirectCreateRecord());
return mainDo;
}
private String validatePurchasereceiptRequestMainImport(InventoryinitRequestMainDO mainDo) {
StringBuilder message = new StringBuilder();
try {
mainDo.setCreateTime(LocalDateTime.now());
mainDo = validaterequestsetting(mainDo);
} catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
try{
mainDo = validateBusinesstype(mainDo);
} catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
try {
ValidationUtils.validate(validator, mainDo);
} catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
return message.toString();
}
@Override @Override
@Transactional @Transactional
public List<InventoryinitRequestMainImportErrorVO> importInventoryinitRequestMainList(List<InventoryinitRequestMainCreateReqVO> datas, Integer mode, boolean updatePart) { public List<InventoryinitRequestMainImportErrorVO> importInventoryinitRequestMainList(List<InventoryinitRequestMainCreateReqVO> datas, Integer mode, boolean updatePart) {
@ -153,107 +302,37 @@ public class InventoryinitRequestMainServiceImpl implements InventoryinitRequest
datas.forEach(createReqVO -> { datas.forEach(createReqVO -> {
String message = ""; String message = "";
// 校验,判断是否有不符合的原因,并加入errorList,如果主表则所有子表都加入errorList // 校验,判断是否有不符合的原因,并加入errorList,如果主表则所有子表都加入errorList
InventoryinitRequestMainDO mainDO = InventoryinitRequestMainConvert.INSTANCE.convert(createReqVO);
String messageMain = this.validatePurchasereceiptRequestMainImport(mainDO);
boolean isError = false;
if(mode != null) {
try {
validatesInventoryinitRequestMainExists(null);
} catch (Exception ex) {
isError = true;
message += ex.getMessage() + ",";
}
}
try {
RequestsettingDO requestsetting = requestsettingService.selectRequestsettingExist("TransferDeliverRequest");
createReqVO.setAutoAgree(requestsetting.getAutoAgree());
createReqVO.setAutoCommit(requestsetting.getAutoCommit());
createReqVO.setAutoExecute(requestsetting.getAutoExecute());
createReqVO.setDirectCreateRecord(requestsetting.getDirectCreateRecord());
}catch (Exception ex) {
isError = true;
message += ex.getMessage() + ",";
}
try {
BusinesstypeDO businesstype = jobUtils.selectDocumentSettingFromBusinessType("InventoryInitialRequest");
createReqVO.setBusinessType(businesstype.getCode());
}catch (Exception ex) {
isError = true;
message += ex.getMessage() + ",";
}
List<InventoryinitRequestDetailCreateReqVO> subList = createReqVO.getSubList(); List<InventoryinitRequestDetailCreateReqVO> subList = createReqVO.getSubList();
List<InventoryinitRequestDetailDO> subDOList = InventoryinitRequestDetailConvert.INSTANCE.convertList03(subList); List<InventoryinitRequestDetailDO> subDOList = InventoryinitRequestDetailConvert.INSTANCE.convertList03(subList);
// 新增子表数据 // 是否有错误数据
boolean flag = true;
for (InventoryinitRequestDetailDO detailDO : subDOList) { for (InventoryinitRequestDetailDO detailDO : subDOList) {
// 校验,判断是否有不符合的原因,并加入errorList,同主表,只把有错误的子表加入errorList String messageDetail = this.validatePurchasereceiptRequestDetailImport(mainDO, detailDO);
detailDO.setNumber(createReqVO.getNumber()); if (!messageMain.isEmpty() || !messageDetail.isEmpty()) {
InventoryinitRequestMainImportErrorVO importErrorVO = InventoryinitRequestMainConvert.INSTANCE.convert(createReqVO, detailDO);
try{ importErrorVO.setImportStatus("失败");
LocationDO location = locationService.selectLocation(detailDO.getLocationCode()); messageMain = messageMain + messageDetail;
detailDO.setAreaCode(location.getAreaCode()); importErrorVO.setImportRemark(messageMain.substring(0, messageMain.length() - 1));
detailDO.setLocationCode(location.getCode()); errorList.add(importErrorVO);
detailDO.setLocationGroupCode(location.getLocationGroupCode()); flag = false;
}catch (Exception ex) {
isError = true;
message += ex.getMessage() + ",";
}
try{
//TODO 传入的实体里没有itemcode detailDO.getItemCode()
ItembasicDO itembasic = itembasicService.selectItembasic(detailDO.getItemCode());
detailDO.setItemDesc1(itembasic.getDesc1());
detailDO.setItemDesc2(itembasic.getDesc2());
detailDO.setItemName(itembasic.getName());
detailDO.setUom(itembasic.getUom());
detailDO.setProjectCode(itembasic.getProject());
}catch (Exception ex) {
isError = true;
message += ex.getMessage() + ",";
}
try{
//TODO 传入的实体里没有itemcode detailDO.getItemCode()
ItempackagingDO itempackaging = itempackagingService.selectItemPackagingExist(detailDO.getItemCode());
detailDO.setStdPackUnit(itempackaging.getStdPackUnit());
detailDO.setStdPackQty(itempackaging.getStdPackQty());
}catch (Exception ex) {
isError = true;
message += ex.getMessage() + ",";
}
if(isError){
InventoryinitRequestMainImportErrorVO importVO = InventoryinitRequestDetailConvert.INSTANCE.convert(createReqVO,detailDO);
importVO.setImportStatus("失败");
importVO.setImportRemark(message.substring(0, message.length() - 1));
errorList.add(importVO);
}else{
if(mode != 3) {
createReqVO.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增"));
String number = serialNumberApi.generateCode(RuleCodeEnum.PURCHASE_CLAIM_RECORD.getCode());
createReqVO.setNumber(number);
detailDO.setNumber(createReqVO.getNumber());
detailDO.setMasterId(createReqVO.getId());
InventoryinitRequestMainDO createObj = InventoryinitRequestMainConvert.INSTANCE.convert(createReqVO);
inventoryinitRequestMainMapper.insert(createObj);
inventoryinitRequestDetailMapper.insertBatch(subDOList);
}
else if( mode != 2){
createReqVO.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增"));
String number = serialNumberApi.generateCode(RuleCodeEnum.PURCHASE_CLAIM_RECORD.getCode());
createReqVO.setNumber(number);
detailDO.setNumber(createReqVO.getNumber());
detailDO.setMasterId(createReqVO.getId());
InventoryinitRequestMainDO createObj = InventoryinitRequestMainConvert.INSTANCE.convert(createReqVO);
inventoryinitRequestMainMapper.updateById(createObj);
inventoryinitRequestDetailMapper.updateBatch(subDOList);
} }
} }
//写入数据
if (flag) {
String number = serialNumberApi.generateCode(RuleCodeEnum.PURCHASE_RECEIPT_REQUEST.getCode());
mainDO.setNumber(number);
mainDO.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增"));
inventoryinitRequestMainMapper.insert(mainDO);
trendsApi.createTrends(mainDO.getId(), "inventoryinitRequestMain", "导入了采购收货申请", TrendsTypeEnum.CREATE);
for (InventoryinitRequestDetailDO detailDO : subDOList) {
detailDO.setMasterId(mainDO.getId());
detailDO.setNumber(number);
}
inventoryinitRequestDetailMapper.insertBatch(subDOList);
} }
}); });
//错误不为空并非部分更新,手工回滚
if(!errorList.isEmpty() && !updatePart) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return errorList; return errorList;
} }

86
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inventorymoveRequest/InventorymoveRequestDetailServiceImpl.java

@ -1,14 +1,29 @@
package com.win.module.wms.service.inventorymoveRequest; package com.win.module.wms.service.inventorymoveRequest;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.wms.controller.inventorymoveRequest.vo.InventorymoveRequestDetailCreateReqVO; import com.win.module.infra.api.trends.TrendsApi;
import com.win.module.wms.controller.inventorymoveRequest.vo.InventorymoveRequestDetailExportReqVO; import com.win.module.infra.enums.TrendsTypeEnum;
import com.win.module.wms.controller.inventorymoveRequest.vo.InventorymoveRequestDetailPageReqVO; import com.win.module.system.api.serialnumber.SerialNumberApi;
import com.win.module.wms.controller.inventorymoveRequest.vo.InventorymoveRequestDetailUpdateReqVO; import com.win.module.system.enums.serialNumber.RuleCodeEnum;
import com.win.module.wms.controller.inventorymoveRequest.vo.*;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainBaseVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainCreateReqVO;
import com.win.module.wms.convert.productputawayRequest.ProductputawayRequestMainConvert;
import com.win.module.wms.dal.dataobject.balance.BalanceDO;
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestMainDO;
import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO;
import com.win.module.wms.enums.request.RequestStatusEnum;
import com.win.module.wms.service.itembasic.ItembasicService;
import com.win.module.wms.service.requestsetting.RequestsettingService;
import com.win.module.wms.util.JobUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestDetailDO; import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestDetailDO;
@ -32,15 +47,70 @@ public class InventorymoveRequestDetailServiceImpl implements InventorymoveReque
@Resource @Resource
private InventorymoveRequestDetailMapper inventorymoveRequestDetailMapper; private InventorymoveRequestDetailMapper inventorymoveRequestDetailMapper;
@Resource
private TrendsApi trendsApi;
@Override @Override
public Long createInventorymoveRequestDetail(InventorymoveRequestDetailCreateReqVO createReqVO) { public Long createInventorymoveRequestDetail(InventorymoveRequestDetailCreateReqVO createReqVO) {
// 插入 RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("MoveRequest");
InventorymoveRequestDetailDO inventorymoveRequestDetail = InventorymoveRequestDetailConvert.INSTANCE.convert(createReqVO); InventorymoveRequestDetailDO inventorymoveRequestDetail = validatorToCreate(createReqVO,requestsettingDO);
inventorymoveRequestDetailMapper.insert(inventorymoveRequestDetail); //调用自动执行方法
// 返回 trendsApi.createTrends(requestsettingDO.getId(), "MoveRequest", "增加了库存转移申请", TrendsTypeEnum.CREATE);
return inventorymoveRequestDetail.getId(); return inventorymoveRequestDetail.getId();
} }
@Resource
private ItembasicService itembasicService;
@Resource
private JobUtils jobUtils;
@Resource
private SerialNumberApi serialNumberApi;
@Resource
private RequestsettingService requestsettingService;
private ItembasicDO validteitem(InventorymoveRequestDetailDO detailDo) {
ItembasicDO itembasicDO = itembasicService.selectItembasic(detailDo.getItemCode());
return itembasicDO;
}
private InventorymoveRequestDetailDO validatorToCreate(InventorymoveRequestDetailCreateReqVO createReqVO, RequestsettingDO requestsettingDO) {
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("MoveRequest");
InventorymoveRequestDetailDO inventorymoveRequestDetailDO = validateDetailMethod(createReqVO,businesstypeDO);
String number = serialNumberApi.generateCode(RuleCodeEnum.INVENTORY_MOVE_REQUEST.getCode());
inventorymoveRequestDetailDO.setNumber(number);
inventorymoveRequestDetailDO.setMasterId(createReqVO.getMasterId());
inventorymoveRequestDetailMapper.insert(inventorymoveRequestDetailDO);
return inventorymoveRequestDetailDO;
}
private InventorymoveRequestDetailDO validateDetailMethod(InventorymoveRequestDetailBaseVO baseVO, BusinesstypeDO businesstypeDO ) {
InventorymoveRequestDetailDO inventorymoveRequestDetailDO = InventorymoveRequestDetailConvert.INSTANCE.convert(baseVO);
inventorymoveRequestDetailDO.setCreateTime(LocalDateTime.now());
ItembasicDO itembasic = validteitem(inventorymoveRequestDetailDO);
inventorymoveRequestDetailDO.setItemDesc1(itembasic.getDesc1());
inventorymoveRequestDetailDO.setItemDesc2(itembasic.getDesc2());
inventorymoveRequestDetailDO.setItemName(itembasic.getName());
inventorymoveRequestDetailDO.setProjectCode(itembasic.getProject());
inventorymoveRequestDetailDO.setUom(itembasic.getUom());
jobUtils.ifInToLocationType(inventorymoveRequestDetailDO.getFromLocationCode(), businesstypeDO);
jobUtils.ifOutInventoryStatuses(inventorymoveRequestDetailDO.getFromInventoryStatus(), businesstypeDO);
validtebalance(inventorymoveRequestDetailDO);
return inventorymoveRequestDetailDO;
}
private void validtebalance(InventorymoveRequestDetailDO detailDo) {
List<String> inventoryStatus = new ArrayList<>();
inventoryStatus.add(detailDo.getFromInventoryStatus());
List<BalanceDO> balanceDOList = jobUtils.selectlocationReturnManagementAccuracy(detailDo.getItemCode(), detailDo.getFromPackingNumber()
, detailDo.getFromBatch(), detailDo.getFromLocationCode(), inventoryStatus);
}
@Override @Override
public void updateInventorymoveRequestDetail(InventorymoveRequestDetailUpdateReqVO updateReqVO) { public void updateInventorymoveRequestDetail(InventorymoveRequestDetailUpdateReqVO updateReqVO) {
// 校验存在 // 校验存在

327
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inventorymoveRequest/InventorymoveRequestMainServiceImpl.java

@ -1,39 +1,52 @@
package com.win.module.wms.service.inventorymoveRequest; package com.win.module.wms.service.inventorymoveRequest;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.util.validation.ValidationUtils;
import com.win.framework.dict.core.util.DictFrameworkUtils; import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.module.infra.api.trends.TrendsApi;
import com.win.module.infra.enums.TrendsTypeEnum;
import com.win.module.system.api.dict.DictDataApi;
import com.win.module.system.api.dict.dto.DictDataRespDTO;
import com.win.module.system.api.serialnumber.SerialNumberApi;
import com.win.module.system.enums.serialNumber.RuleCodeEnum;
import com.win.module.wms.controller.inventorymoveRequest.vo.*; import com.win.module.wms.controller.inventorymoveRequest.vo.*;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestDetailUpdateReqVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainBaseVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainCreateReqVO;
import com.win.module.wms.controller.productputawayRequest.vo.ProductputawayRequestMainUpdateReqVO;
import com.win.module.wms.convert.inventorymoveRequest.InventorymoveRequestDetailConvert; import com.win.module.wms.convert.inventorymoveRequest.InventorymoveRequestDetailConvert;
import com.win.module.wms.convert.inventorymoveRequest.InventorymoveRequestMainConvert; import com.win.module.wms.convert.inventorymoveRequest.InventorymoveRequestMainConvert;
import com.win.module.wms.convert.productputawayRequest.ProductputawayRequestDetailConvert;
import com.win.module.wms.convert.productputawayRequest.ProductputawayRequestMainConvert;
import com.win.module.wms.dal.dataobject.balance.BalanceDO; import com.win.module.wms.dal.dataobject.balance.BalanceDO;
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO; import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestDetailDO; import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestDetailDO;
import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO; import com.win.module.wms.dal.dataobject.inventorymoveRequest.InventorymoveRequestMainDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.location.LocationDO; import com.win.module.wms.dal.dataobject.location.LocationDO;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestDetailDO;
import com.win.module.wms.dal.dataobject.productputawayRequest.ProductputawayRequestMainDO;
import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO;
import com.win.module.wms.dal.mysql.inventorymoveRequest.InventorymoveRequestDetailMapper; import com.win.module.wms.dal.mysql.inventorymoveRequest.InventorymoveRequestDetailMapper;
import com.win.module.wms.dal.mysql.inventorymoveRequest.InventorymoveRequestMainMapper; import com.win.module.wms.dal.mysql.inventorymoveRequest.InventorymoveRequestMainMapper;
import com.win.module.wms.enums.DictTypeConstants; import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.enums.request.RequestStatusEnum;
import com.win.module.wms.service.itembasic.ItembasicService; import com.win.module.wms.service.itembasic.ItembasicService;
import com.win.module.wms.service.itempackaging.ItempackagingService;
import com.win.module.wms.service.location.LocationService; import com.win.module.wms.service.location.LocationService;
import com.win.module.wms.service.shift.ShiftService; import com.win.module.wms.service.requestsetting.RequestsettingService;
import com.win.module.wms.util.JobUtils; import com.win.module.wms.util.JobUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Validator;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.win.module.wms.enums.ErrorCodeConstants.INVENTORYMOVE_REQUEST_MAIN_NOT_EXISTS; import static com.win.module.wms.enums.ErrorCodeConstants.*;
import static com.win.module.wms.enums.ErrorCodeConstants.PURCHASECLAIM_REQUEST_IMPORT_LIST_IS_EMPTY;
/** /**
* 库存转移申请主 Service 实现类 * 库存转移申请主 Service 实现类
@ -49,35 +62,116 @@ public class InventorymoveRequestMainServiceImpl implements InventorymoveRequest
@Resource @Resource
private InventorymoveRequestDetailMapper inventorymoveRequestDetailMapper; private InventorymoveRequestDetailMapper inventorymoveRequestDetailMapper;
@Resource
private Validator validator;
@Resource @Resource
private ItembasicService itembasicService; private ItembasicService itembasicService;
@Resource @Resource
private ItempackagingService itempackagingService; private SerialNumberApi serialNumberApi;
@Resource @Resource
private ShiftService shiftService; private RequestsettingService requestsettingService;
@Resource @Resource
private JobUtils jobUtils; private JobUtils jobUtils;
@Resource @Resource
private LocationService locationService; private LocationService locationService;
@Resource
private TrendsApi trendsApi;
@Override @Override
public Long createInventorymoveRequestMain(InventorymoveRequestMainCreateReqVO createReqVO) { public Long createInventorymoveRequestMain(InventorymoveRequestMainCreateReqVO createReqVO) {
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("MoveRequest");
// 插入 // 插入
InventorymoveRequestMainDO inventorymoveRequestMain = InventorymoveRequestMainConvert.INSTANCE.convert(createReqVO); InventorymoveRequestMainDO inventorymoveRequestMain = validatorToCreate(createReqVO,requestsettingDO);
inventorymoveRequestMainMapper.insert(inventorymoveRequestMain); if(RequestStatusEnum.HANDLING.getCode().equals(inventorymoveRequestMain.getStatus())) {
// 返回
}
trendsApi.createTrends(requestsettingDO.getId(), "MoveRequest", "增加了库存移动申请", TrendsTypeEnum.CREATE);
return inventorymoveRequestMain.getId(); return inventorymoveRequestMain.getId();
} }
private InventorymoveRequestMainDO validatorToCreate(InventorymoveRequestMainCreateReqVO createReqVO, RequestsettingDO requestsettingDO) {
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("MoveRequest");
InventorymoveRequestMainDO inventorymoveRequestMainDO = validateMainMethod(createReqVO,businesstypeDO,requestsettingDO);
List<InventorymoveRequestDetailCreateReqVO> subList = createReqVO.getSubList();
List<InventorymoveRequestDetailDO> subDOList = InventorymoveRequestDetailConvert.INSTANCE.convertList03(subList);
for(InventorymoveRequestDetailDO inventorymoveRequestDetailDO: subDOList){
validateDetailMethod(inventorymoveRequestDetailDO,businesstypeDO,inventorymoveRequestMainDO);
}
String number = serialNumberApi.generateCode(RuleCodeEnum.INVENTORY_MOVE_REQUEST.getCode());
inventorymoveRequestMainDO.setNumber(number);
inventorymoveRequestMainMapper.insert(inventorymoveRequestMainDO);
for( InventorymoveRequestDetailDO inventorymoveRequestDetailDO : subDOList){
inventorymoveRequestDetailDO.setMasterId(inventorymoveRequestMainDO.getId());
inventorymoveRequestDetailDO.setNumber(inventorymoveRequestMainDO.getNumber());
}
inventorymoveRequestDetailMapper.insertBatch(subDOList);
return inventorymoveRequestMainDO;
}
private void validateDetailMethod(InventorymoveRequestDetailDO inventorymoveRequestDetailDO, BusinesstypeDO businesstypeDO, InventorymoveRequestMainDO productputawayRequestMainDO) {
inventorymoveRequestDetailDO.setCreateTime(LocalDateTime.now());
ItembasicDO itembasic = validteitem(inventorymoveRequestDetailDO);
inventorymoveRequestDetailDO.setItemDesc1(itembasic.getDesc1());
inventorymoveRequestDetailDO.setItemDesc2(itembasic.getDesc2());
inventorymoveRequestDetailDO.setItemName(itembasic.getName());
inventorymoveRequestDetailDO.setProjectCode(itembasic.getProject());
inventorymoveRequestDetailDO.setUom(itembasic.getUom());
jobUtils.ifInToLocationType(inventorymoveRequestDetailDO.getFromLocationCode(), businesstypeDO);
jobUtils.ifOutInventoryStatuses(inventorymoveRequestDetailDO.getFromInventoryStatus(), businesstypeDO);
validtebalance(inventorymoveRequestDetailDO);
}
private InventorymoveRequestMainDO validateMainMethod(InventorymoveRequestMainBaseVO baseVO, BusinesstypeDO businesstypeDO, RequestsettingDO requestsettingDO){
InventorymoveRequestMainDO inventorymoveRequestMainDO = InventorymoveRequestMainConvert.INSTANCE.convert(baseVO);
inventorymoveRequestMainDO.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增"));
inventorymoveRequestMainDO.setCreateTime(LocalDateTime.now());
inventorymoveRequestMainDO.setAutoAgree(requestsettingDO.getAutoAgree());
inventorymoveRequestMainDO.setAutoCommit(requestsettingDO.getAutoCommit());
inventorymoveRequestMainDO.setAutoExecute(requestsettingDO.getAutoExecute());
inventorymoveRequestMainDO.setDirectCreateRecord(requestsettingDO.getDirectCreateRecord());
inventorymoveRequestMainDO.setBusinessType(businesstypeDO.getCode());
inventorymoveRequestMainDO.setFromLocationTypes(businesstypeDO.getOutLocationTypes());
inventorymoveRequestMainDO.setToLocationTypes(businesstypeDO.getInLocationTypes());
inventorymoveRequestMainDO.setFromAreaCodes(businesstypeDO.getOutAreaCodes());
inventorymoveRequestMainDO.setToAreaCodes(businesstypeDO.getInAreaCodes());
return inventorymoveRequestMainDO;
}
@Override @Override
public void updateInventorymoveRequestMain(InventorymoveRequestMainUpdateReqVO updateReqVO) { public void updateInventorymoveRequestMain(InventorymoveRequestMainUpdateReqVO updateReqVO) {
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("MoveRequest");
// 校验存在 // 校验存在
validateInventorymoveRequestMainExists(updateReqVO.getId()); validateInventorymoveRequestMainExists(updateReqVO.getId());
// 更新 // 更新
InventorymoveRequestMainDO updateObj = InventorymoveRequestMainConvert.INSTANCE.convert(updateReqVO); InventorymoveRequestMainDO inventorymoveRequestMainDO = validatorToUpdate(updateReqVO, requestsettingDO);
inventorymoveRequestMainMapper.updateById(updateObj);
if(RequestStatusEnum.HANDLING.getCode().equals(inventorymoveRequestMainDO.getStatus())) {
}
trendsApi.createTrends(requestsettingDO.getId(), "MoveRequest", "增加了库存移动申请", TrendsTypeEnum.CREATE);
}
private InventorymoveRequestMainDO validatorToUpdate(InventorymoveRequestMainUpdateReqVO updateReqVO, RequestsettingDO requestsettingDO) {
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("MoveRequest");
InventorymoveRequestMainDO inventorymoveRequestMainDO = validateMainMethod(updateReqVO,businesstypeDO,requestsettingDO);
//子表校验
List<InventorymoveRequestDetailUpdateReqVO> subList = updateReqVO.getSubList();
if(!subList.isEmpty()) {
List<InventorymoveRequestDetailDO> subDOList = InventorymoveRequestDetailConvert.INSTANCE.convertList05(subList);
for (InventorymoveRequestDetailDO inventorymoveRequestDetailDO : subDOList) {
validateDetailMethod(inventorymoveRequestDetailDO, businesstypeDO, inventorymoveRequestMainDO);
}
inventorymoveRequestDetailMapper.updateBatch(subDOList);
}
inventorymoveRequestMainMapper.updateById(inventorymoveRequestMainDO);
return inventorymoveRequestMainDO;
} }
@Override @Override
public void deleteInventorymoveRequestMain(Long id) { public void deleteInventorymoveRequestMain(Long id) {
// 校验存在 // 校验存在
@ -92,6 +186,9 @@ public class InventorymoveRequestMainServiceImpl implements InventorymoveRequest
} }
} }
@Resource
private DictDataApi dictDataApi;
@Override @Override
public InventorymoveRequestMainDO getInventorymoveRequestMain(Long id) { public InventorymoveRequestMainDO getInventorymoveRequestMain(Long id) {
return inventorymoveRequestMainMapper.selectById(id); return inventorymoveRequestMainMapper.selectById(id);
@ -117,6 +214,97 @@ public class InventorymoveRequestMainServiceImpl implements InventorymoveRequest
return inventorymoveRequestMainMapper.selectList(exportReqVO); return inventorymoveRequestMainMapper.selectList(exportReqVO);
} }
private String validateInventorymoveRequestMainImport(InventorymoveRequestMainDO mainDo, BusinesstypeDO businesstypeDO) {
StringBuilder message = new StringBuilder();
mainDo.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增"));
mainDo.setCreateTime(LocalDateTime.now());
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("MoveRequest");
if (requestsettingDO == null) {
message.append("未查找到制品上架申请的相关申请设置");
} else {
mainDo.setAutoAgree(requestsettingDO.getAutoAgree());
mainDo.setAutoCommit(requestsettingDO.getAutoCommit());
mainDo.setAutoExecute(requestsettingDO.getAutoExecute());
mainDo.setDirectCreateRecord(requestsettingDO.getDirectCreateRecord());
}
if (businesstypeDO == null) {
message.append("根据单据设置未查找到制品上架申请的相关业务类型");
} else {
mainDo.setBusinessType(businesstypeDO.getCode());
mainDo.setFromLocationTypes(businesstypeDO.getOutLocationTypes());
mainDo.setToLocationTypes(businesstypeDO.getInLocationTypes());
mainDo.setFromAreaCodes(businesstypeDO.getOutAreaCodes());
mainDo.setToAreaCodes(businesstypeDO.getInAreaCodes());
}
try {
ValidationUtils.validate(validator, mainDo);
} catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
return message.toString();
}
private InventorymoveRequestDetailDO validatelocation(InventorymoveRequestDetailDO detailDo){
LocationDO locationDO = locationService.selectLocation(detailDo.getFromLocationCode());
if (locationDO != null) {
detailDo.setFromLocationCode(locationDO.getCode());
}
return detailDo;
}
private ItembasicDO validteitem(InventorymoveRequestDetailDO detailDo) {
ItembasicDO itembasicDO = itembasicService.selectItembasic(detailDo.getItemCode());
return itembasicDO;
}
private void validtebalance(InventorymoveRequestDetailDO detailDo){
List<String> inventoryStatus = new ArrayList<>();
inventoryStatus.add(detailDo.getFromInventoryStatus());
List<BalanceDO> balanceDOList = jobUtils.selectlocationReturnManagementAccuracy(detailDo.getItemCode(), detailDo.getFromPackingNumber()
, detailDo.getFromBatch(), detailDo.getFromLocationCode(), inventoryStatus);
}
private String validateInventorymoveRequestDetailImport(InventorymoveRequestDetailDO detailDo, InventorymoveRequestMainDO mainDo, BusinesstypeDO businesstypeDO) {
StringBuilder message = new StringBuilder();
// 校验,判断是否有不符合的原因,并加入errorList,同主表,只把有错误的子表加入errorList
try{
detailDo.setCreateTime(LocalDateTime.now());
detailDo = validatelocation(detailDo);
}catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
try{
ItembasicDO itembasic = validteitem(detailDo);
detailDo.setItemDesc1(itembasic.getDesc1());
detailDo.setItemDesc2(itembasic.getDesc2());
detailDo.setItemName(itembasic.getName());
detailDo.setProjectCode(itembasic.getProject());
detailDo.setUom(itembasic.getUom());
}catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
try{
jobUtils.ifInToLocationType(detailDo.getFromLocationCode(), businesstypeDO);
}catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
try{
jobUtils.ifOutInventoryStatuses(detailDo.getFromInventoryStatus(), businesstypeDO);
}catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
try{
validtebalance(detailDo);
}catch (Exception ex) {
message.append(ex.getMessage()).append(",");
}
return message.toString();
}
@Override @Override
public List<InventorymoveRequestMainImportErrorVO> importInventorymoveRequestMainList(List<InventorymoveRequestMainCreateReqVO> datas, Integer mode, boolean updatePart) { public List<InventorymoveRequestMainImportErrorVO> importInventorymoveRequestMainList(List<InventorymoveRequestMainCreateReqVO> datas, Integer mode, boolean updatePart) {
if (CollUtil.isEmpty(datas)) { if (CollUtil.isEmpty(datas)) {
@ -124,105 +312,40 @@ public class InventorymoveRequestMainServiceImpl implements InventorymoveRequest
} }
List<InventorymoveRequestMainImportErrorVO> errorList = new ArrayList<>(); List<InventorymoveRequestMainImportErrorVO> errorList = new ArrayList<>();
datas.forEach(createReqVO -> { datas.forEach(createReqVO -> {
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("MoveRequest");
// 校验,判断是否有不符合的原因,并加入errorList,如果主表则所有子表都加入errorList // 校验,判断是否有不符合的原因,并加入errorList,如果主表则所有子表都加入errorList
String messageMain = "";
//主表的验证 //主表的验证
InventorymoveRequestMainDO mainDo = InventorymoveRequestMainConvert.INSTANCE.convert(createReqVO);
String messageMain = validateInventorymoveRequestMainImport(mainDo, businesstypeDO);
//校验供应商送货策略
// try {
// RuleRespVO ruleRespVO = ruleService.deliverGoods(null, createReqVO.getSupplierCode(), null);
// String json = ruleRespVO.getConfiguration();
// } catch (ServiceException ex) {
// importRemark += ex.getMessage() + ",";
// }
//子表的验证 //子表的验证
List<InventorymoveRequestDetailCreateReqVO> subList = createReqVO.getSubList(); List<InventorymoveRequestDetailCreateReqVO> subList = createReqVO.getSubList();
List<InventorymoveRequestDetailDO> subDOList = InventorymoveRequestDetailConvert.INSTANCE.convertList03(subList); List<InventorymoveRequestDetailDO> subDOList = InventorymoveRequestDetailConvert.INSTANCE.convertList03(subList);
boolean flag = true;
for (InventorymoveRequestDetailDO purchaseDetailDO : subDOList) { for (InventorymoveRequestDetailDO purchaseDetailDO : subDOList) {
String messageDetail = ""; String messageDetail = validateInventorymoveRequestDetailImport(purchaseDetailDO, mainDo, businesstypeDO);
//校验来源/目标库位基础信息 //校验来源/目标库位基础信息
try { if (!"".equals(messageMain) ||!"".equals(messageDetail) ) {
LocationDO locationDO = locationService.selectLocation(createReqVO.getFromWarehouseOde()); InventorymoveRequestMainImportErrorVO importErrorVO = InventorymoveRequestMainConvert.INSTANCE.convert(createReqVO, purchaseDetailDO);
if (locationDO != null) { importErrorVO.setImportStatus("失败");
purchaseDetailDO.setFromLocationCode(locationDO.getCode());
// purchaseDetailDO.setArea_code(purchaseDetailDO.getAreaCode());
// purchaseDetailDO.setLocation_group_code(purchaseDetailDO.getAreaCode());
}
} catch (ServiceException ex) {
messageMain += ex.getMessage() + ",";
}
// 校验物品基础信息
try {
ItembasicDO itembasicDO = itembasicService.selectItembasic(purchaseDetailDO.getItemCode());
if (itembasicDO.getUom() != purchaseDetailDO.getUom()) {
messageDetail += "计量单位" + itembasicDO.getUom() + "错误,应该是" + purchaseDetailDO.getUom() + ",";
} else {
purchaseDetailDO.setItemDesc1(itembasicDO.getDesc1());
purchaseDetailDO.setItemDesc2(itembasicDO.getDesc2());
purchaseDetailDO.setItemName(itembasicDO.getName());
purchaseDetailDO.setProjectCode(itembasicDO.getProject());
}
purchaseDetailDO.setProjectCode(itembasicDO.getCode());
} catch (ServiceException ex) {
messageDetail += ex.getMessage() + ",";
}
// 校验业务类型
try {
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("MoveRequest");
jobUtils.ifInToLocationType(purchaseDetailDO.getFromLocationCode(), businesstypeDO);
jobUtils.ifOutInventoryStatuses(purchaseDetailDO.getFromInventoryStatus(), businesstypeDO);
} catch (ServiceException ex) {
messageDetail += ex.getMessage() + ",";
}
// 校验业务类型
try {
List<String> inventoryStatus = new ArrayList<>();
inventoryStatus.add(purchaseDetailDO.getFromInventoryStatus());
List<BalanceDO> balanceDOList = jobUtils.selectlocationReturnManagementAccuracy(purchaseDetailDO.getItemCode(), purchaseDetailDO.getFromPackingNumber()
, purchaseDetailDO.getFromBatch(), purchaseDetailDO.getFromLocationCode(), inventoryStatus);
if (balanceDOList != null) {
BalanceDO balanceDO = balanceDOList.get(0);
// purchaseDetailDO.setArriveDate( balanceDO.getArriveDate() );
// purchaseDetailDO.setProduceDate( balanceDO.getProduceDate() );
// purchaseDetailDO.setExpireDate( balanceDO.getExpireDate() );
}
} catch (ServiceException ex) {
messageDetail += ex.getMessage() + ",";
}
InventorymoveRequestDetailCreateReqVO purchaseDetailCreateReqVO = InventorymoveRequestDetailConvert.INSTANCE.convert1(purchaseDetailDO);
InventorymoveRequestMainImportErrorVO importVO = InventorymoveRequestDetailConvert.INSTANCE.convert(createReqVO, purchaseDetailCreateReqVO);
//进行子表的错误统计
//主表没有错误 写入库里
if (!messageMain.equals("") || !messageDetail.equals("")) {
importVO.setImportStatus("失败");
messageMain = messageMain + messageDetail; messageMain = messageMain + messageDetail;
importVO.setImportRemark(messageMain.substring(0, messageMain.length() - 1)); importErrorVO.setImportRemark(messageMain.substring(0, messageMain.length() - 1));
errorList.add(importVO); errorList.add(importErrorVO);
} else { flag = false;
purchaseDetailDO.setNumber(createReqVO.getNumber());
purchaseDetailDO.setMasterId(createReqVO.getId());
} }
} }
//写入数据
if (errorList.isEmpty()) { if (flag) {
// 判断如果不存在,在进行插入 String number = serialNumberApi.generateCode(RuleCodeEnum.INVENTORY_CHANGE_REQUEST.getCode());
if (mode != 3) { mainDo.setNumber(number);
createReqVO.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增")); mainDo.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增"));
inventorymoveRequestDetailMapper.insertBatch(subDOList); inventorymoveRequestMainMapper.insert(mainDo);
} else if (mode != 2) { for (InventorymoveRequestDetailDO detailDO : subDOList) {
createReqVO.setStatus(DictFrameworkUtils.parseDictDataValue(DictTypeConstants.REQUEST_STATUS, "新增")); detailDO.setMasterId(mainDo.getId());
inventorymoveRequestDetailMapper.updateBatch(subDOList); detailDO.setNumber(number);
} }
inventorymoveRequestDetailMapper.insertBatch(subDOList);
} }
}); });
//错误不为空并非部分更新,手工回滚
if (!errorList.isEmpty() && !updatePart) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return errorList; return errorList;
} }

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/paramsetting/ParamsettingService.java

@ -49,10 +49,10 @@ public interface ParamsettingService {
/** /**
* 获得参数设置列表 * 获得参数设置列表
* *
* @param ids 编号 * @param conditions 编号
* @return 参数设置列表 * @return 参数设置列表
*/ */
List<ParamsettingDO> getParamsettingList(Collection<Long> ids); List<ParamsettingDO> getParamsettingList(CustomConditions conditions);
/** /**
* 获得参数设置分页 * 获得参数设置分页

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/paramsetting/ParamsettingServiceImpl.java

@ -70,8 +70,8 @@ public class ParamsettingServiceImpl implements ParamsettingService {
} }
@Override @Override
public List<ParamsettingDO> getParamsettingList(Collection<Long> ids) { public List<ParamsettingDO> getParamsettingList(CustomConditions conditions) {
return paramsettingMapper.selectBatchIds(ids); return paramsettingMapper.selectSeniorList(conditions);
} }
@Override @Override

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productputawayRequest/ProductputawayRequestMainServiceImpl.java

@ -182,7 +182,7 @@ public class ProductputawayRequestMainServiceImpl implements ProductputawayReque
if(RequestStatusEnum.HANDLING.getCode().equals(productputawayRequestMainDO.getStatus())) { if(RequestStatusEnum.HANDLING.getCode().equals(productputawayRequestMainDO.getStatus())) {
} }
trendsApi.createTrends(requestsettingDO.getId(), "IssueRequest", "增加了发料申请", TrendsTypeEnum.CREATE); trendsApi.createTrends(requestsettingDO.getId(), "ProductPutawayRequest", "增加了上架申请", TrendsTypeEnum.CREATE);
} }
private ProductputawayRequestMainDO validatorToUpdate(ProductputawayRequestMainUpdateReqVO updateReqVO, RequestsettingDO requestsettingDO) { private ProductputawayRequestMainDO validatorToUpdate(ProductputawayRequestMainUpdateReqVO updateReqVO, RequestsettingDO requestsettingDO) {

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptJob/PurchasereceiptJobMainService.java

@ -106,6 +106,6 @@ public interface PurchasereceiptJobMainService {
* @param purchasereceiptJobMainUpdateReqVO * @param purchasereceiptJobMainUpdateReqVO
* @return * @return
*/ */
Integer excutePurchasereceiptJobMain(PurchasereceiptJobMainUpdateReqVO purchasereceiptJobMainUpdateReqVO); Integer executePurchasereceiptJobMain(PurchasereceiptJobMainUpdateReqVO purchasereceiptJobMainUpdateReqVO);
} }

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptJob/PurchasereceiptJobMainServiceImpl.java

@ -201,7 +201,7 @@ public class PurchasereceiptJobMainServiceImpl implements PurchasereceiptJobMain
@Override @Override
@Transactional @Transactional
public Integer excutePurchasereceiptJobMain(PurchasereceiptJobMainUpdateReqVO purchasereceiptJobMainUpdateReqVO) { public Integer executePurchasereceiptJobMain(PurchasereceiptJobMainUpdateReqVO purchasereceiptJobMainUpdateReqVO) {
//查询数据 //查询数据
PurchasereceiptJobMainDO purchasereceiptJobMainDO = this.validatePurchasereceiptJobMainExists(purchasereceiptJobMainUpdateReqVO.getId()); PurchasereceiptJobMainDO purchasereceiptJobMainDO = this.validatePurchasereceiptJobMainExists(purchasereceiptJobMainUpdateReqVO.getId());
List<PurchasereceiptJobDetailDO> subList = purchasereceiptJobDetailService.selectList(purchasereceiptJobMainDO.getId()); List<PurchasereceiptJobDetailDO> subList = purchasereceiptJobDetailService.selectList(purchasereceiptJobMainDO.getId());

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRequest/PurchasereceiptRequestMainServiceImpl.java

@ -154,7 +154,7 @@ public class PurchasereceiptRequestMainServiceImpl implements PurchasereceiptReq
public Integer updatePurchasereceiptRequestMain(PurchasereceiptRequestMainUpdateReqVO updateReqVO) { public Integer updatePurchasereceiptRequestMain(PurchasereceiptRequestMainUpdateReqVO updateReqVO) {
// 校验存在 // 校验存在
PurchasereceiptRequestMainDO existPurchasereceiptRequestMainDO = validatePurchasereceiptRequestMainExists(updateReqVO.getId()); PurchasereceiptRequestMainDO existPurchasereceiptRequestMainDO = validatePurchasereceiptRequestMainExists(updateReqVO.getId());
if(existPurchasereceiptRequestMainDO.getStatus().equals(RequestStatusEnum.NEW.getCode())) { if(!existPurchasereceiptRequestMainDO.getStatus().equals(RequestStatusEnum.NEW.getCode())) {
throw exception(PURCHASERECEIPT_REQUEST_STATUS_NOT_NEW); throw exception(PURCHASERECEIPT_REQUEST_STATUS_NOT_NEW);
} }
//增加操作记录 //增加操作记录
@ -378,7 +378,7 @@ public class PurchasereceiptRequestMainServiceImpl implements PurchasereceiptReq
// 校验存在 // 校验存在
PurchasereceiptRequestMainDO mainDO = validatePurchasereceiptRequestMainExists(id); PurchasereceiptRequestMainDO mainDO = validatePurchasereceiptRequestMainExists(id);
RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus()); RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus());
boolean flag = requestStatusState.reject(); boolean flag = requestStatusState.refused();
if(!flag) { if(!flag) {
throw new ServiceException(PURCHASERECEIPT_REQUEST_CANNOT_ABORT); throw new ServiceException(PURCHASERECEIPT_REQUEST_CANNOT_ABORT);
} }

63
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayJob/PutawayJobDetailService.java

@ -1,13 +1,12 @@
package com.win.module.wms.service.putawayJob; package com.win.module.wms.service.putawayJob;
import java.util.*;
import javax.validation.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailCreateReqVO; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailExportReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailExportReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailPageReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailPageReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailUpdateReqVO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO; import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import com.win.framework.common.pojo.PageResult;
import java.util.List;
/** /**
* 上架任务子 Service 接口 * 上架任务子 Service 接口
@ -17,13 +16,12 @@ import com.win.framework.common.pojo.PageResult;
public interface PutawayJobDetailService { public interface PutawayJobDetailService {
/** /**
* 创建上架任务子 * 获得上架任务子分页
* *
* @param createReqVO 创建信息 * @param pageReqVO 分页查询
* @return 编号 * @return 上架任务子分页
*/ */
Long createPutawayJobDetail(@Valid PutawayJobDetailCreateReqVO createReqVO); PageResult<PutawayJobDetailDO> getPutawayJobDetailPage(PutawayJobDetailPageReqVO pageReqVO);
/** /**
* 获得用高级搜索上架任务子分页列表 * 获得用高级搜索上架任务子分页列表
@ -33,44 +31,6 @@ public interface PutawayJobDetailService {
*/ */
PageResult<PutawayJobDetailDO> getPutawayJobDetailSenior(CustomConditions conditions); PageResult<PutawayJobDetailDO> getPutawayJobDetailSenior(CustomConditions conditions);
/**
* 更新上架任务子
*
* @param updateReqVO 更新信息
*/
void updatePutawayJobDetail(@Valid PutawayJobDetailUpdateReqVO updateReqVO);
/**
* 删除上架任务子
*
* @param id 编号
*/
void deletePutawayJobDetail(Long id);
/**
* 获得上架任务子
*
* @param id 编号
* @return 上架任务子
*/
PutawayJobDetailDO getPutawayJobDetail(Long id);
/**
* 获得上架任务子列表
*
* @param ids 编号
* @return 上架任务子列表
*/
List<PutawayJobDetailDO> getPutawayJobDetailList(Collection<Long> ids);
/**
* 获得上架任务子分页
*
* @param pageReqVO 分页查询
* @return 上架任务子分页
*/
PageResult<PutawayJobDetailDO> getPutawayJobDetailPage(PutawayJobDetailPageReqVO pageReqVO);
/** /**
* 获得上架任务子列表, 用于 Excel 导出 * 获得上架任务子列表, 用于 Excel 导出
* *
@ -79,4 +39,11 @@ public interface PutawayJobDetailService {
*/ */
List<PutawayJobDetailDO> getPutawayJobDetailList(PutawayJobDetailExportReqVO exportReqVO); List<PutawayJobDetailDO> getPutawayJobDetailList(PutawayJobDetailExportReqVO exportReqVO);
/**
* 根据主表id查询上架任务任务
* @param masterId
* @return
*/
List<PutawayJobDetailDO> selectList(Long masterId);
} }

65
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayJob/PutawayJobDetailServiceImpl.java

@ -1,24 +1,16 @@
package com.win.module.wms.service.putawayJob; package com.win.module.wms.service.putawayJob;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailCreateReqVO; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailExportReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailExportReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailPageReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailPageReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailUpdateReqVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO; import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.convert.putawayJob.PutawayJobDetailConvert;
import com.win.module.wms.dal.mysql.putawayJob.PutawayJobDetailMapper; import com.win.module.wms.dal.mysql.putawayJob.PutawayJobDetailMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; import javax.annotation.Resource;
import static com.win.module.wms.enums.ErrorCodeConstants.*; import java.util.List;
/** /**
* 上架任务子 Service 实现类 * 上架任务子 Service 实现类
@ -33,58 +25,23 @@ public class PutawayJobDetailServiceImpl implements PutawayJobDetailService {
private PutawayJobDetailMapper putawayJobDetailMapper; private PutawayJobDetailMapper putawayJobDetailMapper;
@Override @Override
public Long createPutawayJobDetail(PutawayJobDetailCreateReqVO createReqVO) { public PageResult<PutawayJobDetailDO> getPutawayJobDetailPage(PutawayJobDetailPageReqVO pageReqVO) {
// 插入 return putawayJobDetailMapper.selectPage(pageReqVO);
PutawayJobDetailDO putawayJobDetail = PutawayJobDetailConvert.INSTANCE.convert(createReqVO);
putawayJobDetailMapper.insert(putawayJobDetail);
// 返回
return putawayJobDetail.getId();
} }
@Override
public void updatePutawayJobDetail(PutawayJobDetailUpdateReqVO updateReqVO) {
// 校验存在
validatePutawayJobDetailExists(updateReqVO.getId());
// 更新
PutawayJobDetailDO updateObj = PutawayJobDetailConvert.INSTANCE.convert(updateReqVO);
putawayJobDetailMapper.updateById(updateObj);
}
@Override @Override
public PageResult<PutawayJobDetailDO> getPutawayJobDetailSenior(CustomConditions conditions) { public PageResult<PutawayJobDetailDO> getPutawayJobDetailSenior(CustomConditions conditions) {
return putawayJobDetailMapper.selectSenior(conditions); return putawayJobDetailMapper.selectSenior(conditions);
} }
@Override
public void deletePutawayJobDetail(Long id) {
// 校验存在
validatePutawayJobDetailExists(id);
// 删除
putawayJobDetailMapper.deleteById(id);
}
private void validatePutawayJobDetailExists(Long id) {
if (putawayJobDetailMapper.selectById(id) == null) {
throw exception(PUTAWAY_JOB_DETAIL_NOT_EXISTS);
}
}
@Override
public PutawayJobDetailDO getPutawayJobDetail(Long id) {
return putawayJobDetailMapper.selectById(id);
}
@Override @Override
public List<PutawayJobDetailDO> getPutawayJobDetailList(Collection<Long> ids) { public List<PutawayJobDetailDO> getPutawayJobDetailList(PutawayJobDetailExportReqVO exportReqVO) {
return putawayJobDetailMapper.selectBatchIds(ids); return putawayJobDetailMapper.selectList(exportReqVO);
}
@Override
public PageResult<PutawayJobDetailDO> getPutawayJobDetailPage(PutawayJobDetailPageReqVO pageReqVO) {
return putawayJobDetailMapper.selectPage(pageReqVO);
} }
@Override @Override
public List<PutawayJobDetailDO> getPutawayJobDetailList(PutawayJobDetailExportReqVO exportReqVO) { public List<PutawayJobDetailDO> selectList(Long masterId) {
return putawayJobDetailMapper.selectList(exportReqVO); return putawayJobDetailMapper.selectList(masterId);
} }
} }

71
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayJob/PutawayJobMainService.java

@ -1,17 +1,17 @@
package com.win.module.wms.service.putawayJob; package com.win.module.wms.service.putawayJob;
import java.util.*;
import javax.validation.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainCreateReqVO; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainExportReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainExportReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainPageReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainPageReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainUpdateReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainUpdateReqVO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO; import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import com.win.framework.common.pojo.PageResult;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/** /**
* 上架任务主 Service 接口 * 上架任务主 Service 接口
* *
@ -19,14 +19,6 @@ import org.springframework.lang.Nullable;
*/ */
public interface PutawayJobMainService { public interface PutawayJobMainService {
/**
* 创建上架任务主
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createPutawayJobMain(@Valid PutawayJobMainCreateReqVO createReqVO);
/** /**
* 获得用高级搜索户分页列表 * 获得用高级搜索户分页列表
* *
@ -35,20 +27,6 @@ public interface PutawayJobMainService {
*/ */
PageResult<PutawayJobMainDO> getPutawayJobMainSenior(CustomConditions conditions); PageResult<PutawayJobMainDO> getPutawayJobMainSenior(CustomConditions conditions);
/**
* 更新上架任务主
*
* @param updateReqVO 更新信息
*/
void updatePutawayJobMain(@Valid PutawayJobMainUpdateReqVO updateReqVO);
/**
* 删除上架任务主
*
* @param id 编号
*/
void deletePutawayJobMain(Long id);
/** /**
* 获得上架任务主 * 获得上架任务主
* *
@ -57,14 +35,6 @@ public interface PutawayJobMainService {
*/ */
PutawayJobMainDO getPutawayJobMain(Long id); PutawayJobMainDO getPutawayJobMain(Long id);
/**
* 获得上架任务主列表
*
* @param ids 编号
* @return 上架任务主列表
*/
List<PutawayJobMainDO> getPutawayJobMainList(Collection<Long> ids);
/** /**
* 获得上架任务主分页 * 获得上架任务主分页
* *
@ -80,6 +50,15 @@ public interface PutawayJobMainService {
* @return 上架任务主列表 * @return 上架任务主列表
*/ */
List<PutawayJobMainDO> getPutawayJobMainList(PutawayJobMainExportReqVO exportReqVO); List<PutawayJobMainDO> getPutawayJobMainList(PutawayJobMainExportReqVO exportReqVO);
/**
* 获得上架任务主列表, 用于 Excel 导出
*
* @param conditions 查询条件
* @return 上架任务主列表
*/
List<PutawayJobMainDO> getPutawayJobMainList(CustomConditions conditions);
/** /**
* 校验任务状态正确 * 校验任务状态正确
*@author chenfang *@author chenfang
@ -95,4 +74,26 @@ public interface PutawayJobMainService {
* @return * @return
*/ */
Map<String,Integer> getCountByStatus(@Nullable Collection<String> types); Map<String,Integer> getCountByStatus(@Nullable Collection<String> types);
/**
* 承接任务
* @param id
* @return
*/
Integer acceptPutawayJobMain(Long id);
/**
* 取消承接任务
* @param id
* @return
*/
Integer cancelAcceptPutawayJobMain(Long id);
/**
* 执行任务
* @param putawayJobMainUpdateReqVO
* @return
*/
Integer executePutawayJobMain(PutawayJobMainUpdateReqVO putawayJobMainUpdateReqVO);
} }

237
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayJob/PutawayJobMainServiceImpl.java

@ -1,24 +1,47 @@
package com.win.module.wms.service.putawayJob; package com.win.module.wms.service.putawayJob;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainCreateReqVO; import com.win.framework.common.pojo.PageResult;
import com.win.module.infra.api.trends.TrendsApi;
import com.win.module.infra.enums.TrendsTypeEnum;
import com.win.module.system.api.serialnumber.SerialNumberApi;
import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.system.enums.serialNumber.RuleCodeEnum;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobDetailUpdateReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainExportReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainExportReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainPageReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainPageReqVO;
import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainUpdateReqVO; import com.win.module.wms.controller.putawayJob.vo.PutawayJobMainUpdateReqVO;
import com.win.module.wms.controller.transaction.vo.TransactionCreateReqVO;
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import com.win.module.wms.dal.dataobject.transactiontype.TransactiontypeDO;
import com.win.module.wms.dal.mysql.putawayJob.PutawayJobMainMapper;
import com.win.module.wms.dal.mysql.putawayRecord.PutawayRecordDetailMapper;
import com.win.module.wms.dal.mysql.putawayRecord.PutawayRecordMainMapper;
import com.win.module.wms.dal.mysql.putawayRequest.PutawayRequestMainMapper;
import com.win.module.wms.enums.job.JobStatusEnum;
import com.win.module.wms.enums.job.JobStatusState;
import com.win.module.wms.enums.request.RequestStatusEnum;
import com.win.module.wms.service.expectin.ExpectinService;
import com.win.module.wms.service.transaction.TransactionService;
import com.win.module.wms.util.JobUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.convert.putawayJob.PutawayJobMainConvert;
import com.win.module.wms.dal.mysql.putawayJob.PutawayJobMainMapper;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.win.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static com.win.module.wms.enums.ErrorCodeConstants.*; import static com.win.module.wms.enums.ErrorCodeConstants.*;
/** /**
@ -32,52 +55,35 @@ public class PutawayJobMainServiceImpl implements PutawayJobMainService {
@Resource @Resource
private PutawayJobMainMapper putawayJobMainMapper; private PutawayJobMainMapper putawayJobMainMapper;
@Resource
private PutawayRecordMainMapper putawayRecordMainMapper;
@Resource
private PutawayRecordDetailMapper putawayRecordDetailMapper;
@Resource
private PutawayRequestMainMapper putawayRequestMainMapper;
@Resource
private AdminUserApi userApi;
@Resource
private TrendsApi trendsApi;
@Resource
private SerialNumberApi serialNumberApi;
@Resource
private JobUtils jobUtils;
@Resource
private TransactionService transactionService;
@Resource
private ExpectinService expectinService;
@Override
public Long createPutawayJobMain(PutawayJobMainCreateReqVO createReqVO) {
// 插入
PutawayJobMainDO putawayJobMain = PutawayJobMainConvert.INSTANCE.convert(createReqVO);
putawayJobMainMapper.insert(putawayJobMain);
// 返回
return putawayJobMain.getId();
}
@Override @Override
public PageResult<PutawayJobMainDO> getPutawayJobMainSenior(CustomConditions conditions) { public PageResult<PutawayJobMainDO> getPutawayJobMainSenior(CustomConditions conditions) {
return putawayJobMainMapper.selectSenior(conditions); return putawayJobMainMapper.selectSenior(conditions);
} }
@Override
public void updatePutawayJobMain(PutawayJobMainUpdateReqVO updateReqVO) {
// 校验存在
validatePutawayJobMainExists(updateReqVO.getId());
// 更新
PutawayJobMainDO updateObj = PutawayJobMainConvert.INSTANCE.convert(updateReqVO);
putawayJobMainMapper.updateById(updateObj);
}
@Override
public void deletePutawayJobMain(Long id) {
// 校验存在
validatePutawayJobMainExists(id);
// 删除
putawayJobMainMapper.deleteById(id);
}
private void validatePutawayJobMainExists(Long id) {
if (putawayJobMainMapper.selectById(id) == null) {
throw exception(PUTAWAY_JOB_MAIN_NOT_EXISTS);
}
}
@Override @Override
public PutawayJobMainDO getPutawayJobMain(Long id) { public PutawayJobMainDO getPutawayJobMain(Long id) {
return putawayJobMainMapper.selectById(id); return putawayJobMainMapper.selectById(id);
} }
@Override
public List<PutawayJobMainDO> getPutawayJobMainList(Collection<Long> ids) {
return putawayJobMainMapper.selectBatchIds(ids);
}
@Override @Override
public PageResult<PutawayJobMainDO> getPutawayJobMainPage(PutawayJobMainPageReqVO pageReqVO) { public PageResult<PutawayJobMainDO> getPutawayJobMainPage(PutawayJobMainPageReqVO pageReqVO) {
return putawayJobMainMapper.selectPage(pageReqVO); return putawayJobMainMapper.selectPage(pageReqVO);
@ -87,15 +93,21 @@ public class PutawayJobMainServiceImpl implements PutawayJobMainService {
public List<PutawayJobMainDO> getPutawayJobMainList(PutawayJobMainExportReqVO exportReqVO) { public List<PutawayJobMainDO> getPutawayJobMainList(PutawayJobMainExportReqVO exportReqVO) {
return putawayJobMainMapper.selectList(exportReqVO); return putawayJobMainMapper.selectList(exportReqVO);
} }
@Override
public List<PutawayJobMainDO> getPutawayJobMainList(CustomConditions conditions) {
return putawayJobMainMapper.selectList(conditions);
}
@Override @Override
public PutawayJobMainDO putawayJobMainDoStatusRight(String pnumber, String pstatus) { public PutawayJobMainDO putawayJobMainDoStatusRight(String pnumber, String pstatus) {
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper<PutawayJobMainDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("number",pnumber); queryWrapper.eq("number", pnumber);
queryWrapper.eq("status",pstatus); queryWrapper.eq("status", pstatus);
PutawayJobMainDO putawayJobMainDO = putawayJobMainMapper.selectOne(queryWrapper); PutawayJobMainDO putawayJobMainDO = putawayJobMainMapper.selectOne(queryWrapper);
if(putawayJobMainDO != null){ if (putawayJobMainDO != null) {
return putawayJobMainDO; return putawayJobMainDO;
}else { } else {
throw exception(CUSTOMERRETURN_JOB_MAIN_STATUS_ERROR); throw exception(CUSTOMERRETURN_JOB_MAIN_STATUS_ERROR);
} }
} }
@ -108,4 +120,133 @@ public class PutawayJobMainServiceImpl implements PutawayJobMainService {
map.put("count", l.intValue()); map.put("count", l.intValue());
return map; return map;
} }
@Override
@Transactional
public Integer acceptPutawayJobMain(Long id) {
PutawayJobMainDO putawayJobMainDO = this.validatePutawayJobMainExists(id);
JobStatusState jobStatusState = new JobStatusState(putawayJobMainDO.getStatus());
if(!jobStatusState.accept()) {
throw exception(PUTAWAY_JOB_MAIN_STATUS_ERROR);
}
Long userId = getLoginUserId();
AdminUserRespDTO userRespDTO = userApi.getUser(userId);
putawayJobMainDO.setStatus(jobStatusState.getState().getCode());
putawayJobMainDO.setAcceptUserId(String.valueOf(userId));
putawayJobMainDO.setAcceptUserName(userRespDTO.getNickname());
putawayJobMainDO.setAcceptTime(LocalDateTime.now());
trendsApi.createTrends(id, "putawayJob", "承接了上架任务", TrendsTypeEnum.UPDATE);
return putawayJobMainMapper.updateById(putawayJobMainDO);
}
@Override
@Transactional
public Integer cancelAcceptPutawayJobMain(Long id) {
PutawayJobMainDO putawayJobMainDO = this.validatePutawayJobMainExists(id);
JobStatusState jobStatusState = new JobStatusState(putawayJobMainDO.getStatus());
if(!jobStatusState.cancelAccept()) {
throw exception(PUTAWAY_JOB_MAIN_STATUS_ERROR);
}
putawayJobMainDO.setStatus(jobStatusState.getState().getCode());
putawayJobMainDO.setAcceptUserId(null);
putawayJobMainDO.setAcceptUserName(null);
putawayJobMainDO.setAcceptTime(null);
trendsApi.createTrends(id, "putawayJob", "取消了上架任务", TrendsTypeEnum.UPDATE);
return putawayJobMainMapper.updateById(putawayJobMainDO);
}
@Override
@Transactional
public Integer executePutawayJobMain(PutawayJobMainUpdateReqVO putawayJobMainUpdateReqVO) {
//查询数据
PutawayJobMainDO putawayJobMainDO = this.validatePutawayJobMainExists(putawayJobMainUpdateReqVO.getId());
JobStatusState jobStatusState = new JobStatusState(putawayJobMainDO.getStatus());
boolean flag = jobStatusState.execute();
if(!flag) {
throw new ServiceException(PUTAWAY_JOB_MAIN_STATUS_ERROR);
}
//更新完成信息
Long userId = getLoginUserId();
AdminUserRespDTO userRespDTO = userApi.getUser(userId);
putawayJobMainDO.setStatus(jobStatusState.getState().getCode());
putawayJobMainDO.setCompleteTime(LocalDateTime.now());
putawayJobMainDO.setCompleteUserId(String.valueOf(userRespDTO.getId()));
putawayJobMainDO.setCompleteUserName(userRespDTO.getNickname());
//更新任务表状态
int result = putawayJobMainMapper.updateById(putawayJobMainDO);
//创建采购收货记录主表
PutawayRecordMainDO putawayRecordMainDO = new PutawayRecordMainDO();
BeanUtils.copyProperties(putawayJobMainDO, putawayRecordMainDO);
String number = serialNumberApi.generateCode(RuleCodeEnum.PURCHASE_RECEIPT_RECORD.getCode());
putawayRecordMainDO.setNumber(number);
putawayRecordMainDO.setJobNumber(putawayJobMainDO.getNumber());
putawayRecordMainDO.setId(null);
putawayRecordMainDO.setCreator(null);
putawayRecordMainDO.setCreateTime(null);
putawayRecordMainDO.setUpdater(null);
putawayRecordMainDO.setUpdateTime(null);
putawayRecordMainMapper.insert(putawayRecordMainDO);
//库存事务
List<TransactionCreateReqVO> transactionCreateReqVOList = new ArrayList<>();
List<PutawayJobDetailUpdateReqVO> putawayJobDetailUpdateReqVOList = putawayJobMainUpdateReqVO.getSubList();
List<PutawayRecordDetailDO> putawayRecordDetailDOList = new ArrayList<>();
for(PutawayJobDetailUpdateReqVO putawayJobDetailUpdateReqVO : putawayJobDetailUpdateReqVOList) {
PutawayRecordDetailDO putawayRecordDetailDO = new PutawayRecordDetailDO();
BeanUtils.copyProperties(putawayJobDetailUpdateReqVO, putawayRecordDetailDO);
putawayRecordDetailDO.setMasterId(putawayRecordMainDO.getId());
putawayRecordDetailDO.setNumber(number);
putawayRecordDetailDO.setJobDetailId(String.valueOf(putawayJobDetailUpdateReqVO.getId()));
putawayRecordDetailDO.setId(null);
putawayRecordDetailDO.setCreator(null);
putawayRecordDetailDO.setCreateTime(null);
putawayRecordDetailDO.setUpdater(null);
putawayRecordDetailDO.setUpdateTime(null);
putawayRecordDetailDOList.add(putawayRecordDetailDO);
//添加库存事务list
TransactionCreateReqVO transactionCreateReqVO = new TransactionCreateReqVO();
BeanUtils.copyProperties(putawayRecordDetailDO, transactionCreateReqVO);
//增加业务类型
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("PutawayJob");
transactionCreateReqVO.setBusinessType(businesstypeDO.getCode());
TransactiontypeDO transactiontypeDO = jobUtils.selectDocumentFromTransactionType(businesstypeDO.getInTransactionType());
transactionCreateReqVO.setInventoryAction(transactiontypeDO.getInventoryAction());
transactionCreateReqVO.setTransactionType(transactiontypeDO.getCode());
transactionCreateReqVO.setRecordNumber(number);
transactionCreateReqVO.setId(null);
//待确定库存事务信息
transactionCreateReqVOList.add(transactionCreateReqVO);
}
if(!putawayRecordDetailDOList.isEmpty()) {
putawayRecordDetailMapper.insertBatch(putawayRecordDetailDOList);
}
List<String> typeList = new ArrayList<>();
typeList.add(JobStatusEnum.PENDING.getCode());
typeList.add(JobStatusEnum.PROCESSING.getCode());
Long count = putawayJobMainMapper.selectListCount(typeList, putawayJobMainDO.getRequestNumber());
PutawayRequestMainDO putawayRequestMainDO = putawayRequestMainMapper.selectByNumber(putawayJobMainDO.getRequestNumber());
//申请单下所有任务全部完成
if(count == 0) {
putawayRequestMainDO.setStatus(RequestStatusEnum.COMPLETED.getCode());
putawayRequestMainMapper.updateById(putawayRequestMainDO);
} else if(putawayRequestMainDO.getStatus().equals(RequestStatusEnum.HANDLING.getCode())) {//部分完成
putawayRequestMainDO.setStatus(RequestStatusEnum.PARTIAL.getCode());
putawayRequestMainMapper.updateById(putawayRequestMainDO);
}
//增加库存事务
transactionService.createTransaction(transactionCreateReqVOList);
//移除预计入
expectinService.deleteExpectinByJobNumber(putawayJobMainDO.getNumber());
//变更记录
trendsApi.createTrends(putawayJobMainDO.getId(), "putawayJob", "执行了上架任务", TrendsTypeEnum.UPDATE);
return result;
}
private PutawayJobMainDO validatePutawayJobMainExists(Long id) {
PutawayJobMainDO putawayJobMainDO = putawayJobMainMapper.selectById(id);
if (putawayJobMainDO == null) {
throw exception(INSPECT_JOB_MAIN_NOT_EXISTS);
}
return putawayJobMainDO;
}
} }

55
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRecord/PutawayRecordDetailService.java

@ -1,15 +1,11 @@
package com.win.module.wms.service.putawayRecord; package com.win.module.wms.service.putawayRecord;
import java.util.*;
import javax.validation.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailCreateReqVO; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailExportReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailPageReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailPageReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailUpdateReqVO;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO; import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordDetailDO;
import com.win.framework.common.pojo.PageResult;
import java.util.List;
/** /**
* 上架记录子 Service 接口 * 上架记录子 Service 接口
@ -18,20 +14,6 @@ import com.win.framework.common.pojo.PageResult;
*/ */
public interface PutawayRecordDetailService { public interface PutawayRecordDetailService {
/**
* 创建上架记录子
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createPutawayRecordDetail(@Valid PutawayRecordDetailCreateReqVO createReqVO);
/**
* 更新上架记录子
*
* @param updateReqVO 更新信息
*/
void updatePutawayRecordDetail(@Valid PutawayRecordDetailUpdateReqVO updateReqVO);
/** /**
* 获得用高级搜索上架记录子分页列表 * 获得用高级搜索上架记录子分页列表
* *
@ -39,28 +21,6 @@ public interface PutawayRecordDetailService {
* @return 分页列表 * @return 分页列表
*/ */
PageResult<PutawayRecordDetailDO> getPutawayRecordDetailSenior(CustomConditions conditions); PageResult<PutawayRecordDetailDO> getPutawayRecordDetailSenior(CustomConditions conditions);
/**
* 删除上架记录子
*
* @param id 编号
*/
void deletePutawayRecordDetail(Long id);
/**
* 获得上架记录子
*
* @param id 编号
* @return 上架记录子
*/
PutawayRecordDetailDO getPutawayRecordDetail(Long id);
/**
* 获得上架记录子列表
*
* @param ids 编号
* @return 上架记录子列表
*/
List<PutawayRecordDetailDO> getPutawayRecordDetailList(Collection<Long> ids);
/** /**
* 获得上架记录子分页 * 获得上架记录子分页
@ -71,11 +31,10 @@ public interface PutawayRecordDetailService {
PageResult<PutawayRecordDetailDO> getPutawayRecordDetailPage(PutawayRecordDetailPageReqVO pageReqVO); PageResult<PutawayRecordDetailDO> getPutawayRecordDetailPage(PutawayRecordDetailPageReqVO pageReqVO);
/** /**
* 获得上架记录子列表, 用于 Excel 导出 * 根据主表id查询上架记录
* * @param masterId
* @param exportReqVO 查询条件 * @return
* @return 上架记录子列表
*/ */
List<PutawayRecordDetailDO> getPutawayRecordDetailList(PutawayRecordDetailExportReqVO exportReqVO); List<PutawayRecordDetailDO> selectList(Long masterId);
} }

53
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRecord/PutawayRecordDetailServiceImpl.java

@ -5,6 +5,7 @@ import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailCreateR
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailExportReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailExportReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailPageReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailPageReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailUpdateReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailUpdateReqVO;
import com.win.module.wms.dal.dataobject.inspectRecord.InspectRecordDetailDO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -32,59 +33,19 @@ public class PutawayRecordDetailServiceImpl implements PutawayRecordDetailServic
@Resource @Resource
private PutawayRecordDetailMapper putawayRecordDetailMapper; private PutawayRecordDetailMapper putawayRecordDetailMapper;
@Override
public Long createPutawayRecordDetail(PutawayRecordDetailCreateReqVO createReqVO) {
// 插入
PutawayRecordDetailDO putawayRecordDetail = PutawayRecordDetailConvert.INSTANCE.convert(createReqVO);
putawayRecordDetailMapper.insert(putawayRecordDetail);
// 返回
return putawayRecordDetail.getId();
}
@Override
public void updatePutawayRecordDetail(PutawayRecordDetailUpdateReqVO updateReqVO) {
// 校验存在
validatePutawayRecordDetailExists(updateReqVO.getId());
// 更新
PutawayRecordDetailDO updateObj = PutawayRecordDetailConvert.INSTANCE.convert(updateReqVO);
putawayRecordDetailMapper.updateById(updateObj);
}
@Override
public void deletePutawayRecordDetail(Long id) {
// 校验存在
validatePutawayRecordDetailExists(id);
// 删除
putawayRecordDetailMapper.deleteById(id);
}
private void validatePutawayRecordDetailExists(Long id) {
if (putawayRecordDetailMapper.selectById(id) == null) {
throw exception(PUTAWAY_RECORD_DETAIL_NOT_EXISTS);
}
}
@Override
public PutawayRecordDetailDO getPutawayRecordDetail(Long id) {
return putawayRecordDetailMapper.selectById(id);
}
@Override
public List<PutawayRecordDetailDO> getPutawayRecordDetailList(Collection<Long> ids) {
return putawayRecordDetailMapper.selectBatchIds(ids);
}
@Override @Override
public PageResult<PutawayRecordDetailDO> getPutawayRecordDetailPage(PutawayRecordDetailPageReqVO pageReqVO) { public PageResult<PutawayRecordDetailDO> getPutawayRecordDetailPage(PutawayRecordDetailPageReqVO pageReqVO) {
return putawayRecordDetailMapper.selectPage(pageReqVO); return putawayRecordDetailMapper.selectPage(pageReqVO);
} }
@Override
public List<PutawayRecordDetailDO> getPutawayRecordDetailList(PutawayRecordDetailExportReqVO exportReqVO) {
return putawayRecordDetailMapper.selectList(exportReqVO);
}
@Override @Override
public PageResult<PutawayRecordDetailDO> getPutawayRecordDetailSenior(CustomConditions conditions) { public PageResult<PutawayRecordDetailDO> getPutawayRecordDetailSenior(CustomConditions conditions) {
return putawayRecordDetailMapper.selectSenior(conditions); return putawayRecordDetailMapper.selectSenior(conditions);
} }
@Override
public List<PutawayRecordDetailDO> selectList(Long masterId) {
return putawayRecordDetailMapper.selectList(masterId);
}
} }

58
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRecord/PutawayRecordMainService.java

@ -1,15 +1,12 @@
package com.win.module.wms.service.putawayRecord; package com.win.module.wms.service.putawayRecord;
import java.util.*;
import javax.validation.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainCreateReqVO; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExportReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExportReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainPageReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainPageReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainUpdateReqVO;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO; import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO;
import com.win.framework.common.pojo.PageResult;
import java.util.List;
/** /**
* 上架记录主 Service 接口 * 上架记录主 Service 接口
@ -19,13 +16,12 @@ import com.win.framework.common.pojo.PageResult;
public interface PutawayRecordMainService { public interface PutawayRecordMainService {
/** /**
* 创建上架记录主 * 获得上架记录主分页
* *
* @param createReqVO 创建信息 * @param pageReqVO 分页查询
* @return 编号 * @return 上架记录主分页
*/ */
Long createPutawayRecordMain(@Valid PutawayRecordMainCreateReqVO createReqVO); PageResult<PutawayRecordMainDO> getPutawayRecordMainPage(PutawayRecordMainPageReqVO pageReqVO);
/** /**
* 获得用高级搜索上架记录主分页列表 * 获得用高级搜索上架记录主分页列表
@ -36,49 +32,19 @@ public interface PutawayRecordMainService {
PageResult<PutawayRecordMainDO> getPutawayRecordMainSenior(CustomConditions conditions); PageResult<PutawayRecordMainDO> getPutawayRecordMainSenior(CustomConditions conditions);
/** /**
* 更新上架记录主 * 获得上架记录主列表, 用于 Excel 导出
*
* @param updateReqVO 更新信息
*/
void updatePutawayRecordMain(@Valid PutawayRecordMainUpdateReqVO updateReqVO);
/**
* 删除上架记录主
*
* @param id 编号
*/
void deletePutawayRecordMain(Long id);
/**
* 获得上架记录主
*
* @param id 编号
* @return 上架记录主
*/
PutawayRecordMainDO getPutawayRecordMain(Long id);
/**
* 获得上架记录主列表
* *
* @param ids 编号 * @param exportReqVO 查询条件
* @return 上架记录主列表 * @return 上架记录主列表
*/ */
List<PutawayRecordMainDO> getPutawayRecordMainList(Collection<Long> ids); List<PutawayRecordMainDO> getPutawayRecordMainList(PutawayRecordMainExportReqVO exportReqVO);
/**
* 获得上架记录主分页
*
* @param pageReqVO 分页查询
* @return 上架记录主分页
*/
PageResult<PutawayRecordMainDO> getPutawayRecordMainPage(PutawayRecordMainPageReqVO pageReqVO);
/** /**
* 获得上架记录主列表, 用于 Excel 导出 * 获得上架记录主列表, 用于 Excel 导出
* *
* @param exportReqVO 查询条件 * @param conditions 查询条件
* @return 上架记录主列表 * @return 上架记录主列表
*/ */
List<PutawayRecordMainDO> getPutawayRecordMainList(PutawayRecordMainExportReqVO exportReqVO); List<PutawayRecordMainDO> getPutawayRecordMainList(CustomConditions conditions);
} }

65
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRecord/PutawayRecordMainServiceImpl.java

@ -1,24 +1,16 @@
package com.win.module.wms.service.putawayRecord; package com.win.module.wms.service.putawayRecord;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainCreateReqVO; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExportReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainExportReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainPageReqVO; import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainPageReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainUpdateReqVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO; import com.win.module.wms.dal.dataobject.putawayRecord.PutawayRecordMainDO;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.convert.putawayRecord.PutawayRecordMainConvert;
import com.win.module.wms.dal.mysql.putawayRecord.PutawayRecordMainMapper; import com.win.module.wms.dal.mysql.putawayRecord.PutawayRecordMainMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; import javax.annotation.Resource;
import static com.win.module.wms.enums.ErrorCodeConstants.*; import java.util.List;
/** /**
* 上架记录主 Service 实现类 * 上架记录主 Service 实现类
@ -33,58 +25,23 @@ public class PutawayRecordMainServiceImpl implements PutawayRecordMainService {
private PutawayRecordMainMapper putawayRecordMainMapper; private PutawayRecordMainMapper putawayRecordMainMapper;
@Override @Override
public Long createPutawayRecordMain(PutawayRecordMainCreateReqVO createReqVO) { public PageResult<PutawayRecordMainDO> getPutawayRecordMainPage(PutawayRecordMainPageReqVO pageReqVO) {
// 插入 return putawayRecordMainMapper.selectPage(pageReqVO);
PutawayRecordMainDO putawayRecordMain = PutawayRecordMainConvert.INSTANCE.convert(createReqVO);
putawayRecordMainMapper.insert(putawayRecordMain);
// 返回
return putawayRecordMain.getId();
}
@Override
public void updatePutawayRecordMain(PutawayRecordMainUpdateReqVO updateReqVO) {
// 校验存在
validatePutawayRecordMainExists(updateReqVO.getId());
// 更新
PutawayRecordMainDO updateObj = PutawayRecordMainConvert.INSTANCE.convert(updateReqVO);
putawayRecordMainMapper.updateById(updateObj);
}
@Override
public void deletePutawayRecordMain(Long id) {
// 校验存在
validatePutawayRecordMainExists(id);
// 删除
putawayRecordMainMapper.deleteById(id);
} }
private void validatePutawayRecordMainExists(Long id) {
if (putawayRecordMainMapper.selectById(id) == null) {
throw exception(PUTAWAY_RECORD_MAIN_NOT_EXISTS);
}
}
@Override @Override
public PageResult<PutawayRecordMainDO> getPutawayRecordMainSenior(CustomConditions conditions) { public PageResult<PutawayRecordMainDO> getPutawayRecordMainSenior(CustomConditions conditions) {
return putawayRecordMainMapper.selectSenior(conditions); return putawayRecordMainMapper.selectSenior(conditions);
} }
@Override
public PutawayRecordMainDO getPutawayRecordMain(Long id) {
return putawayRecordMainMapper.selectById(id);
}
@Override @Override
public List<PutawayRecordMainDO> getPutawayRecordMainList(Collection<Long> ids) { public List<PutawayRecordMainDO> getPutawayRecordMainList(PutawayRecordMainExportReqVO exportReqVO) {
return putawayRecordMainMapper.selectBatchIds(ids); return putawayRecordMainMapper.selectList(exportReqVO);
}
@Override
public PageResult<PutawayRecordMainDO> getPutawayRecordMainPage(PutawayRecordMainPageReqVO pageReqVO) {
return putawayRecordMainMapper.selectPage(pageReqVO);
} }
@Override @Override
public List<PutawayRecordMainDO> getPutawayRecordMainList(PutawayRecordMainExportReqVO exportReqVO) { public List<PutawayRecordMainDO> getPutawayRecordMainList(CustomConditions conditions) {
return putawayRecordMainMapper.selectList(exportReqVO); return putawayRecordMainMapper.selectSeniorList(conditions);
} }
} }

16
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestDetailService.java

@ -1,15 +1,15 @@
package com.win.module.wms.service.putawayRequest; package com.win.module.wms.service.putawayRequest;
import java.util.*;
import javax.validation.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailCreateReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailCreateReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailExportReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailExportReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailPageReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailPageReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailUpdateReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailUpdateReqVO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO; import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import com.win.framework.common.pojo.PageResult;
import javax.validation.Valid;
import java.util.List;
/** /**
* 上架申请子 Service 接口 * 上架申请子 Service 接口
@ -56,12 +56,12 @@ public interface PutawayRequestDetailService {
PutawayRequestDetailDO getPutawayRequestDetail(Long id); PutawayRequestDetailDO getPutawayRequestDetail(Long id);
/** /**
* 获得上架申请子列表 * 获得上架申请子
* *
* @param ids 编号 * @param masterId 父id
* @return 上架申请子列表 * @return 检验申请子列表
*/ */
List<PutawayRequestDetailDO> getPutawayRequestDetailList(Collection<Long> ids); List<PutawayRequestDetailDO> selectList(Long masterId);
/** /**
* 获得上架申请子分页 * 获得上架申请子分页

20
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestDetailServiceImpl.java

@ -1,20 +1,22 @@
package com.win.module.wms.service.putawayRequest; package com.win.module.wms.service.putawayRequest;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailCreateReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailCreateReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailExportReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailExportReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailPageReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailPageReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailUpdateReqVO; import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailUpdateReqVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.convert.putawayRequest.PutawayRequestDetailConvert; import com.win.module.wms.convert.putawayRequest.PutawayRequestDetailConvert;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import com.win.module.wms.dal.mysql.putawayRequest.PutawayRequestDetailMapper; import com.win.module.wms.dal.mysql.putawayRequest.PutawayRequestDetailMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.win.module.wms.enums.ErrorCodeConstants.*; import static com.win.module.wms.enums.ErrorCodeConstants.PUTAWAY_REQUEST_DETAIL_NOT_EXISTS;
/** /**
* 上架申请子 Service 实现类 * 上架申请子 Service 实现类
@ -69,8 +71,8 @@ public class PutawayRequestDetailServiceImpl implements PutawayRequestDetailServ
} }
@Override @Override
public List<PutawayRequestDetailDO> getPutawayRequestDetailList(Collection<Long> ids) { public List<PutawayRequestDetailDO> selectList(Long masterId) {
return putawayRequestDetailMapper.selectBatchIds(ids); return putawayRequestDetailMapper.selectList(masterId);
} }
@Override @Override

71
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestMainService.java

@ -1,10 +1,12 @@
package com.win.module.wms.service.putawayRequest; package com.win.module.wms.service.putawayRequest;
import java.util.*;
import javax.validation.*;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.putawayRequest.vo.*; import com.win.module.wms.controller.putawayRequest.vo.*;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO; import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import com.win.framework.common.pojo.PageResult;
import javax.validation.Valid;
import java.util.List;
/** /**
* 上架申请主 Service 接口 * 上架申请主 Service 接口
@ -51,14 +53,6 @@ public interface PutawayRequestMainService {
*/ */
PageResult<PutawayRequestMainDO> getPutawayRequestMainSenior(CustomConditions conditions); PageResult<PutawayRequestMainDO> getPutawayRequestMainSenior(CustomConditions conditions);
/**
* 获得上架申请主列表
*
* @param ids 编号
* @return 上架申请主列表
*/
List<PutawayRequestMainDO> getPutawayRequestMainList(Collection<Long> ids);
/** /**
* 获得上架申请主分页 * 获得上架申请主分页
* *
@ -75,6 +69,59 @@ public interface PutawayRequestMainService {
*/ */
List<PutawayRequestMainDO> getPutawayRequestMainList(PutawayRequestMainExportReqVO exportReqVO); List<PutawayRequestMainDO> getPutawayRequestMainList(PutawayRequestMainExportReqVO exportReqVO);
public List<PutawayRequestImportErrorVO> importPutawayRequestList(List<PutawayRequestMainCreateReqVO> datas, Integer mode, boolean updatePart); /**
* 导入上架申请数据
* @param datas
* @param mode
* @param updatePart
* @return
*/
List<PutawayRequestImportErrorVO> importPutawayRequestList(List<PutawayRequestMainCreateReqVO> datas, Integer mode, boolean updatePart);
/**
* 获得采购收货申请主列表, 用于 Excel 导出
*
* @param conditions 查询条件
* @return 上架申请主列表
*/
List<PutawayRequestMainDO> getPutawayRequestMainList(CustomConditions conditions);
/**
* 关闭上架申请主
*
* @param id 上架申请主ID
* @return 更新数量
*/
Integer closePutawayRequestMain(Long id);
/**
* 提交上架申请主
*
* @param id 上架申请主ID
* @return 更新数量
*/
Integer submitPutawayRequestMain(Long id);
/**
* 审批通过上架申请主
*
* @param id 上架申请主ID
* @return 更新数量
*/
Integer agreePutawayRequestMain(Long id);
/**
* 处理上架申请主
* @param id
* @return
*/
Integer handlePutawayRequestMain(Long id);
/**
* 审批拒绝上架申请主
*
* @param id 上架申请主ID
* @return 更新数量
*/
Integer abortPutawayRequestMain(Long id);
} }

283
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestMainServiceImpl.java

@ -1,45 +1,61 @@
package com.win.module.wms.service.putawayRequest; package com.win.module.wms.service.putawayRequest;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.CustomConditions; import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.util.validation.ValidationUtils; import com.win.framework.common.util.validation.ValidationUtils;
import com.win.framework.dict.core.util.DictFrameworkUtils; import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.module.infra.api.trends.TrendsApi; import com.win.module.infra.api.trends.TrendsApi;
import com.win.module.infra.enums.TrendsTypeEnum; import com.win.module.infra.enums.TrendsTypeEnum;
import com.win.module.system.api.serialnumber.SerialNumberApi; import com.win.module.system.api.serialnumber.SerialNumberApi;
import com.win.module.system.enums.serialNumber.RuleCodeEnum; import com.win.module.system.enums.serialNumber.RuleCodeEnum;
import com.win.module.wms.controller.expectout.vo.ExpectoutCreateReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordDetailCreateReqVO;
import com.win.module.wms.controller.putawayRecord.vo.PutawayRecordMainCreateReqVO;
import com.win.module.wms.controller.putawayRequest.vo.*; import com.win.module.wms.controller.putawayRequest.vo.*;
import com.win.module.wms.convert.putawayJob.PutawayJobDetailConvert;
import com.win.module.wms.convert.putawayJob.PutawayJobMainConvert;
import com.win.module.wms.convert.putawayRecord.PutawayRecordDetailConvert;
import com.win.module.wms.convert.putawayRecord.PutawayRecordMainConvert;
import com.win.module.wms.convert.putawayRequest.PutawayRequestDetailConvert; import com.win.module.wms.convert.putawayRequest.PutawayRequestDetailConvert;
import com.win.module.wms.convert.putawayRequest.PutawayRequestMainConvert;
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO; import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.location.LocationDO; import com.win.module.wms.dal.dataobject.location.LocationDO;
import com.win.module.wms.dal.dataobject.purchase.PurchaseDetailDO; import com.win.module.wms.dal.dataobject.purchase.PurchaseDetailDO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobDetailDO;
import com.win.module.wms.dal.dataobject.putawayJob.PutawayJobMainDO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO; import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestDetailDO;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO; import com.win.module.wms.dal.dataobject.requestsetting.RequestsettingDO;
import com.win.module.wms.dal.mysql.putawayJob.PutawayJobDetailMapper;
import com.win.module.wms.dal.mysql.putawayJob.PutawayJobMainMapper;
import com.win.module.wms.dal.mysql.putawayRecord.PutawayRecordDetailMapper;
import com.win.module.wms.dal.mysql.putawayRecord.PutawayRecordMainMapper;
import com.win.module.wms.dal.mysql.putawayRequest.PutawayRequestDetailMapper; import com.win.module.wms.dal.mysql.putawayRequest.PutawayRequestDetailMapper;
import com.win.module.wms.dal.mysql.putawayRequest.PutawayRequestMainMapper;
import com.win.module.wms.enums.DictTypeConstants; import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.enums.job.JobStatusEnum;
import com.win.module.wms.enums.request.RequestStatusEnum; import com.win.module.wms.enums.request.RequestStatusEnum;
import com.win.module.wms.enums.request.RequestStatusState;
import com.win.module.wms.service.customer.CustomerService; import com.win.module.wms.service.customer.CustomerService;
import com.win.module.wms.service.expectout.ExpectoutService;
import com.win.module.wms.service.itembasic.ItembasicService; import com.win.module.wms.service.itembasic.ItembasicService;
import com.win.module.wms.service.location.LocationService; import com.win.module.wms.service.location.LocationService;
import com.win.module.wms.service.purchase.PurchaseMainService; import com.win.module.wms.service.purchase.PurchaseMainService;
import com.win.module.wms.service.requestsetting.RequestsettingService; import com.win.module.wms.service.requestsetting.RequestsettingService;
import com.win.module.wms.util.JobUtils; import com.win.module.wms.util.JobUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.validation.Validator;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import javax.validation.Validator;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.ArrayList;
import java.util.List;
import com.win.module.wms.dal.dataobject.putawayRequest.PutawayRequestMainDO;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.convert.putawayRequest.PutawayRequestMainConvert;
import com.win.module.wms.dal.mysql.putawayRequest.PutawayRequestMainMapper;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.win.module.wms.enums.ErrorCodeConstants.*; import static com.win.module.wms.enums.ErrorCodeConstants.*;
@ -75,16 +91,25 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
private CustomerService customerService; private CustomerService customerService;
@Resource @Resource
private TrendsApi trendsApi; private TrendsApi trendsApi;
@Resource
private PutawayJobMainMapper putawayJobMainMapper;
@Resource
private PutawayJobDetailMapper putawayJobDetailMapper;
@Resource
private PutawayRecordMainMapper putawayRecordMainMapper;
@Resource
private PutawayRecordDetailMapper putawayRecordDetailMapper;
@Resource
private ExpectoutService expectoutService;
//TODO 主表从仓库代码,到仓库代码暂未赋值
@Override @Override
@Transactional @Transactional
public Long createPutawayRequestMain(PutawayRequestMainCreateReqVO createReqVO) { public Long createPutawayRequestMain(PutawayRequestMainCreateReqVO createReqVO) {
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("PutawayRequest"); RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("PutawayRequest");
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("PutawayRequest"); BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("PutawayRequest");
PutawayRequestMainDO putawayRequestMainDO = validatorToCreate(createReqVO, businesstypeDO,requestsettingDO); PutawayRequestMainDO putawayRequestMainDO = validatorToCreate(createReqVO, businesstypeDO, requestsettingDO);
//调用自动执行方法 //调用自动执行方法
if(RequestStatusEnum.HANDLING.getCode().equals(putawayRequestMainDO.getStatus())) { if (RequestStatusEnum.HANDLING.getCode().equals(putawayRequestMainDO.getStatus())) {
} }
trendsApi.createTrends(requestsettingDO.getId(), "PutawayRequest", "增加了上架申请", TrendsTypeEnum.CREATE); trendsApi.createTrends(requestsettingDO.getId(), "PutawayRequest", "增加了上架申请", TrendsTypeEnum.CREATE);
@ -99,8 +124,8 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
// 校验存在 // 校验存在
validatePutawayRequestMainExists(updateReqVO.getId()); validatePutawayRequestMainExists(updateReqVO.getId());
// 更新 // 更新
PutawayRequestMainDO putawayRequestMainDO = validatorMainMethod(updateReqVO, businesstypeDO,requestsettingDO); PutawayRequestMainDO putawayRequestMainDO = validatorMainMethod(updateReqVO, businesstypeDO, requestsettingDO);
if(putawayRequestMainDO.getStatus().equals(RequestStatusEnum.NEW.getCode())) { if (putawayRequestMainDO.getStatus().equals(RequestStatusEnum.NEW.getCode())) {
throw exception(PURCHASERECEIPT_REQUEST_STATUS_NOT_NEW); throw exception(PURCHASERECEIPT_REQUEST_STATUS_NOT_NEW);
} }
trendsApi.createTrends(updateReqVO.getId(), "PutawayRequestMain", putawayRequestMainDO.toString(), TrendsTypeEnum.UPDATE); trendsApi.createTrends(updateReqVO.getId(), "PutawayRequestMain", putawayRequestMainDO.toString(), TrendsTypeEnum.UPDATE);
@ -116,10 +141,12 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
putawayRequestMainMapper.deleteById(id); putawayRequestMainMapper.deleteById(id);
} }
private void validatePutawayRequestMainExists(Long id) { private PutawayRequestMainDO validatePutawayRequestMainExists(Long id) {
if (putawayRequestMainMapper.selectById(id) == null) { PutawayRequestMainDO putawayRequestMainDO = putawayRequestMainMapper.selectById(id);
if (putawayRequestMainDO == null) {
throw exception(PUTAWAY_REQUEST_MAIN_NOT_EXISTS); throw exception(PUTAWAY_REQUEST_MAIN_NOT_EXISTS);
} }
return putawayRequestMainDO;
} }
@Override @Override
@ -131,10 +158,6 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
public PageResult<PutawayRequestMainDO> getPutawayRequestMainSenior(CustomConditions conditions) { public PageResult<PutawayRequestMainDO> getPutawayRequestMainSenior(CustomConditions conditions) {
return putawayRequestMainMapper.selectSenior(conditions); return putawayRequestMainMapper.selectSenior(conditions);
} }
@Override
public List<PutawayRequestMainDO> getPutawayRequestMainList(Collection<Long> ids) {
return putawayRequestMainMapper.selectBatchIds(ids);
}
@Override @Override
public PageResult<PutawayRequestMainDO> getPutawayRequestMainPage(PutawayRequestMainPageReqVO pageReqVO) { public PageResult<PutawayRequestMainDO> getPutawayRequestMainPage(PutawayRequestMainPageReqVO pageReqVO) {
@ -146,6 +169,11 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
return putawayRequestMainMapper.selectList(exportReqVO); return putawayRequestMainMapper.selectList(exportReqVO);
} }
@Override
public List<PutawayRequestMainDO> getPutawayRequestMainList(CustomConditions conditions) {
return putawayRequestMainMapper.selectSeniorList(conditions);
}
@Override @Override
@Transactional @Transactional
public List<PutawayRequestImportErrorVO> importPutawayRequestList(List<PutawayRequestMainCreateReqVO> datas, Integer mode, boolean updatePart) { public List<PutawayRequestImportErrorVO> importPutawayRequestList(List<PutawayRequestMainCreateReqVO> datas, Integer mode, boolean updatePart) {
@ -156,13 +184,13 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
datas.forEach(createReqVO -> { datas.forEach(createReqVO -> {
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("PutawayRequest"); BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("PutawayRequest");
PutawayRequestMainDO mainDo = PutawayRequestMainConvert.INSTANCE.convert(createReqVO); PutawayRequestMainDO mainDo = PutawayRequestMainConvert.INSTANCE.convert(createReqVO);
String messageMain = validatorPutawayRequestMainImport(mainDo,businesstypeDO); String messageMain = validatorPutawayRequestMainImport(mainDo, businesstypeDO);
List<PutawayRequestDetailCreateReqVO> subList = createReqVO.getSubList(); List<PutawayRequestDetailCreateReqVO> subList = createReqVO.getSubList();
List<PutawayRequestDetailDO> subDOList = PutawayRequestDetailConvert.INSTANCE.convertList03(subList); List<PutawayRequestDetailDO> subDOList = PutawayRequestDetailConvert.INSTANCE.convertList03(subList);
// 是否有错误数据 // 是否有错误数据
boolean flag = true; boolean flag = true;
for (PutawayRequestDetailDO detailDO : subDOList) { for (PutawayRequestDetailDO detailDO : subDOList) {
String messageDetail = validatorPutawayRequestDetailImport(detailDO, mainDo,businesstypeDO); String messageDetail = validatorPutawayRequestDetailImport(detailDO, mainDo, businesstypeDO);
if (!messageMain.isEmpty() || messageDetail.isEmpty()) { if (!messageMain.isEmpty() || messageDetail.isEmpty()) {
PutawayRequestImportErrorVO importErrorVO = PutawayRequestMainConvert.INSTANCE.convert(createReqVO, detailDO); PutawayRequestImportErrorVO importErrorVO = PutawayRequestMainConvert.INSTANCE.convert(createReqVO, detailDO);
importErrorVO.setImportStatus("失败"); importErrorVO.setImportStatus("失败");
@ -189,14 +217,154 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
return errorList; return errorList;
} }
@Override
@Transactional
public Integer closePutawayRequestMain(Long id) {
// 校验存在存在下级单据
PutawayRequestMainDO mainDO = validatePutawayRequestMainExists(id);
Long count = putawayJobMainMapper.selectByRequestNumber(mainDO.getNumber());
if(count > 0) {
throw new ServiceException(PUTAWAY_REQUEST_JOB_EXISTS);
}
RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus());
boolean flag = requestStatusState.close();
if(!flag) {
throw new ServiceException(PUTAWAY_REQUEST_CANNOT_CLOSE);
}
mainDO.setStatus(requestStatusState.getState().getCode());//增加操作记录
trendsApi.createTrends(id, "putawayRequest", "关闭了上架申请", TrendsTypeEnum.UPDATE);
return putawayRequestMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer submitPutawayRequestMain(Long id) {
PutawayRequestMainDO mainDO = validatePutawayRequestMainExists(id);
RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus());
boolean flag = requestStatusState.submit(mainDO.getAutoAgree(), mainDO.getAutoExecute());
if(!flag) {
throw new ServiceException(PUTAWAY_REQUEST_CANNOT_SUBMIT);
}
mainDO.setStatus(requestStatusState.getState().getCode());
//调用自动执行方法
if(RequestStatusEnum.HANDLING.getCode().equals(mainDO.getStatus())) {
this.generateJob(mainDO, putawayRequestDetailMapper.selectList(mainDO.getId()));
}
trendsApi.createTrends(id, "putawayRequest", "提交了上架申请", TrendsTypeEnum.UPDATE);
return putawayRequestMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer agreePutawayRequestMain(Long id) {
// 校验存在
PutawayRequestMainDO mainDO = validatePutawayRequestMainExists(id);
RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus());
boolean flag = requestStatusState.agree(mainDO.getAutoExecute());
if(!flag) {
throw new ServiceException(PUTAWAY_REQUEST_CANNOT_AGREE);
}
mainDO.setStatus(requestStatusState.getState().getCode());
//调用自动执行方法
if(RequestStatusEnum.HANDLING.getCode().equals(mainDO.getStatus())) {
this.generateJob(mainDO, putawayRequestDetailMapper.selectList(mainDO.getId()));
}
trendsApi.createTrends(id, "putawayRequest", "审批同意了上架申请", TrendsTypeEnum.UPDATE);
return putawayRequestMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer handlePutawayRequestMain(Long id) {
// 校验存在
PutawayRequestMainDO mainDO = validatePutawayRequestMainExists(id);
RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus());
boolean flag = requestStatusState.handle();
if(!flag) {
throw new ServiceException(PUTAWAY_REQUEST_CANNOT_HANDLE);
}
mainDO.setStatus(requestStatusState.getState().getCode());
//调用执行方法
this.generateJob(mainDO, putawayRequestDetailMapper.selectList(mainDO.getId()));
trendsApi.createTrends(id, "putawayRequest", "执行了上架申请", TrendsTypeEnum.UPDATE);
return putawayRequestMainMapper.updateById(mainDO);
}
@Override
@Transactional
public Integer abortPutawayRequestMain(Long id) {
// 校验存在
PutawayRequestMainDO mainDO = validatePutawayRequestMainExists(id);
RequestStatusState requestStatusState = new RequestStatusState(mainDO.getStatus());
boolean flag = requestStatusState.refused();
if(!flag) {
throw new ServiceException(PUTAWAY_REQUEST_CANNOT_ABORT);
}
mainDO.setStatus(requestStatusState.getState().getCode());
trendsApi.createTrends(id, "inspectRequest", "审批拒绝了到货校验申请", TrendsTypeEnum.UPDATE);
return putawayRequestMainMapper.updateById(mainDO);
}
/**
* 生成上架任务不要改动事务传播方式否则会有事务问题
* @param mainDO 上架主
* @param detailDOList 上架子
*/
private void generateJob(PutawayRequestMainDO mainDO, List<PutawayRequestDetailDO> detailDOList) {
//跳过任务直接生成记录
if("TRUE".equals(mainDO.getDirectCreateRecord())) {
PutawayRecordMainCreateReqVO putawayRecordMainCreateReqVO = new PutawayRecordMainCreateReqVO();
BeanUtils.copyProperties(mainDO, putawayRecordMainCreateReqVO);
putawayRecordMainCreateReqVO.setRequestNumber(mainDO.getNumber());
String number = serialNumberApi.generateCode(RuleCodeEnum.INSPECT_RECORD.getCode());
putawayRecordMainCreateReqVO.setNumber(number);
//增加业务类型
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("InspectRecord");
putawayRecordMainCreateReqVO.setBusinessType(businesstypeDO.getCode());
putawayRecordMainMapper.insert(PutawayRecordMainConvert.INSTANCE.convert(putawayRecordMainCreateReqVO));
for(PutawayRequestDetailDO putawayRequestDetailDO : detailDOList) {
PutawayRecordDetailCreateReqVO putawayRecordDetailCreateReqVO = new PutawayRecordDetailCreateReqVO();
BeanUtils.copyProperties(putawayRequestDetailDO, putawayRecordDetailCreateReqVO);
putawayRecordDetailCreateReqVO.setNumber(number);
putawayRecordDetailMapper.insert(PutawayRecordDetailConvert.INSTANCE.convert(putawayRecordDetailCreateReqVO));
}
return;
}
List<ExpectoutCreateReqVO> expectoutCreateReqVOList = new ArrayList<>();
PutawayJobMainDO putawayJobMainDO = PutawayJobMainConvert.INSTANCE.convert(mainDO);
putawayJobMainDO.setStatus(JobStatusEnum.PENDING.getCode());
String number = serialNumberApi.generateCode(RuleCodeEnum.INSPECT_JOB.getCode());
putawayJobMainDO.setNumber(number);
//增加业务类型
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("InspectJob");
putawayJobMainDO.setBusinessType(businesstypeDO.getCode());
putawayJobMainMapper.insert(putawayJobMainDO);
List<PutawayJobDetailDO> putawayJobDetailDOList = new ArrayList<>();
for(PutawayRequestDetailDO putawayRequestDetailDO : detailDOList) {
PutawayJobDetailDO putawayJobDetailDO = PutawayJobDetailConvert.INSTANCE.convert(putawayRequestDetailDO);
putawayJobDetailDO.setNumber(number);
putawayJobDetailDO.setMasterId(putawayJobDetailDO.getId());
putawayJobDetailDOList.add(putawayJobDetailDO);
//预计出
ExpectoutCreateReqVO expectoutCreateReqVO = new ExpectoutCreateReqVO();
BeanUtils.copyProperties(putawayJobDetailDO, expectoutCreateReqVO);
expectoutCreateReqVO.setJobNumber(number);
expectoutCreateReqVOList.add(expectoutCreateReqVO);
}
putawayJobDetailMapper.insertBatch(putawayJobDetailDOList);
//增加预计出
expectoutService.createExpectout(expectoutCreateReqVOList);
trendsApi.createTrends(putawayJobMainDO.getId(), "putawayJob", "上架申请生成上架任务", TrendsTypeEnum.CREATE);
}
// 新增校验 // 新增校验
private PutawayRequestMainDO validatorToCreate(PutawayRequestMainCreateReqVO createReqVO, BusinesstypeDO businesstypeDO,RequestsettingDO requestsettingDO) { private PutawayRequestMainDO validatorToCreate(PutawayRequestMainCreateReqVO createReqVO, BusinesstypeDO businesstypeDO, RequestsettingDO requestsettingDO) {
PutawayRequestMainDO mainDo = validatorMainMethod(createReqVO,businesstypeDO,requestsettingDO); PutawayRequestMainDO mainDo = validatorMainMethod(createReqVO, businesstypeDO, requestsettingDO);
//子表校验 //子表校验
List<PutawayRequestDetailCreateReqVO> subList = createReqVO.getSubList(); List<PutawayRequestDetailCreateReqVO> subList = createReqVO.getSubList();
List<PutawayRequestDetailDO> subDOList = PutawayRequestDetailConvert.INSTANCE.convertList03(subList); List<PutawayRequestDetailDO> subDOList = PutawayRequestDetailConvert.INSTANCE.convertList03(subList);
for (PutawayRequestDetailDO detailDO : subDOList) { for (PutawayRequestDetailDO detailDO : subDOList) {
validatorDetailMethod(detailDO,mainDo,businesstypeDO); validatorDetailMethod(detailDO, mainDo, businesstypeDO);
} }
String number = serialNumberApi.generateCode(RuleCodeEnum.PURCHASE_CLAIM_RECORD.getCode()); String number = serialNumberApi.generateCode(RuleCodeEnum.PURCHASE_CLAIM_RECORD.getCode());
mainDo.setNumber(number); mainDo.setNumber(number);
@ -211,7 +379,7 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
} }
//校验主表公共方法(适用于新增/修改) //校验主表公共方法(适用于新增/修改)
private PutawayRequestMainDO validatorMainMethod(PutawayRequestMainBaseVO baseVO, BusinesstypeDO businesstypeDO,RequestsettingDO requestsettingDO){ private PutawayRequestMainDO validatorMainMethod(PutawayRequestMainBaseVO baseVO, BusinesstypeDO businesstypeDO, RequestsettingDO requestsettingDO) {
PutawayRequestMainDO mainDo = PutawayRequestMainConvert.INSTANCE.convert(baseVO); PutawayRequestMainDO mainDo = PutawayRequestMainConvert.INSTANCE.convert(baseVO);
mainDo.setBusinessType(businesstypeDO.getCode()); mainDo.setBusinessType(businesstypeDO.getCode());
mainDo.setFromLocationTypes(businesstypeDO.getOutLocationTypes()); mainDo.setFromLocationTypes(businesstypeDO.getOutLocationTypes());
@ -222,8 +390,9 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
mainDo.setDirectCreateRecord(requestsettingDO.getDirectCreateRecord()); mainDo.setDirectCreateRecord(requestsettingDO.getDirectCreateRecord());
return mainDo; return mainDo;
} }
//校验子表公共方法(适用于新增/修改) //校验子表公共方法(适用于新增/修改)
private void validatorDetailMethod(PutawayRequestDetailDO detailDo,PutawayRequestMainDO mainDo, BusinesstypeDO businesstypeDO) { private void validatorDetailMethod(PutawayRequestDetailDO detailDo, PutawayRequestMainDO mainDo, BusinesstypeDO businesstypeDO) {
ItembasicDO itembasicDO = validatorItembasic(detailDo.getItemCode()); ItembasicDO itembasicDO = validatorItembasic(detailDo.getItemCode());
detailDo.setItemDesc1(itembasicDO.getDesc1()); detailDo.setItemDesc1(itembasicDO.getDesc1());
detailDo.setItemDesc2(itembasicDO.getDesc2()); detailDo.setItemDesc2(itembasicDO.getDesc2());
@ -236,7 +405,7 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
validatorIfOutInventoryStatuses(detailDo.getInventoryStatus(), businesstypeDO); validatorIfOutInventoryStatuses(detailDo.getInventoryStatus(), businesstypeDO);
validatorIfInToLocationType(detailDo.getFromLocationCode(), businesstypeDO); validatorIfInToLocationType(detailDo.getFromLocationCode(), businesstypeDO);
ArrayList<String> inventoryStatus = new ArrayList<>(); ArrayList<String> inventoryStatus = new ArrayList<>();
inventoryStatus.set(0,detailDo.getInventoryStatus()); inventoryStatus.set(0, detailDo.getInventoryStatus());
validatorManagementAccuracy(detailDo.getItemCode(), detailDo.getPackingNumber(), detailDo.getBatch(), detailDo.getFromLocationCode(), inventoryStatus); validatorManagementAccuracy(detailDo.getItemCode(), detailDo.getPackingNumber(), detailDo.getBatch(), detailDo.getFromLocationCode(), inventoryStatus);
} }
@ -246,12 +415,11 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
* @param mainDo * @param mainDo
* @return * @return
*/ */
private String validatorPutawayRequestMainImport(PutawayRequestMainDO mainDo,BusinesstypeDO businesstypeDO) { private String validatorPutawayRequestMainImport(PutawayRequestMainDO mainDo, BusinesstypeDO businesstypeDO) {
StringBuilder message = new StringBuilder(); StringBuilder message = new StringBuilder();
if (businesstypeDO == null) { if (businesstypeDO == null) {
message.append("根据业务类型设置未查找到采购退货申请的相关业务类型"); message.append("根据业务类型设置未查找到采购退货申请的相关业务类型");
} } else {
else {
mainDo.setBusinessType(businesstypeDO.getCode()); mainDo.setBusinessType(businesstypeDO.getCode());
mainDo.setFromLocationTypes(businesstypeDO.getOutLocationTypes()); mainDo.setFromLocationTypes(businesstypeDO.getOutLocationTypes());
mainDo.setFromAreaCodes(businesstypeDO.getOutAreaCodes()); mainDo.setFromAreaCodes(businesstypeDO.getOutAreaCodes());
@ -259,8 +427,7 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("PutawayRequest"); RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("PutawayRequest");
if (requestsettingDO == null) { if (requestsettingDO == null) {
message.append("根据申请单设置未查找到采购退货申请的相关业务类型"); message.append("根据申请单设置未查找到采购退货申请的相关业务类型");
} } else {
else {
mainDo.setAutoAgree(requestsettingDO.getAutoAgree()); mainDo.setAutoAgree(requestsettingDO.getAutoAgree());
mainDo.setAutoCommit(requestsettingDO.getAutoCommit()); mainDo.setAutoCommit(requestsettingDO.getAutoCommit());
mainDo.setAutoExecute(requestsettingDO.getAutoExecute()); mainDo.setAutoExecute(requestsettingDO.getAutoExecute());
@ -280,7 +447,7 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
* @param detailDo * @param detailDo
* @return * @return
*/ */
private String validatorPutawayRequestDetailImport(PutawayRequestDetailDO detailDo, PutawayRequestMainDO mainDo,BusinesstypeDO businesstypeDO) { private String validatorPutawayRequestDetailImport(PutawayRequestDetailDO detailDo, PutawayRequestMainDO mainDo, BusinesstypeDO businesstypeDO) {
StringBuilder message = new StringBuilder(); StringBuilder message = new StringBuilder();
try { try {
ItembasicDO itembasicDO = validatorItembasic(detailDo.getItemCode()); ItembasicDO itembasicDO = validatorItembasic(detailDo.getItemCode());
@ -293,9 +460,9 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
} catch (Exception ex) { } catch (Exception ex) {
message.append(ex.getMessage()).append(","); message.append(ex.getMessage()).append(",");
} }
try{ try {
validatorIfInType(itembasicDO.getType(), businesstypeDO); validatorIfInType(itembasicDO.getType(), businesstypeDO);
}catch (Exception ex) { } catch (Exception ex) {
message.append(ex.getMessage()).append(","); message.append(ex.getMessage()).append(",");
} }
} catch (Exception ex) { } catch (Exception ex) {
@ -306,25 +473,24 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
} catch (Exception ex) { } catch (Exception ex) {
message.append(ex.getMessage()).append(","); message.append(ex.getMessage()).append(",");
} }
try{ try {
validatorLocation(detailDo.getFromLocationCode()); validatorLocation(detailDo.getFromLocationCode());
}catch (Exception ex) { } catch (Exception ex) {
message.append(ex.getMessage()).append(","); message.append(ex.getMessage()).append(",");
} }
try {
try{
validatorIfOutInventoryStatuses(detailDo.getInventoryStatus(), businesstypeDO); validatorIfOutInventoryStatuses(detailDo.getInventoryStatus(), businesstypeDO);
}catch (Exception ex) { } catch (Exception ex) {
message.append(ex.getMessage()).append(","); message.append(ex.getMessage()).append(",");
} }
try{ try {
validatorIfInToLocationType(detailDo.getFromLocationCode(), businesstypeDO); validatorIfInToLocationType(detailDo.getFromLocationCode(), businesstypeDO);
}catch (Exception ex) { } catch (Exception ex) {
message.append(ex.getMessage()).append(","); message.append(ex.getMessage()).append(",");
} }
try { try {
ArrayList<String> inventoryStatus = new ArrayList<>(); ArrayList<String> inventoryStatus = new ArrayList<>();
inventoryStatus.set(0,detailDo.getInventoryStatus()); inventoryStatus.set(0, detailDo.getInventoryStatus());
validatorManagementAccuracy(detailDo.getItemCode(), detailDo.getPackingNumber(), detailDo.getBatch(), detailDo.getFromLocationCode(), inventoryStatus); validatorManagementAccuracy(detailDo.getItemCode(), detailDo.getPackingNumber(), detailDo.getBatch(), detailDo.getFromLocationCode(), inventoryStatus);
} catch (Exception ex) { } catch (Exception ex) {
message.append(ex.getMessage()).append(","); message.append(ex.getMessage()).append(",");
@ -337,34 +503,37 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
return message.toString(); return message.toString();
} }
private void ifUomSuccess(String itemUom,String uom) { private void ifUomSuccess(String itemUom, String uom) {
if(!itemUom.equals(uom)){ if (!itemUom.equals(uom)) {
throw exception(ITEMBASIC_CODE_EXISTS,"提示单位"+ uom + "错误,应该是" + itemUom); throw exception(ITEMBASIC_CODE_EXISTS, "提示单位" + uom + "错误,应该是" + itemUom);
} }
} }
private ItembasicDO validatorItembasic(String itemCode){
private ItembasicDO validatorItembasic(String itemCode) {
return itembasicService.selectItembasic(itemCode); return itembasicService.selectItembasic(itemCode);
} }
private PurchaseDetailDO validatorPurchaseDetailDo(String pnumber, String psupplierCode, String pitemCode, String poLine){ private PurchaseDetailDO validatorPurchaseDetailDo(String pnumber, String psupplierCode, String pitemCode, String poLine) {
return purchaseMainService.selectPurchaseDetailDoExist(pnumber, psupplierCode, pitemCode, poLine); return purchaseMainService.selectPurchaseDetailDoExist(pnumber, psupplierCode, pitemCode, poLine);
} }
private LocationDO validatorLocation(String fromLocationCode){ private LocationDO validatorLocation(String fromLocationCode) {
return locationService.selectLocation(fromLocationCode); return locationService.selectLocation(fromLocationCode);
} }
private void validatorIfInType(String type, BusinesstypeDO businesstypeDO){
private void validatorIfInType(String type, BusinesstypeDO businesstypeDO) {
jobUtils.ifInType(type, businesstypeDO); jobUtils.ifInType(type, businesstypeDO);
} }
private void validatorIfOutInventoryStatuses(String inventoryStatus,BusinesstypeDO businesstypeDO){ private void validatorIfOutInventoryStatuses(String inventoryStatus, BusinesstypeDO businesstypeDO) {
jobUtils.ifOutInventoryStatuses(inventoryStatus, businesstypeDO); jobUtils.ifOutInventoryStatuses(inventoryStatus, businesstypeDO);
} }
private void validatorIfInToLocationType(String fromLocationCode,BusinesstypeDO businesstypeDO){ private void validatorIfInToLocationType(String fromLocationCode, BusinesstypeDO businesstypeDO) {
jobUtils.ifInType(fromLocationCode, businesstypeDO); jobUtils.ifInType(fromLocationCode, businesstypeDO);
} }
private void validatorManagementAccuracy(String itemCode,String packingNumber,String batch,String fromLocationCode,List<String> inventoryStatus){
jobUtils.selectlocationReturnManagementAccuracy(itemCode, packingNumber,batch,fromLocationCode,inventoryStatus); private void validatorManagementAccuracy(String itemCode, String packingNumber, String batch, String fromLocationCode, List<String> inventoryStatus) {
jobUtils.selectlocationReturnManagementAccuracy(itemCode, packingNumber, batch, fromLocationCode, inventoryStatus);
} }
} }

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/requestsetting/RequestsettingServiceImpl.java

@ -246,8 +246,9 @@ public class RequestsettingServiceImpl implements RequestsettingService {
public RequestsettingDO selectRequestsettingExist(String pcode){ public RequestsettingDO selectRequestsettingExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode); queryWrapper.eq("code",pcode);
queryWrapper.eq("available","TRUE");
RequestsettingDO requestsettingDO = requestsettingMapper.selectOne(queryWrapper); RequestsettingDO requestsettingDO = requestsettingMapper.selectOne(queryWrapper);
if(requestsettingDO != null && "TRUE".equals(requestsettingDO.getAvailable())){ if(requestsettingDO != null){
return requestsettingDO; return requestsettingDO;
}else { }else {
throw exception(REQUESTSETTING_NOT_EXISTS); throw exception(REQUESTSETTING_NOT_EXISTS);

8
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/rule/RuleService.java

@ -4,6 +4,7 @@ import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult; import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.itembasic.vo.ItembasicExportReqVO; import com.win.module.wms.controller.itembasic.vo.ItembasicExportReqVO;
import com.win.module.wms.controller.rule.vo.*; import com.win.module.wms.controller.rule.vo.*;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.rule.RuleDO; import com.win.module.wms.dal.dataobject.rule.RuleDO;
import javax.validation.Valid; import javax.validation.Valid;
@ -40,6 +41,13 @@ public interface RuleService {
* @param updateReqVO 更新信息 * @param updateReqVO 更新信息
*/ */
void updateRule(@Valid RuleUpdateReqVO updateReqVO); void updateRule(@Valid RuleUpdateReqVO updateReqVO);
/**
* 获得物品基本信息列表
*
* @param conditions 条件
* @return 物品基本信息列表
*/
List<RuleDO> getRuleList(CustomConditions conditions);
/** /**
* 删除规则 * 删除规则

5
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/rule/RuleServiceImpl.java

@ -83,7 +83,10 @@ public class RuleServiceImpl implements RuleService {
public PageResult<RuleDO> getRulePage(RulePageReqVO pageReqVO) { public PageResult<RuleDO> getRulePage(RulePageReqVO pageReqVO) {
return ruleMapper.selectPage(pageReqVO); return ruleMapper.selectPage(pageReqVO);
} }
@Override
public List<RuleDO> getRuleList(CustomConditions conditions) {
return ruleMapper.selectSeniorList(conditions);
}
private void validateRuleForCreateOrUpdate(Long id, String strategyCode,Integer priority) { private void validateRuleForCreateOrUpdate(Long id, String strategyCode,Integer priority) {
// 关闭数据权限,避免因为没有数据权限,查询不到数据,进而导致唯一校验不正确 // 关闭数据权限,避免因为没有数据权限,查询不到数据,进而导致唯一校验不正确
DataPermissionUtils.executeIgnore(() -> { DataPermissionUtils.executeIgnore(() -> {

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save