Преглед изворни кода

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

wangdy пре 8 година
родитељ
комит
096aec21f3

+ 41 - 1
src/main/java/com/uas/platform/b2c/fa/settlement/model/BillSubmit.java

@@ -2,6 +2,9 @@ package com.uas.platform.b2c.fa.settlement.model;
 
 import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.common.account.model.UserBaseInfo;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.utils.FastjsonUtils;
+import com.uas.platform.core.model.Status;
 
 import javax.persistence.*;
 import java.io.Serializable;
@@ -14,7 +17,7 @@ import java.util.Date;
  */
 @Entity
 @Table(name = "trade$bill_submit")
-public class BillSubmit implements Serializable{
+public class BillSubmit implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
@@ -147,6 +150,12 @@ public class BillSubmit implements Serializable{
     @Column(name = "bs_store_name")
     private String storeName;
 
+    /**
+     * 销售单号,以“,”拼接
+     */
+    @Column(name = "bs_purchaseids")
+    private String purchaseids;
+
     public Long getId() {
         return id;
     }
@@ -317,4 +326,35 @@ public class BillSubmit implements Serializable{
         this.storeName = storeName;
         return this;
     }
+
+    public String getPurchaseids() {
+        return purchaseids;
+    }
+
+    public BillSubmit setPurchaseids(String purchaseids) {
+        this.purchaseids = purchaseids;
+        return this;
+    }
+
+    /**
+     * 设置bill信息
+     * @param bill
+     */
+    public void setBillInfo(Bill bill) {
+        if (bill == null) {
+            return ;
+        }
+        this.setInvoicetitle(bill.getHead());
+        this.setInvoiceid(bill.getId());
+        this.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
+        this.setInvoicetype(bill.getKind());
+        this.setCreateTime(new Date());
+        this.setReceiverName(bill.getName());
+        this.setRecTel(bill.getTelephone());
+        this.setStatus(Status.SUBMITTED.value());
+        this.setSubmituu(SystemSession.getUser().getUserUU());
+        this.setBillInfo(FastjsonUtils.toJson(bill));
+        if (SystemSession.getUser().getEnterprise() != null)
+            this.setSubmitEnuu(SystemSession.getUser().getEnterprise().getUu());
+    }
 }

+ 127 - 33
src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/BillSubmitServiceImpl.java

@@ -1,15 +1,19 @@
 package com.uas.platform.b2c.fa.settlement.service.impl;
 
+import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
+import com.uas.platform.b2c.core.utils.NumberUtil;
 import com.uas.platform.b2c.fa.settlement.dao.BillDao;
 import com.uas.platform.b2c.fa.settlement.dao.BillSubmitDao;
 import com.uas.platform.b2c.fa.settlement.model.Bill;
 import com.uas.platform.b2c.fa.settlement.model.BillSubmit;
 import com.uas.platform.b2c.fa.settlement.service.BillSubmitService;
 import com.uas.platform.b2c.trade.order.dao.OrderDao;
+import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
 import com.uas.platform.b2c.trade.order.model.Order;
+import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Status;
@@ -19,6 +23,7 @@ import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.map.HashedMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.jpa.domain.Specification;
@@ -45,11 +50,17 @@ public class BillSubmitServiceImpl implements BillSubmitService {
 
     private final BillSubmitDao billSubmitDao;
 
+    private final PurchaseDao purchaseDao;
+
+    private final SysConf sysConf;
+
     @Autowired
-    public BillSubmitServiceImpl (OrderDao orderDao, BillDao billDao, BillSubmitDao billSubmitDao) {
+    public BillSubmitServiceImpl(OrderDao orderDao, BillDao billDao, BillSubmitDao billSubmitDao, PurchaseDao purchaseDao, SysConf sysConf) {
         this.orderDao = orderDao;
         this.billDao = billDao;
         this.billSubmitDao = billSubmitDao;
+        this.purchaseDao = purchaseDao;
+        this.sysConf = sysConf;
     }
 
     @Override
@@ -97,12 +108,17 @@ public class BillSubmitServiceImpl implements BillSubmitService {
             } else {
                 map.get(order.getSellerenuu()).add(order);
             }
-
         }
         List<BillSubmit> billSubmits = new ArrayList<BillSubmit>();
         for (Long sellerenuu : map.keySet()) {
-            BillSubmit billSubmit = createBillSubmit(bill, map.get(sellerenuu), buyerEnuu);
-            billSubmits.add(billSubmit);
+            List<BillSubmit> billSubmitList = new ArrayList<>();
+            billSubmitList.add(createBillSubmit(bill, map.get(sellerenuu), buyerEnuu));
+            if (sellerenuu.longValue() == sysConf.getEnUU().longValue()) {
+                billSubmitList.addAll(createBillSubmitByPurchase(map.get(sellerenuu)));
+            }
+            if (billSubmitList != null) {
+                billSubmits.addAll(billSubmitList);
+            }
         }
 
         return billSubmitDao.save(billSubmits);
@@ -113,35 +129,37 @@ public class BillSubmitServiceImpl implements BillSubmitService {
         Long buyeruu = SystemSession.getUser().getUserUU();
         // 发票基本信息
         BillSubmit billSubmit = new BillSubmit();
-        billSubmit.setInvoicetitle(bill.getHead());
-        billSubmit.setInvoiceid(bill.getId());
-        billSubmit.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
-        billSubmit.setInvoicetype(bill.getKind());
-        billSubmit.setCreateTime(new Date());
-        billSubmit.setReceiverName(bill.getName());
-        billSubmit.setRecTel(bill.getTelephone());
-        billSubmit.setStatus(Status.SUBMITTED.value());
-        billSubmit.setSubmituu(SystemSession.getUser().getUserUU());
-        billSubmit.setBillInfo(FastjsonUtils.toJson(bill));
-        if (SystemSession.getUser().getEnterprise() != null)
-            billSubmit.setSubmitEnuu(SystemSession.getUser().getEnterprise().getUu());
+        billSubmit.setBillInfo(bill);
 
         String orderIds = "";
+        String purchaseIds = "";
         Double price = 0d;
         for (int i = 0; i < orders.size(); i++) {
             if (buyerEnuu != null) {
                 Order order = orders.get(i);
                 if (buyerEnuu.equals(order.getBuyerenuu()) && buyeruu.equals(order.getBuyeruu())) {
-                    billSubmit.setSellername(order.getSellername());
-                    billSubmit.setSellerenuu(order.getSellerenuu());
-                    billSubmit.setStoreid(order.getStoreid());
                     order.setInvoicetype(bill.getKind());
-                    order.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
+                    order.setInvoiceAddress(FastjsonUtils.toJson(bill));
                     order.setInvoiceid(bill.getId());
                     order.setInvoicetitle(bill.getHead());
                     order.setVatBillStatus(Status.TOBEMAKE_BILL.value());
                     orderDao.save(order);
-                    price += order.getPrice();
+
+                    price = NumberUtil.add(order.getPrice(), price);
+
+                    List<Purchase> purchases = purchaseDao.findByOrderid(order.getOrderid());
+                    for (Purchase purchase : purchases) {
+                        if (order.getSellerenuu().longValue() != sysConf.getEnUU().longValue()) {
+                            //自营店订单
+                            purchase.setInvoicetitle(bill.getHead());
+                            purchase.setInvoicetype(bill.getKind());
+                            purchase.setInvoiceAddress(FastjsonUtils.toJson(bill));
+                            purchase.setInvoicetitle(bill.getHead());
+                            purchase.setVatBillStatus(Status.TOBEMAKE_BILL.value());
+                            purchaseDao.save(purchase);
+                        }
+                        purchaseIds += ("+" + purchase.getPurchaseid());
+                    }
                     orderIds += order.getOrderid();
                     if (i < orders.size() - 1)
                         orderIds += SplitChar.COMMA;
@@ -152,13 +170,78 @@ public class BillSubmitServiceImpl implements BillSubmitService {
 
             }
         }
-
+        billSubmit.setSellername(orders.get(0).getSellername());
+        billSubmit.setSellerenuu(orders.get(0).getSellerenuu());
+        billSubmit.setStoreid(orders.get(0).getStoreid());
         billSubmit.setPrice(price);
         billSubmit.setOrderids(orderIds);
+        billSubmit.setPurchaseids(purchaseIds);
 
         return billSubmit;
     }
 
+    // 初始化发票申请(用户发起用)
+    public List<BillSubmit> createBillSubmitByPurchase(List<Order> orders) {
+        if (CollectionUtils.isEmpty(orders)) {
+            return Collections.emptyList();
+        }
+        List<Bill> billOne = billDao.getBillByUseruuAndEnuuAndKind(sysConf.getAdminUU(), sysConf.getEnUU(),Type.Bill_Deduct.value());
+        if (CollectionUtils.isEmpty(billOne)) {
+            throw new IllegalOperatorException("商城专票信息被删除,请联系商城管理员添加");
+        }
+        // 发票基本信息
+        List<Purchase> purchaseList = new ArrayList<>();
+        for (Order order : orders) {
+            List<Purchase> purchases = purchaseDao.findByOrderid(order.getOrderid());
+            purchaseList.addAll(purchases);
+        }
+        Map<Long, List<Purchase>> map = new HashedMap();
+        for (Purchase purchase : purchaseList) {
+            //同一个卖家的汇总
+            List<Purchase> purchaseList1 = map.get(purchase.getSellerenuu());
+            if (purchaseList1 == null) {
+                purchaseList1 = new ArrayList<>();
+            }
+            purchaseList1.add(purchase);
+            map.put(purchase.getSellerenuu(), purchaseList1);
+        }
+        List<BillSubmit> list = new ArrayList<>();
+        Set<Long> longSet = map.keySet();
+        Double price = 0d;
+        String orderIds = "";
+        String purchaseIds = "";
+        for (Long enuu : longSet) {
+            List<Purchase> purchases = map.get(enuu);
+            BillSubmit billSubmit = new BillSubmit();
+            Bill bill = billOne.get(0);
+            billSubmit.setBillInfo(bill);
+            price = 0d;
+            orderIds = "";
+            purchaseIds = "";
+            for (Purchase purchase : purchases) {
+                purchase.setInvoicetitle(bill.getHead());
+                purchase.setInvoicetype(bill.getKind());
+                purchase.setInvoiceAddress(FastjsonUtils.toJson(bill));
+                purchase.setInvoicetitle(bill.getHead());
+                purchase.setVatBillStatus(Status.TOBEMAKE_BILL.value());
+                orderIds += ("," + purchase.getOrderid());
+                purchaseIds += ("," + purchase.getPurchaseid());
+                NumberUtil.add(purchase.getPrice(), price);
+            }
+            billSubmit.setSubmituu(sysConf.getAdminUU());
+            billSubmit.setSubmitEnuu(sysConf.getEnUU());
+            billSubmit.setSellername(purchases.get(0).getSellername());
+            billSubmit.setSellerenuu(purchases.get(0).getSellerenuu());
+            billSubmit.setStoreid(purchases.get(0).getStoreid());
+            billSubmit.setPrice(price);
+            billSubmit.setOrderids(orderIds.substring(1));
+            billSubmit.setPurchaseids(purchaseIds.substring(1));
+            list.add(billSubmit);
+
+        }
+        return list;
+    }
+
     @Override
     public BillSubmit saveByAdmin(Order order) {
         Bill bill = billDao.findOne(order.getInvoiceid());
@@ -167,16 +250,9 @@ public class BillSubmitServiceImpl implements BillSubmitService {
         }
 
         // 发票基本信息
+        List<BillSubmit> list = new ArrayList<>();
         BillSubmit billSubmit = new BillSubmit();
-        billSubmit.setBillInfo(FastjsonUtils.toJson(bill));
-        billSubmit.setInvoicetitle(bill.getHead());
-        billSubmit.setInvoiceid(bill.getId());
-        billSubmit.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
-        billSubmit.setInvoicetype(bill.getKind());
-        billSubmit.setCreateTime(new Date());
-        billSubmit.setReceiverName(bill.getName());
-        billSubmit.setRecTel(bill.getTelephone());
-        billSubmit.setStatus(Status.SUBMITTED.value());
+        billSubmit.setBillInfo(bill);
         billSubmit.setSubmituu(order.getBuyeruu());
         if (order.getBuyerenuu() != null)
             billSubmit.setSubmitEnuu(order.getBuyerenuu());
@@ -191,11 +267,29 @@ public class BillSubmitServiceImpl implements BillSubmitService {
         order.setInvoicetitle(bill.getHead());
         order.setVatBillStatus(Status.TOBEMAKE_BILL.value());
         orderDao.save(order);
-
+        String purchaseIds = "";
+        List<Purchase> purchases = purchaseDao.findByOrderid(order.getOrderid());
+        for (Purchase purchase : purchases) {
+            purchaseIds += purchase.getPurchaseid();
+            purchase.setInvoicetitle(bill.getHead());
+            purchase.setInvoicetype(bill.getKind());
+            purchase.setInvoiceAddress(FastjsonUtils.toJson(bill));
+            purchase.setInvoicetitle(bill.getHead());
+            purchase.setVatBillStatus(Status.TOBEMAKE_BILL.value());
+        }
+        purchaseDao.save(purchases);
+        if (order.getSellerenuu().longValue() == sysConf.getEnUU().longValue()) {
+            List<Order> orderList = new ArrayList<>();
+            orderList.add(order);
+            list.addAll(createBillSubmitByPurchase(orderList));
+        }
+        billSubmit.setPurchaseids(purchaseIds);
         billSubmit.setPrice(order.getPrice());
         billSubmit.setOrderids(order.getOrderid());
+        BillSubmit submit = billSubmitDao.save(billSubmit);
+        billSubmitDao.save(list);
 
-        return billSubmitDao.save(billSubmit);
+        return submit;
     }
 
     @Override

+ 1 - 7
src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java

@@ -12,7 +12,6 @@ import com.uas.platform.b2c.core.support.view.JxlsExcelView;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.StringUtilB2C;
 import com.uas.platform.b2c.fa.payment.model.BankTransfer;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
 import com.uas.platform.b2c.trade.inquiry.model.TradeCharge;
 import com.uas.platform.b2c.trade.order.model.Order;
 import com.uas.platform.b2c.trade.order.model.OrderDetail;
@@ -37,12 +36,7 @@ import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
 import javax.management.OperationsException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import static com.uas.platform.b2c.core.utils.StringUtilB2C.decodeValue;
 

+ 48 - 23
src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java

@@ -76,6 +76,7 @@ import com.uas.platform.b2c.trade.presale.dao.TradeBasicPropertiesDao;
 import com.uas.platform.b2c.trade.seek.service.SeekPurchaseService;
 import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.b2c.trade.util.BoundedExecutor;
 import com.uas.platform.b2c.trade.util.Preconditions;
 import com.uas.platform.b2c.trade.util.StatusChangeUtil;
 import com.uas.platform.b2c.trade.util.TradeLogUtil;
@@ -114,6 +115,8 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.*;
 import static com.uas.platform.b2c.trade.util.Preconditions.checkNotNull;
@@ -136,8 +139,7 @@ public class OrderServiceImpl implements OrderService {
     private static final long billNoNeed = -1L;
     private static final TradeBufferedLogger logger = BufferedLoggerManager
             .getLogger(TradeBufferedLogger.class);
-    @Autowired
-    private OrderDao orderDao;
+    private final OrderDao orderDao;
     @Autowired
     private OrderDetailDao orderDetailDao;
     @Autowired
@@ -215,6 +217,15 @@ public class OrderServiceImpl implements OrderService {
     @Autowired
     private MessageNotifyPersonalManagementService messageNotifyPersonalManagementService;
 
+    private final BoundedExecutor executor;
+
+    @Autowired
+    public OrderServiceImpl(OrderDao orderDao) {
+        this.orderDao = orderDao;
+        ExecutorService executorService = Executors.newCachedThreadPool();
+        executor = new BoundedExecutor(executorService, 1600);
+    }
+
     /**
      * 保存订单信息
      *
@@ -1459,21 +1470,20 @@ public class OrderServiceImpl implements OrderService {
                 purchase.setSendstatus(Status.NOT_UPLOAD.value());
                 purchaseDao.save(purchase);
 
-                // 如果买家需要开发票,则生成发票申请
-                if (Type.Bill_No.value() != newOrder.getInvoicetype().intValue()) {
-                    billSubmitService.saveByAdmin(newOrder);
-                }
-
                 //发送短信,异常不作处理
                 try {
                     sendMessage(purchase);
-                }catch (RuntimeException e){}
+                } catch (RuntimeException e){}
             } else if ((purchase.getStatus().intValue() != Status.UNAVAILABLE_DISAGREE.value())
                     && (purchase.getStatus().intValue() != Status.UNAVAILABLE_PERSONAL.value())) { // 采购单不在用户取消状态
                 throw new IllegalOperatorException("采购单" + purchase.getPurchaseid() + ", 状态是"
                         + Status.valueOf(purchase.getStatus()).getPhrase() + ",是异常状态");
             }
         }
+        // 如果买家需要开发票,则生成发票申请
+        if (Type.Bill_No.value() != newOrder.getInvoicetype().intValue()) {
+            billSubmitService.saveByAdmin(newOrder);
+        }
         return newOrder;
     }
 
@@ -1484,15 +1494,14 @@ public class OrderServiceImpl implements OrderService {
      * @throws RuntimeException the runtime exception
      */
 	@Override
-	public void sendMessage(Purchase purchase) throws RuntimeException{
+	public void sendMessage(final Purchase purchase) throws RuntimeException {
         if (purchase == null) {
             return;
         }
         /*-------------发送短信给卖方企业----------------*/
-        int sum = 0;
         try {
             //获取502,406状态下的该卖家采购单总量
-            sum = purchaseDao.getCountBySellerenuuAndStatus(purchase.getSellerenuu(), Status.CONFIRMED.value()) +
+            final int sum = purchaseDao.getCountBySellerenuuAndStatus(purchase.getSellerenuu(), Status.CONFIRMED.value()) +
                     purchaseDao.getCountBySellerenuuAndStatus(purchase.getSellerenuu(), Status.TOBESHIPPED.value());
 
 		/*   暂时取企业管理员的电话信息,这是商品上架人的信息
@@ -1509,15 +1518,27 @@ public class OrderServiceImpl implements OrderService {
             if (en.getEnAdminuu() == null) {
                 return;
             }
-            User admin = userDao.findOne(en.getEnAdminuu());
+            List<User> userList = userDao.findUserByUserUU(en.getEnAdminuu());
+            if (CollectionUtils.isEmpty(userList)) {
+                return ;
+            }
+            final User admin = userList.get(0);
             if (admin == null || admin.getUserTel() == null || purchase.getSellername() == null) {
                 return;
             }
-            sendMessageService.sendMessageForOrderSucess(purchase.getSellername(), sum,
-                    admin.getUserTel(), MessageType.orderpay);
+            executor.submitTask(new Runnable() {
+                @Override
+                public void run() {
+                    sendMessageService.sendMessageForOrderSucess(purchase.getSellername(), sum,
+                            admin.getUserTel(), MessageType.orderpay);
+                }
+            });
+
 		/*--------------------------------------------*/
-        }catch (RuntimeException e){
+        }catch (RuntimeException e) {
             throw e;
+        }catch (InterruptedException e) {
+            e.printStackTrace();
         }
     }
 
@@ -1696,15 +1717,19 @@ public class OrderServiceImpl implements OrderService {
                     orderDetail.setWeight(component.getWeight());
                 }
             } else {
-                GoodsHistory goodsHistory = goodsHisDao.findByBatchCode(orderDetail.getBatchCode()).get(0);
-                orderDetail.setReserve(goodsHistory.getReserve());
-                Component component = null;
-                if (goodsHistory.getUuid() != null){
-                    component = componentService.findByUuid(goodsHistory.getUuid());
-                }
-                if (component != null){
-                    orderDetail.setWeight(component.getWeight());
+                List<GoodsHistory> goodsHistories = goodsHisDao.findByBatchCode(orderDetail.getBatchCode());
+                if (!CollectionUtils.isEmpty(goodsHistories)) {
+                    GoodsHistory goodsHistory = goodsHistories.get(0);
+                    orderDetail.setReserve(goodsHistory.getReserve());
+                    Component component = null;
+                    if (goodsHistory.getUuid() != null){
+                        component = componentService.findByUuid(goodsHistory.getUuid());
+                    }
+                    if (component != null){
+                        orderDetail.setWeight(component.getWeight());
+                    }
                 }
+
             }
 
         }

+ 28 - 0
src/main/webapp/resources/css/pay.css

@@ -167,6 +167,34 @@
     margin: 0 auto;
     display: inline-block;
     padding-right: 14px;
+    position:relative;
+}
+.down-payment .pay-price .aside_info{
+    position:absolute;
+    bottom:-50px;
+    left:20px;
+    width:600px;
+}
+.down-payment .pay-price .aside_info p{
+    font-size: 16px;
+    color:#1da902;
+    line-height: 26px;
+    margin-bottom:10px;
+}
+.down-payment .pay-price .aside_info p a{
+    background: #5078cb;
+    color: #fff;
+    width: 70px;
+    height: 30px;
+    display: inline-block;
+    text-align: center;
+    line-height: 30px;
+    font-size: 14px;
+    margin: 0 5px;
+}
+.down-payment .pay-price .aside_info p small{
+    color:#666;
+    margin-left:20px;
 }
 .down-payment .pay-price div.row{
     font-size: 16px;

+ 13 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_invoice_ctrl.js

@@ -237,8 +237,21 @@ define(['app/app'], function(app) {
             this.form.$setPristine();
             this.form.$setUntouched();
         }
+        function _deepCopy(target) {
+            if (typeof target !== 'object') return
+            // 判断目标类型,来创建返回值
+            var newObj = target instanceof Array ? [] : {}
+            for (var item in target) {
+                // 只复制元素自身的属性,不复制原型链上的
+                if (target.hasOwnProperty(item)) {
+                    newObj[item] = typeof target[item] === 'object' ? _deepCopy(target[item]) : target[item]
+                }
+            }
+            return newObj
+        }
         //修改发票
         $scope.modifyInvoice = function (invoice) {
+            invoice = _deepCopy(invoice)
             $scope.changeBillStatusFlag = true;
             $scope.isAdd = false;
             $scope.billType = invoice.kind

+ 97 - 93
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -600,99 +600,103 @@ define(['app/app'], function(app) {
 		//确认付款
 		$scope.imperfect = false;//暂不完善
 		$scope.confirmPay = function() {
-            // 安全级别
-            if (!$scope.userInfo.pwdEnable || !$scope.userInfo.haveUserQuestion||!$scope.userInfo.emailValidCode || $scope.userInfo.emailValidCode != 2) {
-                $scope.openHomeCenterModel();
-            } else {
-                if($scope.order.status == 502 || $scope.order.status == 503) {
-                    var arr = [];
-                    if($scope.order.orderids) {
-                        arr = $scope.order.orderids.split(",");
-                    }else {
-                        arr.push($scope.order.orderid);
-                    }
-                    if ($scope.order.currency == 'RMB' && $scope.order.paytype == '1102') {
-                        paymentEnsure(arr);
-                    } else if($scope.order.paytype == '1103') {
-                        $state.go('order_transfer', {orderid : enIdFilter(arr.join("-"))});
-                    }else {
-                        toaster.pop('info', '美元请线下付款');
-                    }
-                    return ;
-                }
-                var validRule = checkRule();
-                if (!validRule){
-                    toaster.pop("info", "当前地址部分卖家无法配送,请重新选择地址或与卖家协商处理");
-                    return ;
-                }
-                var validTakeSelf = checkTakeSelf();
-                if (!validTakeSelf){
-                    toaster.pop("info", "请选择一个自提点");
-                    return ;
-                }
-                var orderInfos = [], orderInfo;
-                orderInfo = generateOrderInfo();
-                if(orderInfo == null) {
-                    return ;
-                }
-                orderInfos.push(orderInfo);
-                if(!$scope.imperfect){
-                    var validBill = checkBill();
-                    if (!validBill){
-                        // toaster.pop('info', '请完善专票信息');
-                        $scope.showBillFrame = true;
-                        return ;
-                    }
-                }
-
-                Order.ensure({orderid: enIdFilter($scope.order.orderid)}, orderInfos, function(data){
-                    if(data.code == 1) {
-                        if (data.data && data.data[0]) {
-                            var arr = [];
-                            var batchCodes = [];
-                            for(var i = 0; i < data.data.length; i++) {
-                                arr.push(data.data[i].orderid);
-                                for(var j = 0; j < data.data[i].orderDetails.length; j++) {
-                                    batchCodes.push(data.data[i].orderDetails[j].batchCode);
-                                }
-                            }
-                            if(!$scope.order.buyNow) {
-                                Cart.deleteByBatchCode({}, batchCodes, function(data) {
-                                }, function(response) {
-                                });
-                            }
-                            if ($scope.order.currency == 'RMB' && $scope.order.paytype == '1102') {
-                                paymentEnsure(arr);
-                            } else if($scope.order.paytype == '1103') {
-                                console.log(arr.length)
-                                if(arr.length != 1){
-                                    $state.go('downPayment', {orderid : enIdFilter(arr.join('-'))});
-                                }else {
-                                    $state.go('order_transfer', {orderid : enIdFilter(arr.join('-'))});
-                                }
-                            }else {
-                                toaster.pop('info', '美元请线下付款');
-                                $state.go('buyer_order');
-                            }
-
-                        }
-                    }else {
-                        if(data.code == 6) { //产品信息有更新
-                            toaster.pop('warning', data.message + ",请刷新界面之后重新操作");
-                        }else if(data.code == 7){
-                            toaster.pop('warning', data.message + ",将为您跳转到购物车界面");
-                            $timeout(function () {
-                                $state.go('buyer_cart');
-                            }, 1000);
-                        }else {
-                            toaster.pop('warning', data.message);
-                        }
-                    }
-
-                }, function(response) {
-                    toaster.pop('error', '确认订单失败,' + response.data);
-                });
-            }
+			if ($scope.userInfo) {
+				// 安全级别
+				if (!$scope.userInfo.pwdEnable || !$scope.userInfo.haveUserQuestion||!$scope.userInfo.emailValidCode || $scope.userInfo.emailValidCode != 2) {
+					$scope.openHomeCenterModel();
+				} else {
+					if($scope.order.status == 502 || $scope.order.status == 503) {
+						var arr = [];
+						if($scope.order.orderids) {
+							arr = $scope.order.orderids.split(",");
+						}else {
+							arr.push($scope.order.orderid);
+						}
+						if ($scope.order.currency == 'RMB' && $scope.order.paytype == '1102') {
+							paymentEnsure(arr);
+						} else if($scope.order.paytype == '1103') {
+							$state.go('order_transfer', {orderid : enIdFilter(arr.join("-"))});
+						}else {
+							toaster.pop('info', '美元请线下付款');
+						}
+						return ;
+					}
+					var validRule = checkRule();
+					if (!validRule){
+						toaster.pop("info", "当前地址部分卖家无法配送,请重新选择地址或与卖家协商处理");
+						return ;
+					}
+					var validTakeSelf = checkTakeSelf();
+					if (!validTakeSelf){
+						toaster.pop("info", "请选择一个自提点");
+						return ;
+					}
+					var orderInfos = [], orderInfo;
+					orderInfo = generateOrderInfo();
+					if(orderInfo == null) {
+						return ;
+					}
+					orderInfos.push(orderInfo);
+					if(!$scope.imperfect){
+						var validBill = checkBill();
+						if (!validBill){
+							// toaster.pop('info', '请完善专票信息');
+							$scope.showBillFrame = true;
+							return ;
+						}
+					}
+
+					Order.ensure({orderid: enIdFilter($scope.order.orderid)}, orderInfos, function(data){
+						if(data.code == 1) {
+							if (data.data && data.data[0]) {
+								var arr = [];
+								var batchCodes = [];
+								for(var i = 0; i < data.data.length; i++) {
+									arr.push(data.data[i].orderid);
+									for(var j = 0; j < data.data[i].orderDetails.length; j++) {
+										batchCodes.push(data.data[i].orderDetails[j].batchCode);
+									}
+								}
+								if(!$scope.order.buyNow) {
+									Cart.deleteByBatchCode({}, batchCodes, function(data) {
+									}, function(response) {
+									});
+								}
+								if ($scope.order.currency == 'RMB' && $scope.order.paytype == '1102') {
+									paymentEnsure(arr);
+								} else if($scope.order.paytype == '1103') {
+									console.log(arr.length)
+									if(arr.length != 1){
+										$state.go('downPayment', {orderid : enIdFilter(arr.join('-'))});
+									}else {
+										$state.go('order_transfer', {orderid : enIdFilter(arr.join('-'))});
+									}
+								}else {
+									toaster.pop('info', '美元请线下付款');
+									$state.go('buyer_order');
+								}
+
+							}
+						}else {
+							if(data.code == 6) { //产品信息有更新
+								toaster.pop('warning', data.message + ",请刷新界面之后重新操作");
+							}else if(data.code == 7){
+								toaster.pop('warning', data.message + ",将为您跳转到购物车界面");
+								$timeout(function () {
+									$state.go('buyer_cart');
+								}, 1000);
+							}else {
+								toaster.pop('warning', data.message);
+							}
+						}
+
+					}, function(response) {
+						toaster.pop('error', '确认订单失败,' + response.data);
+					});
+				}
+			} else {
+				toaster.pop('error', '未获取到登录信息,请刷新页面后重试');
+			}
 		};
 
 		// 跳银盛支付页面

+ 5 - 5
src/main/webapp/resources/js/vendor/app.js

@@ -703,11 +703,11 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 				});
 				$rootScope.userInfo = data;
 				if ($location.$$path === '/index') {
-					if ($rootScope.applyStatus === 'NONE') {
-						$state.go('vendor_store_apply');
-					} else if ($rootScope.applyStatus === 'PASS') {
-						$state.go('vendor_store_maintain');
-					}
+					// if ($rootScope.applyStatus === 'NONE') {
+					// 	$state.go('vendor_store_apply');
+					// } else if ($rootScope.applyStatus === 'PASS') {
+						$state.go('vendorSeekPurchase');
+					// }
 				}
                 // 是否pcb
                 StoreInfo.isPcb({enuu: $rootScope.userInfo.enterprise.uu}, function (res) {

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html

@@ -502,8 +502,8 @@
     <div class="ticket_record oder">
         <div class="oder01">
             <ul ng-class="{'active': changeBillStatusFlag}">
-                <li ng-class="{'active': tab == 'buyer_invoice' && !changeBillStatusFlag}"><a ng-click="changeBillStatusFlag = false" ui-sref="buyer_invoice">票信息</a></li>
-                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">未开票</a></li>
+                <li ng-class="{'active': tab == 'buyer_invoice' && !changeBillStatusFlag}"><a ng-click="changeBillStatusFlag = false" ui-sref="buyer_invoice">票信息</a></li>
+                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">待开票信息</a></li>
                 <li ng-class="{'active': tab == 'buyer_invoice-record'}"><a ui-sref="buyer_invoice-record">开票记录</a></li>
             </ul>
         </div>

+ 25 - 18
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice_record.html

@@ -17,6 +17,7 @@
         border: #dae5fd 1px solid;
         border-bottom: none;
         margin-bottom: 0!important;
+        table-layout: fixed;
     }
     .invoice-com-tab thead{
         height: 40px;
@@ -42,6 +43,9 @@
         height: 50px;
         vertical-align: middle;
         text-align: center;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
     }
     .invoice-com-tab tbody>tr>td a.invoice-detail{
         display: block;
@@ -169,8 +173,8 @@
     <div class="ticket_record oder">
         <div class="oder01">
             <ul>
-                <li ng-class="{'active': tab == 'buyer_invoice'}"><a ui-sref="buyer_invoice">票信息</a></li>
-                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">未开票</a></li>
+                <li ng-class="{'active': tab == 'buyer_invoice'}"><a ui-sref="buyer_invoice">票信息</a></li>
+                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">待开票订单</a></li>
                 <li ng-class="{'active': tab == 'buyer_invoice-record'}"><a ui-sref="buyer_invoice-record">开票记录</a></li>
             </ul>
         </div>
@@ -186,21 +190,21 @@
                 <table class="invoice-com-tab table" ng-table="billRecordTableParam">
                     <thead>
                         <tr>
-                            <th width="88">申请时间</th>
-                            <th width="130">商家名称</th>
-                            <th width="80">订单号</th>
-                            <th width="105">可开票金额(¥)</th>
-                            <th width="55" class="select-line">
+                            <th width="100">申请时间</th>
+                            <th width="140">商家名称</th>
+                            <th width="190">订单号</th>
+                            <th width="120">可开票金额(¥)</th>
+                            <th width="60" class="select-line">
                                 <select class="select-adder form-control" ng-model="invoiceType" ng-change="changeInvoiceType(invoiceType)">
                                     <option value="">类型</option>
                                     <option value="1206">普票</option>
                                     <option value="1205">专票</option>
                                 </select>
                             </th>
-                            <th width="100">发票抬头</th>
-                            <th width="50">收票人</th>
-                            <th width="55">联系电话</th>
-                            <th width="55">
+                            <th width="115">发票抬头</th>
+                            <th width="65">收票人</th>
+                            <th width="120">联系电话</th>
+                            <th width="90">
                                 <select class="select-adder form-control" style="width: 60px;" ng-model="status" ng-change="changeStatus(status)">
                                     <option value="">状态</option>
                                     <option value="101">待开票</option>
@@ -211,19 +215,22 @@
                     </thead>
                     <tbody>
                         <tr ng-repeat="item in billData">
-                            <td ng-bind="item.createTime | date : 'yyyy-MM-dd'"></td>
-                            <td><a ng-href="{{'store/' + item.storeid}}" ng-bind="item.sellername" target="_blank"></a></td>
+                            <td ng-bind="item.createTime | date : 'yyyy-MM-dd'" title="{{item.createTime | date : 'yyyy-MM-dd'}}"></td>
+                            <td><a ng-href="{{'store/' + item.storeid}}" ng-bind="item.sellername" target="_blank" title="{{item.sellername}}"></a></td>
                             <td>
-                                <a ng-href="user#/order/detail/{{orderid | EncryptionFilter}}" ng-repeat="orderid in item.orderids.split(',')" ng-bind="orderid" target="_blank" class="invoice-detail"></a>
+                                <a ng-href="user#/order/detail/{{orderid | EncryptionFilter}}"
+                                   ng-repeat="orderid in item.orderids.split(',')"
+                                   ng-bind="orderid"
+                                   title='{{orderid}}' target="_blank" class="invoice-detail"></a>
                             </td>
-                            <td ng-bind="item.price"></td>
+                            <td ng-bind="item.price" title="{{item.price}}"></td>
                             <td style="padding: 0;">
                                 <span ng-bind="item.invoicetype==1206?'普票':'专票'"></span>
                                 <b ng-click="lookInvoiceInfo(item)" class="invoice-info">开票信息</b>
                             </td>
-                            <td ng-bind="item.invoicetitle"></td>
-                            <td ng-bind="item.receiverName"></td>
-                            <td ng-bind="item.recTel"></td>
+                            <td ng-bind="item.invoicetitle" title="{{item.invoicetitle}}"></td>
+                            <td ng-bind="item.receiverName" title="{{item.receiverName}}"></td>
+                            <td ng-bind="item.recTel" title="{{item.recTel}}"></td>
                             <td>
                                 <span ng-bind="item.status==101?'待开票':'已开票'" ng-class="{'blue':item.status==101}"></span>
                             </td>

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/buyer_no_invoice.html

@@ -215,8 +215,8 @@ body div.ng-table-pager a.page-a {
     <div class="ticket_record oder">
         <div class="oder01">
             <ul>
-                <li ng-class="{'active': tab == 'buyer_invoice'}"><a ui-sref="buyer_invoice">票信息</a></li>
-                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">未开票</a></li>
+                <li ng-class="{'active': tab == 'buyer_invoice'}"><a ui-sref="buyer_invoice">票信息</a></li>
+                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">待开票订单</a></li>
                 <li ng-class="{'active': tab == 'buyer_invoice-record'}"><a ui-sref="buyer_invoice-record">开票记录</a></li>
             </ul>
         </div>

+ 5 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

@@ -15,6 +15,9 @@
 
 	.oder .oder_list dl span.wd03{
 		width: 12%;
+		white-space: nowrap;
+		overflow: hidden;
+		text-overflow: ellipsis;
 	}
 	.oder .oder_list dl span{
 		width: 16%;
@@ -912,7 +915,8 @@
 									类目:<a href="product/kind/{{::detail.kindUuid}}" target="_blank" ng-if="detail.uuid"><em ng-bind="::detail.kiName || '-'" title="{{::detail.kiName}}"></em></a><br ng-if="detail.uuid"/>
 									<a class="unstand" ng-if="!detail.uuid"><em ng-bind="detail.kiName || '-'" title="{{::detail.kiName}}"></em></a><br ng-if="!detail.uuid"/>
 									型号:<a href="store/productDetail/{{::detail.batchCode}}" target="_blank"><em ng-bind="::detail.cmpCode || '-'" title="{{::detail.cmpCode}}"></em></a>
-									<a  class="unstand" ng-if="!detail.uuid"><em ng-bind="detail.brName || '-'" title="{{::detail.brName}}"></em></a><br/>
+									<br/>
+									<!--<a  class="unstand" ng-if="!detail.uuid"><em ng-bind="detail.brName || '-'" title="{{::detail.brName}}"></em></a><br/>-->
 									规格:<a><em ng-bind="::detail.spec || '-'" title="{{::detail.spec}}"></em></a><br/>
 								</p>
 							</div>

+ 8 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_transfer.html

@@ -75,7 +75,7 @@
 					</li>
 				</ul>
 			</div>
-			<div class="common-title margin-top-8">水单扫描件</div>
+			<div class="common-title margin-top-8">付款水单扫描件</div>
 			<div class="payment-upload-list" ng-if="type == 'PAIDTOVENDOR' && yesPayinstallmentDetails.length > 0">
 				<div class="item" ng-repeat="installmentImg in yesPayinstallmentDetails">
 					<div class="img-list">
@@ -174,6 +174,13 @@
 					<a ng-click="loadPage()" class="off">取消</a>
 				</div>
 			</div>
+			<div class="aside_info">
+				<p>
+					<img src="static/img/user/bulb.png">
+					若需卖家调整价格,请先和卖家联系后请点击<a href="user#/order">待改价</a>按钮。
+				</p>
+				<p><small>(卖家调整价格完成后,您可以在【买家中心-采购订单】继续完成订单付款)</small></p>
+			</div>
 		</div>
 	</div>
 </div>

+ 9 - 7
src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html

@@ -61,11 +61,11 @@
         text-align: center;
     }
     .invoice-com-tab tbody>tr>td a.link-order{
-        cursor: default;
         display: block;
+        cursor: pointer;
     }
     .invoice-com-tab tbody>tr>td:hover a.link-order{
-        color: #666;
+        color: #5078cb;
     }
     .invoice-com-tab tbody>tr:hover>td b.invoice-info{
         display: block;
@@ -304,7 +304,7 @@
     <div class="count_center">
         <div class="com_tab">
             <ul class="fl">
-                <li ng-class="{'active': active == 'apply_invoice'}" ng-click="toggleTab('apply_invoice')"><a>开票申请</a></li>
+                <li ng-class="{'active': active == 'apply_invoice'}" ng-click="toggleTab('apply_invoice')"><a>买家开票申请</a></li>
                 <li ng-class="{'active': active == 'apply_record'}" ng-click="toggleTab('apply_record')"><a>开票记录</a></li>
             </ul>
         </div>
@@ -359,8 +359,9 @@
                         </td>
                         <td ng-bind="item.createTime | date : 'yyyy-MM-dd'"></td>
                         <td>
-                            <!--<a ng-href="vendor#/purchase/detail/{{orderid | EncryptionFilter}}" ng-repeat="orderid in item.orderids.split(',')" ng-bind="orderid"></a>-->
-                            <a ng-repeat="orderid in item.orderids.split(',')" ng-bind="orderid" class="link-order"></a>
+                             <span ng-repeat="(col, orderid) in item.orderids.split(',')">
+                            <a ng-href="vendor#/purchase/detail/{{item.purchaseids.split(',')[col] | EncryptionFilter}}" ng-bind="orderid" target="_blank" class="link-order"></a>
+                        </span>
                         </td>
                         <td ng-bind="item.price"></td>
                         <td style="padding: 0;">
@@ -424,8 +425,9 @@
                 <tr ng-repeat="item in billData track by $index">
                     <td ng-bind="item.createTime | date : 'yyyy-MM-dd'"></td>
                     <td>
-                        <!--<a ng-href="vendor#/purchase/detail/{{orderid | EncryptionFilter}}" ng-repeat="orderid in item.orderids.split(',')" ng-bind="orderid" target="_blank"></a>-->
-                        <a ng-repeat="orderid in item.orderids.split(',')" ng-bind="orderid" class="link-order"></a>
+                        <span ng-repeat="(col, orderid) in item.orderids.split(',')">
+                            <a ng-href="vendor#/purchase/detail/{{item.purchaseids.split(',')[col] | EncryptionFilter}}" ng-bind="orderid" target="_blank" class="link-order"></a>
+                        </span>
                     </td>
                     <td ng-bind="item.price"></td>
                     <td style="padding: 0;">

+ 6 - 4
src/main/webapp/resources/view/vendor/modal/invoice_look_modal.html

@@ -59,9 +59,9 @@
   .modal-body .item-list:first-child a:hover {
     color: #5078cb;
   }
-  .modal-body .item-list:first-child a.noOrder:hover{
-    color: #333;
-  }
+  /*.modal-body .item-list:first-child a.noOrder:hover{*/
+    /*color: #333;*/
+  /*}*/
   .modal-body .item-list:first-child a:nth-child(odd){
     margin-right: 22px;
   }
@@ -110,7 +110,9 @@
     <span>订单号:</span>
     <span>
       <a ng-if="isUserCenter" ng-href="user#/order/detail/{{orderid | EncryptionFilter}}" ng-repeat="orderid in chooseInvoice.orderids.split(',')" ng-bind="orderid || '-'" target="_blank">965666768973953454654</a>
-      <a ng-if="!isUserCenter" ng-repeat="orderid in chooseInvoice.orderids.split(',')" ng-bind="orderid || '-'" style="cursor: default;" class="noOrder">965666768973953454654</a>
+       <span ng-repeat="(col, orderid) in chooseInvoice.orderids.split(',')">
+         <a ng-href="vendor#/purchase/detail/{{chooseInvoice.purchaseids.split(',')[col] | EncryptionFilter}}" ng-bind="orderid" target="_blank" class="link-order"></a>
+       </span>
     </span>
   </div>
   <div class="item-list">