|
@@ -59,35 +59,21 @@ public class ProductionShipmentNotificationController {
|
|
|
return success();
|
|
return success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @ApiOperation("出货通知列表")
|
|
|
|
|
- @PostMapping("/list")
|
|
|
|
|
- public AjaxResult listAll( @RequestBody ProductionRegularPlanRequest planRequest,HttpServletRequest request) {
|
|
|
|
|
- String productionType = planRequest.getProductionType();
|
|
|
|
|
- QueryWrapper<ProductionShipmentNotification> wrapper = new QueryWrapper<ProductionShipmentNotification>()
|
|
|
|
|
- .eq("org_id", tokenService.getLoginOrgId(request));
|
|
|
|
|
- if (StringUtils.isNotEmpty(productionType)){
|
|
|
|
|
- wrapper.in("a.product_type", Arrays.asList(productionType.split(",")));
|
|
|
|
|
- }
|
|
|
|
|
- wrapper.eq(StringUtils.isNotEmpty(planRequest.getDeliveryDate()),"a.delivery_date",planRequest.getDeliveryDate());
|
|
|
|
|
- List<ProductionShipmentNotification> list = productionShipmentNotificationService.list(wrapper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- return success();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@ApiOperation("出货通知列表")
|
|
@ApiOperation("出货通知列表")
|
|
|
@PostMapping("/listTree")
|
|
@PostMapping("/listTree")
|
|
|
public AjaxResult listTree( @RequestBody ProductionRegularPlanRequest planRequest,HttpServletRequest request) {
|
|
public AjaxResult listTree( @RequestBody ProductionRegularPlanRequest planRequest,HttpServletRequest request) {
|
|
|
- String productionType = planRequest.getProductionType();
|
|
|
|
|
|
|
+ String productionTypes = planRequest.getProductTypes();
|
|
|
QueryWrapper<ProductionShipmentNotification> wrapper = new QueryWrapper<ProductionShipmentNotification>()
|
|
QueryWrapper<ProductionShipmentNotification> wrapper = new QueryWrapper<ProductionShipmentNotification>()
|
|
|
- .eq("org_id", tokenService.getLoginOrgId(request));
|
|
|
|
|
- if (StringUtils.isNotEmpty(productionType)){
|
|
|
|
|
- wrapper.in("a.product_type", Arrays.asList(productionType.split(",")));
|
|
|
|
|
|
|
+ .eq("a.org_id", tokenService.getLoginOrgId(request));
|
|
|
|
|
+ if (StringUtils.isNotEmpty(productionTypes)){
|
|
|
|
|
+ wrapper.in("a.product_num", Arrays.asList(productionTypes.split(",")));
|
|
|
}
|
|
}
|
|
|
wrapper.eq(StringUtils.isNotEmpty(planRequest.getDeliveryDate()),"a.delivery_date",planRequest.getDeliveryDate());
|
|
wrapper.eq(StringUtils.isNotEmpty(planRequest.getDeliveryDate()),"a.delivery_date",planRequest.getDeliveryDate());
|
|
|
List<ProductionRegularPlanParam> listTree = productionShipmentNotificationService.listTree(wrapper);
|
|
List<ProductionRegularPlanParam> listTree = productionShipmentNotificationService.listTree(wrapper);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ System.out.println(listTree.toString());
|
|
|
return success( buildTree(listTree));
|
|
return success( buildTree(listTree));
|
|
|
}
|
|
}
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
@@ -126,42 +112,48 @@ public class ProductionShipmentNotificationController {
|
|
|
lineNode.addChild(marketNode);
|
|
lineNode.addChild(marketNode);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- // 创建customer节点并添加到market节点
|
|
|
|
|
- TreeNode customerNode = new TreeNode(TreeNode.NodeType.CUSTOMER,
|
|
|
|
|
- data.getCustomerNum(), data.getCustomer());
|
|
|
|
|
- marketNode.addChild(customerNode);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- // 第二步:向上收集customerNum
|
|
|
|
|
- for (TreeNode lineNode : lineNodeMap.values()) {
|
|
|
|
|
- for (TreeNode marketNode : lineNode.getChildren()) {
|
|
|
|
|
- for (TreeNode customerNode : marketNode.getChildren()) {
|
|
|
|
|
- customerNode.addCustomerNum(customerNode.getNum());
|
|
|
|
|
- // 收集market节点的customerNum
|
|
|
|
|
- marketNode.getAllCustomerNums().add(customerNode.getNum());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 收集line节点的customerNum
|
|
|
|
|
- lineNode.getAllCustomerNums().addAll(marketNode.getAllCustomerNums());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (!marketNode.getAllCustomerNums().contains(data.getCustomerNum())) {
|
|
|
|
|
+ TreeNode customerNode = new TreeNode(TreeNode.NodeType.CUSTOMER,
|
|
|
|
|
+ data.getCustomerNum(), data.getCustomer());
|
|
|
|
|
+ marketNode.addChild(customerNode);
|
|
|
|
|
+ customerNode.addCustomerNum(data.getCustomerNum());
|
|
|
}
|
|
}
|
|
|
|
|
+ marketNode.addCustomerNum(data.getCustomerNum());
|
|
|
|
|
+ lineNode.addCustomerNum(data.getCustomerNum());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+// for (TreeNode lineNode : lineNodeMap.values()) {
|
|
|
|
|
+// for (TreeNode marketNode : lineNode.getChildren()) {
|
|
|
|
|
+// for (TreeNode customerNode : marketNode.getChildren()) {
|
|
|
|
|
+// customerNode.addCustomerNum(customerNode.getNum());
|
|
|
|
|
+// // 收集market节点的customerNum
|
|
|
|
|
+// marketNode.getAllCustomerNums().add(customerNode.getNum());
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// // 收集line节点的customerNum
|
|
|
|
|
+// lineNode.getAllCustomerNums().addAll(marketNode.getAllCustomerNums());
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
return new ArrayList<>(lineNodeMap.values());
|
|
return new ArrayList<>(lineNodeMap.values());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("出货通知分页")
|
|
@ApiOperation("出货通知分页")
|
|
|
- @GetMapping("/page")
|
|
|
|
|
|
|
+ @PostMapping("/page")
|
|
|
public AjaxResult page(
|
|
public AjaxResult page(
|
|
|
@RequestBody ProductionRegularPlanRequest planRequest,
|
|
@RequestBody ProductionRegularPlanRequest planRequest,
|
|
|
HttpServletRequest request
|
|
HttpServletRequest request
|
|
|
) {
|
|
) {
|
|
|
- String productionType = planRequest.getProductionType();
|
|
|
|
|
|
|
+ String productionTypes = planRequest.getProductTypes();
|
|
|
String customerNums = planRequest.getCustomerNums();
|
|
String customerNums = planRequest.getCustomerNums();
|
|
|
QueryWrapper<ProductionShipmentNotification> wrapper = new QueryWrapper<ProductionShipmentNotification>()
|
|
QueryWrapper<ProductionShipmentNotification> wrapper = new QueryWrapper<ProductionShipmentNotification>()
|
|
|
.eq("org_id", tokenService.getLoginOrgId(request));
|
|
.eq("org_id", tokenService.getLoginOrgId(request));
|
|
|
- if (StringUtils.isNotEmpty(productionType)){
|
|
|
|
|
- wrapper.in("product_type", Arrays.asList(productionType.split(",")));
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(productionTypes)){
|
|
|
|
|
+ wrapper.in("product_type", Arrays.asList(productionTypes.split(",")));
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotEmpty(customerNums)){
|
|
if (StringUtils.isNotEmpty(customerNums)){
|
|
|
wrapper.in("customer_number", Arrays.asList(customerNums.split(",")));
|
|
wrapper.in("customer_number", Arrays.asList(customerNums.split(",")));
|
|
@@ -170,8 +162,27 @@ public class ProductionShipmentNotificationController {
|
|
|
wrapper.eq(StringUtils.isNotEmpty(planRequest.getDeliveryDate()),"delivery_date",planRequest.getDeliveryDate());
|
|
wrapper.eq(StringUtils.isNotEmpty(planRequest.getDeliveryDate()),"delivery_date",planRequest.getDeliveryDate());
|
|
|
|
|
|
|
|
|
|
|
|
|
- productionShipmentNotificationService.page(new Page<>(planRequest.getPageNum(),planRequest.getPageSize()),wrapper);
|
|
|
|
|
- return success();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return success( productionShipmentNotificationService.page(new Page<>(planRequest.getPageNum(),planRequest.getPageSize()),wrapper));
|
|
|
|
|
+ }
|
|
|
|
|
+ @ApiOperation("出货通知列表")
|
|
|
|
|
+ @PostMapping("/list")
|
|
|
|
|
+ public AjaxResult listAll( @RequestBody ProductionRegularPlanRequest planRequest,HttpServletRequest request) {
|
|
|
|
|
+ String productionTypes = planRequest.getProductTypes();
|
|
|
|
|
+ String customerNums = planRequest.getCustomerNums();
|
|
|
|
|
+ QueryWrapper<ProductionShipmentNotification> wrapper = new QueryWrapper<ProductionShipmentNotification>()
|
|
|
|
|
+ .eq("org_id", tokenService.getLoginOrgId(request));
|
|
|
|
|
+ if (StringUtils.isNotEmpty(productionTypes)){
|
|
|
|
|
+ wrapper.in("product_type", Arrays.asList(productionTypes.split(",")));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotEmpty(customerNums)){
|
|
|
|
|
+ wrapper.in("customer_number", Arrays.asList(customerNums.split(",")));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ wrapper.eq(StringUtils.isNotEmpty(planRequest.getDeliveryDate()),"delivery_date",planRequest.getDeliveryDate());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return success( productionShipmentNotificationService.list(wrapper));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation("出货通知详情")
|
|
@ApiOperation("出货通知详情")
|