Browse Source

Merge remote-tracking branch 'origin/dev' into authority

hejq 9 years ago
parent
commit
a4b680ce2d
100 changed files with 2521 additions and 825 deletions
  1. 8 0
      src/main/java/com/uas/platform/b2b/controller/AuthenticationController.java
  2. 38 15
      src/main/java/com/uas/platform/b2b/controller/BaseInfoController.java
  3. 31 17
      src/main/java/com/uas/platform/b2b/controller/DeputyOrderController.java
  4. 15 1
      src/main/java/com/uas/platform/b2b/controller/MakeAcceptController.java
  5. 18 5
      src/main/java/com/uas/platform/b2b/controller/MakeOrderChangeController.java
  6. 15 4
      src/main/java/com/uas/platform/b2b/controller/MakeOrderController.java
  7. 13 1
      src/main/java/com/uas/platform/b2b/controller/MakeOutOrderController.java
  8. 16 2
      src/main/java/com/uas/platform/b2b/controller/MakeReturnController.java
  9. 33 20
      src/main/java/com/uas/platform/b2b/controller/PurcInquiryController.java
  10. 135 8
      src/main/java/com/uas/platform/b2b/controller/PurcProductController.java
  11. 21 21
      src/main/java/com/uas/platform/b2b/controller/PurchaseTenderController.java
  12. 31 0
      src/main/java/com/uas/platform/b2b/controller/RoleController.java
  13. 15 3
      src/main/java/com/uas/platform/b2b/controller/SaleAcceptController.java
  14. 18 3
      src/main/java/com/uas/platform/b2b/controller/SaleApBillController.java
  15. 34 12
      src/main/java/com/uas/platform/b2b/controller/SaleApCheckController.java
  16. 15 2
      src/main/java/com/uas/platform/b2b/controller/SaleBadInController.java
  17. 15 2
      src/main/java/com/uas/platform/b2b/controller/SaleBadOutController.java
  18. 46 35
      src/main/java/com/uas/platform/b2b/controller/SaleInquiryController.java
  19. 28 19
      src/main/java/com/uas/platform/b2b/controller/SaleInquiryMouldController.java
  20. 15 2
      src/main/java/com/uas/platform/b2b/controller/SaleMRBController.java
  21. 45 12
      src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java
  22. 20 9
      src/main/java/com/uas/platform/b2b/controller/SaleOrderChangeController.java
  23. 78 33
      src/main/java/com/uas/platform/b2b/controller/SaleOrderController.java
  24. 104 34
      src/main/java/com/uas/platform/b2b/controller/SaleQuotationController.java
  25. 16 3
      src/main/java/com/uas/platform/b2b/controller/SaleReturnController.java
  26. 76 24
      src/main/java/com/uas/platform/b2b/controller/SaleSampleController.java
  27. 9 7
      src/main/java/com/uas/platform/b2b/controller/UserController.java
  28. 23 2
      src/main/java/com/uas/platform/b2b/controller/VendorController.java
  29. 4 7
      src/main/java/com/uas/platform/b2b/dao/RoleDao.java
  30. 16 9
      src/main/java/com/uas/platform/b2b/erp/model/Prod.java
  31. 2 0
      src/main/java/com/uas/platform/b2b/erp/service/impl/ARCheckServiceImpl.java
  32. 2 0
      src/main/java/com/uas/platform/b2b/erp/service/impl/InquiryMouldServiceImpl.java
  33. 2 0
      src/main/java/com/uas/platform/b2b/erp/service/impl/InquiryServiceImpl.java
  34. 111 1
      src/main/java/com/uas/platform/b2b/erp/service/impl/PublicInquiryServiceImpl.java
  35. 2 0
      src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseForecastServiceImpl.java
  36. 2 0
      src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseSampleServiceImpl.java
  37. 1 0
      src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseServiceImpl.java
  38. 2 0
      src/main/java/com/uas/platform/b2b/erp/service/impl/TenderServiceImpl.java
  39. 1 6
      src/main/java/com/uas/platform/b2b/event/PurcInquirySaveReleaseEvent.java
  40. 1 1
      src/main/java/com/uas/platform/b2b/event/PurchaseInquiryItemSaveEvent.java
  41. 1 1
      src/main/java/com/uas/platform/b2b/event/PurchaseInquiryItemSaveReleaseEvent.java
  42. 51 44
      src/main/java/com/uas/platform/b2b/filter/SSOInterceptor.java
  43. 249 161
      src/main/java/com/uas/platform/b2b/listener/MessageListener.java
  44. 15 19
      src/main/java/com/uas/platform/b2b/model/PurcInquiryItem.java
  45. 4 4
      src/main/java/com/uas/platform/b2b/model/PurchaseInquiryItem.java
  46. 13 0
      src/main/java/com/uas/platform/b2b/model/Resource.java
  47. 27 0
      src/main/java/com/uas/platform/b2b/model/Role.java
  48. 6 0
      src/main/java/com/uas/platform/b2b/service/RoleService.java
  49. 1 1
      src/main/java/com/uas/platform/b2b/service/impl/MakeOrderChangeServiceImpl.java
  50. 1 1
      src/main/java/com/uas/platform/b2b/service/impl/MakeOrderServiceImpl.java
  51. 1 1
      src/main/java/com/uas/platform/b2b/service/impl/PurcInquiryServiceImpl.java
  52. 1 1
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryMouldServiceImpl.java
  53. 112 3
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java
  54. 1 1
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderServiceImpl.java
  55. 31 0
      src/main/java/com/uas/platform/b2b/service/impl/RoleServiceImpl.java
  56. 1 1
      src/main/java/com/uas/platform/b2b/service/impl/SaleARCheckServiceImpl.java
  57. 5 0
      src/main/java/com/uas/platform/b2b/service/impl/UserServiceImpl.java
  58. 2 0
      src/main/java/com/uas/platform/b2b/service/impl/VendorsServiceImpl.java
  59. 45 0
      src/main/java/com/uas/platform/b2b/support/MessageConf.java
  60. 6 1
      src/main/resources/dev/message.properties
  61. 6 1
      src/main/resources/prod/message.properties
  62. 6 1
      src/main/resources/test/message.properties
  63. 2 1
      src/main/webapp/resources/js/common/services.js
  64. 434 68
      src/main/webapp/resources/js/index/app.js
  65. 10 2
      src/main/webapp/resources/js/index/services/Account.js
  66. 27 7
      src/main/webapp/resources/js/index/services/BaseInfo.js
  67. 11 7
      src/main/webapp/resources/js/index/services/DeputyOrder.js
  68. 27 5
      src/main/webapp/resources/js/index/services/Fa.js
  69. 37 6
      src/main/webapp/resources/js/index/services/Make.js
  70. 11 3
      src/main/webapp/resources/js/index/services/Product.js
  71. 176 60
      src/main/webapp/resources/js/index/services/Purc.js
  72. 3 3
      src/main/webapp/resources/tpl/index/approvalFlow/role.html
  73. 11 9
      src/main/webapp/resources/tpl/index/approvalFlow/role_detail.html
  74. 7 7
      src/main/webapp/resources/tpl/index/approvalFlow/user.html
  75. 1 1
      src/main/webapp/resources/tpl/index/baseInfo/prodList.html
  76. 17 12
      src/main/webapp/resources/tpl/index/fa/apBill.html
  77. 6 6
      src/main/webapp/resources/tpl/index/fa/apBill_detail.html
  78. 3 3
      src/main/webapp/resources/tpl/index/fa/apCheck.html
  79. 5 5
      src/main/webapp/resources/tpl/index/fa/apCheck_detail.html
  80. 2 2
      src/main/webapp/resources/tpl/index/make/accept.html
  81. 4 4
      src/main/webapp/resources/tpl/index/make/change.html
  82. 2 2
      src/main/webapp/resources/tpl/index/make/change_detail.html
  83. 4 5
      src/main/webapp/resources/tpl/index/make/order.html
  84. 2 2
      src/main/webapp/resources/tpl/index/make/order_detail.html
  85. 2 2
      src/main/webapp/resources/tpl/index/make/outorder.html
  86. 2 2
      src/main/webapp/resources/tpl/index/make/outorder_detail.html
  87. 2 2
      src/main/webapp/resources/tpl/index/make/returns.html
  88. 4 4
      src/main/webapp/resources/tpl/index/purc/deputyOrder.html
  89. 7 7
      src/main/webapp/resources/tpl/index/purc/deputyOrder_detail.html
  90. 3 3
      src/main/webapp/resources/tpl/index/purc/inquiry.html
  91. 12 4
      src/main/webapp/resources/tpl/index/purc/inquiryInfo_detail.html
  92. 4 3
      src/main/webapp/resources/tpl/index/purc/order.html
  93. 2 2
      src/main/webapp/resources/tpl/index/purc/order_detail.html
  94. 2 2
      src/main/webapp/resources/tpl/index/purc/prodList.html
  95. 4 2
      src/main/webapp/resources/tpl/index/purc/tender_evaluation.html
  96. 1 1
      src/main/webapp/resources/tpl/index/qc/MRB.html
  97. 2 2
      src/main/webapp/resources/tpl/index/qc/badIn.html
  98. 4 3
      src/main/webapp/resources/tpl/index/qc/badOut.html
  99. 3 2
      src/main/webapp/resources/tpl/index/sale/accept.html
  100. 3 3
      src/main/webapp/resources/tpl/index/sale/accept_detail.html

+ 8 - 0
src/main/java/com/uas/platform/b2b/controller/AuthenticationController.java

@@ -5,6 +5,9 @@ import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
 import org.springframework.http.HttpStatus;
+import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -19,6 +22,11 @@ import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.sso.SSOHelper;
 import com.uas.sso.SSOToken;
 
+import java.util.Collection;
+import java.util.Iterator;
+
+import static com.uas.platform.b2b.model.Token.UserType.user;
+
 @RestController
 @RequestMapping("/authentication")
 public class AuthenticationController {

+ 38 - 15
src/main/java/com/uas/platform/b2b/controller/BaseInfoController.java

@@ -45,6 +45,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
+import static org.springframework.data.jpa.domain.AbstractPersistable_.id;
+
 /**
  * 基础资料设置<br>
  * 物料查看、物料资料上传
@@ -72,7 +74,7 @@ public class BaseInfoController {
 	/**
 	 * 查看自己的物料资料
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getAllProductInfo(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(全部)");
@@ -97,7 +99,7 @@ public class BaseInfoController {
 	 * @param keyword
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.STANDARD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.STANDARD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getStandardProductInfo(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(标准)");
@@ -132,7 +134,7 @@ public class BaseInfoController {
 	 * @param keyword
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getNonStandardProductInfo(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(非标准)");
@@ -162,7 +164,7 @@ public class BaseInfoController {
 	/**
 	 * 查看自己的物料资料--不查询(全部)
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getAllProduct(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(全部)");
@@ -174,7 +176,7 @@ public class BaseInfoController {
 	/**
 	 * 查看自己的物料资料--不查询(标准)
 	 */
-	@RequestMapping(value = "/info", params = RequestState.STANDARD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.STANDARD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getAllProductStandard(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(标准)");
@@ -187,7 +189,7 @@ public class BaseInfoController {
 	/**
 	 * 查看自己的物料资料--不查询(非标准)
 	 */
-	@RequestMapping(value = "/info", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getAllProductNonStandard(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(非标准)");
@@ -198,11 +200,11 @@ public class BaseInfoController {
 	}
 
 	/**
-	 * 通过id查看详情
+	 * 通过id查看产品详情(由于权限问题将产品和物料接口分离)
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
-	public Product getProductInfoById(@PathVariable("id") Long id) {
+	public Product getSaleProductInfoById(@PathVariable("id") Long id) {
 		return baseInfoService.findById(id);
 	}
 
@@ -214,9 +216,9 @@ public class BaseInfoController {
 	 * @return
 	 * @throws Exception
 	 */
-	@RequestMapping(value = "/delete/{id}", method = RequestMethod.DELETE)
+	@RequestMapping(value = "/edit/delete", method = RequestMethod.POST)
 	@ResponseBody
-	public ModelMap deleteById(@PathVariable("id") Long id) throws Exception {
+	public ModelMap deleteById(Long id) throws Exception {
 		ModelMap map = new ModelMap();
 		try {
 			baseInfoService.deleteById(id);
@@ -245,7 +247,7 @@ public class BaseInfoController {
 	 * @param prodInfo
 	 * @return
 	 */
-	@RequestMapping(value = "/updateProdInfo", method = RequestMethod.POST)
+	@RequestMapping(value = "/edit/updateProdInfo", method = RequestMethod.POST)
 	@ResponseBody
 	public ModelMap updateProdInfo(String prodInfo, FileUpload uploadItem) throws Exception {
 		Product productInfo = JSONObject.parseObject(prodInfo, Product.class);
@@ -260,7 +262,7 @@ public class BaseInfoController {
 	 * @param prodInfo
 	 * @return
 	 */
-	@RequestMapping(value = "/addNewProduct", method = RequestMethod.POST)
+	@RequestMapping(value = "/edit/addNewProduct", method = RequestMethod.POST)
 	@ResponseBody
 	public ModelMap addNewProduct(String prodInfo, FileUpload uploadItem) throws Exception {
 		Product productInfo = JSONObject.parseObject(prodInfo, Product.class);
@@ -280,6 +282,16 @@ public class BaseInfoController {
 		return modelAndView;
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出Excel
 	 * 
@@ -345,7 +357,7 @@ public class BaseInfoController {
 	 * @param uploadItem
 	 * @return
 	 */
-	@RequestMapping(value = "/release/excel", method = RequestMethod.POST)
+	@RequestMapping(value = "/edit/release/excel", method = RequestMethod.POST)
 	public ModelMap releaseByExcel(FileUpload uploadItem) {
 		ModelMap map = new ModelMap();
 		String fileName = uploadItem.getFile().getOriginalFilename();
@@ -472,12 +484,23 @@ public class BaseInfoController {
 	 * 
 	 * @param status
 	 */
-	@RequestMapping(value = "/toggle/{status}", method = RequestMethod.POST)
+	@RequestMapping(value = "/edit/toggle/{status}", method = RequestMethod.POST)
 	@ResponseBody
 	public void switchPorduct(@PathVariable("status") String status) {
 		baseInfoService.switchPorduct(status);
 	}
 
+	/**
+	 * 一键匹配物料信息
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/edit/matchbytype/{type}", method = RequestMethod.POST)
+	@ResponseBody
+	private ModelMap matchall(@PathVariable String type) {
+		return productService.matchall(type);
+	}
+
 	/**
 	 * 设置单据已读
 	 * @author wangmh

+ 31 - 17
src/main/java/com/uas/platform/b2b/controller/DeputyOrderController.java

@@ -123,19 +123,33 @@ public class DeputyOrderController {
 	 * @param deOrder
 	 * @return
 	 */
-	@RequestMapping(value = "/saveDeOrder", method = RequestMethod.POST)
+	@RequestMapping(value = "/edit/saveDeOrder", method = RequestMethod.POST)
 	public ModelMap saveDeOrder(@RequestBody String deOrder) {
 		DeputyOrder deorder = JSON.parseObject(deOrder, DeputyOrder.class);
+		deorder.setEntrystatus("保存");
 		return deputyOrderService.saveDeOrder(deorder);
 	}
-	
+
+	/**
+	 * 提交代采订单
+	 *
+	 * @param deOrder
+	 * @return
+	 */
+	@RequestMapping(value = "/submit/saveDeOrder", method = RequestMethod.POST)
+	public ModelMap submitDeOrder(@RequestBody String deOrder) {
+		DeputyOrder deorder = JSON.parseObject(deOrder, DeputyOrder.class);
+		deorder.setEntrystatus("已提交");
+		return deputyOrderService.saveDeOrder(deorder);
+	}
+
 	/**
 	 * 买家查看代采订单(全部)
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/getDeOrder", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrder(PageParams params, String searchFilter) {
 		logger.log("客户代采订单", "查看代采订单(全部)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -167,7 +181,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/getDeOrder", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.TODO, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrderTodo(PageParams params, String searchFilter) {
 		logger.log("客户代采订单", "查看代采订单(待提交)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -201,7 +215,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/getDeOrder", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.DONE, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrderDone(PageParams params, String searchFilter) {
 		logger.log("客户代采订单", "查看代采订单(已提交,待下载)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -235,7 +249,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/getDeOrder", params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.END, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrderEnd(PageParams params, String searchFilter) {
 		logger.log("客户代采订单", "查看代采订单(已提交,已下载)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -269,7 +283,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/getDeOrder", params = RequestState.AGREED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.AGREED, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrderAgreed(PageParams params, String searchFilter) {
 		logger.log("客户代采订单", "查看代采订单(审核同意)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -302,7 +316,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/getDeOrder", params = RequestState.REFUSED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.REFUSED, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrderRefused(PageParams params, String keyword) {
 		logger.log("客户代采订单", "查看代采订单(审核不同意)");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
@@ -334,7 +348,7 @@ public class DeputyOrderController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/getOrderDetail/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/getOrderDetail/{id}/info", method = RequestMethod.GET)
 	private DeputyOrder getOrderDetail(@PathVariable Long id) {
 		return deputyOrderService.getOrderDetail(id);
 	}
@@ -353,7 +367,7 @@ public class DeputyOrderController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/clearOrder/{id}", method = RequestMethod.DELETE)
+	@RequestMapping(value = "/edit/clearOrder/{id}", method = RequestMethod.POST)
 	private ModelMap clearOrder(@PathVariable Long id) {
 		return deputyOrderService.clearOrder(id);
 	}
@@ -519,7 +533,7 @@ public class DeputyOrderController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/copyorder/{id}", method = RequestMethod.POST)
+	@RequestMapping(value = "/edit/copyorder/{id}", method = RequestMethod.POST)
 	@ResponseBody
 	public ModelMap copyOrder(@PathVariable("id") Long id) {
 		return deputyOrderService.copyOrder(id);
@@ -531,7 +545,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/orderInfo", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrders(PageParams params, String searchFilter) {
 		logger.log("代采订单", "查看代采订单(全部)");
 		PageInfo pageInfo = new PageInfo(params);
@@ -545,7 +559,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/orderInfo", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrdersTodo(PageParams params, String searchFilter) {
 		logger.log("代采订单", "查看代采订单(待提交)");
 		PageInfo pageInfo = new PageInfo(params);
@@ -561,7 +575,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/orderInfo", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrdersDone(PageParams params, String searchFilter) {
 		logger.log("代采订单", "查看代采订单(未下载)");
 		PageInfo pageInfo = new PageInfo(params);
@@ -577,7 +591,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/orderInfo", params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.END, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrdersEnd(PageParams params, String searchFilter) {
 		logger.log("代采订单", "查看代采订单(已下载)");
 		PageInfo pageInfo = new PageInfo(params);
@@ -593,7 +607,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/orderInfo", params = RequestState.AGREED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.AGREED, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrdersAgreed(PageParams params, String searchFilter) {
 		logger.log("代采订单", "查看代采订单(已同意)");
 		PageInfo pageInfo = new PageInfo(params);
@@ -608,7 +622,7 @@ public class DeputyOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/orderInfo", params = RequestState.REFUSED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.REFUSED, method = RequestMethod.GET)
 	public SPage<DeputyOrder> getDeOrdersRefused(PageParams params, String searchFilter) {
 		logger.log("代采订单", "查看代采订单(不同意)");
 		PageInfo pageInfo = new PageInfo(params);

+ 15 - 1
src/main/java/com/uas/platform/b2b/controller/MakeAcceptController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -99,10 +100,23 @@ public class MakeAcceptController {
 		return makeAcceptService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出Excel-全部
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 18 - 5
src/main/java/com/uas/platform/b2b/controller/MakeOrderChangeController.java

@@ -9,6 +9,7 @@ import org.springframework.data.domain.Sort.Direction;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -60,10 +61,11 @@ public class MakeOrderChangeController {
 	/**
 	 * 作为卖家,收到的委外变更单(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<MakeOrderChangeItem> getReceivedPurchaseOrderChanges(PageParams params, String searchFilter) {
 		logger.log("客户委外变更单", "查看收到的客户委外变更单列表(全部)");
@@ -95,7 +97,7 @@ public class MakeOrderChangeController {
 	 * 处理接口保留,因流程变更不再使用(2015年8月11日10:39:49)
 	 * 
 	 * @param json
-	 * @param changeId
+	 * @param itemId
 	 * @return
 	 */
 	@RequestMapping(value = "/{itemId}/reply", method = RequestMethod.POST)
@@ -112,16 +114,27 @@ public class MakeOrderChangeController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public MakeOrderChangeItem getReceivedPurchaseOrderItemById(@PathVariable("id") Long id) {
 		return makeOrderChangeService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 excel - 全部
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 15 - 4
src/main/java/com/uas/platform/b2b/controller/MakeOrderController.java

@@ -62,7 +62,7 @@ public class MakeOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/status", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<MakeOrder> getAllMakeOrders(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括委外明细)(全部)");
@@ -201,7 +201,7 @@ public class MakeOrderController {
 	 * 作为卖家,回复收到的委外加工单
 	 * 
 	 * @param json
-	 * @param orderItemId
+	 * @param orderId
 	 * @return
 	 */
 	@RequestMapping(value = "/{orderId}/reply", method = RequestMethod.POST)
@@ -216,7 +216,7 @@ public class MakeOrderController {
 	/**
 	 * 作为卖家,查看我的委外加工单回复
 	 * 
-	 * @param orderItemId
+	 * @param orderId
 	 *            加工单ID
 	 * @return
 	 */
@@ -232,7 +232,7 @@ public class MakeOrderController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public MakeOrder getOrderDetailById(@PathVariable("id") Long id) {
 		return makeOrderService.findById(id);
@@ -252,6 +252,17 @@ public class MakeOrderController {
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 excel - 全部
 	 * 

+ 13 - 1
src/main/java/com/uas/platform/b2b/controller/MakeOutOrderController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -103,10 +104,21 @@ public class MakeOutOrderController {
 		return makeOrderService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 excel - 全部
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 16 - 2
src/main/java/com/uas/platform/b2b/controller/MakeReturnController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -58,7 +59,7 @@ public class MakeReturnController {
 	 * 作为卖家,客户的委外验收单(全部)
 	 * 
 	 * @param params
-	 * @param keyword
+	 * @param searchFilter
 	 *            查找关键词
 	 * @return
 	 */
@@ -103,10 +104,23 @@ public class MakeReturnController {
 		return makeReturnService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出Excel-全部
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 33 - 20
src/main/java/com/uas/platform/b2b/controller/PurcInquiryController.java

@@ -13,10 +13,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.alibaba.fastjson.JSON;
@@ -66,10 +63,12 @@ public class PurcInquiryController {
 	/**
 	 * 保存(或修改)
 	 *
-	 * @param formStore
+	 * @param inquiry
+	 * @param contacts
+	 * @param uploadItem
 	 * @return
 	 */
-	@RequestMapping(value = "/save", method = RequestMethod.POST)
+	@RequestMapping(value = "/save/withVendor", method = RequestMethod.POST)
 	private ModelMap save(String inquiry, String contacts, FileUpload uploadItem) {
 		PurcInquiryInfo purcInquiry = JSONObject.parseObject(inquiry, PurcInquiryInfo.class);
 		List<VendorAndContact> vendors = FlexJsonUtils.fromJsonArray(contacts, VendorAndContact.class);
@@ -82,7 +81,7 @@ public class PurcInquiryController {
 	 * @param inquiry
 	 * @return
 	 */
-	@RequestMapping(value = "/saveWithoutVendor", method = RequestMethod.POST)
+	@RequestMapping(value = "/save/withoutVendor", method = RequestMethod.POST)
 	private ModelMap saveWithoutVendor(String inquiry, FileUpload uploadItem) {
 		PurcInquiryInfo purcInquiry = JSONObject.parseObject(inquiry, PurcInquiryInfo.class);
 		return purcInquiryService.saveWithoutVendor(purcInquiry, uploadItem);
@@ -91,10 +90,12 @@ public class PurcInquiryController {
 	/**
 	 * 保存并提交
 	 *
-	 * @param formStore
+	 * @param inquiry
+	 * @param contacts
+	 * @param uploadItem
 	 * @return
 	 */
-	@RequestMapping(value = "/saveAndSubmit", method = RequestMethod.POST)
+	@RequestMapping(value = "/submit/withVendor", method = RequestMethod.POST)
 	private ModelMap saveAndSubmit(String inquiry, String contacts, FileUpload uploadItem) {
 		PurcInquiryInfo purcInquiry = JSONObject.parseObject(inquiry, PurcInquiryInfo.class);
 		List<VendorAndContact> vendors = FlexJsonUtils.fromJsonArray(contacts, VendorAndContact.class);
@@ -104,10 +105,11 @@ public class PurcInquiryController {
 	/**
 	 * 保存并提交(公共)
 	 *
-	 * @param formStore
+	 * @param inquiry
+	 * @param uploadItem
 	 * @return
 	 */
-	@RequestMapping(value = "/saveAndSubmitWithoutVendor", method = RequestMethod.POST)
+	@RequestMapping(value = "/submit/withoutVendor", method = RequestMethod.POST)
 	private ModelMap saveAndSubmitWithoutVendor(String inquiry, FileUpload uploadItem) {
 		PurcInquiryInfo purcInquiry = JSONObject.parseObject(inquiry, PurcInquiryInfo.class);
 		return purcInquiryService.saveAndSubmitWithoutVendor(purcInquiry, uploadItem);
@@ -154,7 +156,7 @@ public class PurcInquiryController {
 	 *
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	public SPage<PurchaseInquiryItem> getReceivedPurchaseInquiries(PageParams params, String searchFilter) {
 		logger.log("采购询价单", "查看发出的采购询价单列表(全部)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -173,7 +175,7 @@ public class PurcInquiryController {
 	 *
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search",params = RequestState.TODO, method = RequestMethod.GET)
 	public SPage<PurchaseInquiryItem> getTodoInquiries(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(待回复)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -194,7 +196,7 @@ public class PurcInquiryController {
 	 *
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search",params = RequestState.END, method = RequestMethod.GET)
 	public SPage<PurchaseInquiryItem> getEndInquiries(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(已失效)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -214,7 +216,7 @@ public class PurcInquiryController {
 	 *
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search",params = RequestState.DONE, method = RequestMethod.GET)
 	public SPage<PurchaseInquiryItem> getDoneInquiries(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(已回复)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -234,7 +236,7 @@ public class PurcInquiryController {
 	 *
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.AGREED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search",params = RequestState.AGREED, method = RequestMethod.GET)
 	public SPage<PurchaseInquiryItem> getAgreedInquiries(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(已采纳)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -254,7 +256,7 @@ public class PurcInquiryController {
 	 *
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.REFUSED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search",params = RequestState.REFUSED, method = RequestMethod.GET)
 	public SPage<PurchaseInquiryItem> getRefusedInquiries(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(未采纳)");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -293,7 +295,7 @@ public class PurcInquiryController {
 	 *
 	 * @return
 	 */
-	@RequestMapping(value = "/unapply", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = "_state=unapply", method = RequestMethod.GET)
 	private Page<PurcInquiry> getUnapply(PageParams params) {
 		return purcInquiryService.getUnapply(params);
 	}
@@ -323,7 +325,7 @@ public class PurcInquiryController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/submit", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = "_state=submit", method = RequestMethod.GET)
 	private Page<PurcInquiry> getSubmit(PageParams params) {
 		return purcInquiryService.getSubmit(params);
 	}
@@ -384,7 +386,7 @@ public class PurcInquiryController {
 	 * 查询公共询价单
 	 *
 	 * @param params
-	 * @param keyword
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/publicInquiryItem", method = RequestMethod.GET)
@@ -480,6 +482,17 @@ public class PurcInquiryController {
 		return map;
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出采购询价单列表(全部)
 	 *

+ 135 - 8
src/main/java/com/uas/platform/b2b/controller/PurcProductController.java

@@ -6,6 +6,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
+import com.alibaba.fastjson.JSONObject;
+import com.uas.platform.b2b.service.BaseInfoService;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -34,6 +36,8 @@ import com.uas.search.b2b.model.Sort;
 import com.uas.search.b2b.model.Sort.Type;
 import com.uas.search.b2b.util.SearchConstants;
 
+import static org.springframework.data.jpa.domain.AbstractPersistable_.id;
+
 /**
  * 采购物料
  * 
@@ -55,6 +59,9 @@ public class PurcProductController {
 	@Autowired
 	private SearchService searchService;
 
+	@Autowired
+	private BaseInfoService baseInfoService;
+
 	/**
 	 * 获取批量上传物料的模板
 	 * 
@@ -68,6 +75,17 @@ public class PurcProductController {
 		return modelAndView;
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出Excel
 	 * 
@@ -87,13 +105,53 @@ public class PurcProductController {
 		return modelAndView;
 	}
 
+	/**
+	 * 导出 - 标准
+	 *
+	 * @param keyword
+	 * @return
+	 */
+	@RequestMapping(value = "/xls", params = RequestState.STANDARD, method = RequestMethod.GET)
+	public ModelAndView exportStandard(String keyword) {
+		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
+		pageInfo.sorting("id", Direction.DESC);
+		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
+		pageInfo.filter("isPurchase", Constant.YES);
+		pageInfo.filter("standard", Constant.YES);
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.addObject("data", productService.findAllByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/baseInfo/baseInfo", "物料资料表"));
+		logger.log("物料资料", "导出Excel列表", "导出可买物料Excel列表");
+		return modelAndView;
+	}
+
+	/**
+	 * 导出Excel
+	 *
+	 * @param keyword
+	 * @return
+	 */
+	@RequestMapping(value = "/xls", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	public ModelAndView exportNonStandard(String keyword) {
+		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
+		pageInfo.sorting("id", Direction.DESC);
+		pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
+		pageInfo.filter("isPurchase", Constant.YES);
+		pageInfo.filter("standard", Constant.NO);
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.addObject("data", productService.findAllByPageInfo(pageInfo, keyword).getContent());
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/baseInfo/baseInfo", "物料资料表"));
+		logger.log("物料资料", "导出Excel列表", "导出可买物料Excel列表");
+		return modelAndView;
+	}
+
 	/**
 	 * 通过excel批量导入物料
 	 * 
 	 * @param uploadItem
 	 * @return
 	 */
-	@RequestMapping(value = "/release/excel", method = RequestMethod.POST)
+	@RequestMapping(value = "/edit/release/excel", method = RequestMethod.POST)
 	public ModelMap releaseByExcel(FileUpload uploadItem) {
 		ModelMap map = new ModelMap();
 		String fileName = uploadItem.getFile().getOriginalFilename();
@@ -120,7 +178,7 @@ public class PurcProductController {
 	/**
 	 * 查看自己的物料资料
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getAllProductInfo(PageParams params, String keyword) {
 		logger.log("查看物料", SystemSession.getUser().getUserName() + "查看了物料信息(全部)");
@@ -145,7 +203,7 @@ public class PurcProductController {
 	 * @param keyword
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.STANDARD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.STANDARD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getStandardProductInfo(PageParams params, String keyword) {
 		logger.log("查看物料", SystemSession.getUser().getUserName() + "查看了物料信息(标准)");
@@ -180,7 +238,7 @@ public class PurcProductController {
 	 * @param keyword
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getNonStandardProductInfo(PageParams params, String keyword) {
 		logger.log("查看物料", SystemSession.getUser().getUserName() + "查看了物料信息(非标准)");
@@ -209,7 +267,7 @@ public class PurcProductController {
 	/**
 	 * 查看自己的物料资料--不查询(全部)
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getAllProduct(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(全部)");
@@ -221,7 +279,7 @@ public class PurcProductController {
 	/**
 	 * 查看自己的物料资料--不查询(标准)
 	 */
-	@RequestMapping(value = "/info", params = RequestState.STANDARD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.STANDARD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getAllProductStandard(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(标准)");
@@ -234,7 +292,7 @@ public class PurcProductController {
 	/**
 	 * 查看自己的物料资料--不查询(非标准)
 	 */
-	@RequestMapping(value = "/info", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<Product> getAllProductNonStandard(PageParams params, String keyword) {
 		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(非标准)");
@@ -244,12 +302,21 @@ public class PurcProductController {
 		return productService.findB2bEnabledProductInfoByPageInfo(pageInfo, keyword);
 	}
 
+	/**
+	 * 通过id查看物料详情(由于权限问题将产品和物料接口分离)
+	 */
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
+	@ResponseBody
+	public Product getPurcProductInfoById(@PathVariable("id") Long id) {
+		return baseInfoService.findById(id);
+	}
+
 	/**
 	 * 开启关闭销售
 	 * 
 	 * @param status
 	 */
-	@RequestMapping(value = "/toggle/{status}", method = RequestMethod.POST)
+	@RequestMapping(value = "/edit/toggle/{status}", method = RequestMethod.POST)
 	@ResponseBody
 	public void switchPorduct(@PathVariable("status") String status) {
 		purcProductService.switchPorduct(status);
@@ -264,4 +331,64 @@ public class PurcProductController {
     public void setReadByOrder(@RequestBody Long... sourceId) {
         productService.setReadByOrder("purc", sourceId);
     }
+
+	/**
+	 * 更新物料信息
+	 *
+	 * @param prodInfo
+	 * @return
+	 */
+	@RequestMapping(value = "/edit/updateProdInfo", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap updateProdInfo(String prodInfo, FileUpload uploadItem) throws Exception {
+		Product productInfo = JSONObject.parseObject(prodInfo, Product.class);
+		logger.log("更新物料", "[" + SystemSession.getUser().getUserName() + "]更新了id为" + productInfo.getId() + "的["
+				+ productInfo.getTitle() + "]");
+		return baseInfoService.update(productInfo, uploadItem);
+	}
+
+	/**
+	 * 新增物料
+	 *
+	 * @param prodInfo
+	 * @return
+	 */
+	@RequestMapping(value = "/edit/addNewProduct", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap addNewProduct(String prodInfo, FileUpload uploadItem) throws Exception {
+		Product productInfo = JSONObject.parseObject(prodInfo, Product.class);
+		return baseInfoService.addNewProduct(productInfo, uploadItem);
+	}
+
+	/**
+	 * 通过id删除
+	 *
+	 * @param id
+	 * @return
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "/edit/delete", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap deleteById(Long id) throws Exception {
+		ModelMap map = new ModelMap();
+		try {
+			baseInfoService.deleteById(id);
+			logger.log("删除物料", "[" + SystemSession.getUser().getUserName() + "]删除了id为 [" + id + "]的物料");
+		} catch (Exception e) {
+			map.put("error", "该物料可能已经被其他单据引用,无法删除");
+		}
+		return map;
+	}
+
+	/**
+	 * 一键匹配物料信息
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/edit/matchbytype/{type}", method = RequestMethod.POST)
+	@ResponseBody
+	private ModelMap matchall(@PathVariable String type) {
+		return productService.matchall(type);
+	}
 }

+ 21 - 21
src/main/java/com/uas/platform/b2b/controller/PurchaseTenderController.java

@@ -71,7 +71,7 @@ public class PurchaseTenderController {
      * @param tender 招标单
      *
      */
-    @RequestMapping(value = "/publish", method = RequestMethod.POST)
+    @RequestMapping(value = "/publish/new", method = RequestMethod.POST)
     @ResponseBody
     @Transactional
     public ResponseEntity<String> publishTender(String tender, String enInfos) {
@@ -97,7 +97,7 @@ public class PurchaseTenderController {
      * @param enInfos  所选供应商uu
      *
      */
-    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @RequestMapping(value = "/save/new", method = RequestMethod.POST)
     @ResponseBody
     @Transactional
     public ResponseEntity<String> saveTender(String tender, String enInfos) {
@@ -134,7 +134,7 @@ public class PurchaseTenderController {
      * @param id 招标单id
      *
      */
-    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    @RequestMapping(value = "/purc/{id}/info", method = RequestMethod.GET)
     @ResponseBody
     public PurchaseTender getTenderById(@PathVariable("id") Long id) {
         return purchaseTenderService.findById(id);
@@ -146,7 +146,7 @@ public class PurchaseTenderController {
      * @param tenderId 招标单id
      *
      */
-    @RequestMapping(value = "/getSaleTenderDetail/{tenderId}", method = RequestMethod.GET)
+    @RequestMapping(value = "/sale/{tenderId}/info", method = RequestMethod.GET)
     @ResponseBody
     public ModelMap getSaleTenderDetail(@PathVariable("tenderId") Long tenderId) {
         return purchaseTenderService.findMySaleTenderDetailByTenderId(tenderId);
@@ -209,7 +209,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return Spage
      */
-    @RequestMapping(method = RequestMethod.GET)
+    @RequestMapping(value = "/sale/info/search", method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getAllTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -238,7 +238,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return Sapge
      */
-    @RequestMapping(params = RequestState.END, method = RequestMethod.GET)
+    @RequestMapping(value = "/sale/info/search", params = RequestState.END, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getEndTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -267,7 +267,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return 招标单Spage
      */
-    @RequestMapping(params = RequestState.WAITING, method = RequestMethod.GET)
+    @RequestMapping(value = "/sale/info/search", params = RequestState.WAITING, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getWaitingTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -298,7 +298,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return 招标单Spage
      */
-    @RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
+    @RequestMapping(value = "/sale/info/search", params = RequestState.DONE, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getDoneTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -329,7 +329,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return 招标单Spage
      */
-    @RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
+    @RequestMapping(value = "/sale/info/search", params = RequestState.TODO, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getTodoTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -361,7 +361,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return 招标单Spage
      */
-    @RequestMapping(params = RequestState.INVALID, method = RequestMethod.GET)
+    @RequestMapping(value = "/sale/info/search", params = RequestState.INVALID, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getInvalidTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -419,7 +419,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return 招标单Spage
      */
-    @RequestMapping(value = "/info", params = RequestState.DONE, method = RequestMethod.GET)
+    @RequestMapping(value = "sale/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getDoneTendersInfo(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -450,7 +450,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return 招标单Spage
      */
-    @RequestMapping(value = "/info", params = RequestState.TODO, method = RequestMethod.GET)
+    @RequestMapping(value = "sale/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getTodoTendersInfo(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -554,7 +554,7 @@ public class PurchaseTenderController {
      * @param params
      * @return
      */
-    @RequestMapping(value = "/purc", method = RequestMethod.GET)
+    @RequestMapping(value = "/purc/info/search", method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getMyAllTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -596,7 +596,7 @@ public class PurchaseTenderController {
      * @param params
      * @return
      */
-    @RequestMapping(value = "/purc", params = RequestState.DONE, method = RequestMethod.GET)
+    @RequestMapping(value = "/purc/info/search", params = RequestState.DONE, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getMyDoneTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -628,7 +628,7 @@ public class PurchaseTenderController {
      * @param params 参数
      * @return 单据
      */
-    @RequestMapping(value = "/purc", params = RequestState.TODO, method = RequestMethod.GET)
+    @RequestMapping(value = "/purc/info/search", params = RequestState.TODO, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getMyTodoTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -660,7 +660,7 @@ public class PurchaseTenderController {
      * @param searchFilter 搜索参数
      *
      */
-    @RequestMapping(value = "/purc", params = RequestState.WAITING, method = RequestMethod.GET)
+    @RequestMapping(value = "/purc/info/search", params = RequestState.WAITING, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getWaitingPTenders(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -691,7 +691,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return Spage
      */
-    @RequestMapping(value = "/purc/info", method = RequestMethod.GET)
+    @RequestMapping(value = "/purc/info/nosearch", method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getMyAllTendersInfo(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -711,7 +711,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return 招标单Spage
      */
-    @RequestMapping(value = "/purc/info", params = RequestState.TODO, method = RequestMethod.GET)
+    @RequestMapping(value = "/purc/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getMyTodoTendersInfo(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -731,7 +731,7 @@ public class PurchaseTenderController {
      * @param params 分页参数
      * @return 招标单Spage
      */
-    @RequestMapping(value = "/purc/info", params = RequestState.WAITING, method = RequestMethod.GET)
+    @RequestMapping(value = "/purc/info/nosearch", params = RequestState.WAITING, method = RequestMethod.GET)
     @ResponseBody
     public SPage<PurchaseTender> getMyWaitingTendersInfo(PageParams params, String searchFilter) {
         if (logger != null) {
@@ -809,7 +809,7 @@ public class PurchaseTenderController {
      *
      * @param tender 招标单json
      */
-    @RequestMapping(value = "/publishSaved", method = RequestMethod.POST)
+    @RequestMapping(value = "/publish/update", method = RequestMethod.POST)
     @ResponseBody
     @Transactional
     public ResponseEntity<String> publishSavedTender(String tender, String enInfos) {
@@ -836,7 +836,7 @@ public class PurchaseTenderController {
      * @param tender 招标单
      * @param enInfos 供应商uu
      */
-    @RequestMapping(value = "/updateSaved", method = RequestMethod.POST)
+    @RequestMapping(value = "/save/update", method = RequestMethod.POST)
     @ResponseBody
     @Transactional
     public ResponseEntity<String> updateSavedTender(String tender, String enInfos) {

+ 31 - 0
src/main/java/com/uas/platform/b2b/controller/RoleController.java

@@ -1,18 +1,22 @@
 package com.uas.platform.b2b.controller;
 
+import com.uas.platform.b2b.model.ResourceItem;
 import com.uas.platform.b2b.model.Role;
 import com.uas.platform.b2b.service.RoleService;
+import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.UsageBufferedLogger;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.AccessDeniedException;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * 账户管理--角色
@@ -98,6 +102,33 @@ public class RoleController {
 	@ResponseBody
 	public ModelMap isManager(){return  roleService.isManager(); }
 
+	@RequestMapping(value = "/isUser", method =  RequestMethod.GET)
+	@ResponseBody
+	public ModelMap isUser(){return  roleService.isUser(); }
+
+	/**
+	 * 更新角色标准库权限,内部使用,仅优软科技有限公司可用
+	 *
+	 * @param desc
+	 * @param resourceItems
+	 * @return
+	 */
+	@RequestMapping(value = "/updateDefault", method =  RequestMethod.POST)
+	@ResponseBody
+	public ModelMap updateDefault(String desc, @RequestBody Set<ResourceItem> resourceItems) {
+		boolean canUpdate = true;
+		if (SystemSession.getUser().getEnterprise().getUu() != 10041166) {
+			throw new AccessDeniedException("您没有权限修改,此功能为内部使用");
+		}
+		if (SystemSession.getUser().getUserUU() != 1000010030) {
+			throw new AccessDeniedException("您没有权限修改,请联系管理者真烦");
+		}
+		if (!canUpdate) {
+			throw new AccessDeniedException("别试了,你不允许修改!!!");
+		}
+		return roleService.updateDefault(desc, resourceItems);
+	}
+
 	/**
 	 * 获取当前角色的默认角色
 	 *

+ 15 - 3
src/main/java/com/uas/platform/b2b/controller/SaleAcceptController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -59,7 +60,7 @@ public class SaleAcceptController {
 	 * 作为卖家,客户的采购验收单(全部)
 	 * 
 	 * @param params
-	 * @param keyword
+	 * @param searchFilter
 	 *            查找关键词
 	 * @return
 	 */
@@ -98,17 +99,28 @@ public class SaleAcceptController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public PurchaseAccept getReceivedPurchaseAcceptById(@PathVariable("id") Long id) {
 		logger.log("客户验收单", "获取单个客户采购验收单,id:" + id);
 		return purchaseAcceptService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 18 - 3
src/main/java/com/uas/platform/b2b/controller/SaleApBillController.java

@@ -6,6 +6,7 @@ import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -56,7 +57,8 @@ public class SaleApBillController {
 	/**
 	 * 作为卖家,客户的应付票据(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -97,17 +99,30 @@ public class SaleApBillController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public PurchaseApBill getReceivedPurchaseApBillById(@PathVariable("id") Long id) {
 		logger.log("客户应付发票", "获取单个客户应付发票,id:" + id);
 		return purchaseApBillService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 34 - 12
src/main/java/com/uas/platform/b2b/controller/SaleApCheckController.java

@@ -73,6 +73,17 @@ public class SaleApCheckController {
 
 	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
+	/**
+	 * 打印权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/printCount/permission", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap printPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 打印对账单,增加打印次数
 	 * 
@@ -91,7 +102,7 @@ public class SaleApCheckController {
 	 * 作废应收对账单
 	 * 
 	 */
-	@RequestMapping("/cancel")
+	@RequestMapping("/operation/cancel")
 	@ResponseBody
 	public ModelMap cancelApcheck(Long id) {
 		boolean result = purchaseApCheckService.cancelApcheck(id);
@@ -103,7 +114,6 @@ public class SaleApCheckController {
 	/**
 	 * 作为卖家,获取应收对账单(全部)
 	 * 
-	 * @param json
 	 * @return
 	 */
 	@RequestMapping(value = "/getAll", method = RequestMethod.GET)
@@ -201,7 +211,7 @@ public class SaleApCheckController {
 	/**
 	 * 保存生成的应收对账单主记录
 	 */
-	@RequestMapping(value = "/save", method = RequestMethod.POST)
+	@RequestMapping(value = "/operation/save", method = RequestMethod.POST)
 	@ResponseBody
 	public ModelMap saveApCheck(@RequestBody String json) {
 		ModelMap map = new ModelMap();
@@ -248,7 +258,7 @@ public class SaleApCheckController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public PurchaseApCheck getCreatedPurchaseApCheckById(@PathVariable("id") Long id) {
 		logger.log("应收对账单", "查看单个应收对账单", null, null, id);
@@ -258,7 +268,7 @@ public class SaleApCheckController {
 	/**
 	 * 删除最新生成未提交的应收对账单
 	 */
-	@RequestMapping(value = "/deleteApCheck", method = RequestMethod.DELETE)
+	@RequestMapping(value = "/operation/deleteApCheck", method = RequestMethod.POST)
 	@ResponseBody
 	public void deleteApCheck(Long id) {
 		purchaseApCheckService.deleteApCheck(id);
@@ -267,7 +277,7 @@ public class SaleApCheckController {
 	/**
 	 * 提交生成的应收对账单
 	 */
-	@RequestMapping(value = "/updateStatus", method = RequestMethod.GET)
+	@RequestMapping(value = "/operation/updateStatus", method = RequestMethod.POST)
 	@ResponseBody
 	public ModelMap updateApCheckStatus(Long id) {
 		ModelMap map = new ModelMap();
@@ -279,7 +289,6 @@ public class SaleApCheckController {
 	 * 作为卖家,获取应收对账单(全部)
 	 * 
 	 * @param params
-	 * @param keyword
 	 * @param searchFilter
 	 * @return
 	 */
@@ -415,7 +424,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 全部
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", method = RequestMethod.GET)
@@ -438,7 +447,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 已确认
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.DONE, method = RequestMethod.GET)
@@ -461,7 +470,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 未对账
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.TODO, method = RequestMethod.GET)
@@ -484,7 +493,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 已做废
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.END, method = RequestMethod.GET)
@@ -504,10 +513,23 @@ public class SaleApCheckController {
 		return modelAndView;
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 全部导出
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 15 - 2
src/main/java/com/uas/platform/b2b/controller/SaleBadInController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -59,7 +60,8 @@ public class SaleBadInController {
 	/**
 	 * 作为卖家,客户的不良品入库(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -101,10 +103,21 @@ public class SaleBadInController {
 		return purchaseBadInService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 15 - 2
src/main/java/com/uas/platform/b2b/controller/SaleBadOutController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -59,7 +60,8 @@ public class SaleBadOutController {
 	/**
 	 * 作为卖家,客户的不良品出库(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -101,10 +103,21 @@ public class SaleBadOutController {
 		return purchaseBadOutService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 46 - 35
src/main/java/com/uas/platform/b2b/controller/SaleInquiryController.java

@@ -65,15 +65,15 @@ public class SaleInquiryController {
 	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
 	/**
-	 * 作为卖家,收到的采购询价(全部)
+	 * 作为卖家,收到的采购询价(全部)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getReceivedPurchaseInquiries(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(全部)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(全部)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -97,15 +97,15 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购询价(待回复)
+	 * 作为卖家,收到的采购询价(待报价)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getTodoInquiries(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(待回复)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(待报价)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -131,14 +131,14 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购询价(已过期)
+	 * 作为卖家,收到的采购询价(已过期)- 搜索
 	 *
 	 * @param params
 	 */
-	@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getEndInquiries(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(已过期)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(已过期)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -167,15 +167,15 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购询价(已回复)
+	 * 作为卖家,收到的采购询价(已报价)- 搜索
 	 *
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getDoneInquiries(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(已回复)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(已报价)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -203,14 +203,14 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购询价(已失效)
+	 * 作为卖家,收到的采购询价(已失效)- 搜索
 	 *
 	 * @param params
 	 */
-	@RequestMapping(params = RequestState.INVALID, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.INVALID, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getInvalidInquiries(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(已失效)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(已失效)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -233,15 +233,15 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购询价(已采纳)
+	 * 作为卖家,收到的采购询价(已采纳)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.AGREED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.AGREED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getAgreedInquiries(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(已采纳)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(已采纳)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -270,15 +270,15 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购询价(未采纳)
+	 * 作为卖家,收到的采购询价(未采纳)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.REFUSED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.REFUSED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getRefusedInquiries(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(未采纳)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(未采纳)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -304,12 +304,12 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购询价(全部)
+	 * 作为卖家,收到的采购询价(全部)不搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getPurchaseInquiries(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(全部)");
@@ -332,7 +332,7 @@ public class SaleInquiryController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getPurchaseInquiriesTodo(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(待报价)");
@@ -358,7 +358,7 @@ public class SaleInquiryController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getPurchaseInquiriesEnd(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(已过期)");
@@ -378,15 +378,15 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购询价(已回复)
+	 * 作为卖家,收到的采购询价(已报价)
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getPurchaseInquiriesDone(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(已回复)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(已报价)");
 		PageInfo pageInfo = new PageInfo(params);
 		pageInfo.filter("overdue", Constant.NO);
 		pageInfo.filter("status", Status.REPLIED.value());
@@ -410,10 +410,10 @@ public class SaleInquiryController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.INVALID, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.INVALID, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getPurchaseInquiriesInvalid(PageParams params, String searchFilter) {
-		logger.log("客户询价单", "查看收到的客户询价单列表(已过期)");
+		logger.log("客户询价单", "查看收到的客户询价单列表(已失效)");
 		PageInfo pageInfo = new PageInfo(params);
 		pageInfo.filter("overdue", Constant.YES);
 		pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
@@ -435,7 +435,7 @@ public class SaleInquiryController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.REFUSED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.REFUSED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getPurchaseInquiriesRefused(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(未采纳)");
@@ -461,7 +461,7 @@ public class SaleInquiryController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.AGREED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.AGREED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryItem> getPurchaseInquiriesAgreed(PageParams params, String searchFilter) {
 		logger.log("客户询价单", "查看收到的客户询价单列表(已采纳)");
@@ -499,7 +499,7 @@ public class SaleInquiryController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public List<PurchaseInquiryItem> getReceivedPurchaseOrderItemById(@PathVariable("id") Long id) {
 		return purchaseInquiryService.findById(id);
@@ -532,7 +532,7 @@ public class SaleInquiryController {
 	 * @param inquiryItemId
 	 * @return
 	 */
-	@RequestMapping(value = "/items/{inquiryItemId}", method = RequestMethod.POST)
+	@RequestMapping(value = "/items/{inquiryItemId}/save", method = RequestMethod.POST)
 	public ResponseEntity<String> saveInquiryItem(@RequestBody String json,
 			@PathVariable("inquiryItemId") Long inquiryItemId, String token) {
 		PurchaseInquiryItem item = FlexJsonUtils.fromJson(json, PurchaseInquiryItem.class);
@@ -555,6 +555,17 @@ public class SaleInquiryController {
 		return purchaseInquiryService.findHistoryByItemId(inquiryItemId);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 - 全部
 	 *
@@ -700,7 +711,7 @@ public class SaleInquiryController {
 
 	/**
 	 *  上传附件
-	 *  @param json
+	 *  @param item
 	 * @param uploadItem
 	 * @return
 	 * @throws Exception

+ 28 - 19
src/main/java/com/uas/platform/b2b/controller/SaleInquiryMouldController.java

@@ -64,15 +64,15 @@ public class SaleInquiryMouldController {
 	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
 	/**
-	 * 作为卖家,收到的模具询价(全部)
+	 * 作为卖家,收到的模具询价(全部)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryMould> getReceivedMouldInquiries(PageParams params, String searchFilter) {
-		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(全部)");
+		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(全部)- 搜索");
 		JSONObject jsonObject = JSONObject.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -96,15 +96,15 @@ public class SaleInquiryMouldController {
 	}
 
 	/**
-	 * 作为卖家,收到的模具询价(待报价)
+	 * 作为卖家,收到的模具询价(待报价)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryMould> getTodoInquiryMould(PageParams params, String searchFilter) {
-		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(待回复)");
+		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(待报价)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -166,15 +166,15 @@ public class SaleInquiryMouldController {
 //	}
 
 	/**
-	 * 作为卖家,收到的模具询价(已报价)
+	 * 作为卖家,收到的模具询价(已报价)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryMould> getDoneInquiryMould(PageParams params, String searchFilter) {
-		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(已回复)");
+		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(已报价)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -200,15 +200,15 @@ public class SaleInquiryMouldController {
 	}
 
 	/**
-	 * 作为卖家,收到的模具询价(已作废)--和已过期合并为已失效
+	 * 作为卖家,收到的模具询价(已作废)--和已过期合并为已失效- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.INVALID, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.INVALID, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryMould> getInvalidInquiryMould(PageParams params, String searchFilter) {
-		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(已回复)");
+		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(已失效)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -238,7 +238,7 @@ public class SaleInquiryMouldController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/sql", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryMould> getReceivedMouldInquiriesBySql(PageParams params, String searchFilter) {
 		logger.log("客户模具询价单", "查看收到的客户模具询价单列表(全部)");
@@ -264,7 +264,7 @@ public class SaleInquiryMouldController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/sql", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryMould> getDoneMouldInquiriesBySql(PageParams params, String searchFilter) {
 		logger.log("客户模具询价单", "直接查看收到的客户模具询价单列表(已报价)");
@@ -292,7 +292,7 @@ public class SaleInquiryMouldController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/sql", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryMould> getTodoMouldInquiriesBySql(PageParams params, String searchFilter) {
 		logger.log("客户模具询价单", "直接查看收到的客户模具询价单列表(待报价)");
@@ -322,7 +322,7 @@ public class SaleInquiryMouldController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/sql", params = RequestState.INVALID, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.INVALID, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseInquiryMould> getInvalidMouldInquiriesBySql(PageParams params, String searchFilter) {
 		logger.log("客户模具询价单", "直接查看收到的客户模具询价单列表(已失效)");
@@ -363,7 +363,7 @@ public class SaleInquiryMouldController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public PurchaseInquiryMould getReceivedPurcInquiryMouldItemById(@PathVariable("id") Long id) {
 		return purchaseInquiryMouldService.findById(id);
@@ -406,7 +406,7 @@ public class SaleInquiryMouldController {
 	 * @param inquiryMouldId
 	 * @return
 	 */
-	@RequestMapping(value = "/detail/{inquiryMouldId}", method = RequestMethod.POST)
+	@RequestMapping(value = "/detail/{inquiryMouldId}/save", method = RequestMethod.POST)
 	public ResponseEntity<String> saveInquiryItem(@RequestBody String json,
 			@PathVariable("inquiryMouldId") Long inquiryMouldId) {
 		PurchaseInquiryMould mould = FlexJsonUtils.fromJson(json, PurchaseInquiryMould.class);
@@ -458,7 +458,16 @@ public class SaleInquiryMouldController {
 		return null;
 	}
 
-
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
 
 	/**
 	 * 导出 - 全部

+ 15 - 2
src/main/java/com/uas/platform/b2b/controller/SaleMRBController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -59,7 +60,8 @@ public class SaleMRBController {
 	/**
 	 * 作为卖家,客户的MRB(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -104,10 +106,21 @@ public class SaleMRBController {
 		return purchaseMRBService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 45 - 12
src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java

@@ -82,7 +82,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getReceivedPurchaseNotices(PageParams params, String keyword, Long fromDate,
 			Long endDate){
@@ -119,7 +119,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(value = "/info", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getTodoPurchaseNoticesInfo(PageParams params, String keyword, Long fromDate, Long endDate) {
 		SearchFilter filter = new SearchFilter();
@@ -148,7 +148,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(value = "/info", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getDonePurchaseNoticesInfo(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(已发货)");
@@ -204,7 +204,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getTodoPurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(待发货)");
@@ -243,7 +243,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getDonePurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(已发货)");
@@ -282,7 +282,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(params = RequestState.WAITING, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.WAITING, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getWaitingPurchaseNotices(PageParams params, String keyword, Long fromDate,
 			Long endDate){
@@ -321,7 +321,7 @@ public class SaleNoticeController {
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 */
-	@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseNotice> getEndPurchaseNotices(PageParams params, String keyword, Long fromDate, Long endDate) {
 		logger.log("客户送货提醒", "查看收到的客户送货提醒列表(已结案)");
@@ -359,7 +359,7 @@ public class SaleNoticeController {
 	 * @param json
 	 * @return
 	 */
-	@RequestMapping(value = "/{noticeId}", method = RequestMethod.POST)
+	@RequestMapping(value = "/{noticeId}/sends", method = RequestMethod.POST)
 	@ResponseBody
 	public ResponseEntity<ModelMap> send(@PathVariable("noticeId") Long noticeId, String token,
 			@RequestBody String json) {
@@ -403,7 +403,7 @@ public class SaleNoticeController {
 	}
 
 	/**
-	 * 作为卖家,查看送货单-全部
+	 * 作为卖家,查看发货单-全部
 	 * 
 	 * @param params
 	 * @return
@@ -411,7 +411,7 @@ public class SaleNoticeController {
 	@RequestMapping(value = "/sends", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleSendAll> getSaleSends(PageParams params, String keyword, Long fromDate, Long endDate) {
-		logger.log("发货单", "查看全部的送货单");
+		logger.log("发货单", "查看全部的发货单");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
 		pageParams.getFilters().put("ss_enuu", SystemSession.getUser().getEnterprise().getUu());
 		SearchFilter filter = userService.distribute();
@@ -444,13 +444,24 @@ public class SaleNoticeController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/sends/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/sends/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public SaleSendAll getSaleSendsById(PageParams params, @PathVariable("id") Long id) {
 		logger.log("发货单", "查看单个送货单", "根据Id查找", "", id);
 		return purchaseNoticeService.findSaleSendById(id);
 	}
 
+	/**
+	 * 打印权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/sends/print/permission", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap printPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 增加发货单打印次数
 	 *
@@ -460,7 +471,7 @@ public class SaleNoticeController {
 	@RequestMapping(value = "/sends/print/{id}", method = RequestMethod.POST)
 	@ResponseBody
 	public void printCount(PageParams params, @PathVariable("id") Long id) {
-		logger.log("发货单", "打印单个送货单", "根据Id查找", "", id);
+		logger.log("发货单", "打印单个发货单", "根据Id查找", "", id);
 		purchaseNoticeService.printCount(id);
 	}
 
@@ -555,6 +566,17 @@ public class SaleNoticeController {
 		return searchService.searchSaleSendIds(keyword, pageParams);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出送货提醒(全部)
 	 * 
@@ -655,6 +677,17 @@ public class SaleNoticeController {
 		return modelAndView;
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/sends/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportSendsPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出发货单Excel - 全部
 	 * 

+ 20 - 9
src/main/java/com/uas/platform/b2b/controller/SaleOrderChangeController.java

@@ -65,7 +65,7 @@ public class SaleOrderChangeController {
 	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderChange> getReceivedPurchaseOrderChanges(PageParams params, String searchFilter) {
 		logger.log("客户采购变更单", "查看收到的客户采购变更单列表(全部)");
@@ -98,7 +98,7 @@ public class SaleOrderChangeController {
 	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderChange> getTodoPurchaseOrderChanges(PageParams params, String searchFilter) {
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -132,7 +132,7 @@ public class SaleOrderChangeController {
 	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderChange> getDonePurchaseOrderChanges(PageParams params, String searchFilter) {
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -166,7 +166,7 @@ public class SaleOrderChangeController {
      * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.UNREAD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.UNREAD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderChange> getUnReadPurchaseOrderChanges(PageParams params, String searchFilter) {
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
@@ -199,7 +199,7 @@ public class SaleOrderChangeController {
      * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderChange> getAllOrderChanges(PageParams params, String searchFilter) {
 		SPage<PurchaseOrderChange> orders = new SPage<PurchaseOrderChange>();
@@ -230,7 +230,7 @@ public class SaleOrderChangeController {
      * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderChange> getTodoOrderChanges(PageParams params, String searchFilter) {
 		SPage<PurchaseOrderChange> orders = new SPage<PurchaseOrderChange>();
@@ -263,7 +263,7 @@ public class SaleOrderChangeController {
      * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderChange> getDoneOrderChanges(PageParams params, String searchFilter) {
 		SPage<PurchaseOrderChange> orders = new SPage<PurchaseOrderChange>();
@@ -296,7 +296,7 @@ public class SaleOrderChangeController {
      * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.UNREAD, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.UNREAD, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderChange> getUnReadOrderChanges(PageParams params, String searchFilter) {
 		SPage<PurchaseOrderChange> orders = new SPage<PurchaseOrderChange>();
@@ -327,7 +327,7 @@ public class SaleOrderChangeController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public PurchaseOrderChange getReceivedPurchaseOrderItemById(@PathVariable("id") Long id) {
 		return purchaseOrderChangeService.findById(id);
@@ -348,6 +348,17 @@ public class SaleOrderChangeController {
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 - 全部
 	 * 

+ 78 - 33
src/main/java/com/uas/platform/b2b/controller/SaleOrderController.java

@@ -80,7 +80,7 @@ public class SaleOrderController {
 	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
 	/**
-	 * 作为卖家,收到的采购订单
+	 * 作为卖家,收到的采购订单 - 弃用
 	 * 
 	 * @param json
 	 * @return
@@ -106,12 +106,35 @@ public class SaleOrderController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public PurchaseOrderAll getReceivedPurchaseOrderItemById(@PathVariable("id") Long id) {
 		return purchaseOrderService.findById(id);
 	}
 
+	/**
+	 * 作为买家,根据采购单据ID查找采购订单(含明细)
+	 *
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/purc/{id}/info", method = RequestMethod.GET)
+	@ResponseBody
+	public PurchaseOrderAll getPurchaseOrderItemById(@PathVariable("id") Long id) {
+		return purchaseOrderService.findById(id);
+	}
+
+	/**
+	 * 打印权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/printCount/permission", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap printPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 打印订单,增加打印次数(供应商)
 	 * 记录打印日志
@@ -143,12 +166,12 @@ public class SaleOrderController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购订单(含明细)
+	 * 作为卖家,收到的采购订单(含明细) - 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderAll> getPurchaseOrderItems(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(全部)");
@@ -177,12 +200,12 @@ public class SaleOrderController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购订单(含明细)(待回复)
+	 * 作为卖家,收到的采购订单(含明细)(待回复) - 搜索
 	 *
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderTodo> getTodoPurchaseOrderItems(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(待回复)");
@@ -210,12 +233,12 @@ public class SaleOrderController {
 	}
 
 	/**
-	 * 作为卖家,收到的采购订单(含明细)(已回复)
+	 * 作为卖家,收到的采购订单(含明细)(已回复) - 搜索
 	 *
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderDone> getDonePurchaseOrderItems(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(已回复)");
@@ -282,12 +305,12 @@ public class SaleOrderController {
 
 
 	/**
-	 * 作为卖家,收到的采购订单(含明细)(已结案)
+	 * 作为卖家,收到的采购订单(含明细)(已结案) - 搜索
 	 *
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items", params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderEnd> getEndPurchaseOrderItems(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(已结案)");
@@ -317,9 +340,9 @@ public class SaleOrderController {
 	/**
 	 * @param params
 	 * @param searchFilter
-	 * @author wangmh 获取已收货的订单
+	 * @author wangmh 获取已收货的订单 - 搜索
 	 */
-	@RequestMapping(value = "/items", params = RequestState.RECEIVED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.RECEIVED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderReceived> getReceivedPurchaseOrderItems(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(已收货)");
@@ -349,9 +372,9 @@ public class SaleOrderController {
 	/**
 	 * @param params
 	 * @param searchFilter
-	 * @author yujia 获取待发货的订单
+	 * @author yujia 获取待发货的订单 - 搜索
 	 */
-	@RequestMapping(value = "/items", params = RequestState.WAITING, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.WAITING, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderWaiting> getWaitingPurchaseOrderItems(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(待交货)");
@@ -390,7 +413,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/info", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderAll> getSaleOrders(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(全部)");
@@ -415,7 +438,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/info", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderTodo> getTodoSaleOrders(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购单列表(待回复)");
@@ -441,7 +464,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/info", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderDone> getDoneSaleOrders(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购单列表(已回复)");
@@ -497,7 +520,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/info", params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderEnd> getEndSaleOrders(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购单列表(已结案)");
@@ -521,7 +544,7 @@ public class SaleOrderController {
 	 * @param searchFilter
 	 * @author wangmh 获取已发货的订单
 	 */
-	@RequestMapping(value = "/items/info", params = RequestState.RECEIVED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.RECEIVED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderReceived> getReceivedOrders(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(待交货)");
@@ -546,7 +569,7 @@ public class SaleOrderController {
 	 * @param searchFilter
 	 * @author yujia 获取待发货的订单
 	 */
-	@RequestMapping(value = "/items/info", params = RequestState.WAITING, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.WAITING, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderWaiting> getWaitingOrders(PageParams params, String searchFilter) {
 		logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(待交货)");
@@ -598,7 +621,7 @@ public class SaleOrderController {
 	 *            订单明细行ID
 	 * @return
 	 */
-	@RequestMapping(value = "/items/{orderItemId}/reply", method = RequestMethod.GET)
+	@RequestMapping(value = "/items/{orderItemId}/reply/all", method = RequestMethod.GET)
 	@ResponseBody
 	public List<PurchaseOrderReply> getPurchaseReply(@PathVariable("orderItemId") Long orderItemId) {
 		return purchaseOrderService.findReplyByOrderItem(orderItemId);
@@ -606,13 +629,13 @@ public class SaleOrderController {
 
 
 	/**
-	 * 作为卖家,查看我的回复
+	 * 作为卖家,查看最后一次回复
 	 *
 	 * @param orderItemId
 	 *            订单明细行ID
 	 * @return
 	 */
-	@RequestMapping(value = "/items/{orderItemId}/latestReplyQty", method = RequestMethod.GET)
+	@RequestMapping(value = "/items/{orderItemId}/reply/last", method = RequestMethod.GET)
 	@ResponseBody
 	public ModelMap getLatestReplyQty(@PathVariable("orderItemId") Long orderItemId) {
 		ModelMap map = new ModelMap();
@@ -687,6 +710,17 @@ public class SaleOrderController {
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 - 全部
 	 *
@@ -823,7 +857,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/purc/info", method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderAll> getAllPurcOrders(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看采购订单列表(包括采购明细)(全部)");
@@ -842,7 +876,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/purc/info", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderTodo> getTodoPurcOrders(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看采购订单列表(包括采购明细)(待回复)");
@@ -862,7 +896,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/purc/info", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderDone> getDonePurcOrders(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看采购订单列表(包括采购明细)(已回复)");
@@ -901,7 +935,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/purc/info", params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/nosearch", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderEnd> getEndPurcOrders(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看采购订单列表(包括采购明细)(已结案)");
@@ -919,7 +953,7 @@ public class SaleOrderController {
 	 * @param searchFilter
 	 *            获取待发货的订单
 	 */
-	@RequestMapping(value = "/items/purc/info", params = RequestState.WAITING, method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/nosearch", params = RequestState.WAITING, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderWaiting> getWaitingPurcOrders(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看采购订单列表(包括采购明细)(待交货)");
@@ -938,7 +972,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/purc", method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderAll> getAllPurcOrderItems(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看收到的采购订单列表(包括采购明细)(全部)");
@@ -961,7 +995,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/purc", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/search", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderTodo> getTodoPurcOrderItems(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看发出的采购订单列表(包括采购明细)(待回复)");
@@ -982,7 +1016,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/purc", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/search", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderDone> getDonePurcOrderItems(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看收到的采购订单列表(包括采购明细)(已回复)");
@@ -1003,7 +1037,7 @@ public class SaleOrderController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/items/purc", params = RequestState.END, method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/search", params = RequestState.END, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderEnd> getEndPurcOrderItems(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看收到的采购订单列表(包括采购明细)(已结案)");
@@ -1023,7 +1057,7 @@ public class SaleOrderController {
 	 * @param searchFilter
 	 *            获取待发货的订单
 	 */
-	@RequestMapping(value = "/items/purc", params = RequestState.WAITING, method = RequestMethod.GET)
+	@RequestMapping(value = "/purc/info/search", params = RequestState.WAITING, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseOrderWaiting> getWaitingPurcOrderItems(PageParams params, String searchFilter) {
 		logger.log("采购单", "查看收到的采购订单列表(包括采购明细)(待交货)");
@@ -1042,6 +1076,17 @@ public class SaleOrderController {
 		return searchService.searchPurchaseWaitingOrderIds(keyword, pageParams);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/purc/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPurcPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 - 全部
 	 *

+ 104 - 34
src/main/java/com/uas/platform/b2b/controller/SaleQuotationController.java

@@ -61,15 +61,15 @@ public class SaleQuotationController {
 	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
 	/**
-	 * 作为卖家,查看自己的主动报价单(全部)
+	 * 作为卖家,查看自己的主动报价单(全部)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getSalQuotationItems(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-全部");
+		logger.log("主动报价单", "查看主动报价单(全部)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -93,15 +93,15 @@ public class SaleQuotationController {
 	}
 
 	/**
-	 * 作为卖家,查看自己的主动报价(已报价)
+	 * 作为卖家,查看自己的主动报价(已报价)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationDone> getSubmitedQuotationItems(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-已报价");
+		logger.log("主动报价单", "查看主动报价单(已报价)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -131,15 +131,15 @@ public class SaleQuotationController {
 	}
 
 	/**
-	 * 作为卖家,查看自己的主动报价(已同意)
+	 * 作为卖家,查看自己的主动报价(已采纳)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.AGREED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.AGREED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getAgreedQuotationItems(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-已同意");
+		logger.log("主动报价单", "查看主动报价单(已采纳)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -165,15 +165,15 @@ public class SaleQuotationController {
 	}
 
 	/**
-	 * 作为卖家,查看自己的主动报价(不同意)
+	 * 作为卖家,查看自己的主动报价(未采纳)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.REFUSED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.REFUSED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getRefusedQuotationItems(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-不同意");
+		logger.log("主动报价单", "查看主动报价单(未采纳)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -199,15 +199,15 @@ public class SaleQuotationController {
 	}
 
 	/**
-	 * 作为卖家,查看自己的主动报价(未提交)
+	 * 作为卖家,查看自己的主动报价(未提交)- 搜索
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getUnSubmitedQuotationItems(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-未提交");
+		logger.log("主动报价单", "查看主动报价单(未提交)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
@@ -231,15 +231,15 @@ public class SaleQuotationController {
 
 
 	/**
-	 * 作为卖家,查看自己的主动报价(已失效)
+	 * 作为卖家,查看自己的主动报价(已失效)- 搜索
 	 *
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(params = RequestState.INVALID, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", params = RequestState.INVALID, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getInvalidQuotationItems(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-已失效");
+		logger.log("主动报价单", "查看主动报价单(已失效)- 搜索");
 		JSONObject jsonObject = JSON.parseObject(searchFilter);
 		String keyword = jsonObject.getString("keyword");
 		// 未过期、已作废参数
@@ -264,15 +264,15 @@ public class SaleQuotationController {
 	}
 
 	/**
-	 * 作为卖家,查看自己的主动报价单(待提交)
+	 * 作为卖家,查看自己的主动报价单(未提交)
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.TODO, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.TODO, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getSalQuotationInfoTodo(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-未提交");
+		logger.log("主动报价单", "查看主动报价单(未提交)");
 		// 当前登录企业作为供应商
 		SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
 		SearchFilter disfilter = userService.distribute();
@@ -296,10 +296,10 @@ public class SaleQuotationController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.DONE, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.DONE, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationDone> getSalQuotationInfoDone(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-已报价");
+		logger.log("主动报价单", "查看主动报价单(已报价)");
 		// 当前登录企业作为供应商
 		SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
 		SearchFilter disfilter = userService.distribute();
@@ -318,15 +318,15 @@ public class SaleQuotationController {
 	}
 
 	/**
-	 * 作为卖家,查看自己的主动报价单(已同意)
+	 * 作为卖家,查看自己的主动报价单(已采纳)
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.AGREED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.AGREED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getSalQuotationInfoAgreed(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-已同意");
+		logger.log("主动报价单", "查看主动报价单(已采纳)");
 		// 当前登录企业作为供应商
 		SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
 		SearchFilter disfilter = userService.distribute();
@@ -346,15 +346,15 @@ public class SaleQuotationController {
 	}
 
 	/**
-	 * 作为卖家,查看自己的主动报价单(不同意)
+	 * 作为卖家,查看自己的主动报价单(未采纳)
 	 * 
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.REFUSED, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.REFUSED, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getSalQuotationInfoRefused(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-已同意");
+		logger.log("主动报价单", "查看主动报价单(未采纳)");
 		// 当前登录企业作为供应商
 		SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
 		SearchFilter disfilter = userService.distribute();
@@ -379,10 +379,10 @@ public class SaleQuotationController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", params = RequestState.INVALID, method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", params = RequestState.INVALID, method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getSalQuotationInfoInvalid(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-已失效");
+		logger.log("主动报价单", "查看主动报价单(已失效)");
 		// 当前登录企业作为供应商
 		SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
 		SearchFilter disfilter = userService.distribute();
@@ -408,10 +408,10 @@ public class SaleQuotationController {
 	 * @param params
 	 * @return
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<SaleQuotationAll> getSalQuotationInfo(PageParams params, String searchFilter) {
-		logger.log("主动报价单", "查看主动报价单-全部");
+		logger.log("主动报价单", "查看主动报价单(全部)");
 		// 当前登录企业作为供应商
 		SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
 		SearchFilter disfilter = userService.distribute();
@@ -434,9 +434,10 @@ public class SaleQuotationController {
 	 * @param json
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.POST)
+	@RequestMapping(value = "/save", method = RequestMethod.POST)
 	public ResponseEntity<ModelMap> save(@RequestBody String json) {
 		SaleQuotationItem item = FlexJsonUtils.fromJson(json, SaleQuotationItem.class);
+		item.getQuotation().setStatus((short) Status.INPUTTING.value());
 		item = saleQuotationService.save(item);
 		logger.log("主动报价单", "在平台上录入主动报价单", item.replyDescription(), item.getQuotation().getCode(),
 				item.getQuotation().getId());
@@ -445,6 +446,24 @@ public class SaleQuotationController {
 		return new ResponseEntity<ModelMap>(map, HttpStatus.OK);
 	}
 
+	/**
+	 * 作为卖家,主动报价
+	 *
+	 * @param json
+	 * @return
+	 */
+	@RequestMapping(value = "/submit", method = RequestMethod.POST)
+	public ResponseEntity<ModelMap> submit(@RequestBody String json) {
+		SaleQuotationItem item = FlexJsonUtils.fromJson(json, SaleQuotationItem.class);
+		item.getQuotation().setStatus((short) Status.SUBMITTED.value());
+		item = saleQuotationService.save(item);
+		logger.log("主动报价单", "在平台上提交主动报价单", item.replyDescription(), item.getQuotation().getCode(),
+				item.getQuotation().getId());
+		ModelMap map = new ModelMap();
+		map.put("id", item.getQuotation().getId());
+		return new ResponseEntity<ModelMap>(map, HttpStatus.OK);
+	}
+
 	/**
 	 * 作为卖家,获取主动报价明细
 	 * 
@@ -458,6 +477,17 @@ public class SaleQuotationController {
 		return saleQuotationService.findItemById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出Excel - 全部
 	 * 
@@ -518,6 +548,46 @@ public class SaleQuotationController {
 		return modelAndView;
 	}
 
+	/**
+	 * 导出Excel - 已采纳
+	 *
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(value = "/xls", params = RequestState.AGREED, method = RequestMethod.GET)
+	public ModelAndView exportAgreedQuotation(PageParams params, String searchFilter) {
+		params.setPage(1);
+		params.setCount(SearchConstants.TOP_NUM);
+		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.addObject("state", "已采纳");
+		modelAndView.addObject("dateFormat", dateFormat);
+		modelAndView.addObject("data",getAgreedQuotationItems(params, searchFilter).getContent());
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleQuotation", "主动报价单列表_已失效"));
+		logger.log("主动报价单", "导出Excel列表", "导出已失效Excel列表");
+		return modelAndView;
+	}
+
+	/**
+	 * 导出Excel - 未采纳
+	 *
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(value = "/xls", params = RequestState.REFUSED, method = RequestMethod.GET)
+	public ModelAndView exportRefusedQuotation(PageParams params, String searchFilter) {
+		params.setPage(1);
+		params.setCount(SearchConstants.TOP_NUM);
+		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+		ModelAndView modelAndView = new ModelAndView();
+		modelAndView.addObject("state", "未采纳");
+		modelAndView.addObject("dateFormat", dateFormat);
+		modelAndView.addObject("data",getRefusedQuotationItems(params, searchFilter).getContent());
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/sale/saleQuotation", "主动报价单列表_已失效"));
+		logger.log("主动报价单", "导出Excel列表", "导出已失效Excel列表");
+		return modelAndView;
+	}
+
 	/**
 	 * 导出Excel - 已失效
 	 *

+ 16 - 3
src/main/java/com/uas/platform/b2b/controller/SaleReturnController.java

@@ -6,6 +6,7 @@ import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -61,7 +62,8 @@ public class SaleReturnController {
 	/**
 	 * 作为卖家,客户的采购验退单(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -99,7 +101,7 @@ public class SaleReturnController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public PurchaseReturn getReceivedPurchaseReturnById(@PathVariable("id") Long id) {
 		logger.log("客户验退单", "获取单个客户采购验退单,id:" + id);
@@ -116,7 +118,18 @@ public class SaleReturnController {
 	public Enterprise getEnterprieNameByEnuu(@PathVariable("id")Long id,Long enuu) {
 		return enterpriseService.findByEnUU(enuu);
 	}
-	
+
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 

+ 76 - 24
src/main/java/com/uas/platform/b2b/controller/SaleSampleController.java

@@ -72,10 +72,11 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样申请单
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getProofingItems(PageParams params, String searchFilter) {
 		logger.log("客户打样申请", "查看所有客户打样申请");
@@ -105,10 +106,11 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样申请单(待处理)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET, params = RequestState.TODO)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET, params = RequestState.TODO)
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getTodoProofingItems(PageParams params, String searchFilter) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
@@ -139,10 +141,11 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样申请单(已处理)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET, params = RequestState.DONE)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET, params = RequestState.DONE)
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getDoneProofingItems(PageParams params, String searchFilter) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
@@ -173,10 +176,11 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样申请单(已作废)
 	 *
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(method = RequestMethod.GET, params = RequestState.INVALID)
+	@RequestMapping(value = "/info/search", method = RequestMethod.GET, params = RequestState.INVALID)
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getInvalidProofingItems(PageParams params, String searchFilter) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
@@ -207,10 +211,11 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样申请单
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET)
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getAllProofingItems(PageParams params, String searchFilter) {
 		logger.log("客户打样申请", "查看所有客户打样申请");
@@ -234,10 +239,11 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样申请单(待处理)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET, params = RequestState.TODO)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET, params = RequestState.TODO)
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getTodoItems(PageParams params, String searchFilter) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
@@ -263,10 +269,11 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样申请单(已处理)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET, params = RequestState.DONE)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET, params = RequestState.DONE)
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getDoneItems(PageParams params, String searchFilter) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
@@ -292,10 +299,11 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样申请单(已作废)
 	 *
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
-	@RequestMapping(value = "/info", method = RequestMethod.GET, params = RequestState.INVALID)
+	@RequestMapping(value = "/info/nosearch", method = RequestMethod.GET, params = RequestState.INVALID)
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getInvalidItems(PageParams params, String searchFilter) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
@@ -324,7 +332,7 @@ public class SaleSampleController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public PurchaseProofingItem getProofingItemById(@PathVariable("id") Long id) {
 		logger.log("客户打样申请", "查看单个客户打样申请,打样申请明细id:" + id);
@@ -359,7 +367,7 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,获取送样申请明细的送样单
 	 * 
-	 * @param json
+	 * @param id
 	 * @return
 	 */
 	@RequestMapping(value = "/{id}/send", method = RequestMethod.GET)
@@ -377,7 +385,10 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样认定单(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/approval", method = RequestMethod.GET)
@@ -415,7 +426,10 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样认定单(合格)
 	 *
-	 * @param json
+	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/approval", params = RequestState.AGREED, method = RequestMethod.GET)
@@ -457,7 +471,10 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,分页获取客户的打样认定单(不合格)
 	 *
-	 * @param json
+	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/approval", params = RequestState.REFUSED, method = RequestMethod.GET)
@@ -496,7 +513,7 @@ public class SaleSampleController {
 	/**
 	 * 作为卖家,根据ID获取客户的打样认定单详细界面
 	 * 
-	 * @param json
+	 * @param id
 	 * @return
 	 */
 	@RequestMapping(value = "/approval/{id}", method = RequestMethod.GET)
@@ -506,6 +523,17 @@ public class SaleSampleController {
 		return purchaseProofingService.findByidApproval(id);
 	}
 
+	/**
+	 * 打印权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/printCount/permission", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap printPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 记录打样申请单的打印次数
 	 * 
@@ -516,10 +544,21 @@ public class SaleSampleController {
 	@ResponseBody
 	public ResponseEntity<String> printCount(@PathVariable("id") Long id) {
 		purchaseProofingService.print(id);
-		logger.log("客户采购单", "打印客户采购订单", id.toString());
+		logger.log("客户打样申请单", "打印打样申请单", id.toString());
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出打样申请 - 全部
 	 * 
@@ -600,10 +639,23 @@ public class SaleSampleController {
 		return modelAndView;
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/approval/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportApprovalPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出认定单 - 全部
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/approval/xls", method = RequestMethod.GET)

+ 9 - 7
src/main/java/com/uas/platform/b2b/controller/UserController.java

@@ -34,6 +34,8 @@ import com.uas.platform.core.util.mq.AuthCodeSoap;
 import com.uas.platform.core.util.mq.MessageLog;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
 
+import static com.uas.platform.b2b.model.Token.UserType.user;
+
 /**
  * 企业请求
  * 
@@ -198,13 +200,13 @@ public class UserController {
 	 * 
 	 * @return
 	 */
-			@RequestMapping(method = RequestMethod.PUT)
-			public ResponseEntity<String> saveUser(@RequestBody String json, HttpServletRequest request) {
-				User user = FlexJsonUtils.fromJson(json, User.class);
-				user = userService.updateUserInfo(user);
-				if (user != null) {
-					logger.log("用户信息", "修改用户信息,UU:" + user.getUserUU());
-					if (SystemSession.getUser().getUserUU().equals(user.getUserUU()))
+	@RequestMapping(method = RequestMethod.PUT)
+	public ResponseEntity<String> saveUser(@RequestBody String json, HttpServletRequest request) {
+		User user = FlexJsonUtils.fromJson(json, User.class);
+		user = userService.updateUserInfo(user);
+		if (user != null) {
+			logger.log("用户信息", "修改用户信息,UU:" + user.getUserUU());
+			if (SystemSession.getUser().getUserUU().equals(user.getUserUU()))
 				request.getSession().setAttribute("user", user);
 		}
 		return new ResponseEntity<String>(HttpStatus.OK);

+ 23 - 2
src/main/java/com/uas/platform/b2b/controller/VendorController.java

@@ -82,7 +82,7 @@ public class VendorController {
 	 * @param id
 	 * @return
 	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
+	@RequestMapping(value = "/{id}/info", method = RequestMethod.GET)
 	@ResponseBody
 	public Vendor getVendorDetail(@PathVariable Long id) {
 		return vendorService.findById(id);
@@ -131,7 +131,28 @@ public class VendorController {
 	public User getUser(){
 		return SystemSession.getUser();
 	}
-	
+
+	/**
+	 * 获取客户详情
+	 *
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/customer/{id}/info", method = RequestMethod.GET)
+	@ResponseBody
+	public Vendor getCustomerDetail(@PathVariable Long id) {
+		return vendorService.findById(id);
+	}
+
+	/**
+	 * 导出客户权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/customer/permission/xls", method = RequestMethod.GET)
+	public ModelMap exportVendorsPermission() {
+		return new ModelMap("success", true);
+	}
 	/**
 	 * 导出
 	 * 

+ 4 - 7
src/main/java/com/uas/platform/b2b/dao/RoleDao.java

@@ -56,16 +56,13 @@ public interface RoleDao extends JpaRepository<Role, Long> {
     @Query(value = "select count(1) from sec$roles r left join sec$userrole u on r.role_id = u.role_id where r.role_enuu = :enuu and u.user_uu = :useruu and (r.role_name = 'ROLE_ADMIN' or r.role_name = 'ROLE_SALEMANAGER')",nativeQuery = true)
     Double findByEnuuAndUseruu(@Param("enuu") Long enuu, @Param("useruu") Long useruu);
 
-	/**
-	 * 是否是当前企业的管理员(只有管理员才能设置权限)
-	 *
-	 * @param enuu
-	 * @param useruu
-	 * @return
-	 */
 	@Query(value = "select count(1) from sec$roles r left join sec$userrole u on r.role_id = u.role_id where r.role_enuu = :enuu and u.user_uu = :useruu and r.role_name = 'ROLE_ADMIN'",nativeQuery = true)
 	Double findByEnuuAndUserUU(@Param("enuu") Long enuu, @Param("useruu") Long useruu);
 
+	@Query(value = "select count(1) from sec$roles r left join sec$userrole u on r.role_id = u.role_id where r.role_enuu = :enuu and u.user_uu = :useruu and r.role_name = 'ROLE_USER'",nativeQuery = true)
+	Double findByEnuuAndUserUu(@Param("enuu") Long enuu, @Param("useruu") Long useruu);
+
+
 	/**
 	 * 根据角色名称查找默认角色的默认值
 	 * @param desc

+ 16 - 9
src/main/java/com/uas/platform/b2b/erp/model/Prod.java

@@ -1,11 +1,12 @@
 package com.uas.platform.b2b.erp.model;
 
-import java.util.Date;
-
 import com.uas.platform.b2b.model.Enterprise;
 import com.uas.platform.b2b.model.Product;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.model.Constant;
+import com.uas.platform.core.model.Status;
+
+import java.util.Date;
 
 /**
  * ERP系统的产品
@@ -274,13 +275,19 @@ public class Prod {
 		product.setLtinstock(this.pr_ltinstock);
 		product.setSourceId(this.pr_id);
 		product.setBrand(this.pr_brand);
-		// if (this.pr_status != null) {
-		// if (this.pr_status.equals(Status.AUDITED.getPhrase())) {
-		// product.setIsSale((short) 1);
-		// } else if (this.pr_status.equals(Status.DISABLED.getPhrase())) {
-		// product.setIsSale((short) 0);
-		// }
-		// }
+		if (this.pr_status != null) {
+			if (this.pr_status.equals(Status.DISABLED.getPhrase())) {
+				product.setB2benabled(Constant.YES);
+			} else {
+				product.setB2benabled(null);
+			}
+
+//			if (this.pr_status.equals(Status.AUDITED.getPhrase())) {
+//				//product.setIsSale((short) 1);
+//			} else if (this.pr_status.equals(Status.DISABLED.getPhrase())) {
+//				//product.setIsSale((short) 0);
+//			}
+		}
 		if (this.pr_orispeccode != null) {
 			product.setCmpCode(this.pr_orispeccode);
 		} else {

+ 2 - 0
src/main/java/com/uas/platform/b2b/erp/service/impl/ARCheckServiceImpl.java

@@ -103,6 +103,8 @@ public class ARCheckServiceImpl implements ARCheckService {
 		vendor.setVendEnUU(SystemSession.getUser().getEnterprise().getUu());
 		// 卖方联系人为卖方企业管理员
 		vendor.setVendUserUU(SystemSession.getUser().getEnterprise().getEnAdminuu());
+		vendor.setCustswitch(Constant.YES);
+		vendor.setVendswitch(Constant.YES);
 		return vendorDao.save(vendor);
 	}
 

+ 2 - 0
src/main/java/com/uas/platform/b2b/erp/service/impl/InquiryMouldServiceImpl.java

@@ -165,6 +165,8 @@ public class InquiryMouldServiceImpl implements InquiryMouldService {
 		Vendor vendor = new Vendor();
 		vendor.setMyEnUU(SystemSession.getUser().getEnterprise().getUu());
 		vendor.setMyEnterprise(SystemSession.getUser().getEnterprise());
+		vendor.setCustswitch(Constant.YES);
+		vendor.setVendswitch(Constant.YES);
 		if (purchaseInquiryMould.getUseruu() != null && purchaseInquiryMould.getUseruu() != 0) {
 			vendor.setMyUserUU(purchaseInquiryMould.getUseruu());
 		} else {

+ 2 - 0
src/main/java/com/uas/platform/b2b/erp/service/impl/InquiryServiceImpl.java

@@ -193,6 +193,8 @@ public class InquiryServiceImpl implements InquiryService {
 		}
 		vendor.setMyUserUU(SystemSession.getUser().getUserUU());
 		vendor.setMyEnterprise(SystemSession.getUser().getEnterprise());
+		vendor.setCustswitch(Constant.YES);
+		vendor.setVendswitch(Constant.YES);
 		Enterprise vendEnterprise = enterpriseDao.findOne(inquiryItem.getVendUU());
 		if (vendEnterprise != null) {
 			vendor.setVendorEnterprise(vendEnterprise);

+ 111 - 1
src/main/java/com/uas/platform/b2b/erp/service/impl/PublicInquiryServiceImpl.java

@@ -1,6 +1,9 @@
 package com.uas.platform.b2b.erp.service.impl;
 
+import com.uas.message.mail.service.MailService;
 import com.uas.platform.b2b.core.util.ContextUtils;
+import com.uas.platform.b2b.core.util.DateFormatUtils;
+import com.uas.platform.b2b.core.util.ThreadTask;
 import com.uas.platform.b2b.dao.*;
 import com.uas.platform.b2b.erp.model.BatchInProduct;
 import com.uas.platform.b2b.erp.model.BatchInquiry;
@@ -10,16 +13,21 @@ import com.uas.platform.b2b.event.PurcInquirySaveReleaseEvent;
 import com.uas.platform.b2b.model.Product;
 import com.uas.platform.b2b.model.PurcInquiry;
 import com.uas.platform.b2b.model.PurcInquiryItem;
+import com.uas.platform.b2b.support.MessageConf;
 import com.uas.platform.b2b.support.SystemSession;
+import com.uas.platform.b2b.temporary.model.SmsMessage;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.Status;
+import com.uas.platform.core.util.HttpUtil;
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.util.*;
+import java.util.regex.Pattern;
 
 /**
  * Created by hejq on 2017-09-18.
@@ -45,6 +53,12 @@ public class PublicInquiryServiceImpl implements PublicInquiryService {
     @Autowired
     protected  JdbcTemplate jdbcTemplate;
 
+    @Autowired
+    private MailService mailService;
+
+    @Autowired
+    private MessageConf messageConf;
+
     private final static ErpBufferedLogger logger = BufferedLoggerManager.getLogger(ErpBufferedLogger.class);
 
     @Override
@@ -93,6 +107,7 @@ public class PublicInquiryServiceImpl implements PublicInquiryService {
 
     @Override
     public void save(List<PurcInquiry> inquiries) {
+        List<PurcInquiryItem> inquiryItems = new ArrayList<>();
         if(!CollectionUtils.isEmpty(inquiries)) {
             for(PurcInquiry inquiry : inquiries) {
                 List<PurcInquiryItem> items = new ArrayList<PurcInquiryItem>();
@@ -104,15 +119,110 @@ public class PublicInquiryServiceImpl implements PublicInquiryService {
                 }
                 try {
                     items = purcInquiryItemDao.save(items);
-                    ContextUtils.publishEvent(new PurcInquirySaveReleaseEvent(items));
+                    inquiryItems.addAll(items);
                 } catch (Exception e) {
                     logger.log("公共询价保存出错", inquiry.getEnUU() + "," +inquiry.getCode() +" 保存失败", 0);
                     e.printStackTrace();
                 }
             }
+            // 产生消息
+            sendMessage(inquiryItems);
+            // 发送通知
+            sendRemind(inquiries);
         }
     }
 
+    /**
+     * 产生消息
+     * @param inquiryItems
+     */
+    private void sendMessage(final List<PurcInquiryItem> inquiryItems) {
+        ThreadTask.getInstance().execute(new Runnable() {
+            @Override
+            public void run() {
+                List<PurcInquiry> inquiries = PurcInquiryItem.distinct(inquiryItems);
+                List<PurcInquiryItem> items = new ArrayList<>();
+                for (PurcInquiry inquiry : inquiries) {
+                    Set<Long> enUUs = new HashSet<>();
+                    for (PurcInquiryItem inquiryItem : inquiry.getInquiryItems()) {
+                        if (!enUUs.contains(inquiryItem.getVendUU())) {
+                            items.add(inquiryItem);
+                            enUUs.add(inquiryItem.getVendUU());
+                        }
+                    }
+                }
+                ContextUtils.publishEvent(new PurcInquirySaveReleaseEvent(items));
+            }
+        });
+    }
+
+    /**
+     * 发送通知
+     *
+     * @param inquiries 采购询价单主表
+     * @return
+     */
+    private void sendRemind(final List<PurcInquiry> inquiries){
+        ThreadTask.getInstance().execute(new Runnable() {
+            @Override
+            public void run() {
+                for (PurcInquiry inquiry : inquiries) {
+                    // 一个询价单,给一个企业只发一封邮件
+                    Set<Long> enUUs = new HashSet<>();
+                    // 短信设置
+                    SmsMessage sms = new SmsMessage();
+                    List<Object> obj = new ArrayList<Object>();
+                    obj.add(inquiry.getEnterprise().getEnName());
+                    sms.setParams(obj);
+                    for (PurcInquiryItem inquiryItem : inquiry.getInquiryItems()) {
+                        if (!enUUs.contains(inquiryItem.getVendUU())) {
+                            // 查找业务员邮箱
+                            String userEmailSql = "select distinct us.user_email useremail from sec$users us " +
+                                    " left join sec$userrole ur on us.user_uu = ur.user_uu left join sec$roles sr " +
+                                    " on ur.role_id = sr.role_id where sr.role_desc = '业务员' and us.user_email is not null " +
+                                    " and sr.role_enuu = " + inquiryItem.getVendUU();
+                            List<String> userEmails = commonDao.query(userEmailSql, String.class);
+                            String userTelSql = "select distinct us.user_email useremail from sec$users us " +
+                                    " left join sec$userrole ur on us.user_uu = ur.user_uu left join sec$roles sr " +
+                                    " on ur.role_id = sr.role_id where sr.role_desc = '业务员' and us.user_email is not null " +
+                                    " and sr.role_enuu = " + inquiryItem.getVendUU();
+                            List<String> userTels = commonDao.query(userTelSql, String.class);
+                            // 发邮件
+                            Map<String, Object> model = new HashMap<String, Object>();
+                            model.put("vendorname", inquiryItem.getEnterprise().getEnName());
+                            model.put("custname", inquiry.getEnterprise().getEnName());
+                            model.put("date", DateFormatUtils.DATE_FORMAT.format(new Date()));
+                            for (String userEmail : userEmails) {
+                                String emailRegex = "[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?";
+                                if (Pattern.matches(emailRegex, userEmail)) {
+                                    try {
+                                        mailService.send(messageConf.getTplInquiryForB2B(), userEmail, model);
+                                    } catch (Exception e) {
+                                        logger.log("公共询价发送邮件出错", inquiry.getEnUU() + "," +inquiry.getCode() +" 发送失败", 0);
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                            // 发短信
+                            for (String userTel : userTels) {
+                                try {
+                                    sms.setReceiver(userTel);
+                                    sms.setTemplateId(messageConf.getMsgInquiryForB2B());
+                                    HttpUtil.sendPost(messageConf.getMessageUrl(), FlexJsonUtils.toJsonDeep(sms));
+
+                                } catch (Exception e) {
+                                    logger.log("公共询价发送短信出错", inquiry.getEnUU() + "," +inquiry.getCode() +" 发送失败", 0);
+                                    e.printStackTrace();
+                                }
+                            }
+                            enUUs.add(inquiryItem.getVendUU());
+                        }
+                    }
+                }
+            }
+        });
+    }
+
     @Override
     public void updateStatus(List<BatchInquiry> inquiries) {
         if(!CollectionUtils.isEmpty(inquiries)) {

+ 2 - 0
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseForecastServiceImpl.java

@@ -191,6 +191,8 @@ public class PurchaseForecastServiceImpl implements PurchaseForecastService {
 			Vendor vendor = new Vendor();
 			vendor.setMyEnUU(forecastItem.getOrder().getEnUU());
 			vendor.setMyEnterprise(SystemSession.getUser().getEnterprise());
+			vendor.setCustswitch(Constant.YES);
+			vendor.setVendswitch(Constant.YES);
 			if (forecastItem.getOrder().getUserUU() != null
 					&& userDao.findOne(forecastItem.getOrder().getUserUU()) != null)
 				vendor.setMyUserUU(forecastItem.getOrder().getUserUU());

+ 2 - 0
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseSampleServiceImpl.java

@@ -130,6 +130,8 @@ public class PurchaseSampleServiceImpl implements PurchaseSampleService {
 			vendor.setMyEnterprise(SystemSession.getUser().getEnterprise());
 			vendor.setVendorEnterprise(enterprise);
 			vendor.setVendEnUU(enterprise.getUu());
+			vendor.setCustswitch(Constant.YES);
+			vendor.setVendswitch(Constant.YES);
 			if (proofingItem.getVendUserUU() != null) {
 				List<User> users = userDao.findByEnUUAndUserUU(enterprise.getUu(), proofingItem.getVendUserUU());
 				if (users.size() > 0) {

+ 1 - 0
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseServiceImpl.java

@@ -143,6 +143,7 @@ public class PurchaseServiceImpl implements PurchaseService {
 		vendor.setMyEnterprise(SystemSession.getUser().getEnterprise());
 		// 默认开启供应商
 		vendor.setVendswitch(Constant.YES);
+		vendor.setCustswitch(Constant.YES);
 		// 买方用户(联系人)
 		// 1、单据存在买方用户UU号:买方企业存在对应uu号的用户,设为该用户;买方企业不存在对应uu号的用户,供应商和单据设为当前用户(管理员)
 		// 2、单据不存在买方用户UU号:供应商和单据设为当前用户(管理员)

+ 2 - 0
src/main/java/com/uas/platform/b2b/erp/service/impl/TenderServiceImpl.java

@@ -872,6 +872,8 @@ public class TenderServiceImpl implements TenderService {
             vendor.setMyUserUU(saleTender.getRecorderuu());
             vendor.setVendorEnterprise(enterprise);
             vendor.setVendEnUU(enterprise.getUu());
+            vendor.setCustswitch(Constant.YES);
+            vendor.setVendswitch(Constant.YES);
             if (saleTender.getUseruu() != null) {
                 List<User> users = userDao.findByEnUUAndUserUU(enterprise.getUu(), saleTender.getUseruu());
                 if (users.size() > 0) {

+ 1 - 6
src/main/java/com/uas/platform/b2b/event/PurcInquirySaveReleaseEvent.java

@@ -58,12 +58,7 @@ public class PurcInquirySaveReleaseEvent extends SaveReleaseEvent<PagingReleaseD
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
         String inDate = formatter.format(purcInquiry.getDate());
         String endDate = formatter.format(purcInquiry.getEndDate());
-        String context;
-        if (item.getProduct().getTitle().length() > 10) {
-            context = purcInquiry.getEnterprise().getEnName() + "于" + inDate + "发起了对于\"" + item.getProduct().getTitle().substring(0, 9) + "...\"物料的询价,报价截止日期:" + endDate + "!";
-        } else {
-            context = purcInquiry.getEnterprise().getEnName() + "于" + inDate + "发起了对于\"" + item.getProduct().getTitle() + "\"物料的询价,报价截止日期:" + endDate + "!";
-        }
+        String context = "\"" + purcInquiry.getEnterprise().getEnName() + "\"发起了公共询价(" + codeValue + "),请快速报价!";
         PagingRelease release = new PagingRelease(emUU, emName, enUU, date, codeValue, from, title, context, type, isReply, category, table, sourceId, orderStatus, toVendor, url);
         // 公共询价无供应商UU
         Long vendUU = 1L;

+ 1 - 1
src/main/java/com/uas/platform/b2b/event/PurchaseInquiryItemSaveEvent.java

@@ -54,7 +54,7 @@ public class PurchaseInquiryItemSaveEvent extends SaveEvent<PurchaseInquiryItemI
 			PurchaseInquiry inquiry = item.getInquiry();
 			if (item.getVendUserUU() != null) {
 				XingePusher.pushByUserUU(item.getVendUserUU(), "新增一条客户询价单", "单号:" + inquiry.getCode() + ",客户:" + inquiry.getEnterprise().getEnName(), 
-						"#/sale/inquiry/" + item.getId(), 
+						"#/sale/inquiry/" + item.getId(),
 						"客户采购询价单");
 			}
 		}

+ 1 - 1
src/main/java/com/uas/platform/b2b/event/PurchaseInquiryItemSaveReleaseEvent.java

@@ -59,7 +59,7 @@ public class PurchaseInquiryItemSaveReleaseEvent extends SaveReleaseEvent<Paging
         String url = "#/sale/inquiry/" + inquiryItem.getInquiry().getId();
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String orderDate = formatter.format(inquiryItem.getInquiry().getDate());
-        String context = inquiryItem.getInquiry().getEnterprise().getEnName() + "的" + emName + "给您发送了一张新的采购询价单(" + codeValue + ")!";
+        String context = "您的合作伙伴\"" + inquiryItem.getInquiry().getEnterprise().getEnName() + "\"发布新的询价单(" + codeValue + "),请快速报价!";
         PagingRelease release = new PagingRelease(emUU, emName, enUU, date, codeValue, from, title, context, type, isReply, category, table, sourceId, orderStatus, toVendor, url);
         Long vendUU = inquiryItem.getVendUU();
         Long vendUserUU = inquiryItem.getVendUserUU();

+ 51 - 44
src/main/java/com/uas/platform/b2b/filter/SSOInterceptor.java

@@ -1,17 +1,22 @@
 package com.uas.platform.b2b.filter;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import com.uas.platform.b2b.dao.ResourceItemDao;
+import com.uas.platform.b2b.manage.service.AccessTokenService;
+import com.uas.platform.b2b.model.*;
+import com.uas.platform.b2b.service.EnterpriseService;
+import com.uas.platform.b2b.service.RoleService;
+import com.uas.platform.b2b.service.SigninLogService;
+import com.uas.platform.b2b.service.UserService;
+import com.uas.platform.b2b.support.SecurityConstant;
+import com.uas.platform.b2b.support.SystemSession;
+import com.uas.platform.b2b.support.UserCreater;
+import com.uas.platform.core.model.Constant;
+import com.uas.platform.core.util.AgentUtils;
+import com.uas.platform.core.util.encry.Md5Utils;
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
+import com.uas.sso.SSOHelper;
+import com.uas.sso.SSOToken;
+import com.uas.sso.web.spring.AbstractSSOInterceptor;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,28 +34,12 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.util.StringUtils;
 
-import com.uas.platform.b2b.dao.ResourceItemDao;
-import com.uas.platform.b2b.manage.service.AccessTokenService;
-import com.uas.platform.b2b.model.Enterprise;
-import com.uas.platform.b2b.model.ResourceItem;
-import com.uas.platform.b2b.model.Role;
-import com.uas.platform.b2b.model.SigninLog;
-import com.uas.platform.b2b.model.User;
-import com.uas.platform.b2b.model.Vendor;
-import com.uas.platform.b2b.service.EnterpriseService;
-import com.uas.platform.b2b.service.RoleService;
-import com.uas.platform.b2b.service.SigninLogService;
-import com.uas.platform.b2b.service.UserService;
-import com.uas.platform.b2b.support.SecurityConstant;
-import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.b2b.support.UserCreater;
-import com.uas.platform.core.model.Constant;
-import com.uas.platform.core.util.AgentUtils;
-import com.uas.platform.core.util.encry.Md5Utils;
-import com.uas.platform.core.util.serializer.FlexJsonUtils;
-import com.uas.sso.SSOHelper;
-import com.uas.sso.SSOToken;
-import com.uas.sso.web.spring.AbstractSSOInterceptor;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+
+import static com.uas.platform.b2b.model.Token.UserType.user;
 
 @SuppressWarnings("deprecation")
 public class SSOInterceptor extends AbstractSSOInterceptor {
@@ -125,7 +114,11 @@ public class SSOInterceptor extends AbstractSSOInterceptor {
 		}
 		if (user != null) {
 			SystemSession.setUser(user);
-			accessDecision(request, user);
+			try {
+				accessDecision(request, user, response);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
 			return true;
 		} else {
 			if (SecurityConstant.AUTHENTICATION_URL.equals(request.getRequestURI())) {
@@ -161,21 +154,25 @@ public class SSOInterceptor extends AbstractSSOInterceptor {
 		}
 		if (user != null) {
 			SystemSession.setUser(user);
-			accessDecision(request, user);
+			try {
+				accessDecision(request, user, response);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
 		}
 	}
 
 	/**
 	 * 权限验证
 	 */
-	private void accessDecision(HttpServletRequest request, User user) {
+	private void accessDecision(HttpServletRequest request, User user, HttpServletResponse response) throws IOException {
 		Collection<ConfigAttribute> configAttributes = getAttributes(request);
 		if (null == configAttributes || configAttributes.size() == 0 || user.isSys()) {
 			return;
 		}
-		if (null == authorities || !authorities.containsKey(user.getUserUU())) {
+//		if (null == authorities || !authorities.containsKey(user.getUserUU())) {
 			setGrantedAuthorities(user);
-		}
+//		}
 		Iterator<ConfigAttribute> iterator = configAttributes.iterator();
 		String needPermission = null;
 		Collection<GrantedAuthority> userAuthorities = authorities.get(user.getUserUU());
@@ -198,12 +195,22 @@ public class SSOInterceptor extends AbstractSSOInterceptor {
 		}
 
 		// 验证该用户是否被分配客户
-		List<Vendor> myVendors = userService.findDistribute();
-		if (!CollectionUtils.isEmpty(myVendors)) {
-			return;
+//		List<Vendor> myVendors = userService.findDistribute();
+//		if (!CollectionUtils.isEmpty(myVendors)) {
+//			return;
+//		}
+		if (needPermission != null) {
+//			if(needPermission.contains("导出")) {
+//				String retUrl = request.getContextPath();
+//				try {
+//					throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
+//				} finally {
+////					response.sendRedirect(retUrl + "/static/tpl/start/index.html");
+//				}
+//			} else {
+				throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
+//			}
 		}
-		if (needPermission != null)
-			throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
 	}
 
 	@Override

+ 249 - 161
src/main/java/com/uas/platform/b2b/listener/MessageListener.java

@@ -20,123 +20,203 @@ import java.util.Set;
 /**
  * 监听新增数据事件
  * 生成对应消息
- *
  */
 @Component
 public class MessageListener implements ApplicationListener<SaveReleaseEvent<?, ?>> {
 
-	@Autowired
-	private PagingReleaseDetailDao pagingReleaseDetailDao;
+    @Autowired
+    private PagingReleaseDetailDao pagingReleaseDetailDao;
 
-	@Autowired
-	private VendorDao vendorDao;
+    @Autowired
+    private VendorDao vendorDao;
 
-	@Autowired
-	private RoleDao roleDao;
+    @Autowired
+    private EnterpriseDao enterpriseDao;
 
-	@Autowired
-	private UserDao userDao;
+    @Autowired
+    private RoleDao roleDao;
 
-	@Autowired
-	private DistributeDao distributeDao;
+    @Autowired
+    private UserDao userDao;
 
-	@Autowired
-	private MobileReleaseService mobileReleaseService;
+    @Autowired
+    private DistributeDao distributeDao;
 
-	@Autowired
-	private CommonDao commonDao;
+    @Autowired
+    private MobileReleaseService mobileReleaseService;
 
-	@Autowired
-	private PurcInquiryItemDao purcInquiryItemDao;
+    @Autowired
+    private CommonDao commonDao;
 
-	@SuppressWarnings("unchecked")
-	@Async
-	@Override
-	public void onApplicationEvent(final SaveReleaseEvent<?, ?> event) {
-		List<PagingReleaseDetail> pagingReleaseDetails = (List<PagingReleaseDetail>) event.release();
-		Set<Long> userUUs = new HashSet<>(); // 存储需要接收消息的用户UU
-		List<PagingReleaseDetail> otherReleaseDetails = new ArrayList<>(); // 用来保存单据新增的其他消息
-		// ERP公共询价比较特殊,单独处理
-		if (event instanceof PurcInquirySaveReleaseEvent) {
-			for(PagingReleaseDetail detail : pagingReleaseDetails) {
-				PurcInquiryItem item = purcInquiryItemDao.findOne(detail.getPagingRelease().getSourceId());
-				if (null != item) {
-					//先取出企业uu
-					// 产品库存在
-					String prodSql = "select distinct pr_enuu enuu from products p left join purc$vendors v " +
-							"on v.ve_vendenuu = p.pr_enuu where p.pr_title = '" + item.getProduct().getTitle() + "' " +
-							"and v.ve_myenuu = " + item.getInquiry().getEnUU();
-					// 询价单已报价的
-					String inquirySql = "select distinct id_venduu enuu from purc$inquiryitems d left join purc$inquiry n " +
-							"on n.in_id = d.id_inid left join products p on p.pr_id = d.id_prid where d.id_status = 201 " +
-							"and p.pr_title = '" + item.getProduct().getTitle() + "' and n.in_enuu = " + item.getInquiry().getEnUU();
-					// 下过采购订单的
-					String orderSql = "select distinct pu_venduu enuu from purc$orders pu left join purc$orderitems pd " +
-							"on pu.pu_id = pd.pd_puid left join products p on p.pr_id = pd.pd_prid " +
-							"where p.pr_title = '" + item.getProduct().getTitle() + "' and pu.pu_enuu = " + item.getInquiry().getEnUU();
-					// 主动报价过的
-					String quotationSql = "select distinct qu_enuu enuu from sale$quotation qu left join sale$quotationitem qd" +
-							" on qu.qu_id = qd.qd_quid left join products p on qd.qd_prid = p.pr_id " +
-							"where p.pr_title = '" + item.getProduct().getTitle() + "' and qu.qu_custuu = " + item.getInquiry().getEnUU();
-					List<UserAndEnterprise> prodEnUUs = commonDao.query(prodSql, UserAndEnterprise.class);
-					List<UserAndEnterprise> inquiryEnUUs = commonDao.query(inquirySql, UserAndEnterprise.class);
-					List<UserAndEnterprise> orderEnUUs = commonDao.query(orderSql, UserAndEnterprise.class);
-					List<UserAndEnterprise> quotationEnUUs = commonDao.query(quotationSql, UserAndEnterprise.class);
-					List<UserAndEnterprise> enuus = new ArrayList<>();
-					Set<Long> enUUs = new HashSet<>();
-					enuus.addAll(prodEnUUs);
-					enuus.addAll(inquiryEnUUs);
-					enuus.addAll(orderEnUUs);
-					enuus.addAll(quotationEnUUs);
-					// enuus存在才进行人员选择
-					if(enuus.size() > 0) {
-						for(UserAndEnterprise enter : enuus) {
-							if (!enUUs.contains(enter.getEnuu())) {
-								List<UserAndEnterprise> useruus =  commonDao.query(
-										"select user_uu useruu from sec$userrole u left join sec$roles r on u.role_id = r.role_id where r.role_desc = '业务员' and r.role_enuu = " + enter.getEnuu(),
-										UserAndEnterprise.class);
-								if (CollectionUtils.isEmpty(useruus)) {
-									useruus =  commonDao.query(
-											"select user_uu useruu from sec$userrole u left join sec$roles r on u.role_id = r.role_id where r.role_desc = '管理员' and r.role_enuu = " + enter.getEnuu(),
-											UserAndEnterprise.class);
-								}
-								// 新增消息
-								for (UserAndEnterprise userAndEnterprise : useruus) {
-									Long userUU = userAndEnterprise.getUseruu();
-									try { //去除userUU为空值的情况
-										if (null != userUU) {
-											User user = userDao.findOne(userUU);
-											if (null != user) {
-												PagingReleaseDetail pagingReleaseDetail = new PagingReleaseDetail(enter.getEnuu(), userUU, user.getUserName());
-												pagingReleaseDetail.setPagingRelease(detail.getPagingRelease());
-												otherReleaseDetails.add(pagingReleaseDetail);
-											}
-										}
-									} catch (RuntimeException e) {
-										e.getStackTrace();
-									}
-								}
-								enUUs.add(enter.getEnuu());
-							}
-						}
-					}
-				}
-			}
-			// 公共询价消息暂时不采用手机推送
-			pagingReleaseDetailDao.save(otherReleaseDetails);
-			// 询价单单独处理(使用共用方法会出现,分别给两个企业发同一张询价单,两个企业都存在的用户会只收到其中一个企业的一条消息。)
-//		} else if (event instanceof PurchaseInquiryItemSaveReleaseEvent || event instanceof PurchaseInquiryItemInvalidReleaseEvent || event instanceof PurchaseInquiryItemDecideReleaseEvent) {
+    @Autowired
+    private PurcInquiryItemDao purcInquiryItemDao;
 
-		} else {
-			for (PagingReleaseDetail detail : pagingReleaseDetails) {
-				// 先将产生的一条记录加入保存列表,去掉用1补充空值的情况
-				if (detail.getVendUserUU() != 1 && !userUUs.contains(detail.getVendUserUU())) {
-					userUUs.add(detail.getVendUserUU());
-				}
-				PagingRelease release = detail.getPagingRelease();
-				if (null != detail.getVendUU() && null != release.getEnUU()) { // 确保消息有效才继续
-					if (release.getToVendor() == Constant.YES) { // 如果是发给供应商的消息,才会管理员和有权限用户都可以收到消息--2017年8月24日 16:12:05加,避免客户方用户收到太多消息
-						// 添加管理员
+    @SuppressWarnings("unchecked")
+    @Async
+    @Override
+    public void onApplicationEvent(final SaveReleaseEvent<?, ?> event) {
+        List<PagingReleaseDetail> pagingReleaseDetails = (List<PagingReleaseDetail>) event.release();
+        List<PagingReleaseDetail> otherReleaseDetails = new ArrayList<>(); // 用来保存单据新增的其他消息
+        // ERP公共询价比较特殊,单独处理
+        if (event instanceof PurcInquirySaveReleaseEvent) {
+            for (PagingReleaseDetail detail : pagingReleaseDetails) {
+                PurcInquiryItem item = purcInquiryItemDao.findOne(detail.getPagingRelease().getSourceId());
+                if (null != item) {
+                    //先取出企业uu
+                    // 产品库存在
+                    String prodSql = "select distinct pr_enuu enuu from products p left join purc$vendors v " +
+                            "on v.ve_vendenuu = p.pr_enuu where p.pr_title = '" + item.getProduct().getTitle() + "' " +
+                            "and v.ve_myenuu = " + item.getInquiry().getEnUU();
+                    // 询价单已报价的
+                    String inquirySql = "select distinct id_venduu enuu from purc$inquiryitems d left join purc$inquiry n " +
+                            "on n.in_id = d.id_inid left join products p on p.pr_id = d.id_prid where d.id_status = 201 " +
+                            "and p.pr_title = '" + item.getProduct().getTitle() + "' and n.in_enuu = " + item.getInquiry().getEnUU();
+                    // 下过采购订单的
+                    String orderSql = "select distinct pu_venduu enuu from purc$orders pu left join purc$orderitems pd " +
+                            "on pu.pu_id = pd.pd_puid left join products p on p.pr_id = pd.pd_prid " +
+                            "where p.pr_title = '" + item.getProduct().getTitle() + "' and pu.pu_enuu = " + item.getInquiry().getEnUU();
+                    // 主动报价过的
+                    String quotationSql = "select distinct qu_enuu enuu from sale$quotation qu left join sale$quotationitem qd" +
+                            " on qu.qu_id = qd.qd_quid left join products p on qd.qd_prid = p.pr_id " +
+                            "where p.pr_title = '" + item.getProduct().getTitle() + "' and qu.qu_custuu = " + item.getInquiry().getEnUU();
+                    List<UserAndEnterprise> prodEnUUs = commonDao.query(prodSql, UserAndEnterprise.class);
+                    List<UserAndEnterprise> inquiryEnUUs = commonDao.query(inquirySql, UserAndEnterprise.class);
+                    List<UserAndEnterprise> orderEnUUs = commonDao.query(orderSql, UserAndEnterprise.class);
+                    List<UserAndEnterprise> quotationEnUUs = commonDao.query(quotationSql, UserAndEnterprise.class);
+                    List<UserAndEnterprise> enuus = new ArrayList<>();
+                    Set<Long> enUUs = new HashSet<>();
+                    enuus.addAll(prodEnUUs);
+                    enuus.addAll(inquiryEnUUs);
+                    enuus.addAll(orderEnUUs);
+                    enuus.addAll(quotationEnUUs);
+                    // enuus存在才进行人员选择
+                    if (enuus.size() > 0) {
+                        for (UserAndEnterprise enter : enuus) {
+                            if (!enUUs.contains(enter.getEnuu())) {
+                                List<UserAndEnterprise> useruus = commonDao.query(
+                                        "select user_uu useruu from sec$userrole u left join sec$roles r on u.role_id = r.role_id where r.role_desc = '业务员' and r.role_enuu = " + enter.getEnuu(),
+                                        UserAndEnterprise.class);
+                                if (CollectionUtils.isEmpty(useruus)) {
+                                    useruus = commonDao.query(
+                                            "select user_uu useruu from sec$userrole u left join sec$roles r on u.role_id = r.role_id where r.role_desc = '管理员' and r.role_enuu = " + enter.getEnuu(),
+                                            UserAndEnterprise.class);
+                                }
+                                // 新增消息
+                                for (UserAndEnterprise userAndEnterprise : useruus) {
+                                    Long userUU = userAndEnterprise.getUseruu();
+                                    try { //去除userUU为空值的情况
+                                        if (null != userUU) {
+                                            User user = userDao.findOne(userUU);
+                                            if (null != user) {
+                                                PagingReleaseDetail pagingReleaseDetail = new PagingReleaseDetail(enter.getEnuu(), userUU, user.getUserName());
+                                                pagingReleaseDetail.setPagingRelease(detail.getPagingRelease());
+                                                otherReleaseDetails.add(pagingReleaseDetail);
+                                            }
+                                        }
+                                    } catch (RuntimeException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                                enUUs.add(enter.getEnuu());
+                            }
+                        }
+                    }
+                }
+            }
+            // 公共询价消息暂时不采用手机推送
+            pagingReleaseDetailDao.save(otherReleaseDetails);
+            // 询价单单独处理 优先发送给分配过客户的用户,如果不存在就发送给企业管理员
+        } else if (event instanceof PurchaseInquiryItemSaveReleaseEvent || event instanceof PurchaseInquiryItemInvalidReleaseEvent || event instanceof PurchaseInquiryItemDecideReleaseEvent) {
+            for (PagingReleaseDetail detail : pagingReleaseDetails) {
+                Set<Long> userUUs = new HashSet<>(); // 存储需要接收消息的用户UU
+                PagingRelease release = detail.getPagingRelease();
+                if (null != detail.getVendUU() && null != release.getEnUU()) { // 确保消息有效才继续
+                    List<Vendor> vendors;
+                    // 判断提前,防止客户方收到过多单据提示消息
+//					if (release.getToVendor() == Constant.YES) { // 消息接收方为供应商,查找供应商表方式不同
+                    vendors = vendorDao.findByMyEnUUAndVendUU(release.getEnUU(), detail.getVendUU());
+                    // 不添加供应商联系人
+//                    if (!CollectionUtils.isEmpty(vendors) && !userUUs.contains(vendors.get(0).getVendUserUU())) {
+//                        userUUs.add(vendors.get(0).getVendUserUU());
+//                    }
+//					} else { // 消息接收方为客户,查找供应商表方式不同
+//						vendors = vendorDao.findByMyEnUUAndVendUU(detail.getVendUU(), release.getEnUU());
+//						if (!CollectionUtils.isEmpty(vendors) && !userUUs.contains(vendors.get(0).getMyUserUU())) {
+//							userUUs.add(vendors.get(0).getMyUserUU());
+//						}
+//					}
+                    // 查找被分配客户的用户
+                    if (!CollectionUtils.isEmpty(vendors)) {
+                        Long vendorId = vendors.get(0).getId();
+                        List<Distribute> distributes = distributeDao.findByVendorId(vendorId);
+                        // 找出当前企业拥有管理员权限的角色
+                        List<Role> roles = roleDao.findByEnUUAndIssys(detail.getVendUU(), Constant.YES);
+                        Set<Long> adminUUs = new HashSet<>();
+                        if (!CollectionUtils.isEmpty(roles)) {
+                            List<User> admins = userDao.findByRole(roles.get(0).getId());
+                            for (User admin : admins) {
+                                adminUUs.add(admin.getUserUU());
+                            }
+                        }
+                        if (!CollectionUtils.isEmpty(distributes)) {
+                            for (Distribute distribute : distributes) {
+                                if (!userUUs.contains(distribute.getUserUU()) && !adminUUs.contains(distribute.getUserUU())) {
+                                    userUUs.add(distribute.getUserUU());
+                                }
+                            }
+                        }
+                    }
+                    // 新增消息
+                    if (!CollectionUtils.isEmpty(userUUs)) {
+                        for (Long userUU : userUUs) {
+                            try { //去除userUU为空值的情况
+                                if (null != userUU) {
+                                    User user = userDao.findOne(userUU);
+                                    if (null != user) {
+                                        PagingReleaseDetail pagingReleaseDetail = new PagingReleaseDetail(detail.getVendUU(), userUU, user.getUserName());
+                                        pagingReleaseDetail.setPagingRelease(release);
+                                        otherReleaseDetails.add(pagingReleaseDetail);
+                                    }
+                                }
+                            } catch (RuntimeException e) {
+                                e.getStackTrace();
+                            }
+                        }
+                    } else {
+                        Enterprise vendor = enterpriseDao.findOne(detail.getVendUU());
+                        if (null != vendor && null != vendor.getEnAdminuu() && null != vendor.getAdmin()) {
+                            PagingReleaseDetail pagingReleaseDetail = new PagingReleaseDetail(detail.getVendUU(), vendor.getEnAdminuu(), vendor.getAdmin().getUserName());
+                            pagingReleaseDetail.setPagingRelease(release);
+                            otherReleaseDetails.add(pagingReleaseDetail);
+                        }
+                    }
+                    System.out.println("---------------BEGIN----------------");
+                    System.out.println("消息内容:" + detail.getPagingRelease().getContext());
+                    System.out.println("接收企业UU:" + detail.getVendUU());
+                    System.out.println("接收人UU:" + userUUs);
+                    System.out.println("----------------END---------------");
+                }
+            }
+            otherReleaseDetails = pagingReleaseDetailDao.save(otherReleaseDetails);
+            if (!CollectionUtils.isEmpty(otherReleaseDetails)) {
+                pagingReleaseDetails.addAll(otherReleaseDetails);
+            }
+            try { // 推送消息
+                mobileReleaseService.pushReleases(pagingReleaseDetails);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        } else {
+            for (PagingReleaseDetail detail : pagingReleaseDetails) {
+                Set<Long> userUUs = new HashSet<>(); // 存储需要接收消息的用户UU
+                // 先将产生的一条记录加入保存列表,去掉用1补充空值的情况
+                if (detail.getVendUserUU() != 1 && !userUUs.contains(detail.getVendUserUU())) {
+                    userUUs.add(detail.getVendUserUU());
+                }
+                PagingRelease release = detail.getPagingRelease();
+                if (null != detail.getVendUU() && null != release.getEnUU()) { // 确保消息有效才继续
+                    if (release.getToVendor() == Constant.YES) { // 如果是发给供应商的消息,才会管理员和有权限用户都可以收到消息--2017年8月24日 16:12:05加,避免客户方用户收到太多消息
+                        // 添加管理员
 //					List<Role> roles = roleDao.findByEnUUAndIssys(detail.getVendUU(), Constant.YES);
 //					if (!CollectionUtils.isEmpty(roles)) {
 //						List<User> admins = userDao.findByRole(roles.get(0).getId());
@@ -146,68 +226,76 @@ public class MessageListener implements ApplicationListener<SaveReleaseEvent<?,
 //							}
 //						}
 //					}
-						List<Vendor> vendors;
-						// 判断提前,防止客户方收到过多单据提示消息
+                        List<Vendor> vendors;
+                        // 判断提前,防止客户方收到过多单据提示消息
 //					if (release.getToVendor() == Constant.YES) { // 消息接收方为供应商,查找供应商表方式不同
-						vendors = vendorDao.findByMyEnUUAndVendUU(release.getEnUU(), detail.getVendUU());
-						if (!CollectionUtils.isEmpty(vendors) && !userUUs.contains(vendors.get(0).getVendUserUU())) {
-							userUUs.add(vendors.get(0).getVendUserUU());
-						}
+                        vendors = vendorDao.findByMyEnUUAndVendUU(release.getEnUU(), detail.getVendUU());
+                        // 不添加供应商联系人
+//                        if (!CollectionUtils.isEmpty(vendors) && !userUUs.contains(vendors.get(0).getVendUserUU())) {
+//                            userUUs.add(vendors.get(0).getVendUserUU());
+//                        }
 //					} else { // 消息接收方为客户,查找供应商表方式不同
 //						vendors = vendorDao.findByMyEnUUAndVendUU(detail.getVendUU(), release.getEnUU());
 //						if (!CollectionUtils.isEmpty(vendors) && !userUUs.contains(vendors.get(0).getMyUserUU())) {
 //							userUUs.add(vendors.get(0).getMyUserUU());
 //						}
 //					}
-						// 查找有权限的用户
-						if (!CollectionUtils.isEmpty(vendors)) {
-							Long vendorId = vendors.get(0).getId();
-							List<Distribute> distributes = distributeDao.findByVendorId(vendorId);
-							if (!CollectionUtils.isEmpty(distributes)) {
-								// 去掉已将权限转移的管理员
-								Set<Long> leaderUUs = new HashSet<>();
-								for (Distribute distribute : distributes) {
-									if (null != distribute.getIsTransfer() && distribute.getIsTransfer() == Constant.YES && distribute.getLeaderUU() != null
-											&& !leaderUUs.contains(distribute.getLeaderUU())) {
-										leaderUUs.add(distribute.getLeaderUU());
-									}
-								}
-								for (Distribute distribute : distributes) {
-									if (!userUUs.contains(distribute.getUserUU()) && !leaderUUs.contains(distribute.getUserUU())) {
-										userUUs.add(distribute.getUserUU());
-									}
-								}
-							}
-						}
-						// 新增消息
-						for (Long userUU : userUUs) {
-							try { //去除userUU为空值的情况
-								if (null != userUU) {
-									User user = userDao.findOne(userUU);
-									if (null != user) {
-										PagingReleaseDetail pagingReleaseDetail = new PagingReleaseDetail(detail.getVendUU(), userUU, user.getUserName());
-										pagingReleaseDetail.setPagingRelease(release);
-										otherReleaseDetails.add(pagingReleaseDetail);
-									}
-								}
-							} catch (RuntimeException e) {
-								e.getStackTrace();
-							}
-						}
-					} else { // 发送给客户方的,直接添加消息到保存列表
-						otherReleaseDetails.add(detail);
-					}
-				}
-			}
-			otherReleaseDetails = pagingReleaseDetailDao.save(otherReleaseDetails);
-			if (!CollectionUtils.isEmpty(otherReleaseDetails)) {
-				pagingReleaseDetails.addAll(otherReleaseDetails);
-			}
-			try { // 推送消息
-				mobileReleaseService.pushReleases(pagingReleaseDetails);
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-		}
-	}
+                        // 查找有权限的用户
+                        if (!CollectionUtils.isEmpty(vendors)) {
+                            Long vendorId = vendors.get(0).getId();
+                            List<Distribute> distributes = distributeDao.findByVendorId(vendorId);
+                            if (!CollectionUtils.isEmpty(distributes)) {
+                                // 找出当前企业拥有管理员权限的角色
+                                List<Role> roles = roleDao.findByEnUUAndIssys(detail.getVendUU(), Constant.YES);
+                                Set<Long> adminUUs = new HashSet<>();
+                                if (!CollectionUtils.isEmpty(roles)) {
+                                    List<User> admins = userDao.findByRole(roles.get(0).getId());
+                                    for (User admin : admins) {
+                                        adminUUs.add(admin.getUserUU());
+                                    }
+                                }
+                                // 被分配客户的,且不是管理员的用户才接收消息
+                                for (Distribute distribute : distributes) {
+                                    if (!userUUs.contains(distribute.getUserUU()) && !adminUUs.contains(distribute.getUserUU())) {
+                                        userUUs.add(distribute.getUserUU());
+                                    }
+                                }
+                            }
+                        }
+                        // 新增消息
+                        for (Long userUU : userUUs) {
+                            try { //去除userUU为空值的情况
+                                if (null != userUU) {
+                                    User user = userDao.findOne(userUU);
+                                    if (null != user) {
+                                        PagingReleaseDetail pagingReleaseDetail = new PagingReleaseDetail(detail.getVendUU(), userUU, user.getUserName());
+                                        pagingReleaseDetail.setPagingRelease(release);
+                                        otherReleaseDetails.add(pagingReleaseDetail);
+                                    }
+                                }
+                            } catch (RuntimeException e) {
+                                e.getStackTrace();
+                            }
+                        }
+                    } else { // 发送给客户方的,直接添加消息到保存列表
+                        otherReleaseDetails.add(detail);
+                    }
+                    System.out.println("---------------BEGIN----------------");
+                    System.out.println("消息内容:" + detail.getPagingRelease().getContext());
+                    System.out.println("接收企业UU:" + detail.getVendUU());
+                    System.out.println("接收人UU:" + userUUs);
+                    System.out.println("----------------END---------------");
+                }
+            }
+            otherReleaseDetails = pagingReleaseDetailDao.save(otherReleaseDetails);
+            if (!CollectionUtils.isEmpty(otherReleaseDetails)) {
+                pagingReleaseDetails.addAll(otherReleaseDetails);
+            }
+            try { // 推送消息
+                mobileReleaseService.pushReleases(pagingReleaseDetails);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
 }

+ 15 - 19
src/main/java/com/uas/platform/b2b/model/PurcInquiryItem.java

@@ -1,26 +1,10 @@
 package com.uas.platform.b2b.model;
 
-import java.util.Date;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.OrderBy;
-import javax.persistence.SequenceGenerator;
-import javax.persistence.Table;
-
+import com.alibaba.fastjson.annotation.JSONField;
 import org.codehaus.jackson.annotate.JsonIgnore;
 
-import com.alibaba.fastjson.annotation.JSONField;
+import javax.persistence.*;
+import java.util.*;
 
 /**
  * 平台新增询价单明细
@@ -551,4 +535,16 @@ public class PurcInquiryItem {
 	public void setSourceid(Long sourceid) {
 		this.sourceid = sourceid;
 	}
+
+    public static List<PurcInquiry> distinct(List<PurcInquiryItem> inquiryItems) {
+		List<PurcInquiry> inquiries = new ArrayList<>();
+		Set<Long> keys = new HashSet<>();
+		for (PurcInquiryItem item : inquiryItems) {
+			if (!keys.contains(item.getInquiry().getId())) {
+				inquiries.add(item.getInquiry());
+				keys.add(item.getInquiry().getId());
+			}
+		}
+		return inquiries;
+    }
 }

+ 4 - 4
src/main/java/com/uas/platform/b2b/model/PurchaseInquiryItem.java

@@ -610,15 +610,15 @@ public class PurchaseInquiryItem {
 				&& this.agreed == null);
 	}
 
-    public static List<PurchaseInquiryItem> distinct(List<PurchaseInquiryItem> purcitems) {
-		List<PurchaseInquiryItem> inquiryItems = new ArrayList<>();
+    public static List<PurchaseInquiry> distinct(List<PurchaseInquiryItem> purcitems) {
+		List<PurchaseInquiry> inquiries = new ArrayList<>();
 		Set<Long> keys = new HashSet<>();
 		for (PurchaseInquiryItem item : purcitems) {
 			if (!keys.contains(item.getInquiry().getId())) {
-				inquiryItems.add(item);
+				inquiries.add(item.getInquiry());
 				keys.add(item.getInquiry().getId());
 			}
 		}
-		return inquiryItems;
+		return inquiries;
     }
 }

+ 13 - 0
src/main/java/com/uas/platform/b2b/model/Resource.java

@@ -64,6 +64,12 @@ public class Resource implements Serializable{
 	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
 	private Set<ResourceItem> items;
 
+	/**
+	 * 权限显示排序下标
+	 */
+	@Column(name = "res_index")
+	private Long index;
+
 	public Long getId() {
 		return id;
 	}
@@ -96,4 +102,11 @@ public class Resource implements Serializable{
 		this.items = items;
 	}
 
+	public Long getIndex() {
+		return index;
+	}
+
+	public void setIndex(Long index) {
+		this.index = index;
+	}
 }

+ 27 - 0
src/main/java/com/uas/platform/b2b/model/Role.java

@@ -89,6 +89,12 @@ public class Role implements Serializable {
 	@Column(name = "role_duty")
 	private String duty;
 
+	/**
+	 * 下标,用于排序
+	 */
+	@Column(name = "role_index")
+	private Long index;
+
 	public Long getId() {
 		return id;
 	}
@@ -159,6 +165,14 @@ public class Role implements Serializable {
 		this.duty = duty;
 	}
 
+	public Long getIndex() {
+		return index;
+	}
+
+	public void setIndex(Long index) {
+		this.index = index;
+	}
+
 	@Override
 	public int hashCode() {
 		final int prime = 31;
@@ -184,4 +198,17 @@ public class Role implements Serializable {
 		return true;
 	}
 
+	@Override
+	public String toString() {
+		return "Role{" +
+				"id=" + id +
+				", name='" + name + '\'' +
+				", issys=" + issys +
+				", isdefault=" + isdefault +
+				", desc='" + desc + '\'' +
+				", resourceItems=" + resourceItems +
+				", enUU=" + enUU +
+				", duty='" + duty + '\'' +
+				'}';
+	}
 }

+ 6 - 0
src/main/java/com/uas/platform/b2b/service/RoleService.java

@@ -1,9 +1,11 @@
 package com.uas.platform.b2b.service;
 
+import com.uas.platform.b2b.model.ResourceItem;
 import com.uas.platform.b2b.model.Role;
 import org.springframework.ui.ModelMap;
 
 import java.util.List;
+import java.util.Set;
 
 public interface RoleService {
 
@@ -72,4 +74,8 @@ public interface RoleService {
     Role recover(Long roleId);
 
     Role getDefaultRole(Long roleId);
+
+	ModelMap isUser();
+
+    ModelMap updateDefault(String desc, Set<ResourceItem> resourceItems);
 }

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/MakeOrderChangeServiceImpl.java

@@ -258,7 +258,7 @@ public class MakeOrderChangeServiceImpl implements MakeOrderChangeService {
 						}
 					}
 				}
-				List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(order.getVendUU(), order.getEnUU());
+				List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(order.getEnUU(), order.getVendUU());
 				// 查找有权限的用户
 				if (!CollectionUtils.isEmpty(vendors)) {
 					Long vendorId = vendors.get(0).getId();

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/MakeOrderServiceImpl.java

@@ -130,7 +130,7 @@ public class MakeOrderServiceImpl implements MakeOrderService {
 							}
 						}
 					}
-					List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(order.getVendUU(), order.getEnUU());
+					List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(order.getEnUU(), order.getVendUU());
 					// 查找有权限的用户
 					if (!CollectionUtils.isEmpty(vendors)) {
 						Long vendorId = vendors.get(0).getId();

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurcInquiryServiceImpl.java

@@ -296,7 +296,7 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
 		}
 		List<PurchaseInquiryItem> purcitems = purchaseInquiryItemDao.save(items);
 		// 触发事件,产生消息
-		ContextUtils.publishEvent(new PurchaseInquiryItemSaveReleaseEvent(PurchaseInquiryItem.distinct(purcitems)));
+		ContextUtils.publishEvent(new PurchaseInquiryItemSaveReleaseEvent(purcitems));
 		if (purcitems.get(0).getId() != null) {
 			inquiry = inquiryDao.findOne(id);
 			inquiry.setEnteryStatus(Status.ENABLED.value());

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryMouldServiceImpl.java

@@ -479,7 +479,7 @@ public class PurchaseInquiryMouldServiceImpl implements PurchaseInquiryMouldServ
 							}
 						}
 					}
-					List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(mould.getVenduu(), mould.getEnuu());
+					List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(mould.getEnuu(), mould.getVenduu());
 					// 查找有权限的用户
 					if (!CollectionUtils.isEmpty(vendors)) {
 						Long vendorId = vendors.get(0).getId();

+ 112 - 3
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java

@@ -1,27 +1,35 @@
 package com.uas.platform.b2b.service.impl;
 
+import com.uas.message.mail.service.MailService;
 import com.uas.platform.b2b.core.util.ContextUtils;
+import com.uas.platform.b2b.core.util.DateFormatUtils;
 import com.uas.platform.b2b.core.util.ThreadTask;
 import com.uas.platform.b2b.core.util.ThreadUtils;
 import com.uas.platform.b2b.dao.*;
 import com.uas.platform.b2b.erp.model.Inquiry;
 import com.uas.platform.b2b.erp.model.QuotationDown;
 import com.uas.platform.b2b.erp.model.QuotationDownDetail;
+import com.uas.platform.b2b.erp.support.ErpBufferedLogger;
 import com.uas.platform.b2b.event.*;
 import com.uas.platform.b2b.model.*;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.AttachService;
 import com.uas.platform.b2b.service.PurchaseInquiryService;
+import com.uas.platform.b2b.support.MessageConf;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.XingePusher;
 import com.uas.platform.b2b.temporary.model.InquiryMessage;
+import com.uas.platform.b2b.temporary.model.SmsMessage;
 import com.uas.platform.core.concurrent.IRunnable;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.exception.IllegalStatusException;
+import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Status;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
+import com.uas.platform.core.util.HttpUtil;
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.search.b2b.model.PageParams;
 import com.uas.search.b2b.model.SPage;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,6 +47,7 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import java.util.*;
+import java.util.regex.Pattern;
 
 
 @Service
@@ -89,12 +98,45 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 	@Autowired
 	private DistributeDao distributeDao;
 
+	@Autowired
+	private MailService mailService;
+
+	@Autowired
+	private MessageConf messageConf;
+
+	private final static ErpBufferedLogger logger = BufferedLoggerManager.getLogger(ErpBufferedLogger.class);
+
 	@Override
 	public void save(List<PurchaseInquiryItem> inquiryItems) {
 		inquiryItems = purchaseInquiryItemDao.save(inquiryItems);
 		saveUserOrders(inquiryItems);
-		ContextUtils.publishEvent(new PurchaseInquiryItemSaveEvent(inquiryItems));
-		ContextUtils.publishEvent(new PurchaseInquiryItemSaveReleaseEvent(PurchaseInquiryItem.distinct(inquiryItems)));
+		sendRemind(PurchaseInquiryItem.distinct(inquiryItems));
+//		ContextUtils.publishEvent(new PurchaseInquiryItemSaveEvent(inquiryItems));  // 之前的索引分词,已弃用
+		sendMessage(inquiryItems);
+	}
+
+	/**
+	 * 产生消息
+	 * @param inquiryItems
+	 */
+	private void sendMessage(final List<PurchaseInquiryItem> inquiryItems) {
+		ThreadTask.getInstance().execute(new Runnable() {
+			@Override
+			public void run() {
+				List<PurchaseInquiry> inquiries = PurchaseInquiryItem.distinct(inquiryItems);
+				List<PurchaseInquiryItem> items = new ArrayList<>();
+				for (PurchaseInquiry inquiry : inquiries) {
+					Set<Long> enUUs = new HashSet<>();
+					for (PurchaseInquiryItem inquiryItem : inquiry.getInquiryItems()) {
+						if (!enUUs.contains(inquiryItem.getVendUU())) {
+							items.add(inquiryItem);
+							enUUs.add(inquiryItem.getVendUU());
+						}
+					}
+				}
+				ContextUtils.publishEvent(new PurchaseInquiryItemSaveReleaseEvent(items));
+			}
+		});
 	}
 
 	/**
@@ -155,6 +197,73 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 		});
 	}
 
+	/**
+	 * 发送通知
+	 *
+	 * @param inquiries 采购询价单主表
+	 * @return
+	 */
+	private void sendRemind(final List<PurchaseInquiry> inquiries){
+		ThreadTask.getInstance().execute(new Runnable() {
+			@Override
+			public void run() {
+				for (PurchaseInquiry inquiry : inquiries) {
+					// 一个询价单,给一个企业只发一封邮件
+					Set<Long> enUUs = new HashSet<>();
+					// 短信设置
+					SmsMessage sms = new SmsMessage();
+					List<Object> obj = new ArrayList<Object>();
+					obj.add(inquiry.getEnterprise().getEnName());
+					sms.setParams(obj);
+					for (PurchaseInquiryItem inquiryItem : inquiry.getInquiryItems()) {
+						if (!enUUs.contains(inquiryItem.getVendUU())) {
+							// 查找业务员邮箱
+							String userEmailSql = "select distinct us.user_email useremail from sec$users us " +
+									" left join sec$userrole ur on us.user_uu = ur.user_uu left join sec$roles sr " +
+									" on ur.role_id = sr.role_id where sr.role_desc = '业务员' and us.user_email is not null " +
+									" and sr.role_enuu = " + inquiryItem.getVendUU();
+							List<String> userEmails = commonDao.query(userEmailSql, String.class);
+							String userTelSql = "select distinct us.user_email useremail from sec$users us " +
+									" left join sec$userrole ur on us.user_uu = ur.user_uu left join sec$roles sr " +
+									" on ur.role_id = sr.role_id where sr.role_desc = '业务员' and us.user_email is not null " +
+									" and sr.role_enuu = " + inquiryItem.getVendUU();
+							List<String> userTels = commonDao.query(userTelSql, String.class);
+							// 发邮件
+							Map<String, Object> model = new HashMap<String, Object>();
+							model.put("vendorname", inquiryItem.getEnterprise().getEnName());
+							model.put("custname", inquiry.getEnterprise().getEnName());
+							model.put("date", DateFormatUtils.DATE_FORMAT.format(new Date()));
+							for (String userEmail : userEmails) {
+								String emailRegex = "[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?";
+								if (Pattern.matches(emailRegex, userEmail)) {
+									try {
+										mailService.send(messageConf.getTplInquiryForB2B(), userEmail, model);
+									} catch (Exception e) {
+										logger.log("内部询价发送邮件出错", inquiry.getEnUU() + "," +inquiry.getCode() +" 发送失败", 0);
+										throw new RuntimeException(e);
+									}
+								}
+							}
+							// 发短信
+							for (String userTel : userTels) {
+								try {
+									sms.setReceiver(userTel);
+									sms.setTemplateId(messageConf.getMsgInquiryForB2B());
+									HttpUtil.sendPost(messageConf.getMessageUrl(), FlexJsonUtils.toJsonDeep(sms));
+
+								} catch (Exception e) {
+									logger.log("内部询价发送短信出错", inquiry.getEnUU() + "," +inquiry.getCode() +" 发送失败", 0);
+									throw new RuntimeException(e);
+								}
+							}
+							enUUs.add(inquiryItem.getVendUU());
+						}
+					}
+				}
+			}
+		});
+	}
+
 	@Override
 	public List<PurchaseInquiryItem> findNotUploadReply() {
 		return purchaseInquiryItemDao.findByEnUUAndBackStatus(SystemSession.getUser().getEnterprise().getUu(),
@@ -594,7 +703,7 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 		}, inquiries).run();
 		List<PurchaseInquiryItem> savedInquiryItems = purchaseInquiryItemDao.save(newInquiryItems);
 		// 触发消息事件
-		ContextUtils.publishEvent(new PurchaseInquiryItemInvalidReleaseEvent(PurchaseInquiryItem.distinct(savedInquiryItems)));
+		ContextUtils.publishEvent(new PurchaseInquiryItemInvalidReleaseEvent(savedInquiryItems));
 	}
 
 	@Override

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderServiceImpl.java

@@ -149,7 +149,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 							}
 						}
 					}
-					List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(order.getVendUU(), order.getEnUU());
+					List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(order.getEnUU(), order.getVendUU());
 					// 查找有权限的用户
 					if (!CollectionUtils.isEmpty(vendors)) {
 						Long vendorId = vendors.get(0).getId();

+ 31 - 0
src/main/java/com/uas/platform/b2b/service/impl/RoleServiceImpl.java

@@ -1,5 +1,9 @@
 package com.uas.platform.b2b.service.impl;
 
+import com.uas.platform.b2b.dao.EnterpriseDao;
+import com.uas.platform.b2b.dao.RoleDao;
+import com.uas.platform.b2b.dao.UserDao;
+import com.uas.platform.b2b.model.ResourceItem;
 import com.uas.platform.b2b.dao.*;
 import com.uas.platform.b2b.model.Role;
 import com.uas.platform.b2b.model.User;
@@ -14,6 +18,7 @@ import org.springframework.util.Assert;
 import org.springframework.util.CollectionUtils;
 
 import java.util.List;
+import java.util.Set;
 
 @Service
 public class RoleServiceImpl implements RoleService {
@@ -102,6 +107,32 @@ public class RoleServiceImpl implements RoleService {
 		return new ModelMap("isManager", roleDao.findByEnuuAndUserUU(SystemSession.getUser().getEnterprise().getUu(),SystemSession.getUser().getUserUU()) > 0 ? true : false);
 	}
 
+	@Override
+	public ModelMap isUser() {
+		return new ModelMap("isUser", roleDao.findByEnuuAndUserUu(SystemSession.getUser().getEnterprise().getUu(),SystemSession.getUser().getUserUU()) > 0 ? true : false);
+	}
+
+    @Override
+    public ModelMap updateDefault(String desc, Set<ResourceItem> resourceItems) {
+		List<Role> roles = roleDao.findByEnUUAndDesc(null, desc);
+		System.out.println(roles);
+		if (roles == null || roles.size() == 0) {
+			throw new RuntimeException("没有找到默认角色");
+		} else if (roles.size() > 1) {
+			throw new RuntimeException("有多个角色企业UU为空,请查看");
+		} else {
+			Role role = roles.get(0);
+			if (role.getId() > 9101 && role.getId() < 9201){
+				role.getResourceItems().clear();
+				role.getResourceItems().addAll(resourceItems);
+				roleDao.save(role);
+				return new ModelMap("success", true);
+			} else {
+				throw new RuntimeException("默认角色被修改!!无法更新");
+			}
+		}
+    }
+
 	/**
 	 * 恢复默认权限
 	 *

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/SaleARCheckServiceImpl.java

@@ -87,7 +87,7 @@ public class SaleARCheckServiceImpl implements SaleARCheckService {
 							}
 						}
 					}
-					List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(item.getArCheck().getVendUU(), item.getArCheck().getEnUU());
+					List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(item.getArCheck().getEnUU(), item.getArCheck().getVendUU());
 					// 查找有权限的用户
 					if (!CollectionUtils.isEmpty(vendors)) {
 						Long vendorId = vendors.get(0).getId();

+ 5 - 0
src/main/java/com/uas/platform/b2b/service/impl/UserServiceImpl.java

@@ -705,6 +705,11 @@ public class UserServiceImpl implements UserService {
 		for (Role role : roles) {
 			if (role.getIssys() == 1) {
 				isSys = true;
+				break;
+			}
+			if ("ROLE_SALEMANAGER".equals(role.getName())) {
+				isSys = true;
+				break;
 			}
 		}
 		if (!SystemSession.getUser().isSys() && !isSys) {

+ 2 - 0
src/main/java/com/uas/platform/b2b/service/impl/VendorsServiceImpl.java

@@ -62,6 +62,8 @@ public class VendorsServiceImpl implements VendorService {
 	public Vendor addVendor(Vendor vendor) {
 		vendor.setMyEnUU(SystemSession.getUser().getEnterprise().getUu());
 		vendor.setMyEnterprise(SystemSession.getUser().getEnterprise());
+		vendor.setCustswitch(Constant.YES);
+		vendor.setVendswitch(Constant.YES);
 		Vendor vendor1 = vendorDao.save(vendor);
 		addPartnerShipRecord(vendor1); // 添加合作伙伴关系
 		return vendor1;

+ 45 - 0
src/main/java/com/uas/platform/b2b/support/MessageConf.java

@@ -32,6 +32,27 @@ public class MessageConf {
 	@Value("#{message.msgTenderForB2B}")
 	private String msgTenderForB2B;
 
+	/**
+	 * 邮件模版id:询价单提醒供应商报价
+	 * @return
+	 */
+	@Value("#{message.tplInquiryForB2B}")
+	private String tplInquiryForB2B;
+
+	/**
+	 * 短信模版id:询价单提醒供应商报价
+	 * @return
+	 */
+	@Value("#{message.msgInquiryForB2B}")
+	private String msgInquiryForB2B;
+
+	/**
+	 * 短信接口地址
+	 * @return
+	 */
+	@Value("#{message.messageUrl}")
+	private String messageUrl;
+
 	public String getTplInvitationForB2B() {
 		return tplInvitationForB2B;
 	}
@@ -63,4 +84,28 @@ public class MessageConf {
 	public void setMsgTenderForB2B(String msgTenderForB2B) {
 		this.msgTenderForB2B = msgTenderForB2B;
 	}
+
+	public String getTplInquiryForB2B() {
+		return tplInquiryForB2B;
+	}
+
+	public void setTplInquiryForB2B(String tplInquiryForB2B) {
+		this.tplInquiryForB2B = tplInquiryForB2B;
+	}
+
+	public String getMsgInquiryForB2B() {
+		return msgInquiryForB2B;
+	}
+
+	public void setMsgInquiryForB2B(String msgInquiryForB2B) {
+		this.msgInquiryForB2B = msgInquiryForB2B;
+	}
+
+	public String getMessageUrl() {
+		return messageUrl;
+	}
+
+	public void setMessageUrl(String messageUrl) {
+		this.messageUrl = messageUrl;
+	}
 }

+ 6 - 1
src/main/resources/dev/message.properties

@@ -1,4 +1,9 @@
 tplInvitationForB2B=e472f874-0579-4ca2-9bb8-2635109dc7f3
 msgInvitationForB2B=73c513f8-7423-49c4-b57c-50a63bd8a0af
 tplAfterBeAddedtoB2B=b9dee589-9fd8-45d3-9b2a-64b56d65e7e2
-msgTenderForB2B=f9e29b6f-4116-4d33-9bde-048aa037f8c6
+msgTenderForB2B=f9e29b6f-4116-4d33-9bde-048aa037f8c6
+
+## ×Ô¶¯Ñ¯¼Û±¨¼ÛÌáÐÑ
+tplInquiryForB2B=bc60d592-9651-4ca1-9305-0852fc7c4101
+msgInquiryForB2B=72cc98e4-0c2b-4d16-944b-2e0515048b8d
+messageUrl=http://message.ubtob.com/sms/send

+ 6 - 1
src/main/resources/prod/message.properties

@@ -1,4 +1,9 @@
 tplInvitationForB2B=e472f874-0579-4ca2-9bb8-2635109dc7f3
 msgInvitationForB2B=73c513f8-7423-49c4-b57c-50a63bd8a0af
 tplAfterBeAddedtoB2B=b9dee589-9fd8-45d3-9b2a-64b56d65e7e2
-msgTenderForB2B=f9e29b6f-4116-4d33-9bde-048aa037f8c6
+msgTenderForB2B=f9e29b6f-4116-4d33-9bde-048aa037f8c6
+
+## ×Ô¶¯Ñ¯¼Û±¨¼ÛÌáÐÑ
+tplInquiryForB2B=bc60d592-9651-4ca1-9305-0852fc7c4101
+msgInquiryForB2B=72cc98e4-0c2b-4d16-944b-2e0515048b8d
+messageUrl=http://message.ubtob.com/sms/send

+ 6 - 1
src/main/resources/test/message.properties

@@ -1,4 +1,9 @@
 tplInvitationForB2B=e472f874-0579-4ca2-9bb8-2635109dc7f3
 msgInvitationForB2B=73c513f8-7423-49c4-b57c-50a63bd8a0af
 tplAfterBeAddedtoB2B=b9dee589-9fd8-45d3-9b2a-64b56d65e7e2
-msgTenderForB2B=f9e29b6f-4116-4d33-9bde-048aa037f8c6
+msgTenderForB2B=f9e29b6f-4116-4d33-9bde-048aa037f8c6
+
+## ×Ô¶¯Ñ¯¼Û±¨¼ÛÌáÐÑ
+tplInquiryForB2B=bc60d592-9651-4ca1-9305-0852fc7c4101
+msgInquiryForB2B=72cc98e4-0c2b-4d16-944b-2e0515048b8d
+messageUrl=http://message.ubtob.com/sms/send

+ 2 - 1
src/main/webapp/resources/js/common/services.js

@@ -267,7 +267,8 @@ define(['angular', 'toaster', 'big'], function(angular, big) {
             customer: $resource('vendor/customer/:id', {}),
             vendor: $resource('vendor/:id', {}),
             userInfo: $resource('vendor/userInfo/:uu', {}),
-            user: $resource('vendor/user', {})
+            user: $resource('vendor/user', {}),
+            exportXls: $resource('vendor/customer/permission/xls', {})
         };
     }]).factory('AccountUser', ['$resource', function($resource) {
         return $resource('account/user/:uu', {}, {

File diff suppressed because it is too large
+ 434 - 68
src/main/webapp/resources/js/index/app.js


+ 10 - 2
src/main/webapp/resources/js/index/services/Account.js

@@ -45,7 +45,11 @@ define([ 'ngResource' ], function() {
             getDefaultRole: {
                 url: 'account/role/default/:roleId',
                 method: 'GET'
-            }
+            },
+			updateDefault: {
+				url: 'account/role/updateDefault',
+				method: 'POST'
+			}
 		});
 	}]).factory('FuzzySearch', ['$resource', function($resource){
 		return $resource('account/user', {}, {
@@ -70,7 +74,11 @@ define([ 'ngResource' ], function() {
 			isManager: {
             	url: 'account/role/isManager',
 				method: 'GET'
-			}
+			},
+            isUser: {
+                url: 'account/role/isUser',
+                method: 'GET'
+            }
         })
     }]);
 });

+ 27 - 7
src/main/webapp/resources/js/index/services/BaseInfo.js

@@ -1,6 +1,14 @@
 define(['ngResource'], function() {
 	angular.module('ProductServices', [ 'ngResource']).factory('GetProductInfo', ['$resource', function($resource) {
-		return $resource('product/baseInfo', {}, {
+		return $resource('product/baseInfo/info/search', {}, {
+			getSaleProduct: {
+				url: 'product/baseInfo/:id/info',
+				method: 'GET'
+			},
+			getPurcProduct: {
+				url: 'purcProduct/:id/info',
+				method: 'GET'
+			},
 			getOne : {
 				url : "product/baseInfo/:id",
 				method : 'GET'
@@ -23,16 +31,20 @@ define(['ngResource'], function() {
 				method : 'GET',
 			},
 			addNewProd : {
-				url: "product/baseInfo/addNewProduct",
+				url: "product/baseInfo/edit/addNewProduct",
 				method : 'POST'			
 			},
 			update : {
-				url: "product/baseInfo/updateProdInfo",
+				url: "product/baseInfo/edit/updateProdInfo",
 				method : 'POST'
 			},
 			deleteById : {
-				url: "product/baseInfo/delete/:id",
-				method : 'DELETE'
+				url: "product/baseInfo/edit/delete",
+				method : 'POST'
+			},
+			deletePurcById : {
+				url: "purcProduct/edit/delete",
+				method : 'POST'
 			},
 			getAllPartners : {
 				url : "product/baseInfo/getAllPartners",
@@ -67,7 +79,7 @@ define(['ngResource'], function() {
 				method: 'GET',
 			},
 			toggle: {
-				url: 'product/baseInfo/toggle/:status',
+				url: 'product/baseInfo/edit/toggle/:status',
 				method: 'POST'
 			},
 			setRead:{
@@ -81,10 +93,18 @@ define(['ngResource'], function() {
 			getUnreadCount:{
 				url: 'product/baseInfo/unread',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'product/baseInfo/permission/xls',
+				method: 'GET'
+			},
+			matchbytype: {
+				url: '/product/baseInfo/edit/matchbytype/:type',
+				method: 'POST'
 			}
 		})
 	}]).factory('GetProductInfoNewest', ['$resource', function($resource) {
-		return $resource('product/baseInfo/info', {}, {
+		return $resource('product/baseInfo/info/nosearch', {}, {
 			getAll : {
 				isArray : false
 			},

+ 11 - 7
src/main/webapp/resources/js/index/services/DeputyOrder.js

@@ -2,11 +2,15 @@ define(['ngResource'], function() {
 	angular.module('DeputyOrderService', [ 'ngResource']).factory('DeputyOrder', ['$resource', function($resource) {
 		return $resource('deputyOrder', {}, {
 			saveDeOrder: {
-				url: 'deputyOrder/saveDeOrder',
+				url: 'deputyOrder/edit/saveDeOrder',
+				method: 'POST'
+			},
+			submitDeOrder: {
+				url: 'deputyOrder/submit/saveDeOrder',
 				method: 'POST'
 			},
 			getOrderDetail: {
-				url: 'deputyOrder/getOrderDetail/:id',
+				url: 'deputyOrder/getOrderDetail/:id/info',
 				method: 'GET'
 			},
 			getProdList: {
@@ -73,12 +77,12 @@ define(['ngResource'], function() {
             	method: 'GET'
             },
             copyOrder: {
-            	url: 'deputyOrder/copyorder/:id',
+            	url: 'deputyOrder/edit/copyorder/:id',
             	method: 'POST'
             },
             clearOrder: {
-            	url: 'deputyOrder/clearOrder/:id',
-            	method: 'DELETE'
+            	url: 'deputyOrder/edit/clearOrder/:id',
+            	method: 'POST'
             },
             odersAmount: {
             	url: 'deputyOrder/odersAmount',
@@ -90,7 +94,7 @@ define(['ngResource'], function() {
             }
 		})
 	}]).factory('getDeOrder', ['$resource', function($resource) {
-		return $resource('deputyOrder/getDeOrder', {}, {
+		return $resource('deputyOrder/info/search', {}, {
 			getAll: {
 				isArray: false
 			},
@@ -121,7 +125,7 @@ define(['ngResource'], function() {
             }
 		})
 	}]).factory('getOrderInfo', ['$resource', function($resource) {
-		return $resource('deputyOrder/orderInfo', {}, {
+		return $resource('deputyOrder/info/nosearch', {}, {
 			getAll: {
 				isArray: false
 			},

+ 27 - 5
src/main/webapp/resources/js/index/services/Fa.js

@@ -2,6 +2,14 @@ define([ 'ngResource'], function() {
 	angular.module('FaServices', [ 'ngResource'
 	]).factory('FaApBill', ['$resource', function($resource) {
 		return $resource('sale/apBill/:id', {}, {
+			getAll: {
+				url: 'sale/apBill/:id/info',
+				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/apBill/xls/permission',
+				method: 'GET'
+			}
 		});
 	}]).factory('FaApBillOut', ['$resource', function($resource) {
 		return $resource('sale/apBillOut/:id', {}, {
@@ -100,6 +108,10 @@ define([ 'ngResource'], function() {
 		});
 	}]).factory('FaApCheck', ['$resource', function($resource) {
 		return $resource('sale/apCheck/:id', {}, {
+			getItem: {
+				url: 'sale/apCheck/:id/info',
+				method: 'GET',
+			},
 			getAll: {
 				url: 'sale/apCheck/getAll',
 				method: 'GET',
@@ -116,7 +128,7 @@ define([ 'ngResource'], function() {
 				isArray: true
 			},
 			saveApCheck: {
-				url : 'sale/apCheck/save',				
+				url : 'sale/apCheck/operation/save',
 				method: 'POST'
 			},
 			update: {
@@ -124,16 +136,21 @@ define([ 'ngResource'], function() {
 				method: 'POST'
 			},
 			deleteApCheck: {
-				url: 'sale/apCheck/deleteApCheck',
-				method: 'DELETE'
+				url: 'sale/apCheck/operation/deleteApCheck',
+				method: 'POST'
 			},
 			updateStatus: {
-				url: 'sale/apCheck/updateStatus'
+				url: 'sale/apCheck/operation/updateStatus',
+                method: 'POST'
 			},
 			printCount: {
 				url: 'sale/apCheck/printCount/:id',
 				method: 'POST'
 			},
+			printPermission: {
+				url: 'sale/apCheck/printCount/permission',
+				method: 'POST'
+			},
 //			getTodoApCheck: {
 //				url: 'sale/apCheck/',
 //				params: {
@@ -156,7 +173,8 @@ define([ 'ngResource'], function() {
 				}
 			},
 			cancel: {
-				url: 'sale/apCheck/cancel'
+				url: 'sale/apCheck/operation/cancel',
+                method: 'POST'
 			},
 			setRead:{
 				url: 'sale/apCheck/setRead',
@@ -173,6 +191,10 @@ define([ 'ngResource'], function() {
 			getBilled: {
 				url: 'sale/apCheck/getBilled',
 				method: 'GET',
+			},
+			exportXls: {
+				url: 'sale/apCheck/xls/permission',
+				method: 'GET',
 			}
 		});
 	}]).factory('ApbillAdjustment', ['$resource', function($resource) {

+ 37 - 6
src/main/webapp/resources/js/index/services/Make.js

@@ -1,7 +1,11 @@
 define([ 'ngResource'], function() {
 	angular.module('MakeServices', [ 'ngResource'
 	]).factory('MakeOrder', ['$resource', function($resource) {
-		return $resource('make/orders/:id', {}, {
+		return $resource('make/orders/status', {}, {
+			getItem: {
+				url: 'make/orders/:id/info',
+				method: 'GET'
+			},
 			reply: {
 				url: 'make/orders/:orderId/reply',
 				method: 'POST',
@@ -54,10 +58,14 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'make/orders/unread',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'make/orders/permission/xls',
+				method: 'GET'
 			}
 		});
 	}]).factory('MakeChange', ['$resource', function($resource) {
-		return $resource('make/changes/:id', {}, {
+		return $resource('make/changes/info/search', {}, {
 			reply: {
 				url: 'make/changes/:itemId/reply',
 				method: 'POST',
@@ -65,19 +73,42 @@ define([ 'ngResource'], function() {
 					itemId: 'itemId'
 				}
 			},
-			getAll: {}
+			getAll: {
+				url: 'make/changes/info/search',
+				method: 'GET',
+			},
+			getItem: {
+				url: 'make/changes/:id/info',
+				method: 'GET',
+			},
+			exportXls: {
+				url: 'make/changes/permission/xls',
+				method: 'GET',
+			}
 		});
 	}]).factory('MakeAccept',['$resource',function($resource){
 		return $resource('make/accept/:id',{},{
-			getAll: {}
+			getAll: {},
+			exportXls: {
+				url: 'make/accept/xls/permission',
+				method: 'GET'
+			}
 		});
 	}]).factory('MakeReturn',['$resource',function($resource){
 		return $resource('make/return/:id',{},{
-			getAll: {}
+			getAll: {},
+			exportXls: {
+				url: 'make/return/xls/permission',
+				method: 'GET'
+			}
 		});
 	}]).factory('MakeOutOrder', ['$resource',function($resource){
 		return $resource('make/outorders/:id', {}, {
-			getAll: {}
+			getAll: {},
+			exportXls: {
+				url: 'make/outorders/xls/permission',
+				method: 'GET'
+			}
 		})
 	}]);
 });

+ 11 - 3
src/main/webapp/resources/js/index/services/Product.js

@@ -23,7 +23,7 @@ define([ 'ngResource'], function() {
 				method: 'POST',
 			},
 			toggle: {
-				url: 'purcProduct/toggle/:status',
+				url: 'purcProduct/edit/toggle/:status',
 				method: 'POST'
 			},
 			updateByBatch: {
@@ -135,7 +135,7 @@ define([ 'ngResource'], function() {
 			},
 		});
 	}]).factory('PurcProduct', ['$resource', function($resource) {
-		return $resource('purcProduct', {}, {
+		return $resource('purcProduct/info/search', {}, {
 			getAll : {
 				isArray : false
 			},
@@ -152,10 +152,18 @@ define([ 'ngResource'], function() {
 			setRead:{
 				url: 'purcProduct/setRead',
 				method: 'POST'
+			},
+			matchbytype: {
+				url: '/purcProduct/edit/matchbytype/:type',
+				method: 'POST'
+			},
+			exportXls: {
+				url: '/purcProduct/xls/permission',
+				method: 'GET'
 			}
 		})
 	}]).factory('PurcProductNewest', ['$resource', function($resource) {
-		return $resource('purcProduct/info', {}, {
+		return $resource('purcProduct/info/nosearch', {}, {
 			getAll : {
 				isArray : false
 			},

+ 176 - 60
src/main/webapp/resources/js/index/services/Purc.js

@@ -1,7 +1,7 @@
 define([ 'ngResource'], function() {
 	angular.module('PurcServices', [ 'ngResource'
 	]).factory('PurcOrder', ['$resource', function($resource) {
-		return $resource('sale/orders/:id', {}, {
+		return $resource('sale/orders/:id/info', {}, {
 			setRead: {
 				url: 'sale/orders/display',
 				method: 'POST',
@@ -27,13 +27,17 @@ define([ 'ngResource'], function() {
 				url: 'sale/orders/printCount/:id',
 				method: 'POST'
 			},
+			printPermission: {
+				url: 'sale/orders/printCount/permission',
+				method: 'POST'
+			},
             custPrintCount: {
                 url: 'sale/orders/custPrintCount/:id',
                 method: 'POST'
             }
 		});
 	}]).factory('PurcOrderItem', ['$resource', function($resource) {
-		return $resource('sale/orders/items', {}, {
+		return $resource('sale/orders/info/search', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -74,7 +78,7 @@ define([ 'ngResource'], function() {
 				}
 			},
 			getReply: {
-				url: 'sale/orders/items/:orderItemId/reply',
+				url: 'sale/orders/items/:orderItemId/reply/all',
 				method: 'GET',
 				isArray: true,
 				params: {
@@ -82,7 +86,7 @@ define([ 'ngResource'], function() {
 				}
 			},
 			getLatestReplyQty: {
-				url: 'sale/orders/items/:orderItemId/latestReplyQty',
+				url: 'sale/orders/items/:orderItemId/reply/last',
 				method: 'GET',
 				params: {
 				orderItemId: 'orderItemId'
@@ -99,10 +103,14 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'sale/orders/unread',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/orders/permission/xls',
+				method: 'GET'
 			}
 		});
 	}]).factory('PurcOrderItemInfo', ['$resource', function($resource) {
-		return $resource('sale/orders/items/info', {}, {
+		return $resource('sale/orders/info/nosearch', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -142,9 +150,10 @@ define([ 'ngResource'], function() {
 			}
 		});
 	}]).factory('PurcOrdersInfo', ['$resource', function($resource) {
-		return $resource('sale/orders/items/purc/info', {}, {
+		return $resource('sale/orders/purc/info/nosearch', {}, {
 			getAll: {
-				
+				url: 'sale/orders/purc/:id/info',
+				method: 'GET'
 			},
 			getTodo: {
 				params: {
@@ -173,7 +182,7 @@ define([ 'ngResource'], function() {
 			}
 		});
 	}]).factory('PurcOrders', ['$resource', function($resource) {
-		return $resource('sale/orders/items/purc', {}, {
+		return $resource('sale/orders/purc/info/search', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -210,10 +219,18 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'sale/orders/unread/purc',
 				method: 'GET'
+			},
+			exportXls: {
+				url: '/sale/orders/purc/xls/permission',
+				method: 'GET'
 			}
 		});
 	}]).factory('PurcChange', ['$resource', function($resource) {
-		return $resource('sale/changes/:id', {}, {
+		return $resource('sale/changes/info/search', {}, {
+            getItem: {
+                url: 'sale/changes/:id/info',
+                method: 'GET'
+            },
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -254,10 +271,14 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'sale/changes/unread',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/changes/permission/xls',
+				method: 'GET'
 			}
 		});
 	}]).factory('PurcChanges', ['$resource', function($resource) {
-		return $resource('sale/changes/info', {}, {
+		return $resource('sale/changes/info/nosearch', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -275,8 +296,9 @@ define([ 'ngResource'], function() {
 			}
 		});
 	}]).factory('PurcInquiry', ['$resource', function($resource) {
-        return $resource('sale/inquiry/:id', {}, {
+        return $resource('sale/inquiry/info/search', {}, {
             getAll: {
+				url: 'sale/inquiry/:id/info',
                 isArray: true
             },
             getTodo: {
@@ -322,7 +344,7 @@ define([ 'ngResource'], function() {
                     itemId: 'itemId'
                 }
             }, saveItem: {
-                url: 'sale/inquiry/items/:itemId',
+                url: 'sale/inquiry/items/:itemId/save',
                 method: 'POST',
                 params: {
                     itemId: 'itemId'
@@ -351,11 +373,15 @@ define([ 'ngResource'], function() {
 			setRead:{
 				url: 'sale/inquiry/setRead',
 				method: 'POST'
+			},
+			exportXls: {
+				url: 'sale/inquiry/permission/xls',
+				method: 'GET'
 			}
         });
         // 数据库直接获取
     }]).factory('PurcInquiryInfo', ['$resource', function($resource) {
-        return $resource('sale/inquiry/info', {}, {
+        return $resource('sale/inquiry/info/nosearch', {}, {
             getAll: {
                 isArray: true
             },
@@ -392,24 +418,24 @@ define([ 'ngResource'], function() {
         });
         // 数据库直接获取
     }]).factory('PurcTenderInfo', ['$resource', function($resource) {
-        return $resource('tender', {}, {
+        return $resource('tender/sale/info/search', {}, {
             getMyAll: {
-                url: 'tender/purc/info'
+                url: 'tender/purc/info/nosearch'
             },
             getMyDone: {
-                url: 'tender/purc',
+                url: 'tender/purc/info/search',
                 params: {
                     _state: 'done'
                 }
             },
             getMyTodo: {
-                url: 'tender/purc/info',
+                url: 'tender/purc/info/nosearch',
                 params: {
                     _state: 'todo'
                 }
             },
             getMyWaiting: {
-                url: 'tender/purc/info',
+                url: 'tender/purc/info/nosearch',
                 params: {
                     _state: 'waiting'
                 }
@@ -430,13 +456,13 @@ define([ 'ngResource'], function() {
                 }
             },
             getDone: {
-                url: 'tender/info',
+                url: 'tender/sale/info/nosearch',
                 params: {
                     _state: 'done'
                 }
             },
             getTodo: {
-                url: 'tender/info',
+                url: 'tender/sale/info/nosearch',
                 params: {
                     _state: 'todo'
                 }
@@ -448,24 +474,24 @@ define([ 'ngResource'], function() {
             }
         });
     }]).factory('PurcTender', ['$resource', function($resource) {
-    	return $resource('tender', {}, {
+    	return $resource('tender/sale/info/search', {}, {
             getMyAll: {
-                url: 'tender/purc'
+                url: 'tender/purc/info/search'
             },
             getMyDone: {
-                url: 'tender/purc',
+                url: 'tender/purc/info/search',
                 params: {
                     _state: 'done'
                 }
             },
             getMyTodo: {
-                url: 'tender/purc',
+                url: 'tender/purc/info/search',
                 params: {
                     _state: 'todo'
                 }
             },
             getMyWaiting: {
-                url: 'tender/purc',
+                url: 'tender/purc/info/search',
                 params: {
                     _state: 'waiting'
                 }
@@ -518,15 +544,15 @@ define([ 'ngResource'], function() {
             //         _state: 'end'
             //     }
             // },
-    		getOne: {
-    			url: 'tender/:id',
+			getPurcTenderDetail: {
+    			url: 'tender/purc/:id/info',
 				method: 'GET',
 				params: {
     				id: 'id'
 				}
 			},
             getSaleTenderDetail: {
-                url: 'tender/getSaleTenderDetail/:tenderId',
+                url: 'tender/sale/:tenderId/info',
                 method: 'GET',
                 params: {
                     tenderId: 'tenderId'
@@ -564,11 +590,11 @@ define([ 'ngResource'], function() {
             //     isArray: true
             // },
 			save: {
-                url: 'tender/save',
+                url: 'tender/save/new',
                 method: 'POST'
 			},
 			publish: {
-                url: 'tender/publish',
+                url: 'tender/publish/new',
                 method: 'POST'
 			},
 			reply: {
@@ -587,11 +613,11 @@ define([ 'ngResource'], function() {
                 }
             },
             publishSaved: {
-                url: 'tender/publishSaved',
+                url: 'tender/publish/update',
                 method: 'POST'
             },
             updateSaved: {
-                url: 'tender/updateSaved',
+                url: 'tender/save/update',
                 method: 'POST'
             },
             removeAttach: {
@@ -682,9 +708,10 @@ define([ 'ngResource'], function() {
             }
         });
 	}]).factory('PurcInquiryMould', ['$resource', function($resource) {
-		return $resource('sale/mould/:id', {}, {
+		return $resource('sale/mould/info/search', {}, {
 			getAll: {
-				
+				url: 'sale/mould/:id/info',
+                method: 'GET'
 			},
 			getTodo: {
 				params: {
@@ -725,7 +752,7 @@ define([ 'ngResource'], function() {
 					id: 'id'
 				}
 			}, saveItem: {
-				url: 'sale/mould/detail/:id',
+				url: 'sale/mould/detail/:id/save',
 				method: 'POST',
 				params: {
 					id: 'id'
@@ -748,10 +775,14 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'sale/mould/unread',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/mould/permission/xls',
+				method: 'GET'
 			}
 		});
     }]).factory('PurcInquiryMouldSql', ['$resource', function($resource) {
-        return $resource('sale/mould/sql', {}, {
+        return $resource('sale/mould/info/nosearch', {}, {
             getAll: {
 
             },
@@ -772,7 +803,7 @@ define([ 'ngResource'], function() {
             }
         });
 	}]).factory('PurcNotice', ['$resource', function($resource) {
-		return $resource('sale/notice/:id', {}, {
+		return $resource('sale/notice/info/search', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -793,6 +824,10 @@ define([ 'ngResource'], function() {
 					_state: 'waiting'
 				}
 			},
+			save: {
+				url: 'sale/notice/:id/sends',
+				method: 'POST'
+			},
 			getSends: {
 				url: 'sale/notice/:id/sendItems',
 				method: 'GET',
@@ -813,18 +848,22 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'sale/notice/unread',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/notice/xls/permission',
+				method: 'GET'
 			}
 		});
     }]).factory('PurcNoticeInfo', ['$resource', function($resource) {
-        return $resource('sale/notice', {}, {
+        return $resource('sale/notice/info/search', {}, {
             getTodo: {
-                url: 'sale/notice/info',
+                url: 'sale/notice/info/nosearch',
                 params: {
                     _state: 'todo'
                 }
             },
             getDone: {
-                url: 'sale/notice/info',
+                url: 'sale/notice/info/nosearch',
                 params: {
                     _state: 'done'
                 }
@@ -842,6 +881,10 @@ define([ 'ngResource'], function() {
         });
 	}]).factory('SaleSend', ['$resource', function($resource) {
 		return $resource('sale/notice/sends/:id', {}, {
+			getItem: {
+				url: 'sale/notice/sends/:id/info',
+				method: 'GET'
+			},
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -859,6 +902,10 @@ define([ 'ngResource'], function() {
             printCount:{
             	url: 'sale/notice/sends/print/:id',
                 method: 'POST'
+       	 	},
+			printPermission:{
+            	url: 'sale/notice/sends/print/permission',
+                method: 'POST'
        	 	},
 			generateBarcodes :{
 				url: 'sale/notice/generateBarcodes',
@@ -879,16 +926,26 @@ define([ 'ngResource'], function() {
 			updatePrintStatus: {
                 url: 'sale/notice/updatePrintStatus',
                 method: 'POST'
-            }
+            },
+			exportXls: {
+				url: 'sale/notice/sends/xls/permission',
+				method: 'GET'
+			}
 		});
 	}]).factory('PurcForecast', ['$resource', function($resource) {
 		return $resource('sale/forecast/:id', {}, {
 		});
 	}]).factory('PurcAccept', ['$resource', function($resource) {
 		return $resource('sale/accept/:id', {}, {
-			getAll: {},
+			getAll: {
+
+            },
 			getDetail : {
-				url: 'sale/accept/:id',
+				url: 'sale/accept/:id/info',
+				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/accept/xls/permission',
 				method: 'GET'
 			}
 		});
@@ -900,25 +957,49 @@ define([ 'ngResource'], function() {
 				method: "GET"
 			},
 			getDetail: {
-				url: 'sale/return/:id',
+				url: 'sale/return/:id/info',
+				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/return/xls/permission',
 				method: 'GET'
 			}
 		});
 	}]).factory('PurcBadIn', ['$resource', function($resource) {
 		return $resource('sale/badIn/:id', {}, {
+			exportXls: {
+				url: 'sale/badIn/xls/permission',
+				method:'GET'
+			}
 		});
 	}]).factory('PurcBadOut', ['$resource', function($resource) {
 		return $resource('sale/badOut/:id', {}, {
+			exportXls: {
+				url: 'sale/badOut/xls/permission',
+				method:'GET'
+			}
 		});
 	}]).factory('PurcMRB', ['$resource', function($resource) {
 		return $resource('sale/MRB/:id', {}, {
+			exportXls: {
+				url: 'sale/MRB/xls/permission',
+				method:'GET'
+			}
 		});
 	}]).factory('PurcSample', ['$resource', function($resource) {
-		return $resource('sale/sample/:id', {}, {
+		return $resource('sale/sample/info/search', {}, {
+			getItem: {
+				url: 'sale/sample/:id/info',
+				method: 'GET'
+			},
 			printCount: {
 				url: 'sale/sample/printCount/:id',
 				method: 'POST'
 			},
+            printPermission: {
+				url: 'sale/sample/printCount/permission',
+				method: 'POST'
+			},
 			getSend: {
 				url: 'sale/sample/:id/send',
 				method: 'GET',
@@ -953,10 +1034,14 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'sale/sample/unread',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/sample/xls/permission',
+				method: 'GET'
 			}
 		});
 	}]).factory('PurcSampleInfo', ['$resource', function($resource) {
-		return $resource('sale/sample/info', {}, {
+		return $resource('sale/sample/info/nosearch', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -988,7 +1073,11 @@ define([ 'ngResource'], function() {
                 params: {
                     _state: 'refused'
                 }
-            }
+            },
+			exportXls: {
+				url: 'sale/sample/approval/xls/permission',
+				method: 'GET'
+			}
 		});
 	}]).factory('PurcOrderItemHis', ['$resource', function($resource) {
 		return $resource('sale/orders/history/items', {}, {
@@ -1177,7 +1266,11 @@ define([ 'ngResource'], function() {
                 url: 'vendor/servicer'
             },
 			getVendorDetail: {
-				url: 'vendor/:id',
+				url: 'vendor/:id/info',
+				method: 'GET'
+			},
+			getCustomerDetail: {
+				url: 'vendor/customer/:id/info',
 				method: 'GET'
 			},
 			saveContact: {
@@ -1235,7 +1328,7 @@ define([ 'ngResource'], function() {
 			}
 		});
 	}]).factory('Quotation', ['$resource', function($resource){
-		return $resource('sale/quotation', {}, {
+		return $resource('sale/quotation/info/search', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -1262,6 +1355,15 @@ define([ 'ngResource'], function() {
                 }
             },
 			save: {
+				url: 'sale/quotation/save',
+				method: 'POST',
+				isArray: false,
+				headers: {
+					'Content-Type' : 'application/text;charset=UTF-8'
+				}
+			},
+			submit: {
+				url: 'sale/quotation/submit',
 				method: 'POST',
 				isArray: false,
 				headers: {
@@ -1275,10 +1377,14 @@ define([ 'ngResource'], function() {
 			deleteById: {
 				url: 'sale/quotation/deleteById/:id',
 				method: 'DELETE'
+			},
+			exportXls: {
+				url: 'sale/quotation/permission/xls',
+				method: 'GET'
 			}
 		});
 	}]).factory('QuotationInfo', ['$resource', function($resource){
-		return $resource('sale/quotation/info', {}, {
+		return $resource('sale/quotation/info/nosearch', {}, {
 			getTodo: {
 				params: {
 					_state: 'todo'
@@ -1429,7 +1535,7 @@ define([ 'ngResource'], function() {
             }
         });
     }]).factory('PurchaseInquiry', ['$resource', function($resource){
-		return $resource('purc/inquiry', {}, {
+		return $resource('purc/inquiry/info/search', {}, {
 			getTodo: {
                 params: {
                     _state: 'todo'
@@ -1462,13 +1568,19 @@ define([ 'ngResource'], function() {
 				method: 'GET'
 			},
 			getUnapply: {
-               url: 'purc/inquiry/unapply',
-               method: 'GET'
+               	url: 'purc/inquiry/info/nosearch',
+               	method: 'GET',
+				params: {
+					_state: 'unapply'
+				}
 			},
 			getSubmit: {
-	               url: 'purc/inquiry/submit',
-	               method: 'GET'
-				},
+				url: 'purc/inquiry/info/nosearch',
+	               method: 'GET',
+				params: {
+					_state: 'submit'
+				}
+			},
 			deleteById: {
 				url: 'purc/inquiry/deleteById/:id',
 				method: 'DELETE'
@@ -1478,7 +1590,7 @@ define([ 'ngResource'], function() {
 				method: 'DELETE'
 			},
 			save: {
-				url: 'purc/inquiry/save',
+				url: 'purc/inquiry/save/withVendor',
 				method: 'POST'
 			},
 			detail: {
@@ -1486,7 +1598,7 @@ define([ 'ngResource'], function() {
 				method: 'GET'
 			},
 			submit: {
-				url: 'purc/inquiry/saveAndSubmit',
+				url: 'purc/inquiry/submit/withVendor',
 				method: 'POST'
 			},
 			accept: {
@@ -1507,11 +1619,11 @@ define([ 'ngResource'], function() {
 				method: 'POST'
 			},
 			saveAndSubmitWithoutVendor: {
-				url: 'purc/inquiry/saveAndSubmitWithoutVendor',
+				url: 'purc/inquiry/submit/withoutVendor',
 				method: 'POST'
 			},
 			saveWithoutVendor: {
-				url: 'purc/inquiry/saveWithoutVendor',
+				url: 'purc/inquiry/save/withoutVendor',
 				method: 'POST'
 			},
 			publishInquiry: {
@@ -1541,6 +1653,10 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'sale/inquiry/unread/purc',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'purc/inquiry/xls/permission',
+				method: 'GET'
 			}
 		});
 	}]);

+ 3 - 3
src/main/webapp/resources/tpl/index/approvalFlow/role.html

@@ -36,12 +36,12 @@
 <div class="block role-container">
 	<h1 class="page-header">默认角色</h1>
 	<div class="role-list-bg01 role-list">
-		<div class="item" ng-repeat="role in roles.defaults track by role.id">
-			<a class="icon" ng-click="editRole(role)">
+		<div class="item" ng-repeat="role in roles.defaults | orderBy:'index' track by role.id">
+			<a ng-if="role.name != 'ROLE_PURCMANAGER'" class="icon" ng-click="editRole(role)">
 				<i class="fa fa-user"
 					ng-class="{'fa-user-md': role.name=='ROLE_ADMIN','fa-male': role.name=='ROLE_SALE','fa-street-view': role.name=='ROLE_USER'}"></i>
 			</a>
-			<div class="desc">
+			<div ng-if="role.name != 'ROLE_PURCMANAGER'" class="desc">
 				<h3><a ng-click="editRole(role)" ng-bind="role.desc" class="none"></a></h3>
 				<div class="text-muted" ng-bind="role.duty"></div>
 			</div>

+ 11 - 9
src/main/webapp/resources/tpl/index/approvalFlow/role_detail.html

@@ -7,7 +7,7 @@
 <form name="roleForm" novalidate ng-submit="save()">
 	<div class="modal-body">
 		<div class="form-group">
-			<label>角色名称</label> <input type="text" name="desc"
+			<label>角色名称</label> <input type="text" name="desc" ng-disabled="!isManager"
 				ng-model="role.desc" class="form-control" placeholder="输入3-8个中文字描述"
 				required autofocus ng-readonly="role.isdefault">
 			<div class="tooltip in left control-tooltip"
@@ -18,7 +18,7 @@
 		</div>
 		<div class="form-group">
 			<label>职责范围</label>
-			<textarea class="form-control" name="duty" ng-model="role.duty"
+			<textarea class="form-control" name="duty" ng-model="role.duty" ng-disabled="!isManager"
 				placeholder="角色的具体职责(50个中文字以内)" required
 				ng-readonly="role.isdefault"></textarea>
 			<div class="tooltip in left control-tooltip"
@@ -37,17 +37,17 @@
 				<div class="choose-inline">
 					<div class="item">
 						<ul class="list-unstyled">
-							<li ng-repeat="resource in resources"
+							<li ng-repeat="resource in resources | orderBy:'index' track by resource.id"
 								ng-class="{active: resource.$active}"
-								ng-click="onItemClick(resource)"><input id="check_{{resource.id}}" type="checkbox"
-								ng-model="resource.$checked"
-								ng-change="onResourceChange(resource)"/><a>{{::resource.name}}<span
+								ng-click="onItemClick(resource)"><input ng-if="resource.items.length > 0" id="check_{{resource.id}}" type="checkbox"
+								ng-model="resource.$checked" ng-disabled="!isManager"
+								ng-change="onResourceChange(resource)"/><a ng-if="resource.items.length > 0">{{::resource.name}}<span
 									class="caret"></span></a></li>
 						</ul>
 					</div>
 					<div class="item">
 						<ul class="list-unstyled">
-							<li ng-repeat="item in resourceItems"><input type="checkbox"
+							<li ng-repeat="item in resourceItems"><input type="checkbox" ng-disabled="!isManager"
 								ng-model="item.$checked" ng-change="onItemChange()" />{{::item.name}}</li>
 						</ul>
 					</div>
@@ -59,11 +59,13 @@
 		<p class="pull-left text-muted" ng-show="role.isdefault == 1">
 			<i class="fa fa-fw fa-warning"></i>默认角色不允许删除,只能修改权限分配
 		</p>
-		<button class="btn btn-warning" type="button" ng-click="recover()" ng-if="role.isdefault == 1">恢复默认</button>
+		<!--仅优软科技有限公司可用-->
+		<button ng-if="role.enUU == 10041166" class="btn btn-primary" type="button" ng-click="updateDefault()">更新默认权限标准库</button>
+		<button class="btn btn-warning" type="button" ng-click="recover()" ng-if="role.isdefault == 1" ng-disabled="!isManager">恢复默认</button>
 		<button class="btn btn-primary" type="submit"
 			ng-disabled="roleForm.$invalid || !isChanged(role)">确认</button>
 		<button class="btn btn-default" type="button"
-			ng-show="role.id && role.isdefault == 0" ng-click="del()">删除角色</button>
+			ng-show="role.id && role.isdefault == 0" ng-click="del()" ng-disabled="!isManager">删除角色</button>
 		<button class="btn btn-default" ng-click="cancel()" type="button">取消</button>
 	</div>
 	<div class="modal-footer" ng-if="role.issys == 1">

+ 7 - 7
src/main/webapp/resources/tpl/index/approvalFlow/user.html

@@ -32,10 +32,10 @@
 .row-operator2>.operator-menu2 {
 	position: absolute;
 	width: 140px;
-	height: 60;
+	height: 60px;
 	line-height: 30px;
 	padding: 0 10px;
-	top: 30;
+	top: 30px;
 	background-color: #333;
 	border-radius: 0 3px 3px 0;
 	opacity: 0;
@@ -62,10 +62,10 @@
 .row-operator2>.operator-menu3 {
 	position: absolute;
 	width: 125px;
-	height: 60;
+	height: 60px;
 	line-height: 30px;
 	padding: 0 10px;
-	top: 30;
+	top: 30px;
 	background-color: #333;
 	border-radius: 0 3px 3px 0;
 	opacity: 0;
@@ -281,14 +281,14 @@
 		margin-left: 120px;
 	}
 </style>
-<div class="pane base-info" style="border-bottom: none;">
+<div class="pane base-info" style="border-bottom: none;" ng-if="!isManager">
 	<div class="title-div" style="border-bottom: 1px dashed #327ebe;">
 		<span class="f14">我的客户</span>
 		<div class="pull-right">
 			共&nbsp;{{distributes.length}}&nbsp;客户
 		</div>
 	</div>
-	<div class="pane-body" id="order-detail-list">
+	<div class="pane-body" id="customer-detail-list">
 		<table class="block table table-default table-striped" style="margin-bottom: 0;">
 			<tr class="header" style="height: 40px;">
 				<th width="90">UU</th>
@@ -455,7 +455,7 @@
 						</td>
 						<!-- 系统管理员无法被编辑限制,因为用户反馈注册用户都是业务员,需要权限来保护隐私,所以拿掉这个限制 -->
 						<!-- ng-show="user.sys && enterprise.enAdminuu != u.userUU" -->
-						<td class="row-operator" ng-show="isManager">
+						<td class="row-operator" ng-if="isManager">
 							<a class="operator-trigger" href="javascript:void(0);"><i class="fa fa-pencil fa-lg" ng-show="(user.sys && enterprise.enAdminuu != u.userUU) || $data.length == 1"></i></a>
 							<ul class="list-unstyle list-inline operator-menu" ng-show="(user.sys && enterprise.enAdminuu != u.userUU) || $data.length == 1">
 								<li><a ng-click="editUserRole(u)"><i class="fa fa-fw fa-pencil-square-o" style="color: #fff"></i>编辑</a></li>

+ 1 - 1
src/main/webapp/resources/tpl/index/baseInfo/prodList.html

@@ -213,7 +213,7 @@ width: 80px;
     <div class="pub-com_head">
         <span>产品库</span>
         <div class="p-right">
-            <a href="product/baseInfo/xls?_state={{active}}&keyword={{keywordXls}}" target="_self" class="text-simple" title="导出Excel表格">导出</a>
+            <a ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格">导出</a>
             <a ui-sref="sale.newProdInfo">新增</a>
             <a ui-sref="sale.uploadByBatch" title="批量导入">批量导入</a>
             <a ng-click="toggle('off')" ng-if="saleStatus != 0">一键关闭</a>

+ 17 - 12
src/main/webapp/resources/tpl/index/fa/apBill.html

@@ -114,7 +114,7 @@
 	<div class="pub-com_head">
 		<span>发票</span>
 		<div class="p-right">
-			<a href="sale/apBill/xls?keyword={{keywordXls}}&fromDate={{fromDateXls}}&endDate={{endDateXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+			<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
 	<div class="condition block">
@@ -211,7 +211,7 @@
 			<td colspan="3"><span title="客户名称"
 				ng-bind="::bill.enterprise.enName"></span></td>
 			<td colspan="1" class="order-sum text-num">
-				<span title="票据总额">
+				<span ng-if="isUser" title="票据总额">
 					<span ng-bind="::bill.currency"></span>
 					<span ng-bind="::bill.apAmount"></span>
 				</span>
@@ -237,8 +237,9 @@
 			</td>
 			<td class="text-center">
 				<div class="text-num" title="{{::item.price}}">
-					<span ng-bind="::bill.currency"></span>
-					<span ng-bind="::item.price"></span>
+					<span ng-if="!isUser" ng-bind="::bill.currency"></span>
+					<span ng-if="!isUser" ng-bind="::item.price"></span>
+					<span ng-if="isUser" ng-bind="'-'"></span>
 				</div>
 				<div>&nbsp;</div>
 				<div class="text-muted"
@@ -252,14 +253,16 @@
 			</td>
 			<td class="text-center br-l">
 				<div class="text-num text-bold">
-					<span ng-bind="::bill.currency"></span>
-					<span ng-bind="::item.apAmount"></span>
+					<span ng-if="!isUser" ng-bind="::bill.currency"></span>
+					<span ng-if="!isUser" ng-bind="::item.apAmount"></span>
+					<span ng-if="isUser" class="text-num" ng-bind="::'-'"></span>
 				</div>
 				<div>&nbsp;</div>
 				<div class="text-muted">
 					税金:
-					<span class="text-num" ng-bind="::bill.currency"></span>
-					<span class="text-num" ng-bind="::item.taxAmount"></span>
+					<span ng-if="!isUser" class="text-num" ng-bind="::bill.currency"></span>
+					<span ng-if="!isUser" class="text-num" ng-bind="::item.taxAmount"></span>
+					<span ng-if="isUser" class="text-num" ng-bind="::'-'"></span>
 				</div>
 			</td>
 			<td class="br-l" colspan="2" ng-if="item.orderCode">
@@ -270,8 +273,9 @@
 				</span><span class="text-muted" ng-bind="::item.product.unit"></span>
 				</div>
 				<div class="text-muted">单据金额:
-					<span class="text-num" ng-bind="::bill.currency"></span>
-					<span class="text-num" ng-bind="::item.amount"></span>
+					<span ng-if="!isUser" class="text-num" ng-bind="::bill.currency"></span>
+					<span ng-if="!isUser" class="text-num" ng-bind="::item.amount"></span>
+					<span ng-if="isUser" class="text-num" ng-bind="::'-'"></span>
 				</div>
 			</td>
 			<td class="br-l" colspan="2" ng-if="!item.orderCode">
@@ -280,8 +284,9 @@
 				</span><span class="text-muted" ng-bind="::item.product.unit"></span>
 				</div>
 				<div class="text-muted">单据金额:
-					<span class="text-num" ng-bind="::bill.currency"></span>
-					<span class="text-num" ng-bind="::item.amount"></span>
+					<span ng-if="!isUser" class="text-num" ng-bind="::bill.currency"></span>
+					<span ng-if="!isUser" class="text-num" ng-bind="::item.amount"></span>
+					<span ng-if="isUser" class="text-num" ng-bind="::'-'"></span>
 				</div>
 			</td>
 		</tr>

+ 6 - 6
src/main/webapp/resources/tpl/index/fa/apBill_detail.html

@@ -97,15 +97,15 @@
 			</div>
 			<div class="col-xs-3">
 				<span class="title">应付总额</span>
-				<div class="content text-num" ng-bind="::bill.apAmount | number:2 || 0"></div>
+				<div class="content text-num" ng-bind="::isUser?'-':(bill.apAmount | number:2 || 0)"></div>
 			</div>
 			<div class="col-xs-3">
 				<span class="title">付款金额</span>
-				<div class="content" ng-bind="bill.payAmount || 0"></div>
+				<div class="content" ng-bind="isUser?'-':(bill.payAmount || 0)"></div>
 			</div>
 			<div class="col-xs-3">
 				<span class="title">税金合计</span>
-				<div class="content" ng-bind="bill.taxSum || 0"></div>
+				<div class="content" ng-bind="isUser?'-':(bill.taxSum || 0)"></div>
 			</div>
 		</div>
 		<div class="row row-sm item">
@@ -151,11 +151,11 @@
 						<td ng-bind="item.orderCode"></td>
 						<td ng-bind="item.pdinoutNo"></td>
 						<td ng-bind="item.thisvoQty"></td>
-						<td ng-bind="item.price"></td>
+						<td ng-bind="isUser?'-':item.price"></td>
 						<td ng-bind="item.taxrate"></td>
-						<td ng-bind="item.amount"></td>
+						<td ng-bind="isUser?'-':item.amount"></td>
 						<td ng-bind="item.qty"></td>
-						<td ng-bind="item.apAmount"></td>
+						<td ng-bind="isUser?'-':item.apAmount"></td>
 						<td ng-bind="item.invoQty"></td>
 						<td ng-bind="item.yQty"></td>
 						<td ng-if="item.remark" ng-bind="item.remark"></td>

+ 3 - 3
src/main/webapp/resources/tpl/index/fa/apCheck.html

@@ -133,7 +133,7 @@
 		<span>应收对账单</span>
 		<div class="p-right">
 			<a class="text-simple append" ui-sref="fa.apCheckList" title="新增对账单"><img src="static/img/icon/add.png">新增对账单</a>&nbsp;&nbsp;&nbsp;
-			<a href="sale/apCheck/allxls?_state={{active}}&searchFilter={{searchFilterXls}}"
+			<a href="#" ng-click="exportXls()"
 			   target="_self" title="导出Excel表格" class="blue f14"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
@@ -266,8 +266,8 @@
 					<div class="static">
 						<p><span class="f14 text-num">{{::check.beginDate | date:'yyyy/MM/dd'}} - {{::check.endDate | date:'yyyy/MM/dd'}}</span></p>
 						<p>
-							<strong class="text-num">{{::check.checkAmount | number:2}}</strong>
-							<span class="text-number">{{::check.currency}}</span>
+							<strong class="text-num">{{::(isUser?'-':(check.checkAmount | number:2))}}</strong>
+							<span ng-if="!isUser" class="text-number">{{::check.currency}}</span>
 						</p>
 						<p>
 							<strong class="text-num">{{::check.items.length}}</strong> 条<br>

+ 5 - 5
src/main/webapp/resources/tpl/index/fa/apCheck_detail.html

@@ -97,7 +97,7 @@
 		<div class="row row-sm item">
 			<div class="col-xs-3">
 				<span class="title">对账总额</span>
-				<div class="content text-num" ng-bind="::data.checkAmount | number:2"></div>
+				<div class="content text-num" ng-bind="::(isUser?'-':(data.checkAmount | number:2))"></div>
 			</div>
 			<div class="col-xs-3">
 				<span class="title">币别</span>
@@ -140,10 +140,10 @@
 						<td ng-bind="item.inoutno"></td>
 						<td ng-bind="item.orderClass"></td>
 						<td ng-bind="item.inoutnodetno"></td>
-						<td ng-bind="item.price"></td>
+						<td ng-bind="isUser?'-':item.price"></td>
 						<td ng-bind="item.taxrate"></td>
 						<td ng-bind="item.checkQty"></td>
-						<td ng-bind="item.amount | number:2"></td>
+						<td ng-bind="isUser?'-':(item.amount | number:2)"></td>
 						<td ng-bind="item.orderCode"></td>
 						<td ng-bind="item.orderDetno"></td>
 						<td ng-bind="item.receiveName"></td>
@@ -152,8 +152,8 @@
 			</table>
 		</div>	
  		<div class="row">
-			<div ng-hide="data.status" class="col-xs-1 col-xs-offset-5"><button class="btn btn-success" ng-click="submitApCheck()">提交</button></div>
-			<div ng-hide="data.status"  class="col-xs-1"><button class="btn btn-info" ui-sref="fa.apCheck" ng-click="deleteApCheck()">删除</button></div>
+			<div ng-hide="data.status || !data.code" class="col-xs-1 col-xs-offset-5"><button class="btn btn-success" ng-click="submitApCheck()">提交</button></div>
+			<div ng-hide="data.status || !data.code"  class="col-xs-1"><button class="btn btn-info" ui-sref="fa.apCheck" ng-click="deleteApCheck()">删除</button></div>
 			<div ng-if="data.checkStatus == '不同意'" class="col-xs-1 col-xs-offset-5"><button class="btn btn-warning" ui-sref="fa.apCheck" ng-click="cancelApCheck(data)">作废</button></div>
 			<div ng-show="data.status == 314 && data.checkStatus != '已作废'" class="col-xs-1 col-xs-offset-5"><button class="btn btn-warning" ui-sref="fa.apCheck" ng-click="cancelApCheck(data)">作废</button></div>
 			<div class="col-xs-7 col-xs-offset-2" ng-show="data.status == 314" style="margin-top:5px">

+ 2 - 2
src/main/webapp/resources/tpl/index/make/accept.html

@@ -107,7 +107,7 @@
 	<div class="pub-com_head">
 		<span>客户委外验收单</span>
 		<div class="p-right">
-			<a href="make/accept/xls?_state={{active}}&keyword={{keywordXls.keyword}}&fromDate={{keywordXls.fromDate}}&endDate={{keywordXls.endDate}}"
+			<a href="#" ng-click="exportXls()"
 			   target="_self" class="text-simple" title="导出Excel表格"><i
 					class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
@@ -255,7 +255,7 @@
 					</div>
 				</td>
 				<td>
-					<div class="text-num" title="{{item.orderPrice}}">
+					<div ng-if="!isUser" class="text-num" title="{{item.orderPrice}}">
 						<span ng-bind="::currency(accept.currency)"></span><span
 							ng-bind="item.orderPrice || 0 | number : 6"></span>
 					</div>

+ 4 - 4
src/main/webapp/resources/tpl/index/make/change.html

@@ -110,7 +110,7 @@
 <div class="pub-com_head">
 	<span>委外变更单</span>
 	<div class="p-right">
-		<a href="make/changes/xls?_state={{active}}&searchFilter={{keywordXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+		<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 	</div>
 </div>
     <div class="condition block">
@@ -225,18 +225,18 @@
 			<td class="product">
 				<div>
 					<span class="text-num text-bold" ng-bind="::change.product.code"></span>
-					<span class="text-light">
+					<span class="text-light"></span>
 				</div>
 				<div ng-bind="::change.product.title"></div>
 				<div class="text-muted" ng-bind="::change.product.spec"></div>
 				<div class="" ng-if="::change.reason">变更原因:<span ng-bind="::change.reason"></span></div>
 			</td>
 			<td class="text-center">
-				<div class="text-num"
+				<div class="text-num" ng-if="!isUser"
 					ng-class="{'text-inverse': change.newPrice != change.oldPrice}"
 					title="{{change.newPrice}}" ng-bind="::change.newPrice | number:6"></div>
 				<div ng-show="change.newPrice != change.oldPrice">
-					<s class="text-num text-muted" ng-bind="::change.oldPrice | number:6"></s>
+					<s ng-if="!isUser" class="text-num text-muted" ng-bind="::change.oldPrice | number:6"></s>
 				</div>
 				税率 <span class="text-num" ng-class="{'text-inverse': change.newtaxrate != change.taxrate}">
 									{{::change.newtaxrate || 0}}%

+ 2 - 2
src/main/webapp/resources/tpl/index/make/change_detail.html

@@ -115,11 +115,11 @@
 							<div class="text-muted" ng-bind="::change.product.spec"></div>
 						</td>
 						<td class="text-center" width="100">
-							<div class="text-num"
+							<div class="text-num" ng-if="!isUser"
 								ng-class="{'text-inverse': change.newPrice != change.oldPrice}"
 								title="{{change.newPrice}}" ng-bind="::change.newPrice | number:6"></div>
 							<div ng-show="change.newPrice != change.oldPrice">
-								<s class="text-num text-muted" ng-bind="::change.oldPrice | number:6"></s>
+								<s ng-if="!isUser" class="text-num text-muted" ng-bind="::change.oldPrice | number:6"></s>
 							</div>
 							<div class="text-muted">
 								税率 <span class="text-num" ng-class="{'text-inverse': change.newtaxrate != change.taxrate}">

+ 4 - 5
src/main/webapp/resources/tpl/index/make/order.html

@@ -126,7 +126,7 @@
 	<div class="pub-com_head">
 		<span>客户委外单</span>
 		<div class="p-right">
-			<a href="make/orders/xls?_state={{active}}&searchFilter={{keywordXls}}"
+			<a href="#" ng-click="exportXls()"
 			   target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
@@ -261,10 +261,9 @@
 						 ng-click="setOrdersRead(order.id)" title="查看详情"></a></span>
 				</div>
 			</td>
-			<td colspan="1" class="order-sum">{{::order.currency}}: <span
-				ng-bind="::order.qty * order.price| number : 2"
+			<td colspan="1" class="order-sum">{{::(isUser?'':order.currency+':')}} <span
+				ng-bind="::(isUser?'-':(order.qty * order.price| number : 2))"
 				class="text-num text-bold"></span>
-			</td>
 			<td colspan="1" class="text-center">
 				<div class="operates">
 					<a ng-click="print(order)" title="打印{{order.print? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !order.print, 'text-muted': order.print}"><i
@@ -295,7 +294,7 @@
 				<div class="text-bold text-inverse" ng-if="order.factory">送货工厂:<span ng-bind="::order.factory"></span></div>
 			</td>
 			<td>
-				<div class="text-num" ng-bind="::order.price | number:6"></div>
+				<div class="text-num" ng-bind="::(isUser?'':(order.price | number:6))"></div>
 				<div class="text-muted">税率:{{::order.taxrate || 0}}%</div>
 			</td>
 			<td class="text-center">

+ 2 - 2
src/main/webapp/resources/tpl/index/make/order_detail.html

@@ -57,7 +57,7 @@
 			</div>
 			<div class="col-xs-4">
 				<span class="title">金额</span>
-				<div class="content" ng-bind="::order.total"></div>
+				<div class="content" ng-bind="::(isUser?'-':order.total)"></div>
 			</div>
 			<div class="col-xs-5">
 				<span class="title">付款方式</span>
@@ -104,7 +104,7 @@
 							<div class="text-muted" ng-bind="::order.product.spec"></div>
 						</td>
 						<td class="text-center" width="80">
-							<div class="text-num" ng-bind="::order.price | number:6"></div>
+							<div ng-if="!isUser" class="text-num" ng-bind="::order.price | number:6"></div>
 							<div class="text-muted">税率:{{order.taxrate || 0}}%</div>
 						</td>
 						<td class="text-center" width="100">

+ 2 - 2
src/main/webapp/resources/tpl/index/make/outorder.html

@@ -101,7 +101,7 @@
 		<span>委外订单</span>
 		<div class="p-right">
 			<a
-				href="make/outorders/xls?_state={{active}}&searchFilter={{keywordXls}}"
+				href="#" ng-click="exportXls()"
 				target="_self" class="text-simple" title="导出Excel表格"><i
 				class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
@@ -254,7 +254,7 @@
 					</div>
 				</td>
 				<td class="text-center">
-					<div class="text-num" ng-bind="::order.price | number:6"></div>
+					<div ng-if="!isUser" class="text-num" ng-bind="::order.price | number:6"></div>
 					<div class="text-muted">税率:{{::order.taxrate || 0}}%</div>
 				</td>
 				<td class="text-center">

+ 2 - 2
src/main/webapp/resources/tpl/index/make/outorder_detail.html

@@ -65,7 +65,7 @@
 		<div class="row row-sm item">
 			<div class="col-xs-3">
 				<span class="title">金额</span>
-				<div class="content" ng-bind="::order.total"></div>
+				<div ng-if="!isUser" class="content" ng-bind="::order.total"></div><div ng-if="isUser">-</div>
 			</div>
 			<div class="col-xs-9">
 				<span class="title">交货地址</span>
@@ -104,7 +104,7 @@
 							<div class="text-muted" ng-bind="::order.product.spec"></div>
 						</td>
 						<td class="text-center">
-							<div class="text-num" ng-bind="::order.price | number:6"></div>
+							<div ng-if="!isUser" class="text-num" ng-bind="::order.price | number:6"></div>
 							<div class="text-muted">税率:{{order.taxrate || 0}}%</div>
 						</td>
 						<td class="text-center">

+ 2 - 2
src/main/webapp/resources/tpl/index/make/returns.html

@@ -112,7 +112,7 @@
 	<div class="pub-com_head">
 		<span>客户委外验退单</span>
 		<div class="p-right">
-			<a href="make/return/xls?_state={{active}}&keyword={{keywordXls.keyword}}&fromDate={{keywordXls.fromDate}}&endDate={{keywordXls.endDate}}" target="_self"
+			<a href="#" target="_self" ng-click="exportXls()"
 			   class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
@@ -238,7 +238,7 @@
 					<div class="text-bold text-inverse" ng-if="item.order.factory">送货工厂:<span ng-bind="::item.order.factory"></span></div>
 				</td>
 				<td>
-					<div class="text-num" title="{{::item.order.price}}">
+					<div ng-if="!isUser" class="text-num" title="{{::item.order.price}}">
 						<span ng-bind="::currency(returns.currency)"></span><span
 							ng-bind="::item.order.price | number:6"></span>
 					</div>

+ 4 - 4
src/main/webapp/resources/tpl/index/purc/deputyOrder.html

@@ -196,7 +196,7 @@
         <div class="pub-com_head">
             <span>代采订单</span>
             <div class="p-right">
-            	<span style="color: #3a89d1">总金额: {{odersAmount| number}} </span><span></span>
+            	<span ng-if="!isUser" style="color: #3a89d1">总金额: {{odersAmount| number}} </span><span></span>
                 <a ui-sref="purc.newdeputy" type="button" title="新增代采订单"><img src="static/img/icon/add.png">新增</a>
                 <a ui-sref="purc.deputylog" type="button" title="错误日志"><i class="fa fa-file-text"></i> 错误日志</a>
             </div>
@@ -326,16 +326,16 @@
                             <div>录入日期:<span ng-bind="order.entrydate| date: 'yyyy-MM-dd'"></span></div>
                             <div>提交日期:<span ng-bind="order.date| date: 'yyyy-MM-dd'"></span></div>
                             <div>终端供应商:<span ng-bind="order.tervendor"></span></div>
-                            <div>订单金额:<span ng-bind="order.totalamount | number"></span></div>
+                            <div>订单金额:<span ng-if="!isUser" ng-bind="order.totalamount | number"></span><span ng-if="isUser">-</span></div>
                         </div>
                         <div class="col-md-3">
                             <div>订单编号:<a ng-bind="order.salecode" ui-sref="purc.deputydetail({id:order.id})"></a></div>
                             <div>最新付款日期:<span ng-bind="order.paydate| date: 'yyyy-MM-dd'"></span></div>
-                            <div>累计付款金额:<span ng-bind="order.totalamount | number"></span></div>
+                            <div>累计付款金额:<span ng-if="!isUser" ng-bind="order.totalamount | number"></span><span ng-if="isUser">-</span></div>
                         </div>
                         <div class="col-md-3">
                             <div>最新付款日期:<span ng-bind="order.deliverydate| date: 'yyyy-MM-dd'"></span></div>
-                            <div>累计付款金额:<span ng-bind="order.usdpayment | number"></span></div>
+                            <div>累计付款金额:<span ng-if="!isUser" ng-bind="order.usdpayment | number"></span><span ng-if="isUser">-</span></div>
                         </div>
                         <div class="col-md-2 text-center">
                             <span ng-if="order.print" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #5D6C79">已打印</span>

+ 7 - 7
src/main/webapp/resources/tpl/index/purc/deputyOrder_detail.html

@@ -327,8 +327,8 @@
                             <span><input type="text" class="text-center" ng-model="item.prodspec" ng-required="true"></span>
                             <span><input type="text" class="text-center" ng-model="item.prodbrand" ng-required="true"></span>
                             <span><input type="text" class="text-center" ng-model="item.amount" ng-required="true" ng-change="totalPrice()"></span>
-                            <span><input type="text" class="text-center" ng-model="item.unitprice" ng-required="true" ng-change="totalPrice()"></span>
-                            <span><input type="text" class="text-center" ng-model="item.purcprice" ng-required="true" ng-change="totalPrice()"></span>
+                            <span><input type="text" class="text-center" ng-model="item.unitprice" ng-init="item.unitprice=isUser?'-':item.unitprice" ng-required="true" ng-change="totalPrice()"></span>
+                            <span><input type="text" class="text-center" ng-model="item.purcprice" ng-init="item.purcprice = isUser?'-':item.purcprice" ng-required="true" ng-change="totalPrice()"></span>
                             <span>{{item.unitprice * item.amount | number}}</span>
                             <span><input type="text" class="text-center" ng-model="item.remark"></span>
                             <span><button ng-click="add($index)" style="color: #1f4fb2" ng-disabled="!deOrder.$editing">添加</button>
@@ -352,11 +352,11 @@
                         <li>
                             <div class="fl">
                                 <em>总价款({{deOrder.currency}}):</em>
-                                <span >{{deOrder.totalamount| number}}</span>
+                                <span ng-if="!isUser">{{deOrder.totalamount| number}}</span><span ng-if="isUser">-</span>
                             </div>
                             <div class="fr">
                             	 <em>订单总价款({{deOrder.currency}}):</em>
-                                <span >{{deOrder.orderamount| number}}</span>
+                                <span ng-if="!isUser">{{deOrder.orderamount| number}}</span><span ng-if="isUser">-</span>
                             </div>
                         </li>
                         <li>
@@ -385,7 +385,7 @@
                         <li>
                             <div class="fl">
                                 <em>我方付款金额({{deOrder.currency}}):</em>
-                                <span >{{deOrder.totalpayament| number}}</span>
+                                <span ng-if="!isUser">{{deOrder.totalpayament| number}}</span><span ng-if="isUser">-</span>
                             </div>
                             <div class="fr">
                                 <em>我方付款日期:</em>
@@ -446,11 +446,11 @@
                         <li>
                             <div class="fl">
                                 <em>付款金额({{deOrder.currency}}):</em>
-                                <span>{{deOrder.usdpayment| number}}</span>
+                                <span ng-if="!isUser">{{deOrder.usdpayment| number}}</span><span ng-if="isUser">-</span>
                             </div>
                             <div class="fr">
                                 <em>实际付款金额({{deOrder.currency}}):</em>
-                                <span ng-bind="deOrder.actusdpayment | number"></span>
+                                <span ng-if="!isUser" ng-bind="deOrder.actusdpayment | number"></span><span ng-if="isUser">-</span>
                             </div>
                         </li>
                         <li>

+ 3 - 3
src/main/webapp/resources/tpl/index/purc/inquiry.html

@@ -305,7 +305,7 @@ margin-left: 55px;
 		<div class="p-right">
 			<a ui-sref="purc.inquiry_unapply" title="待提交"><img src="static/img/icon/wait.png"/>待发布</a>
 			<a ui-sref="purc.inquiry_new" title="新增询价单"><img src="static/img/icon/add.png"/>新增</a>
-			<a href="purc/inquiry/xls?_state={{active}}&searchFilter={{searchFilterXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+			<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
 	<div class="menu condition block">
@@ -565,8 +565,8 @@ margin-left: 55px;
 			<td class="text-center br-l">
 				<div>
 					<div ng-repeat="reply in inquiryItem.replies">
-						<span ng-bind="reply.price | number:6"></span> <span
-							ng-show="reply.price == null" class="text-muted">-</span>
+						<span ng-if="!isUser" ng-bind="reply.price | number:6"></span> <span
+							ng-show="reply.price == null || isUser" class="text-muted">-</span>
 					</div>
 					<!-- <div class="dropdown">
 						<a href="javascript:void(0);" class="dropdown-toggle text-default"

+ 12 - 4
src/main/webapp/resources/tpl/index/purc/inquiryInfo_detail.html

@@ -323,10 +323,18 @@
 }
 
 .tender-list02 .comment-oder-list dl dd span a {
+    margin-top: 15px;
 	margin-left: 15px;
 	font-size: 12px;
-}
+    width: 104px;
+    height: 25px;
+    line-height: 25px;
+    float: left;
 
+}
+.dropdown:hover>.dropdown-menu{
+    margin-top: 51px;
+}
 .tender-list02 .comment-oder-list dl dd:hover {
 	border-bottom: #ccc 1px dotted;
 	border-top: none;
@@ -517,7 +525,7 @@ i, em {
 																<div class="row row-sm"
 																	ng-repeat="reply in ::inquiryItem.replies">
 																	<div class="col-xs-5">≥{{reply.lapQty}}</div>
-																	<div class="col-xs-5">价格{{reply.price | number:6}}</div>
+																	<div class="col-xs-5">价格{{isUser?'-':(reply.price | number:6)}}</div>
 																</div>
 															</div>
 													</ul>
@@ -530,7 +538,7 @@ i, em {
 											<div class="row row-sm"
 												ng-repeat="reply in ::inquiryItem.replies">
 												<div class="col-xs-5">≥{{reply.lapQty}}</div>
-												<div class="col-xs-5">{{reply.price | number:6}}</div>
+												<div class="col-xs-5">{{isUser?'-':(reply.price | number:6)}}</div>
 											</div>
 										</div>
 										<div  ng-if="::inquiryItem.replies.length == 0">暂无报价信息</div>
@@ -543,7 +551,7 @@ i, em {
                                         <em>{{inquiryItem.vendToDate|date: 'yyyy-MM-dd'}}</em>
                                     </span>
                                     <span ng-if="inquiryItem.status == 200" class="text-trans info">暂未报价</span>
-                                    <span ng-if="inquiryItem.status == 201 && inquiryItem.agreed == null && inquiryItem.vendToDate > nowDate""><a ng-click="accept(inquiryItem.id)">采纳</a><a ng-click="refuse(inquiryItem.id)">拒绝</a></span>
+                                    <span ng-if="inquiryItem.status == 201 && inquiryItem.agreed == null && inquiryItem.vendToDate > nowDate"><a ng-click="accept(inquiryItem.id)">采纳</a><a ng-click="refuse(inquiryItem.id)">拒绝</a></span>
 									<span ng-if="inquiryItem.status == 201 && inquiryItem.agreed == 1" class="text-trans success">报价已采纳</span>
 									<span ng-if="inquiryItem.status == 201 && inquiryItem.agreed == 0" class="text-trans error">报价未采纳</span>
 									<span ng-if="inquiryItem.status == 201 && inquiryItem.agreed == null && inquiryItem.vendToDate < nowDate" class="text-trans text-light">已失效</span>

+ 4 - 3
src/main/webapp/resources/tpl/index/purc/order.html

@@ -169,7 +169,7 @@
 	<div class="p-right">
 		<a ui-sref="purc.newOrder" title="新增采购单"><img src="static/img/icon/add.png"/>新增</a>
 		<a ui-sref="purc.cart" title="购物车"><img src="static/img/icon/cart.png"/>购物车</a>
-		<a href="sale/orders/purc/xls?_state={{active}}&searchFilter={{searchFilterXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+		<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 	</div>
 </div>
 <div class="menu condition block">
@@ -342,10 +342,11 @@
 						ng-click="setOrdersRead(order.id)"></a></span>
 				</div>
 			</td>
-			<td class="order-sum">{{::order.currency}}: <span
+			<td ng-if="!isUser" class="order-sum">{{::order.currency}}: <span
 				ng-bind="getOrderTotal(order.orderItems) | number : 2"
 				class="text-num text-bold"></span>
 			</td>
+			<td ng-if="isUser" class="order-sum"></td>
 			<td class="text-center">
 				<span ng-if="order.custPrint" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #5D6C79">已打印</span>
 				<span ng-if="!order.custPrint" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #CA3955">未打印</span>
@@ -373,7 +374,7 @@
 				<div class="text-bold text-inverse" ng-if="item.remark">备注:<span ng-bind="::item.remark"></span></div>
 			</td>
 			<td class="text-center">
-				<div class="text-num" ng-bind="::item.price | number:6"></div>
+				<div ng-if="!isUser" class="text-num" ng-bind="::item.price | number:6"></div>
 			</td>
 			<td class="text-center"><div class="text-muted">{{::item.taxrate || 0}}</div></td>
 			<td class="text-center">

+ 2 - 2
src/main/webapp/resources/tpl/index/purc/order_detail.html

@@ -55,7 +55,7 @@
 			</div>
 			<div class="col-xs-3">
 				<span class="title">金额</span>
-				<div class="content" ng-bind="::order.total | number:2"></div>
+				<div ng-if="!isUser" class="content" ng-bind="::order.total | number:2"></div>
 			</div>
 			<div class="col-xs-6">
 				<span class="title">付款方式</span>
@@ -110,7 +110,7 @@
 							<div class="text-bold text-inverse" ng-if="item.remark">备注:<span ng-bind="::item.remark"></span></div>
 						</td>
 						<td class="text-center" width="110">
-							<div class="text-num" ng-bind="::item.price | number:6"></div>
+							<div ng-if="!isUser" class="text-num" ng-bind="::item.price | number:6"></div>
 							<div class="text-muted">税率:{{::item.taxrate || 0}}%</div>
 						</td>
 						<td class="text-center"  width="100">

+ 2 - 2
src/main/webapp/resources/tpl/index/purc/prodList.html

@@ -117,7 +117,7 @@
 }
 .order-hd td{
     line-height: 25px;
-    word-break: break-word;
+    word-break: break-all;
     padding: 10px 5px !important;
 }
 .toolbar td a{
@@ -184,7 +184,7 @@
     <div class="pub-com_head">
         <span>物料库</span>
         <div class="p-right">
-            <a href="product/baseInfo/xls?keyword={{keywordXls}}" target="_self" class="text-simple" title="导出Excel表格">导出</a>
+            <a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格">导出</a>
             <a ui-sref="purc.newProduct">新增</a>
             <a ui-sref="purc.uploadProduct" title="批量导入">批量导入</a>
             <a ng-click="toggle('off');" ng-if="purcStatus != 0">一键关闭</a>

+ 4 - 2
src/main/webapp/resources/tpl/index/purc/tender_evaluation.html

@@ -326,8 +326,10 @@
                                     </span>
                                     <!-- start过了投标截止日期,且审批状态不是已提交的 -->
                                     <span class="prod-number" ng-show="tender.overdue == 1" title="{{saleTenderItem.taxrate}}">{{saleTenderItem.saleTender.auditStatus != 0 ? saleTenderItem.taxrate || 0: 0}}</span>
-                                    <span class="prod-number" ng-show="tender.overdue == 1" title="{{saleTenderItem.price}}">{{saleTenderItem.saleTender.auditStatus != 0 ? (saleTenderItem.price || 0 | number: 6) : 0}}</span>
-                                    <span class="prod-number" ng-show="tender.overdue == 1" title="{{saleTenderItem.price * tenderProd.qty  || 0 | number: 2}}">{{saleTenderItem.saleTender.auditStatus != 0 ? (saleTenderItem.price * tenderProd.qty  || 0 | number: 2) : 0}}</span>
+                                    <span class="prod-number" ng-show="tender.overdue == 1 && !isUser" title="{{saleTenderItem.price}}">{{saleTenderItem.saleTender.auditStatus != 0 ? (saleTenderItem.price || 0 | number: 6) : 0}}</span>
+                                    <span class="prod-number" ng-show="isUser">-</span>
+                                    <span class="prod-number" ng-show="tender.overdue == 1 && !isUser" title="{{saleTenderItem.price * tenderProd.qty  || 0 | number: 2}}">{{saleTenderItem.saleTender.auditStatus != 0 ? (saleTenderItem.price * tenderProd.qty  || 0 | number: 2) : 0}}</span>
+                                    <span class="prod-number" ng-show="isUser">-</span>
                                     <span class="prod-number" ng-show="tender.overdue == 1">{{saleTenderItem.saleTender.auditStatus != 0 ? saleTenderItem.cycle || 0 : 0}}</span>
                                     <!-- end过了投标截止日期,且审批状态不是已提交的 -->
                                     <!-- start未过投标截止日期或者审批状态是已提交的 -->

+ 1 - 1
src/main/webapp/resources/tpl/index/qc/MRB.html

@@ -112,7 +112,7 @@
 	<div class="pub-com_head">
 		<span>MRB单</span>
 		<div class="p-right">
-			<a href="sale/MRB/xls?searchFilter={{searchFilterXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+			<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
 	<div class="condition block">

+ 2 - 2
src/main/webapp/resources/tpl/index/qc/badIn.html

@@ -111,7 +111,7 @@
 	<div class="pub-com_head">
 		<span>不良品入库单</span>
 		<div class="p-right">
-			<a href="sale/badIn/xls?searchFilter={{searchFilterXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+			<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
     <div class="condition block">
@@ -235,7 +235,7 @@
 					ng-bind="::item.orderItem.product.spec"></div>
 			</td>
 			<td>
-				<div class="text-num" title="{{item.orderPrice}}">
+				<div ng-if="!isUser" class="text-num" title="{{item.orderPrice}}">
 					<span ng-bind="::badIn.currency"></span>
 					<span ng-bind="::item.orderPrice"></span>
 				</div>

+ 4 - 3
src/main/webapp/resources/tpl/index/qc/badOut.html

@@ -111,7 +111,7 @@
 	<div class="pub-com_head">
 		<span>不良品出库单</span>
 		<div class="p-right">
-			<a href="sale/badOut/xls?searchFilter={{keywordXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+			<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
     <div class="condition block">
@@ -236,8 +236,9 @@
 			</td>
 			<td>
 				<div class="text-num" title="{{::item.orderPrice}}">
-					<span ng-bind="::badOut.currency"></span>
-					<span ng-bind="::item.orderPrice"></span>
+					<span ng-if="!isUser" ng-bind="::badOut.currency"></span>
+					<span ng-if="!isUser" ng-bind="::item.orderPrice"></span>
+					<span ng-if="isUser">-</span>
 				</div>
 				<div class="text-muted"
 					title="{{item.orderItem.taxrate}}%">

+ 3 - 2
src/main/webapp/resources/tpl/index/sale/accept.html

@@ -112,7 +112,7 @@
 	<div class="pub-com_head">
 		<span>客户采购验收单</span>
 		<div class="p-right">
-			<a href="sale/accept/xls?searchFilter={{searchFilterXls}}" target="_self" class="text-simple" title="导出Excel表格"><i
+			<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i
 					class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
@@ -249,10 +249,11 @@
 					</div>
 				</td>
 				<td>
-					<div class="text-num" title="{{item.orderPrice}}">
+					<div ng-if="!isUser" class="text-num" title="{{item.orderPrice}}">
 						<span ng-bind="::currency(accept.currency)"></span><span
 							ng-bind="item.orderPrice | number : 6"></span>
 					</div>
+					<div  ng-if="isUser" class="text-num"></div>
 					<div class="text-muted" title="{{item.orderItem.taxrate}}%">
 						<br> 税率:<span ng-bind="::item.orderItem.taxrate + '%'"
 							class="text-num" ng-if="item.orderItem.taxrate!=null"></span> <span

+ 3 - 3
src/main/webapp/resources/tpl/index/sale/accept_detail.html

@@ -65,7 +65,7 @@
 			</div>
 			<div class="col-xs-6">
 				<div class="title">金额:</div>
-				<div class="unchanged-info">{{totalPrice| number: 6}}</div>
+				<div ng-if="!isUser" class="unchanged-info">{{totalPrice| number: 6}}</div>
 			</div>
 		</div>
 		<div class="row row-sm item">
@@ -118,12 +118,12 @@
 							<div ng-bind="::acceptitem.orderItem.product.unit"></div>
 						</td>
 						<td class="text-center" width="60">
-							<div ng-bind="::acceptitem.orderPrice"></div>
+							<div ng-if="!isUser" ng-bind="::acceptitem.orderPrice"></div>
 						<td class="text-center" width="80">
 							<div ng-bind="::acceptitem.qty"></div>
 						</td>
 						<td class="text-center" width="80">
-							<div>{{acceptitem.qty * acceptitem.orderPrice | number: 6}}</div>
+							<div ng-if="!isUser">{{acceptitem.qty * acceptitem.orderPrice | number: 6}}</div>
 						</td>
 						<td class="text-center" width="120">
 							<div ng-bind="::acceptitem.batchCode"></div>

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