Просмотр исходного кода

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@483 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

administrator 11 лет назад
Родитель
Сommit
9c39592258

+ 12 - 2
src/main/java/com/uas/platform/b2b/dao/PurchaseOrderItemDao.java

@@ -48,7 +48,17 @@ public interface PurchaseOrderItemDao extends JpaSpecificationExecutor<PurchaseO
 	@Query("from PurchaseOrderItem d where d.order.vendUU = :vendUU and d.endStatus = :endStatus")
 	public List<PurchaseOrderItem> findByVendUUAndEndStatus(@Param("vendUU") long vendUU, @Param("endStatus") short endStatus);
 
+	/**
+	 * 按回复记录更新采购明细的回复状态
+	 * 
+	 * @param qty
+	 * @param delivery
+	 * @param remark
+	 * @param status
+	 * @param id
+	 */
 	@Modifying(clearAutomatically = true)
-	@Query("update PurchaseOrderItem p set p.replyQty=p.replyQty+ :qty,p.replyDelivery= :delivery,p.replyRemark= :remark where p.id= :id")
-	public void updateByReply(@Param("qty") double qty, @Param("delivery") Date delivery, @Param("remark") String remark, @Param("id") long id);
+	@Query("update PurchaseOrderItem p set p.replyQty=(select sum(r.qty) from PurchaseOrderReply r where r.orderItem=p),p.replyDelivery= :delivery,p.replyRemark= :remark,p.status= :status where p.id= :id")
+	public void updateByReply(@Param("qty") double qty, @Param("delivery") Date delivery, @Param("remark") String remark,
+			@Param("status") short status, @Param("id") long id);
 }

+ 1 - 0
src/main/java/com/uas/platform/b2b/erp/model/QuotationDetail.java

@@ -143,6 +143,7 @@ public class QuotationDetail {
 		product.setCode(this.qd_prodcode);
 		product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
 		item.setProduct(product);
+		item.setCustProductCode(this.qd_custprodcode);
 		Set<SaleQuotationPrice> prices = new HashSet<SaleQuotationPrice>();
 		if (!CollectionUtils.isEmpty(this.dets)) {
 			for (QuotationDetailDet det : this.dets)

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

@@ -122,14 +122,12 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 		Double replyQty = item.getReplyQty();
 		replyQty = replyQty == null ? 0 : replyQty;
 		item.setReplyQty(replyQty + reply.getQty());
-//		item.setReplyDelivery(reply.getDelivery());
-//		item.setReplyRemark(reply.getRemark());
 		if (item.getReplyQty() > item.getQty())
 			throw new IllegalOperatorException("回复的数量合计超过了订单数量");
 		// 该行回复状态
 		item.setStatus((short) (Double.compare(item.getReplyQty(), item.getQty()) == 0 ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
 		purchaseOrderReplyDao.save(reply);
-		purchaseOrderItemDao.updateByReply(reply.getQty(), reply.getDelivery(), reply.getRemark(), item.getId());
+		purchaseOrderItemDao.updateByReply(reply.getQty(), reply.getDelivery(), reply.getRemark(), item.getStatus(), item.getId());
 		// 订单主记录状态
 		List<PurchaseOrderItem> notReply = purchaseOrderItemDao.findByOrderIdAndStatus(item.getOrder().getId(),
 				(short) Status.NOT_REPLY.value());

+ 5 - 5
src/main/java/com/uas/platform/b2b/support/CustomAccessDecisionManager.java

@@ -3,7 +3,7 @@ package com.uas.platform.b2b.support;
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.log4j.Logger;
+//import org.apache.log4j.Logger;
 import org.springframework.security.access.AccessDecisionManager;
 import org.springframework.security.access.AccessDeniedException;
 import org.springframework.security.access.ConfigAttribute;
@@ -23,7 +23,7 @@ public class CustomAccessDecisionManager implements AccessDecisionManager {
 	/**
 	 * LOGGER 日志对象
 	 */
-	private final static Logger LOGGER = Logger.getLogger(CustomAccessDecisionManager.class);
+//	private final static Logger LOGGER = Logger.getLogger(CustomAccessDecisionManager.class);
 
 	/**
 	 * @param authentication
@@ -34,7 +34,7 @@ public class CustomAccessDecisionManager implements AccessDecisionManager {
 	 */
 	public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes)
 			throws AccessDeniedException, InsufficientAuthenticationException {
-		LOGGER.info("CustomAccessDecisionManager.decide");
+//		LOGGER.info("CustomAccessDecisionManager.decide");
 
 		if (null == configAttributes || configAttributes.size() == 0) {
 			return;
@@ -47,9 +47,9 @@ public class CustomAccessDecisionManager implements AccessDecisionManager {
 
 			needRole = c.getAttribute();
 
-			LOGGER.info("菜单访问权限:" + needRole);
+//			LOGGER.info("菜单访问权限:" + needRole);
 			for (GrantedAuthority ga : authentication.getAuthorities()) {
-				System.out.println(ga.getAuthority());
+//				System.out.println(ga.getAuthority());
 				if (needRole.trim().equals(ga.getAuthority())) {
 					return;
 				}