Browse Source

新增采购单打印。

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9461 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
dongbw 8 years ago
parent
commit
8b878eb34c

+ 16 - 1
src/main/java/com/uas/platform/b2b/controller/SaleOrderController.java

@@ -90,7 +90,7 @@ public class SaleOrderController {
 	}
 
 	/**
-	 * 打印订单,增加打印次数
+	 * 打印订单,增加打印次数(供应商)
 	 * 记录打印日志
 	 * 
 	 * @param id
@@ -104,6 +104,21 @@ public class SaleOrderController {
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
 
+	/**
+	 * 打印订单,增加打印次数(采购方)
+	 * 记录打印日志
+	 *
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/custPrintCount/{id}", method = RequestMethod.POST)
+	@ResponseBody
+	public ResponseEntity<String> custPrintCount(@PathVariable("id") Long id) {
+		purchaseOrderService.custPrint(id);
+		logger.log("采购单", "打印采购订单", id.toString());
+		return new ResponseEntity<String>(HttpStatus.OK);
+	}
+
 	/**
 	 * 作为卖家,收到的采购订单(含明细)
 	 * 

+ 15 - 1
src/main/java/com/uas/platform/b2b/history/model/PurchaseOrderAll.java

@@ -156,11 +156,17 @@ public class PurchaseOrderAll {
 	private Short display;
 	
 	/**
-	 * 打印次数
+	 * 打印次数(供应商)
 	 */
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
 	public Long getId() {
 		return id;
 	}
@@ -213,6 +219,14 @@ public class PurchaseOrderAll {
 		return type;
 	}
 
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	public void setType(String type) {
 		this.type = type;
 	}

+ 14 - 0
src/main/java/com/uas/platform/b2b/history/model/PurchaseOrderEnd.java

@@ -165,6 +165,20 @@ public class PurchaseOrderEnd {
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	public Long getId() {
 		return id;
 	}

+ 14 - 0
src/main/java/com/uas/platform/b2b/history/model/PurchaseOrderTodo.java

@@ -166,6 +166,20 @@ public class PurchaseOrderTodo {
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	public Long getId() {
 		return id;
 	}

+ 15 - 1
src/main/java/com/uas/platform/b2b/model/PurchaseOrder.java

@@ -172,11 +172,17 @@ public class PurchaseOrder implements Serializable {
 	private Short display;
 	
 	/**
-	 * 打印次数
+	 * 打印次数(供应商)
 	 */
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
 	/**
 	 * 应付供应商名称
 	 */
@@ -195,6 +201,14 @@ public class PurchaseOrder implements Serializable {
 	@Column(name = "pu_erpid")
 	private Long erpId;
 
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	/**
 	 * 打印日志
 	 */

+ 15 - 1
src/main/java/com/uas/platform/b2b/model/PurchaseOrderAll.java

@@ -176,11 +176,17 @@ public class PurchaseOrderAll {
 	private Short display;
 
 	/**
-	 * 打印次数
+	 * 打印次数(供应商)
 	 */
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
 	/**
 	 * 应付供应商名称
 	 */
@@ -237,6 +243,14 @@ public class PurchaseOrderAll {
 		return enterprise;
 	}
 
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	public void setEnterprise(EnterpriseInfo enterprise) {
 		this.enterprise = enterprise;
 	}

+ 14 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseOrderDone.java

@@ -171,6 +171,12 @@ public class PurchaseOrderDone {
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
 	/**
 	 * 应付供应商名称
 	 */
@@ -386,6 +392,14 @@ public class PurchaseOrderDone {
 		return receiveCode;
 	}
 
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	public void setReceiveCode(String receiveCode) {
 		this.receiveCode = receiveCode;
 	}

+ 16 - 2
src/main/java/com/uas/platform/b2b/model/PurchaseOrderEnd.java

@@ -164,13 +164,27 @@ public class PurchaseOrderEnd {
 	 */
 	@Column(name = "pu_display")
 	private Short display;
-	
+
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	/**
-	 * 打印次数
+	 * 打印次数(供应商)
 	 */
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
 	/**
 	 * 应付供应商名称
 	 */

+ 15 - 1
src/main/java/com/uas/platform/b2b/model/PurchaseOrderTodo.java

@@ -160,11 +160,17 @@ public class PurchaseOrderTodo {
 	private Short display;
 	
 	/**
-	 * 打印次数
+	 * 打印次数(供应商)
 	 */
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
 	/**
 	 * 应付供应商名称
 	 */
@@ -349,6 +355,14 @@ public class PurchaseOrderTodo {
 		return display;
 	}
 
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	public void setDisplay(Short display) {
 		this.display = display;
 	}

+ 14 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseOrderWaiting.java

@@ -169,6 +169,20 @@ public class PurchaseOrderWaiting {
 	@Column(name = "pu_print")
 	private Short print;
 
+	/**
+	 * 打印次数(采购方)
+	 */
+	@Column(name = "pu_custprint")
+	private Short custPrint;
+
+	public Short getCustPrint() {
+		return custPrint;
+	}
+
+	public void setCustPrint(Short custPrint) {
+		this.custPrint = custPrint;
+	}
+
 	/**
 	 * 应付供应商名称
 	 */

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

@@ -297,4 +297,6 @@ public interface PurchaseOrderService {
 	 * @param idArray
 	 */
 	void onPrintSendSuccess(String[] idArray);
+
+    void custPrint(Long id);
 }

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

@@ -634,6 +634,15 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 		purchaseOrderAllDao.save(order);
 	}
 
+	@Override
+	public void custPrint(Long id) {
+		PurchaseOrderAll order = purchaseOrderAllDao.findOne(id);
+		if (order != null) {
+			order.setCustPrint((short) ((order.getCustPrint() == null ? 0 : order.getCustPrint()) + 1));
+		}
+		purchaseOrderAllDao.save(order);
+	}
+
 	@Override
 	public Long getOrdersCount(Long uu) {
 		return purchaseOrderAllDao.findOrderCountByEnUU(uu);

+ 7 - 1
src/main/webapp/resources/js/index/app.js

@@ -2272,7 +2272,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
   			});
   			return sum;
   		};
-  		
+
+        // 需方  打印    采购单
+        $scope.custPrint = function(order) {
+           PurcOrder.custPrintCount({id: order.id},{});//增加打印此次
+           ReportService.print(order.enUU, 'PURCLIST_CUST', "where purc$orders.pu_id=" + order.id);
+        };
+
   		$scope.openDatePicker = function($event, item, openParam) {
   			$event.preventDefault();
   		    $event.stopPropagation();

+ 5 - 1
src/main/webapp/resources/js/index/services/Purc.js

@@ -26,7 +26,11 @@ define([ 'ngResource'], function() {
 			printCount: {
 				url: 'sale/orders/printCount/:id',
 				method: 'POST'
-			}
+			},
+            custPrintCount: {
+                url: 'sale/orders/custPrintCount/:id',
+                method: 'POST'
+            }
 		});
 	}]).factory('PurcOrderItem', ['$resource', function($resource) {
 		return $resource('sale/orders/items', {}, {

+ 9 - 1
src/main/webapp/resources/tpl/index/purc/order.html

@@ -331,10 +331,18 @@
 						class="text-num" ng-bind="::order.code" ui-sref="purc.order_detail({id:order.id})" target="_self"></a></span>
 				</div>
 			</td>
-			<td colspan="2" class="order-sum">{{::order.currency}}: <span
+			<td class="order-sum">{{::order.currency}}: <span
 				ng-bind="getOrderTotal(order.orderItems) | number : 2"
 				class="text-num text-bold"></span>
 			</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>
+				<div class="operates">
+					<a ng-click="custPrint(order)" title="打印{{order.custPrint? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !order.custPrint, 'text-muted': order.custPrint}"><i
+							class="fa fa-print fa-lg"></i></a></a>
+				</div>
+			</td>
 		</tr>
 		<tr class="order-bd" ng-repeat="item in order.orderItems track by item.id"
 			ng-if="!order.$collapsed "><!-- && (!searchFilterXls.keyword || item.key || order.$showAll) -->