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

Merge remote-tracking branch 'origin/feature-material-wangcz' into feature-material-wangcz

wangcz 7 лет назад
Родитель
Сommit
f4392b9aa4

+ 9 - 0
src/main/java/com/uas/platform/b2c/logistics/controller/InvoiceController.java

@@ -380,4 +380,13 @@ public class InvoiceController {
         logger.log("平台出货单管理", "保存出货单信息", "保存出货单信息 流水号:" + id + ", 操作人:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
         return invoiceService.ship(json, id);
     }
+
+	/**
+	 * 获取买家的待收货出库单
+	 * @return ResultMap
+	 */
+	@RequestMapping(value = "/enterprise/inbound", method = RequestMethod.GET)
+    public Page<Invoice> getEnterpriseInboundInvoice(PageParams pageParams) {
+		return invoiceService.getEnterpriseInboundInvoice(pageParams);
+	}
 }

+ 13 - 0
src/main/java/com/uas/platform/b2c/logistics/model/Invoice.java

@@ -274,6 +274,12 @@ public class Invoice extends Document implements Serializable {
 	@Column(name = "in_sendstatus")
 	private Integer sendstatus;
 
+	/**
+	 * 是否个人用户
+	 */
+	@Column(name = "in_dissociative")
+	private Integer dissociative;
+
 	@Transient
 	private Boolean isSelfSeller;
 
@@ -678,7 +684,13 @@ public class Invoice extends Document implements Serializable {
 		return this;
 	}
 
+	public Integer getDissociative() {
+		return dissociative;
+	}
 
+	public void setDissociative(Integer dissociative) {
+		this.dissociative = dissociative;
+	}
 
 	/**
 	 * @Tip 对象初始化时必须给历史记录赋值
@@ -764,6 +776,7 @@ public class Invoice extends Document implements Serializable {
 		this.deliveryType = Type.valueOf(this.sendType).getPhrase();
 		this.storeid = order.getStoreid();
 		this.proofingid = order.getProofingid();
+		this.dissociative = order.getDissociative();
     }
 
     public Invoice(InvoiceFPurchase fPurchase) {

+ 10 - 0
src/main/java/com/uas/platform/b2c/logistics/service/InvoiceService.java

@@ -8,7 +8,10 @@ import com.uas.platform.b2c.trade.order.model.Order;
 import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.PageParams;
 import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 
 import javax.management.OperationsException;
 import java.util.List;
@@ -203,4 +206,11 @@ public interface InvoiceService {
      * @return 返回发货单
      */
     ResultMap ship(String shiInfo, Long id);
+
+
+    /**
+     * 获取买家的待收货出库单
+     * @return Page<Invoice>
+     */
+    Page<Invoice> getEnterpriseInboundInvoice(PageParams pageParams);
 }

+ 22 - 0
src/main/java/com/uas/platform/b2c/logistics/service/impl/InvoiceServiceImpl.java

@@ -45,6 +45,7 @@ import com.uas.platform.b2c.trade.util.TradeLogUtil;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.EncodingRulesConstant;
 import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.PageParams;
 import com.uas.platform.core.model.Status;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
@@ -727,6 +728,7 @@ public class InvoiceServiceImpl implements InvoiceService {
         }
         pageInfo.filter("piclass", piclass);
         Page<Invoice> invoicePage = invoiceDao.findAll(new Specification<Invoice>() {
+            @Override
             public Predicate toPredicate(Root<Invoice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
                 query.where(pageInfo.getPredicates(root, query, builder));
                 return null;
@@ -1199,4 +1201,24 @@ public class InvoiceServiceImpl implements InvoiceService {
         }
         return ResultMap.success(inFpu);
     }
+
+    @Override
+    public Page<Invoice> getEnterpriseInboundInvoice(PageParams pageParams) {
+        final PageInfo info = new PageInfo(pageParams);
+        User user = SystemSession.getUser();
+        Enterprise enterprise = user.getEnterprise();
+        if (enterprise == null) {
+            info.filter("dissociative", Type.PERSONAL.value());
+            info.filter("buyeruu", user.getUserUU());
+        } else {
+            info.filter("buyerenuu", user.getEnterprise().getUu());
+        }
+        return invoiceDao.findAll(new Specification<Invoice>() {
+            @Override
+            public Predicate toPredicate(Root<Invoice> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
+                query.where(info.getPredicates(root, query, cb));
+                return null;
+            }
+        }, info);
+    }
 }

+ 1 - 1
src/main/webapp/resources/js/common/query/goods.js

@@ -316,7 +316,7 @@ define([ 'ngResource' ], function() {
             },
             // 根据所有ID获取产品信息
             findAllProduct : {
-                url: '/trade/products/ids',
+                url: 'trade/products/ids',
                 method: 'GET',
                 isArray : true
             }