|
@@ -1,7 +1,6 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
@@ -11,7 +10,6 @@ import org.springframework.data.domain.Sort.Direction;
|
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -28,7 +26,6 @@ import com.uas.platform.b2b.model.PurchaseOrderReply;
|
|
|
import com.uas.platform.b2b.model.PurchaseOrderTodo;
|
|
import com.uas.platform.b2b.model.PurchaseOrderTodo;
|
|
|
import com.uas.platform.b2b.model.PurchaseOrderWaiting;
|
|
import com.uas.platform.b2b.model.PurchaseOrderWaiting;
|
|
|
import com.uas.platform.b2b.model.SearchFilter;
|
|
import com.uas.platform.b2b.model.SearchFilter;
|
|
|
-import com.uas.platform.b2b.model.Vendor;
|
|
|
|
|
import com.uas.platform.b2b.service.PurchaseOrderService;
|
|
import com.uas.platform.b2b.service.PurchaseOrderService;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
import com.uas.platform.b2b.support.JxlsExcelView;
|
|
import com.uas.platform.b2b.support.JxlsExcelView;
|
|
@@ -53,7 +50,7 @@ public class SaleOrderController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PurchaseOrderService purchaseOrderService;
|
|
private PurchaseOrderService purchaseOrderService;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private UserService userService;
|
|
private UserService userService;
|
|
|
|
|
|
|
@@ -72,9 +69,9 @@ public class SaleOrderController {
|
|
|
logger.log("客户采购单", "查看收到的客户采购订单列表");
|
|
logger.log("客户采购单", "查看收到的客户采购订单列表");
|
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- //判断当前用户是否被客户分配
|
|
|
|
|
|
|
+ // 判断当前用户是否被客户分配
|
|
|
SearchFilter filter = userService.distribute();
|
|
SearchFilter filter = userService.distribute();
|
|
|
- if(filter != null && filter.getDistribute() == null) {
|
|
|
|
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
return purchaseOrderService.findAllByPageInfo(info, filter);
|
|
return purchaseOrderService.findAllByPageInfo(info, filter);
|
|
@@ -91,7 +88,7 @@ public class SaleOrderController {
|
|
|
public PurchaseOrderAll getReceivedPurchaseOrderItemById(@PathVariable("id") Long id) {
|
|
public PurchaseOrderAll getReceivedPurchaseOrderItemById(@PathVariable("id") Long id) {
|
|
|
return purchaseOrderService.findById(id);
|
|
return purchaseOrderService.findById(id);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 作为卖家,根据采购单据ID查找采购订单(含明细)
|
|
* 作为卖家,根据采购单据ID查找采购订单(含明细)
|
|
|
*
|
|
*
|
|
@@ -102,7 +99,7 @@ public class SaleOrderController {
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public ResponseEntity<String> printCount(@PathVariable("id") Long id) {
|
|
public ResponseEntity<String> printCount(@PathVariable("id") Long id) {
|
|
|
purchaseOrderService.print(id);
|
|
purchaseOrderService.print(id);
|
|
|
- logger.log("客户采购单", "打印客户采购订单",id.toString());
|
|
|
|
|
|
|
+ logger.log("客户采购单", "打印客户采购订单", id.toString());
|
|
|
return new ResponseEntity<String>(HttpStatus.OK);
|
|
return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -120,18 +117,17 @@ public class SaleOrderController {
|
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- //判断当前用户是否被客户分配
|
|
|
|
|
|
|
+ // 判断当前用户是否被客户分配
|
|
|
SearchFilter filter2 = userService.distribute();
|
|
SearchFilter filter2 = userService.distribute();
|
|
|
- if(filter2 != null ) {
|
|
|
|
|
|
|
+ if (filter2 != null) {
|
|
|
if (filter2.getDistribute() == null) {
|
|
if (filter2.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
} else {
|
|
} else {
|
|
|
filter.setDistribute(filter2.getDistribute());
|
|
filter.setDistribute(filter2.getDistribute());
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
return purchaseOrderService.findAllDetailByPageInfo(info, filter);
|
|
return purchaseOrderService.findAllDetailByPageInfo(info, filter);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 作为卖家,收到的采购订单(含明细)(待回复)
|
|
* 作为卖家,收到的采购订单(含明细)(待回复)
|
|
@@ -147,15 +143,15 @@ public class SaleOrderController {
|
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- //判断当前用户是否被客户分配
|
|
|
|
|
|
|
+ // 判断当前用户是否被客户分配
|
|
|
SearchFilter filter2 = userService.distribute();
|
|
SearchFilter filter2 = userService.distribute();
|
|
|
- if(filter2 != null ) {
|
|
|
|
|
|
|
+ if (filter2 != null) {
|
|
|
if (filter2.getDistribute() == null) {
|
|
if (filter2.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
} else {
|
|
} else {
|
|
|
filter.setDistribute(filter2.getDistribute());
|
|
filter.setDistribute(filter2.getDistribute());
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
return purchaseOrderService.findTodoByPageInfo(info, filter);
|
|
return purchaseOrderService.findTodoByPageInfo(info, filter);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -173,15 +169,15 @@ public class SaleOrderController {
|
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- //判断当前用户是否被客户分配
|
|
|
|
|
|
|
+ // 判断当前用户是否被客户分配
|
|
|
SearchFilter filter2 = userService.distribute();
|
|
SearchFilter filter2 = userService.distribute();
|
|
|
- if(filter2 != null ) {
|
|
|
|
|
|
|
+ if (filter2 != null) {
|
|
|
if (filter2.getDistribute() == null) {
|
|
if (filter2.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
} else {
|
|
} else {
|
|
|
filter.setDistribute(filter2.getDistribute());
|
|
filter.setDistribute(filter2.getDistribute());
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
return purchaseOrderService.findDoneByPageInfo(info, filter);
|
|
return purchaseOrderService.findDoneByPageInfo(info, filter);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -199,25 +195,23 @@ public class SaleOrderController {
|
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
// 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- //判断当前用户是否被客户分配
|
|
|
|
|
|
|
+ // 判断当前用户是否被客户分配
|
|
|
SearchFilter filter2 = userService.distribute();
|
|
SearchFilter filter2 = userService.distribute();
|
|
|
- if(filter2 != null ) {
|
|
|
|
|
|
|
+ if (filter2 != null) {
|
|
|
if (filter2.getDistribute() == null) {
|
|
if (filter2.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
} else {
|
|
} else {
|
|
|
filter.setDistribute(filter2.getDistribute());
|
|
filter.setDistribute(filter2.getDistribute());
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
return purchaseOrderService.findEndByPageInfo(info, filter);
|
|
return purchaseOrderService.findEndByPageInfo(info, filter);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
- * @param params
|
|
|
|
|
- * @param searchFilter
|
|
|
|
|
- * @author yujia
|
|
|
|
|
- * 获取待发货的订单
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * @param params
|
|
|
|
|
+ * @param searchFilter
|
|
|
|
|
+ * @author yujia 获取待发货的订单
|
|
|
|
|
+ */
|
|
|
@RequestMapping(value = "/items", params = RequestState.WAITING, method = RequestMethod.GET)
|
|
@RequestMapping(value = "/items", params = RequestState.WAITING, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Page<PurchaseOrderWaiting> getWaitingPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
public Page<PurchaseOrderWaiting> getWaitingPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
@@ -225,18 +219,17 @@ public class SaleOrderController {
|
|
|
PageInfo info = new PageInfo(params);
|
|
PageInfo info = new PageInfo(params);
|
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
|
|
|
- //判断当前用户是否被客户分配
|
|
|
|
|
|
|
+ // 判断当前用户是否被客户分配
|
|
|
SearchFilter filter2 = userService.distribute();
|
|
SearchFilter filter2 = userService.distribute();
|
|
|
- if(filter2 != null ) {
|
|
|
|
|
|
|
+ if (filter2 != null) {
|
|
|
if (filter2.getDistribute() == null) {
|
|
if (filter2.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
} else {
|
|
} else {
|
|
|
filter.setDistribute(filter2.getDistribute());
|
|
filter.setDistribute(filter2.getDistribute());
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
return purchaseOrderService.findWaitingByPageInfo(info, filter);
|
|
return purchaseOrderService.findWaitingByPageInfo(info, filter);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 作为卖家,回复收到的采购订单
|
|
* 作为卖家,回复收到的采购订单
|
|
@@ -252,8 +245,7 @@ public class SaleOrderController {
|
|
|
orderItem.setId(orderItemId);
|
|
orderItem.setId(orderItemId);
|
|
|
reply.setOrderItem(orderItem);
|
|
reply.setOrderItem(orderItem);
|
|
|
reply = purchaseOrderService.reply(reply);
|
|
reply = purchaseOrderService.reply(reply);
|
|
|
- logger.log("客户采购单", "单个回复客户采购明细", reply.replyDescription(), reply.getOrderItem().getOrder().getCode(),
|
|
|
|
|
- orderItemId);
|
|
|
|
|
|
|
+ logger.log("客户采购单", "单个回复客户采购明细", reply.replyDescription(), reply.getOrderItem().getOrder().getCode(), orderItemId);
|
|
|
return new ResponseEntity<String>(HttpStatus.OK);
|
|
return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -280,8 +272,8 @@ public class SaleOrderController {
|
|
|
public ResponseEntity<String> replyOrderItems(@RequestBody String idString) {
|
|
public ResponseEntity<String> replyOrderItems(@RequestBody String idString) {
|
|
|
List<PurchaseOrderReply> replies = purchaseOrderService.reply(idString.split(","));
|
|
List<PurchaseOrderReply> replies = purchaseOrderService.reply(idString.split(","));
|
|
|
for (PurchaseOrderReply reply : replies)
|
|
for (PurchaseOrderReply reply : replies)
|
|
|
- logger.log("客户采购单", "批量回复客户采购明细", reply.replyDescription(), reply.getOrderItem().getOrder().getCode(),
|
|
|
|
|
- reply.getOrderItem().getId());
|
|
|
|
|
|
|
+ logger.log("客户采购单", "批量回复客户采购明细", reply.replyDescription(), reply.getOrderItem().getOrder().getCode(), reply.getOrderItem()
|
|
|
|
|
+ .getId());
|
|
|
return new ResponseEntity<String>(HttpStatus.OK);
|
|
return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -350,7 +342,7 @@ public class SaleOrderController {
|
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleOrder", "客户采购单列表_全部"));
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleOrder", "客户采购单列表_全部"));
|
|
|
logger.log("客户采购单", "导出Excel列表", "导出全部Excel列表");
|
|
logger.log("客户采购单", "导出Excel列表", "导出全部Excel列表");
|
|
|
return modelAndView;
|
|
return modelAndView;
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 导出 - 待回复
|
|
* 导出 - 待回复
|
|
@@ -417,7 +409,7 @@ public class SaleOrderController {
|
|
|
logger.log("客户采购单", "导出Excel列表", "导出已结案Excel列表");
|
|
logger.log("客户采购单", "导出Excel列表", "导出已结案Excel列表");
|
|
|
return modelAndView;
|
|
return modelAndView;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 导出 - 待交货
|
|
* 导出 - 待交货
|
|
|
*
|
|
*
|