Procházet zdrojové kódy

Merge branch 'feature_installment_v1' into dev-mysql

wangyc před 8 roky
rodič
revize
ad64d35ac0
59 změnil soubory, kde provedl 5186 přidání a 806 odebrání
  1. 10 0
      src/main/java/com/uas/platform/b2c/common/base/service/SendMessageService.java
  2. 11 1
      src/main/java/com/uas/platform/b2c/common/base/service/impl/SendMessageServiceImpl.java
  3. 12 0
      src/main/java/com/uas/platform/b2c/core/constant/Status.java
  4. 10 0
      src/main/java/com/uas/platform/b2c/core/constant/Type.java
  5. 1 1
      src/main/java/com/uas/platform/b2c/external/erp/order/api/PurchaseController.java
  6. 14 0
      src/main/java/com/uas/platform/b2c/fa/payment/controller/BankInfoController.java
  7. 71 0
      src/main/java/com/uas/platform/b2c/fa/payment/controller/InstallmentController.java
  8. 71 0
      src/main/java/com/uas/platform/b2c/fa/payment/controller/InstallmentStoreController.java
  9. 29 0
      src/main/java/com/uas/platform/b2c/fa/payment/dao/InstallmentDao.java
  10. 36 0
      src/main/java/com/uas/platform/b2c/fa/payment/dao/InstallmentDetailDao.java
  11. 32 0
      src/main/java/com/uas/platform/b2c/fa/payment/dao/InstallmentStoreDao.java
  12. 43 1
      src/main/java/com/uas/platform/b2c/fa/payment/model/BankTransfer.java
  13. 156 0
      src/main/java/com/uas/platform/b2c/fa/payment/model/Installment.java
  14. 175 0
      src/main/java/com/uas/platform/b2c/fa/payment/model/InstallmentDetail.java
  15. 116 0
      src/main/java/com/uas/platform/b2c/fa/payment/model/InstallmentStore.java
  16. 57 0
      src/main/java/com/uas/platform/b2c/fa/payment/service/InstallmentService.java
  17. 46 0
      src/main/java/com/uas/platform/b2c/fa/payment/service/InstallmentStoreService.java
  18. 0 1
      src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankInfoServiceImpl.java
  19. 109 22
      src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankTransferServiceImpl.java
  20. 365 0
      src/main/java/com/uas/platform/b2c/fa/payment/service/impl/InstallmentServiceImpl.java
  21. 98 0
      src/main/java/com/uas/platform/b2c/fa/payment/service/impl/InstallmentStoreServiceImpl.java
  22. 22 0
      src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java
  23. 15 2
      src/main/java/com/uas/platform/b2c/trade/order/controller/PurchaseController.java
  24. 47 0
      src/main/java/com/uas/platform/b2c/trade/order/model/Order.java
  25. 18 0
      src/main/java/com/uas/platform/b2c/trade/order/model/OrderDetail.java
  26. 49 1
      src/main/java/com/uas/platform/b2c/trade/order/model/Purchase.java
  27. 18 0
      src/main/java/com/uas/platform/b2c/trade/order/model/PurchaseDetail.java
  28. 22 0
      src/main/java/com/uas/platform/b2c/trade/order/service/OrderService.java
  29. 13 3
      src/main/java/com/uas/platform/b2c/trade/order/service/PurchaseService.java
  30. 134 9
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java
  31. 283 32
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseServiceImpl.java
  32. 555 0
      src/main/webapp/resources/css/pay.css
  33. binární
      src/main/webapp/resources/img/icon/icon-no.png
  34. binární
      src/main/webapp/resources/img/icon/icon-xiala.png
  35. binární
      src/main/webapp/resources/img/icon/icon-yes.png
  36. binární
      src/main/webapp/resources/img/icon/img.png
  37. binární
      src/main/webapp/resources/img/icon/nummber-bg.png
  38. binární
      src/main/webapp/resources/img/icon/pay-ok-icon.png
  39. binární
      src/main/webapp/resources/img/icon/payment-add.png
  40. binární
      src/main/webapp/resources/img/icon/payment-upload.png
  41. 9 0
      src/main/webapp/resources/js/common/query/bankInfo.js
  42. 27 0
      src/main/webapp/resources/js/common/query/installments.js
  43. 12 1
      src/main/webapp/resources/js/common/query/order.js
  44. 10 0
      src/main/webapp/resources/js/common/query/purchase.js
  45. 6 0
      src/main/webapp/resources/js/usercenter/app.js
  46. 144 0
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_down_payment_ctrl.js
  47. 60 2
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_order_ctrl.js
  48. 393 119
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_transfer_ctrl.js
  49. 6 1
      src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js
  50. 2 2
      src/main/webapp/resources/js/vendor/app.js
  51. 285 10
      src/main/webapp/resources/js/vendor/controllers/forstore/purchase_detail.js
  52. 192 3
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js
  53. 1 1
      src/main/webapp/resources/view/admin/trade/trade_order.html
  54. 45 0
      src/main/webapp/resources/view/usercenter/forstore/buyer_down_payment.html
  55. 228 7
      src/main/webapp/resources/view/usercenter/forstore/buyer_order.html
  56. 278 580
      src/main/webapp/resources/view/usercenter/forstore/buyer_transfer.html
  57. 385 4
      src/main/webapp/resources/view/vendor/forstore/purchase_detail.html
  58. 370 3
      src/main/webapp/resources/view/vendor/forstore/vendor_order.html
  59. 95 0
      src/main/webapp/resources/view/vendor/modal/cancelOrder_modal.html

+ 10 - 0
src/main/java/com/uas/platform/b2c/common/base/service/SendMessageService.java

@@ -27,4 +27,14 @@ public interface SendMessageService {
 	 * @param type 消息类型
 	 */
 	public void sendMessageForOrderSucess(String sellername, int num, String userPhone, MessageType type);
+
+	/**
+	 * 分期付款后发送信息给卖家
+	 * @param enName 卖家企业名称
+	 * @param uuName 买家姓名
+	 * @param amount 付款金额
+	 * @param userPhone 发送手机号
+	 * @param type 消息类型
+	 */
+	public void sendMessageForInstallmentPay(String enName, String uuName, Double amount, String userPhone, MessageType type);
 }

+ 11 - 1
src/main/java/com/uas/platform/b2c/common/base/service/impl/SendMessageServiceImpl.java

@@ -58,5 +58,15 @@ public class SendMessageServiceImpl implements SendMessageService {
 		}
 	}
 
-
+	@Override
+	public void sendMessageForInstallmentPay(String enName, String uuName, Double amount, String userPhone, MessageType type) {
+		try {
+			Set<String> userPhones = new HashSet<>();
+			userPhones.add(userPhone);
+			Object[] obj = {enName, uuName, amount};
+			smsService.sendAll("154fa7d4-adef-4318-80a4-60389a43ecaf",userPhones,obj);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
 }

+ 12 - 0
src/main/java/com/uas/platform/b2c/core/constant/Status.java

@@ -179,6 +179,18 @@ public enum Status {
 	 * {@code 503 待付款}
 	 */
 	TOBEPAID(503, "待付款"),
+	/**
+	 * {@code 525 卖家取消申请待确认}
+	 */
+	CANCELTOBECONFIRMED(525, "卖家取消申请待确认"),
+	/**
+	 * {@code 524 待继续分期付款}
+	 */
+	TOBEPAIDAGAGIN(524, "待继续分期付款"),
+	/**
+	 * {@code 523 付款中}
+	 */
+	PAIDING(523, "付款中"),
 	/**
 	 * {@code 504 已付款}
 	 */

+ 10 - 0
src/main/java/com/uas/platform/b2c/core/constant/Type.java

@@ -251,6 +251,16 @@ public enum Type {
 	 */
 	ENTERPRISING(1602, "ENTERPRISING"),
 
+	/**
+	 * 付款给平台
+	 */
+	PAIDTOPLATFORM(1603, "PAIDTOPLATFORM"),
+
+	/**
+	 * 付款给卖家
+	 */
+	PAIDTOVENDOR(1604, "PAIDTOVENDOR"),
+
 	/**
 	 * {@code 1666 企业入库 <b>企业入库</b>}
 	 */

+ 1 - 1
src/main/java/com/uas/platform/b2c/external/erp/order/api/PurchaseController.java

@@ -229,7 +229,7 @@ public class PurchaseController {
      */
     @RequestMapping(value = "/{id}/ensurePaid", method = RequestMethod.PUT)
 	public Purchase ensurePaid(@PathVariable Long id) {
-		return purchaseService.ensurePaid(id);
+		return purchaseService.ensurePaid(id, null);
 	}
 
     /**

+ 14 - 0
src/main/java/com/uas/platform/b2c/fa/payment/controller/BankInfoController.java

@@ -99,6 +99,20 @@ public class BankInfoController {
 		return bankInfoService.getEnterpriseBankInfoContainsStatus(Type.SUP.value(), Status.ALLOW.value());
 	}
 
+	/**
+	 * 获取供应商审核通过的信息
+	 * 2016年3月15日 下午5:16:00
+	 *
+	 * @return list
+	 * @author yujia
+	 */
+	@RequestMapping(value="/sale/enterprise/{enuu}", method=RequestMethod.GET, params = {"type=sup", "status=104"})
+	@ApiOperation(value = "获取供应商审核通过的信息", httpMethod = "GET")
+	public List<BankInfo> getSaleBankInfoAudit(@PathVariable("enuu") Long enuu) {
+		logger.log("银行账户信息", "获取供应商银行账户信息");
+		return bankInfoService.getEnterpriseBankInfoContainsStatus(Type.SUP.value(), Status.ALLOW.value(), enuu);
+	}
+
 	/**
 	 * 获取供应商账户信息
 	 * 2016年3月15日 下午5:16:00

+ 71 - 0
src/main/java/com/uas/platform/b2c/fa/payment/controller/InstallmentController.java

@@ -0,0 +1,71 @@
+package com.uas.platform.b2c.fa.payment.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.uas.platform.b2c.core.utils.FastjsonUtils;
+import com.uas.platform.b2c.fa.payment.model.Installment;
+import com.uas.platform.b2c.fa.payment.service.InstallmentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 分期消息controller
+ * @author wangyc
+ *
+ * @version 2017/9/7 8:56 wangyc
+ */
+@RestController
+@RequestMapping(value = "/trade/installments")
+public class InstallmentController {
+
+    private final InstallmentService installmentService;
+
+    @Autowired
+    public InstallmentController(InstallmentService installmentService) {
+        this.installmentService = installmentService;
+    }
+
+    /**
+     * 新增分期信息
+     * @param json 分期信息及采购单号
+     * @return
+     */
+    @RequestMapping(method = RequestMethod.POST)
+    public Installment createInstallment(@RequestBody String json) {
+        JSONObject jsonObject = FastjsonUtils.fromJson(json, JSONObject.class);
+        Installment installment = FastjsonUtils.fromJson(jsonObject.get("installment").toString(), Installment.class);
+        Long purchaseId = jsonObject.getLong("purchaseId");
+        return installmentService.createInstallment(installment, purchaseId);
+    }
+
+    /**
+     * 更新分期信息
+     * @param json 分期信息及采购单号
+     * @return
+     */
+    @RequestMapping(method = RequestMethod.PUT)
+    public Installment updateInstallment(@RequestBody String json) {
+        JSONObject jsonObject = FastjsonUtils.fromJson(json, JSONObject.class);
+        Installment installment = FastjsonUtils.fromJson(jsonObject.get("installment").toString(), Installment.class);
+        Long purchaseId = jsonObject.getLong("purchaseId");
+        return installmentService.updateInstallment(installment, purchaseId);
+    }
+
+    /**
+     * 删除分期信息
+     * @param purchaseId 采购单id
+     */
+    @RequestMapping(value = "/{purchaseId}", method = RequestMethod.DELETE)
+    public void deleteInstallment(@PathVariable("purchaseId") Long purchaseId) {
+        installmentService.deleteInstallment(purchaseId);
+    }
+
+    /**
+     * 验证是否能启用分期信息
+     * @param purchaseId 采购单id
+     * @return
+     */
+    @RequestMapping(value = "/{purchaseId}/validate", method = RequestMethod.GET)
+    public String validateEnableInstallment(@PathVariable("purchaseId") Long purchaseId) {
+        return installmentService.validationEnableInstallment(purchaseId);
+    }
+}

+ 71 - 0
src/main/java/com/uas/platform/b2c/fa/payment/controller/InstallmentStoreController.java

@@ -0,0 +1,71 @@
+package com.uas.platform.b2c.fa.payment.controller;
+
+import com.uas.platform.b2c.fa.payment.model.InstallmentStore;
+import com.uas.platform.b2c.fa.payment.service.InstallmentStoreService;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+
+/**
+ * 分期权限店铺controller
+ * @author wangyc
+ *
+ * @version 2017/9/7 11:21 wangyc
+ */
+@RestController
+@RequestMapping("trade/installment-stores")
+public class InstallmentStoreController {
+
+    private final InstallmentStoreService installmentStoreService;
+
+    @Autowired
+    public InstallmentStoreController(InstallmentStoreService installmentStoreService) {
+        this.installmentStoreService = installmentStoreService;
+    }
+
+    /**
+     * 分期权限店铺的保存功能
+     * @param storeUuid 店铺uuid
+     */
+    @RequestMapping(value = "/{storeUuid}", method = RequestMethod.POST)
+    public InstallmentStore saveStore(@PathVariable("storeUuid") String storeUuid) {
+        return installmentStoreService.saveStore(storeUuid);
+    }
+
+    /**
+     * 分期权限店铺的删除功能
+     * @param storeUuid 店铺uuid
+     */
+    @RequestMapping(value = "/{storeUuid}", method = RequestMethod.DELETE)
+    public void deleteStore(@PathVariable("storeUuid") String storeUuid) {
+        installmentStoreService.deleteStore(storeUuid);
+    }
+
+    /**
+     * 分期权限店铺的禁用功能
+     * @param storeUuid 店铺uuid
+     */
+    @RequestMapping(value = "/disable/{storeUuid}", method = RequestMethod.PUT)
+    public InstallmentStore capsOFF(@PathVariable("storeUuid") String storeUuid) {
+        return installmentStoreService.capsOFF(storeUuid);
+    }
+
+    /**
+     * 分期权限店铺的启用功能
+     * @param storeUuid 店铺uuid
+     */
+    @RequestMapping(value = "/enable/{storeUuid}", method = RequestMethod.PUT)
+    public InstallmentStore capsON(@PathVariable("storeUuid") String storeUuid) {
+        return installmentStoreService.capsON(storeUuid);
+    }
+
+    /**
+     * 分期权限店铺开启分期功能的验证
+     */
+    @RequestMapping(value = "/capsOFFVerify", method = RequestMethod.GET)
+    public String capsOFFVerify() {
+        return installmentStoreService.capsOFFVerify();
+    }
+}

+ 29 - 0
src/main/java/com/uas/platform/b2c/fa/payment/dao/InstallmentDao.java

@@ -0,0 +1,29 @@
+package com.uas.platform.b2c.fa.payment.dao;
+
+import com.uas.platform.b2c.fa.payment.model.Installment;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 分期支付dao
+ * @author wangyc
+ *
+ * @version 2017/9/7 9:10 wangyc
+ */
+@Repository
+public interface InstallmentDao extends JpaSpecificationExecutor<Installment>, JpaRepository<Installment, Long>{
+
+    /**
+     * 通过采购单id获取分期信息
+     * @param purchaseId
+     * @return
+     */
+    Installment findByPurchaseId(Long purchaseId);
+
+    /**
+     * 通过采购单id删除分期信息
+     * @param purchaseId
+     */
+    void deleteByPurchaseId(Long purchaseId);
+}

+ 36 - 0
src/main/java/com/uas/platform/b2c/fa/payment/dao/InstallmentDetailDao.java

@@ -0,0 +1,36 @@
+package com.uas.platform.b2c.fa.payment.dao;
+
+import com.uas.platform.b2c.fa.payment.model.InstallmentDetail;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 分期明细dao
+ * @author wangyc
+ *
+ * @version 2017/9/7 9:12 wangyc
+ */
+@Repository
+public interface InstallmentDetailDao extends JpaSpecificationExecutor<InstallmentDetail>, JpaRepository<InstallmentDetail, Long>{
+
+    /**
+     * 通过分期信息id和序号获取分期明细信息
+     * @param installmentId
+     * @param detno
+     * @return
+     */
+    InstallmentDetail findByInstallmentIdAndDetno(Long installmentId, Short detno);
+
+    /**
+     * 根据分期信息id和序号删除序号大于该序号的分期明细
+     * @param installmentId
+     * @param detno
+     */
+    @Modifying
+    @Query(value = "delete from trade$installment_detail where insd_installmentid =:installmentId and insd_detno >:detno", nativeQuery = true)
+    void deleteGtDetno(@Param("installmentId") Long installmentId, @Param("detno") Short detno);
+}

+ 32 - 0
src/main/java/com/uas/platform/b2c/fa/payment/dao/InstallmentStoreDao.java

@@ -0,0 +1,32 @@
+package com.uas.platform.b2c.fa.payment.dao;
+
+import com.uas.platform.b2c.fa.payment.model.InstallmentStore;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 分期店铺权限dao
+ * @author wangyc
+ *
+ * @version 2017/9/7 11:24 wangyc
+ */
+@Repository
+public interface InstallmentStoreDao extends JpaSpecificationExecutor<InstallmentStore>, JpaRepository<InstallmentStore, Long> {
+
+    /**
+     * 通过企业uu获取拥有分期权限店铺
+     *
+     * @param enuu 企业uu
+     * @param enable 是否启用
+     * @return
+     */
+    InstallmentStore findByEnuuAndEnable(Long enuu, Short enable);
+
+    /**
+     * 通过店铺uuid获取权限信息
+     * @param storeUuid
+     * @return
+     */
+    InstallmentStore findByStoreUuid(String storeUuid);
+}

+ 43 - 1
src/main/java/com/uas/platform/b2c/fa/payment/model/BankTransfer.java

@@ -30,6 +30,24 @@ public class BankTransfer {
 	@Column(name = "banktf_sn", unique = true)
 	private String banktranssn;
 
+	/**
+	 * 转账类型(转账给卖家,转账给平台)
+	 */
+	@Column(name = "banktf_type")
+	private String type;
+
+	/**
+	 * 对应分期明细id
+	 */
+	@Column(name = "banktf_installdetailid")
+	private Long installmentDetailId;
+
+	/**
+	 * 对应分期金额数组
+	 */
+	@Transient
+	private String pricesArr;
+
 	/**
 	 * 状态 TOBEMADEOUTANINVOICE(512, "待开发票"), MADEOUTANINVOICE(513, "已开发票"),
 	 */
@@ -69,7 +87,7 @@ public class BankTransfer {
 	/**
 	 * 凭证图片
 	 */
-	@Column(name = "banktf_imgUrl", length = 2000)
+	@Column(name = "banktf_imgUrl", length = 4000)
 	private String imgUrl;
 
 	/**
@@ -151,6 +169,30 @@ public class BankTransfer {
 		this.banktranssn = banktranssn;
 	}
 
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public Long getInstallmentDetailId() {
+		return installmentDetailId;
+	}
+
+	public void setInstallmentDetailId(Long installmentDetailId) {
+		this.installmentDetailId = installmentDetailId;
+	}
+
+	public String getPricesArr() {
+		return pricesArr;
+	}
+
+	public void setPricesArr(String pricesArr) {
+		this.pricesArr = pricesArr;
+	}
+
 	public Long getCollectenuu() {
 		return collectenuu;
 	}

+ 156 - 0
src/main/java/com/uas/platform/b2c/fa/payment/model/Installment.java

@@ -0,0 +1,156 @@
+package com.uas.platform.b2c.fa.payment.model;
+
+import javax.persistence.*;
+import java.util.Set;
+
+/**
+ * 分期信息
+ * @author wangyc
+ *
+ * @version 2017/9/6 16:09 wangyc
+ */
+@Entity
+@Table(name = "trade$installment")
+public class Installment {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "ins_id")
+    private Long id;
+
+    /**
+     * 订单号
+     */
+    @Column(name = "ins_ordernum")
+    private String orderNum;
+
+    /**
+     * 订单id
+     */
+    @Column(name = "ins_orderid")
+    private Long orderId;
+
+    /**
+     * 采购单id
+     */
+    @Column(name = "insss_purchaseid")
+    private Long purchaseId;
+
+    /**
+     * 卖家企业uu
+     */
+    @Column(name = "ins_sellerenuu")
+    private Long sellerenuu;
+
+    /**
+     * 订单总金额
+     */
+    @Column(name = "ins_price")
+    private Double price;
+
+    /**
+     * 状态
+     * TOBEPAID(503, "待付款"),PAID(504, "已付款"),MONEYRECEIVED(505, "已收款")
+     */
+    @Column(name = "ins_status")
+    private Integer status;
+
+    /**
+     * 当前期数
+     */
+    @Column(name = "ins_currentno")
+    private Short currentNo;
+
+    /**
+     * 总期数
+     */
+    @Column(name = "ins_count")
+    private Integer count;
+
+    /**
+     * 分期明细
+     */
+    @OneToMany(mappedBy = "installment", cascade = { CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE, CascadeType.DETACH, CascadeType.REMOVE }, fetch = FetchType.EAGER, orphanRemoval = true)
+    @OrderBy("detno")
+    private Set<InstallmentDetail> installmentDetails;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getOrderNum() {
+        return orderNum;
+    }
+
+    public void setOrderNum(String orderNum) {
+        this.orderNum = orderNum;
+    }
+
+    public Long getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Long orderId) {
+        this.orderId = orderId;
+    }
+
+    public Long getPurchaseId() {
+        return purchaseId;
+    }
+
+    public void setPurchaseId(Long purchaseId) {
+        this.purchaseId = purchaseId;
+    }
+
+    public Long getSellerenuu() {
+        return sellerenuu;
+    }
+
+    public void setSellerenuu(Long sellerenuu) {
+        this.sellerenuu = sellerenuu;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Short getCurrentNo() {
+        return currentNo;
+    }
+
+    public void setCurrentNo(Short currentNo) {
+        this.currentNo = currentNo;
+    }
+
+    public Integer getCount() {
+        return count;
+    }
+
+    public void setCount(Integer count) {
+        this.count = count;
+    }
+
+    public Set<InstallmentDetail> getInstallmentDetails() {
+        return installmentDetails;
+    }
+
+    public void setInstallmentDetails(Set<InstallmentDetail> installmentDetails) {
+        this.installmentDetails = installmentDetails;
+    }
+}

+ 175 - 0
src/main/java/com/uas/platform/b2c/fa/payment/model/InstallmentDetail.java

@@ -0,0 +1,175 @@
+package com.uas.platform.b2c.fa.payment.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import org.codehaus.jackson.annotate.JsonIgnore;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * 分期信息明细
+ * @author wangyc
+ *
+ * @version 2017/9/6 16:22 wangyc
+ */
+@Entity
+@Table(name = "trade$installment_detail")
+public class InstallmentDetail {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "insd_id")
+    private Long id;
+
+    /**
+     * 分期信息id
+     */
+    @Column(name = "insd_installmentid")
+    private Long installmentId;
+
+    /**
+     * 分期信息
+     */
+    @ManyToOne(cascade = {CascadeType.REFRESH})
+    @JoinColumn(name = "insd_installmentid", insertable = false, updatable = false)
+    private Installment installment;
+
+    /**
+     * 本期金额
+     */
+    @Column(name = "insd_price")
+    private Double price;
+
+    /**
+     * 第几期
+     */
+    @Column(name = "insd_detno")
+    private Short detno;
+
+    /**
+     * 本期状态
+     * TOBEPAID(503, "待付款"),PAID(504, "已付款"),MONEYRECEIVED(505, "已收款")
+     */
+    @Column(name = "insd_status")
+    private Integer status;
+
+    /**
+     * 本期截止日期
+     */
+    @Column(name = "insd_deadline")
+    private Date deadline;
+
+    /**
+     * 买家付款日期
+     */
+    @Column(name = "insd_paiddate")
+    private Date paidDate;
+
+    /**
+     * 卖家确认收款日期
+     */
+    @Column(name = "insd_ensuredate")
+    private Date ensureDate;
+
+    /**
+     * 上传水单图片,以“,”拼接,最多6张
+     */
+    @Column(name = "insd_imgs", length = 4000)
+    private String imgs;
+
+    /**
+     * 上传水单金额,以“,”拼接,最多6个
+     */
+    @Column(name = "insd_pricesarr", length = 4000)
+    private String pricesArr;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getInstallmentId() {
+        return installmentId;
+    }
+
+    public void setInstallmentId(Long installmentId) {
+        this.installmentId = installmentId;
+    }
+
+    @JsonIgnore
+    @JSONField(serialize = false)
+    public Installment getInstallment() {
+        return installment;
+    }
+
+    public void setInstallment(Installment installment) {
+        this.installment = installment;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Short getDetno() {
+        return detno;
+    }
+
+    public void setDetno(Short detno) {
+        this.detno = detno;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getDeadline() {
+        return deadline;
+    }
+
+    public void setDeadline(Date deadline) {
+        this.deadline = deadline;
+    }
+
+    public Date getPaidDate() {
+        return paidDate;
+    }
+
+    public void setPaidDate(Date paidDate) {
+        this.paidDate = paidDate;
+    }
+
+    public Date getEnsureDate() {
+        return ensureDate;
+    }
+
+    public void setEnsureDate(Date ensureDate) {
+        this.ensureDate = ensureDate;
+    }
+
+    public String getImgs() {
+        return imgs;
+    }
+
+    public void setImgs(String imgs) {
+        this.imgs = imgs;
+    }
+
+    public String getPricesArr() {
+        return pricesArr;
+    }
+
+    public void setPricesArr(String pricesArr) {
+        this.pricesArr = pricesArr;
+    }
+}

+ 116 - 0
src/main/java/com/uas/platform/b2c/fa/payment/model/InstallmentStore.java

@@ -0,0 +1,116 @@
+package com.uas.platform.b2c.fa.payment.model;
+
+import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.prod.store.model.StoreIn;
+
+import javax.persistence.*;
+
+/**
+ * 分期权限店铺
+ * @author wangyc
+ *
+ * @version 2017/9/7 11:12 wangyc
+ */
+@Entity
+@Table(name = "trade$installment_store")
+public class InstallmentStore {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "inss_id")
+    private Long id;
+
+    /**
+     * 店铺uuid
+     */
+    @Column(name = "inss_storeuuid")
+    private String storeUuid;
+
+    /**
+     * 店铺id
+     */
+    @Column(name = "inss_storeid")
+    private Long storeId;
+
+    /**
+     * 店铺信息
+     */
+    @OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
+    @JoinColumn(name = "inss_storeid", insertable = false, updatable = false)
+    private StoreIn store;
+
+    /**
+     * 企业uu
+     */
+    @Column(name = "inss_enuu")
+    private Long enuu;
+
+    /**
+     * 企业信息
+     */
+    @OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
+    @JoinColumn(name = "inss_enuu", insertable = false, updatable = false)
+    private Enterprise enterprise;
+
+    /**
+     * 是否启用 启用:1,禁用:0
+     */
+    @Column(name = "inss_enable")
+    private Short enable;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getStoreUuid() {
+        return storeUuid;
+    }
+
+    public void setStoreUuid(String storeUuid) {
+        this.storeUuid = storeUuid;
+    }
+
+    public Long getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Long storeId) {
+        this.storeId = storeId;
+    }
+
+    public StoreIn getStore() {
+        return store;
+    }
+
+    public void setStore(StoreIn store) {
+        this.store = store;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public Enterprise getEnterprise() {
+        return enterprise;
+    }
+
+    public void setEnterprise(Enterprise enterprise) {
+        this.enterprise = enterprise;
+    }
+
+    public Short getEnable() {
+        return enable;
+    }
+
+    public void setEnable(Short enable) {
+        this.enable = enable;
+    }
+}

+ 57 - 0
src/main/java/com/uas/platform/b2c/fa/payment/service/InstallmentService.java

@@ -0,0 +1,57 @@
+package com.uas.platform.b2c.fa.payment.service;
+
+import com.uas.platform.b2c.fa.payment.model.BankTransfer;
+import com.uas.platform.b2c.fa.payment.model.Installment;
+
+/**
+ * 分期支付service
+ * @author wangyc
+ *
+ * @version 2017/9/7 9:07 wangyc
+ */
+public interface InstallmentService {
+
+    /**
+     * 新增分期信息
+     * @param installment 分期信息
+     * @param purchaseId 采购单id
+     * @return
+     */
+    Installment createInstallment(Installment installment, Long purchaseId);
+
+    /**
+     * 更新分期信息
+     * @param installment 分期信息
+     * @param purchaseId 采购单id
+     * @return
+     */
+    Installment updateInstallment(Installment installment, Long purchaseId);
+
+    /**
+     * 支付单一分期
+     * @param bankTransfer 转账信息
+     * @param orderId 订单id
+     * @return
+     */
+    Installment paidInstallment(BankTransfer bankTransfer, Long orderId);
+
+    /**
+     * 删除分期信息
+     * @param purchaseId
+     */
+    void deleteInstallment(Long purchaseId);
+
+    /**
+     * 验证卖家是否能够设置分期信息
+     * @param purchaseId
+     * @return
+     */
+    String validationEnableInstallment(Long purchaseId);
+
+    /**
+     * 采购单改价后更新分期信息
+     * @param purchaseDetailId
+     * @return
+     */
+    Installment updateAfterModifyPurchasePrice(String purchaseDetailId);
+}

+ 46 - 0
src/main/java/com/uas/platform/b2c/fa/payment/service/InstallmentStoreService.java

@@ -0,0 +1,46 @@
+package com.uas.platform.b2c.fa.payment.service;
+
+import com.uas.platform.b2c.fa.payment.model.InstallmentStore;
+
+/**
+ * 分期权限店铺service
+ * @author wangyc
+ *
+ * @version 2017/9/7 11:22 wangyc
+ */
+public interface InstallmentStoreService {
+
+    /**
+     * 分期权限店铺的保存功能
+     *
+     * @param storeUuid 店铺uuid
+     */
+    InstallmentStore saveStore(String storeUuid);
+
+    /**
+     * 分期权限店铺的删除功能
+     *
+     * @param storeUuid 店铺uuid
+     */
+    void deleteStore(String storeUuid);
+
+    /**
+     * 分期权限店铺的禁用功能
+     *
+     * @param storeUuid 店铺uuid
+     */
+    InstallmentStore capsOFF(String storeUuid);
+
+    /**
+     * 分期权限店铺的启用功能
+     *
+     * @param storeUuid 店铺uuid
+     */
+    InstallmentStore capsON(String storeUuid);
+
+    /**
+     * 验证分期权限店铺的是否开启功能
+     */
+    String capsOFFVerify();
+
+}

+ 0 - 1
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankInfoServiceImpl.java

@@ -154,7 +154,6 @@ public class BankInfoServiceImpl implements BankInfoService {
 		}else {
 			return bankInfoDao.findByEnuuAndTypeAndStatusAndOpraterUserTypeOrderByNumAsc(enuu, (short)2, status, operatorUserType);
 		}
-
 	}
 
 	@Override

+ 109 - 22
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankTransferServiceImpl.java

@@ -1,5 +1,7 @@
 package com.uas.platform.b2c.fa.payment.service.impl;
 
+import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
+import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
@@ -11,6 +13,7 @@ import com.uas.platform.b2c.fa.payment.model.BankTransAssociate;
 import com.uas.platform.b2c.fa.payment.model.BankTransfer;
 import com.uas.platform.b2c.fa.payment.service.BankInfoService;
 import com.uas.platform.b2c.fa.payment.service.BankTransferService;
+import com.uas.platform.b2c.fa.payment.service.InstallmentService;
 import com.uas.platform.b2c.logistics.dao.ReceiptDao;
 import com.uas.platform.b2c.logistics.model.Receipt;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
@@ -90,10 +93,16 @@ public class BankTransferServiceImpl implements BankTransferService {
 
 	private final BankTransAssociateDao transAssociateDao;
 
+	private final EnterpriseDao enterpriseDao;
+
+	private final InstallmentService installmentService;
+
 	@Autowired
-	public BankTransferServiceImpl(BankInfoDao bankInfoDao, BankTransAssociateDao transAssociateDao) {
+	public BankTransferServiceImpl(BankInfoDao bankInfoDao, BankTransAssociateDao transAssociateDao, EnterpriseDao enterpriseDao, InstallmentService installmentService) {
 		this.bankInfoDao = bankInfoDao;
 		this.transAssociateDao = transAssociateDao;
+		this.enterpriseDao = enterpriseDao;
+		this.installmentService = installmentService;
 	}
 
 	@Override
@@ -255,34 +264,45 @@ public class BankTransferServiceImpl implements BankTransferService {
 	public BankTransfer save(BankTransfer bankTransfer, String order) {
 		// 将转账信息的ID保存到订单类型中
 		String[] orderIds = order.split("-");
+		BankTransfer saveBankTransfer = new BankTransfer();
 
-		bankTransfer.setPayUseruu(SystemSession.getUser().getUserUU());
-		bankTransfer.setPayenuu(SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null);
-		if (bankTransfer.getPayenuu() == null) {
-			bankTransfer.setDissociative(Type.PERSONAL.value());
-		} else {
-			bankTransfer.setDissociative(Type.ENTERPRISING.value());
-		}
-		bankTransfer.setCollectUseruu(sysConf.getAdminUU()); // 收款方 设置为应鹏账号
-		bankTransfer.setCollectenuu(sysConf.getEnUU()); // 收款方设置为B2C的uu
-		bankTransfer.setBanktranssn(EncodingRulesConstant.BANKTRANSFER.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$bank_transfer", 8)));
-		bankTransfer.setTranferCreateTime(new Date());
-		bankTransfer.setOperateType(Type.MALL.value());
-
-		BankTransfer saveBankTransfer = bankTransferDao.save(bankTransfer);
+		if (com.uas.platform.b2c.core.constant.Type.PAIDTOVENDOR.name().equals(bankTransfer.getType())) {// 付款类型为分期付款
+			if (orderIds.length > 1)
+				throw new IllegalOperatorException("多张订单合并付款只能向平台支付,如需直接支付给卖家,请前往 订单中心 进行单张支付");
 
-		for (String orderId : orderIds) {
-			Order orderN = orderService.findByOrId(orderId);
-			if (orderN == null) {
-				throw new IllegalOperatorException("您要操作的订单不存在:" + orderId);
+			Order orderN = orderService.findByOrId(orderIds[0]);
+			if (orderN == null)
+				throw new IllegalOperatorException("您要操作的订单不存在:" + orderIds[0]);
+			if (orderN.getStatus() != Status.TOBEPAID.value() && orderN.getStatus() != com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value() && orderN.getStatus() != com.uas.platform.b2c.core.constant.Status.PAID.value()) {
+				throw new IllegalOperatorException("您操作的订单不在待付款状态:" + orderIds[0]);
 			}
 
-			if (orderN.getStatus() != Status.TOBEPAID.value()) {
-				throw new IllegalOperatorException("您操作的订单不在待付款状态:" + orderId);
+			bankTransfer.setPayUseruu(SystemSession.getUser().getUserUU());
+			bankTransfer.setPayenuu(SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null);
+			if (bankTransfer.getPayenuu() == null) {
+				bankTransfer.setDissociative(Type.PERSONAL.value());
+			} else {
+				bankTransfer.setDissociative(Type.ENTERPRISING.value());
 			}
 
+			List<BankInfo> bankInfos = bankInfoService.getEnterpriseBankInfoContainsStatus(Type.SUP.value(), Status.ALLOW.value(), orderN.getSellerenuu());
+			if (CollectionUtils.isEmpty(bankInfos))
+				throw new IllegalOperatorException("卖家收款账户不存在,请联系卖家");
+			Enterprise enterprise = enterpriseDao.findByUu(orderN.getSellerenuu());
+			if (enterprise == null)
+				throw new IllegalOperatorException("卖家企业不存在,请联系管理员");
+
+			bankTransfer.setCollectUseruu(enterprise.getEnAdminuu());
+			bankTransfer.setCollectenuu(orderN.getSellerenuu());
+
+			bankTransfer.setBanktranssn(EncodingRulesConstant.BANKTRANSFER.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$bank_transfer", 8)));
+			bankTransfer.setTranferCreateTime(new Date());
+			bankTransfer.setOperateType(Type.SUP.value());
+
+			saveBankTransfer = bankTransferDao.save(bankTransfer);
+
 			BankTransAssociate bankTransAssociate = new BankTransAssociate();
-			bankTransAssociate.setBtaTableserNum(orderId);
+			bankTransAssociate.setBtaTableserNum(orderIds[0]);
 			bankTransAssociate.setBtaBanktranssn(saveBankTransfer.getBanktranssn());
 			btaDao.save(bankTransAssociate);
 
@@ -316,7 +336,74 @@ public class BankTransferServiceImpl implements BankTransferService {
 			}
 			purchaseDao.save(purchases);
 			orderDao.save(orderN);
+			// 单期分期付款
+			installmentService.paidInstallment(bankTransfer, orderN.getId());
+		} else {
+			bankTransfer.setPayUseruu(SystemSession.getUser().getUserUU());
+			bankTransfer.setPayenuu(SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null);
+			if (bankTransfer.getPayenuu() == null) {
+				bankTransfer.setDissociative(Type.PERSONAL.value());
+			} else {
+				bankTransfer.setDissociative(Type.ENTERPRISING.value());
+			}
+
+			bankTransfer.setCollectUseruu(sysConf.getAdminUU()); // 收款方 设置为应鹏账号
+			bankTransfer.setCollectenuu(sysConf.getEnUU()); // 收款方设置为B2C的uu
+
+			bankTransfer.setBanktranssn(EncodingRulesConstant.BANKTRANSFER.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$bank_transfer", 8)));
+			bankTransfer.setTranferCreateTime(new Date());
+			bankTransfer.setOperateType(Type.MALL.value());
+
+			saveBankTransfer = bankTransferDao.save(bankTransfer);
+
+			for (String orderId : orderIds) {
+				Order orderN = orderService.findByOrId(orderId);
+				if (orderN == null) {
+					throw new IllegalOperatorException("您要操作的订单不存在:" + orderId);
+				}
+
+				if (orderN.getStatus() != Status.TOBEPAID.value()) {
+					throw new IllegalOperatorException("您操作的订单不在待付款状态:" + orderId);
+				}
+
+				BankTransAssociate bankTransAssociate = new BankTransAssociate();
+				bankTransAssociate.setBtaTableserNum(orderId);
+				bankTransAssociate.setBtaBanktranssn(saveBankTransfer.getBanktranssn());
+				btaDao.save(bankTransAssociate);
+
+				orderN.setBanktfid(saveBankTransfer.getId());
+				Long userUU = SystemSession.getUser().getUserUU();
+				orderN.setStatusPaid(userUU);
+				Set<OrderDetail> orderDetails = orderN.getOrderDetails();
+				for (OrderDetail orderDetail : orderDetails) {
+					if(orderDetail.getStatus().intValue() == Status.TOBEPAID.value()) {
+						orderDetail.setStatusPaid(userUU);
+					}
+
+				}
+				orderN.setBuyaccount(bankTransfer.getJsonPament());
+				orderN.setSelleraccount(bankTransfer.getJsonReceive());
+				orderN.setPaytime(new Date());
+				orderN.setPaytype(Type.Payment_CompanyTransfer_Code.value());
+
+				//修改采购单的状态
+				List<Purchase> purchases = purchaseDao.findByOrderid(orderN.getOrderid());
+				for (Purchase purchase : purchases) {
+					if(purchase.getStatus().intValue() == Status.TOBECONFIRMED.value()) {
+						Set<PurchaseDetail> purchaseDetails = purchase.getPurchaseDetails();
+						for (PurchaseDetail purchaseDetail : purchaseDetails) {
+							if(purchaseDetail.getStatus().intValue() == Status.TOBECONFIRMED.value()) {
+								purchaseDetail.setStatusPaid(userUU);
+							}
+						}
+						purchase.setStatusPaid(userUU);
+					}
+				}
+				purchaseDao.save(purchases);
+				orderDao.save(orderN);
+			}
 		}
+
 		return saveBankTransfer;
 	}
 

+ 365 - 0
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/InstallmentServiceImpl.java

@@ -0,0 +1,365 @@
+package com.uas.platform.b2c.fa.payment.service.impl;
+
+import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
+import com.uas.platform.b2c.common.account.dao.UserBaseInfoDao;
+import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.common.account.model.UserBaseInfo;
+import com.uas.platform.b2c.common.base.service.SendMessageService;
+import com.uas.platform.b2c.core.constant.Status;
+import com.uas.platform.b2c.core.constant.Type;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.utils.NumberUtil;
+import com.uas.platform.b2c.fa.payment.dao.InstallmentDao;
+import com.uas.platform.b2c.fa.payment.dao.InstallmentDetailDao;
+import com.uas.platform.b2c.fa.payment.dao.InstallmentStoreDao;
+import com.uas.platform.b2c.fa.payment.model.*;
+import com.uas.platform.b2c.fa.payment.service.BankInfoService;
+import com.uas.platform.b2c.fa.payment.service.InstallmentService;
+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.dao.PurchaseDetailDao;
+import com.uas.platform.b2c.trade.order.model.Order;
+import com.uas.platform.b2c.trade.order.model.Purchase;
+import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
+import com.uas.platform.core.exception.IllegalOperatorException;
+import com.uas.platform.core.util.mq.MessageType;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 分期支付service实现类
+ * @author wangyc
+ *
+ * @version 2017/9/7 9:07 wangyc
+ */
+@Service
+public class InstallmentServiceImpl implements InstallmentService{
+
+    private final InstallmentStoreDao installmentStoreDao;
+
+    private final PurchaseDao purchaseDao;
+
+    private final OrderDao orderDao;
+
+    private final InstallmentDao installmentDao;
+
+    private final BankInfoService bankInfoService;
+
+    private final InstallmentDetailDao installmentDetailDao;
+
+    private final PurchaseDetailDao purchaseDetailDao;
+
+    private final SendMessageService sendMessageService;
+
+    private final EnterpriseDao enterpriseDao;
+
+    private final UserBaseInfoDao userBaseInfoDao;
+
+    @Autowired
+    public InstallmentServiceImpl(InstallmentStoreDao installmentStoreDao, PurchaseDao purchaseDao, OrderDao orderDao, InstallmentDao installmentDao, BankInfoService bankInfoService, InstallmentDetailDao installmentDetailDao, PurchaseDetailDao purchaseDetailDao, SendMessageService sendMessageService, EnterpriseDao enterpriseDao, UserBaseInfoDao userBaseInfoDao) {
+        this.installmentStoreDao = installmentStoreDao;
+        this.purchaseDao = purchaseDao;
+        this.orderDao = orderDao;
+        this.installmentDao = installmentDao;
+        this.bankInfoService = bankInfoService;
+        this.installmentDetailDao = installmentDetailDao;
+        this.purchaseDetailDao = purchaseDetailDao;
+        this.sendMessageService = sendMessageService;
+        this.enterpriseDao = enterpriseDao;
+        this.userBaseInfoDao = userBaseInfoDao;
+    }
+
+    @Override
+    public Installment createInstallment(Installment installment, Long purchaseId) {
+        // 基础验证
+        validationEnableInstallment(purchaseId);
+
+        Purchase purchase = purchaseDao.findOne(purchaseId);
+
+        // 如果之前具有分期信息,删除分期信息
+        if (purchase.getInstallmentId() != null) {
+            Installment oldInstallment = installmentDao.findOne(purchase.getInstallmentId());
+            if (oldInstallment != null)
+                installmentDao.delete(oldInstallment.getId());
+        }
+
+        Set<InstallmentDetail> installmentDetails = installment.getInstallmentDetails();
+        if (CollectionUtils.isEmpty(installmentDetails))
+            throw new IllegalOperatorException("分期详情为空,请您设置分期详情");
+
+        for(InstallmentDetail installmentDetail : installmentDetails) {
+            installmentDetail.setStatus(Status.TOBEPAID.value());
+        }
+
+        // 设置分期基本信息
+        installment.setSellerenuu(SystemSession.getUser().getEnterprise().getUu());
+        installment.setStatus(Status.TOBEPAID.value());
+        installment.setCount(installmentDetails.size());
+        installment.setCurrentNo((short) 1);
+        installment.setOrderNum(purchase.getOrderid());
+        installment.setPurchaseId(purchaseId);
+
+        Order order = orderDao.findOrderByOrderid(purchase.getOrderid());
+        if (order == null)
+            throw new IllegalOperatorException("此订单不存在,请重新确认信息");
+
+        installment.setOrderId(order.getId());
+        installment.setPrice(purchase.getPrice());
+        installment.setInstallmentDetails(installmentDetails);
+
+        // 保存分期信息
+        installment = installmentDao.save(installment);
+
+        for (InstallmentDetail installmentDetail : installmentDetails) {
+            installmentDetail.setInstallment(installment);
+            installmentDetail.setInstallmentId(installment.getId());
+        }
+
+        installmentDetailDao.save(installmentDetails);
+
+        // 订单、采购单保存分期id
+        purchase.setInstallmentId(installment.getId());
+        order.setInstallmentId(installment.getId());
+
+        purchaseDao.save(purchase);
+        orderDao.save(order);
+
+        return installment;
+    }
+
+    @Override
+    public Installment updateInstallment(Installment installment, Long purchaseId) {
+        // 基础验证
+        validationEnableInstallment(purchaseId);
+
+        Purchase purchase = purchaseDao.findOne(purchaseId);
+
+        Set<InstallmentDetail> installmentDetails = installment.getInstallmentDetails();
+        if (CollectionUtils.isEmpty(installmentDetails))
+            throw new IllegalOperatorException("分期详情为空,请您设置分期详情");
+
+        Installment oldInstallment = installmentDao.findByPurchaseId(purchaseId);
+        if (oldInstallment == null)
+            throw new IllegalOperatorException("此订单分期信息不存在,请重新确认信息");
+
+
+//        installmentDao.delete(oldInstallment.getId());
+
+        for(InstallmentDetail installmentDetail : installmentDetails) {
+            installmentDetail.setStatus(Status.TOBEPAID.value());
+        }
+
+        // 设置分期基本信息
+        installment.setSellerenuu(SystemSession.getUser().getEnterprise().getUu());
+        installment.setStatus(Status.TOBEPAID.value());
+        installment.setCount(installmentDetails.size());
+        installment.setCurrentNo((short) 1);
+        installment.setOrderNum(purchase.getOrderid());
+        installment.setPurchaseId(purchaseId);
+
+        Order order = orderDao.findByOrderid(purchase.getOrderid());
+        if (order == null)
+            throw new IllegalOperatorException("此订单不存在,请重新确认信息");
+
+        installment.setOrderId(order.getId());
+        installment.setPrice(purchase.getPrice());
+        installment.setInstallmentDetails(installmentDetails);
+
+        oldInstallment.getInstallmentDetails().clear();
+
+        // 保存分期信息
+        BeanUtils.copyProperties(installment, oldInstallment, "installmentDetails");
+        oldInstallment = installmentDao.save(oldInstallment);
+        for (InstallmentDetail installmentDetail : installment.getInstallmentDetails()) {
+            installmentDetail.setInstallmentId(oldInstallment.getId());
+        }
+        installmentDetailDao.save(installment.getInstallmentDetails());
+
+        return oldInstallment;
+    }
+
+    @Override
+    public Installment paidInstallment(BankTransfer bankTransfer, Long orderId) {
+        // 验证分期明细合法性
+        InstallmentDetail installmentDetail = installmentDetailDao.findOne(bankTransfer.getInstallmentDetailId());
+        if (installmentDetail == null)
+            throw new IllegalOperatorException("该订单分期信息不存在,请重新确认订单");
+        if (!orderId.equals(installmentDetail.getInstallment().getOrderId()))
+            throw new IllegalOperatorException("此分期信息与该订单不符,请重新确认分期信息");
+        if (Status.TOBEPAID.value() != installmentDetail.getStatus().intValue() && Status.PAID.value() != installmentDetail.getStatus().intValue())
+            throw new IllegalOperatorException("此次付款分期不为待付款状态,请重新确认分期信息");
+
+        // 更新分期信息状态为付款中
+        Installment installment = installmentDetail.getInstallment();
+        if (!installment.getCurrentNo().equals(installmentDetail.getDetno())) {
+            throw new IllegalOperatorException("此次付款分期与应付分期信息不符,请重新确认分期信息");
+        }
+        if ((Status.TOBEPAID.value() != installment.getStatus().intValue()) && (Status.PAID.value() != installment.getStatus().intValue())) {
+            throw new IllegalOperatorException("此分期不为待付款状态,请重新确认分期信息");
+        }
+
+        installment.setStatus(com.uas.platform.b2c.core.constant.Status.PAID.value());
+
+        installmentDetail.setPaidDate(new Date());
+        installmentDetail.setImgs(bankTransfer.getImgUrl());
+        installmentDetail.setPricesArr(bankTransfer.getPricesArr());
+        installmentDetail.setStatus(com.uas.platform.b2c.core.constant.Status.PAID.value());
+
+        installmentDetailDao.save(installmentDetail);
+
+        Order order = orderDao.findOne(orderId);
+
+        if (order == null)
+            throw new IllegalOperatorException("订单不存在,请重新确认订单信息");
+        List<Purchase> purchases = purchaseDao.findByOrderid(order.getOrderid());
+
+        if (CollectionUtils.isNotEmpty(purchases)) {
+            for (Purchase purchase : purchases) {
+                Enterprise enterprise = enterpriseDao.findByUu(purchase.getSellerenuu());
+                if (enterprise == null)
+                    throw new IllegalOperatorException("卖家企业不存在,请重新确认");
+                UserBaseInfo admin = userBaseInfoDao.findUserByUserUU(enterprise.getEnAdminuu());
+                if (admin == null)
+                    throw new IllegalOperatorException("卖家管理员不存在,请联系卖家");
+                // 发送信息
+                sendMessageService.sendMessageForInstallmentPay(purchase.getSellername(), purchase.getBuyername(), installmentDetail.getPrice(),
+                        admin.getUserTel(), MessageType.orderpay);
+            }
+        }
+
+        return installmentDao.save(installment);
+    }
+
+    @Override
+    public void deleteInstallment(Long purchaseId) {
+        validatePurchase(purchaseId);
+        Purchase purchase = purchaseDao.findOne(purchaseId);
+        Order order = orderDao.findByOrderid(purchase.getOrderid());
+
+        Installment installment = installmentDao.findByPurchaseId(purchaseId);
+        if (installment == null)
+            throw new IllegalOperatorException("分期信息不存在,请重新确认分期信息");
+
+        order.setInstallmentId(null);
+        purchase.setInstallmentId(null);
+
+        orderDao.save(order);
+        purchaseDao.save(purchase);
+
+        installmentDao.delete(installment.getId());
+    }
+
+    @Override
+    public Installment updateAfterModifyPurchasePrice(String purchaseDetailId) {
+        PurchaseDetail purchaseDetail = purchaseDetailDao.findByDetailid(purchaseDetailId);
+        if (purchaseDetail == null)
+            throw new IllegalOperatorException("订单改价明细数据不存在,请重新确认订单信息");
+        Purchase purchase = purchaseDetail.getPurchase();
+
+        if (purchase != null && purchase.getInstallmentId() != null)
+            validationEnableInstallment(purchase.getId());
+
+        Installment installment = installmentDao.findByPurchaseId(purchase.getId());
+
+        Double total = purchase.getPrice();
+        Double installTotal = installment.getPrice();
+        Double dvalue = 0d;
+
+        if (NumberUtil.compare(total, installTotal) == 1) {
+            InstallmentDetail installmentDetail = installmentDetailDao.findByInstallmentIdAndDetno(installment.getId(), installment.getCount().shortValue());
+            installmentDetail.setPrice(NumberUtil.pricesScaleTwo(total - installTotal + installmentDetail.getPrice()));
+            installmentDetailDao.save(installmentDetail);
+        }
+
+
+
+        if (NumberUtil.compare(total, installTotal) == -1) {
+            for (short i = 1; i < installment.getCount() + 1; i++) {
+                InstallmentDetail installmentDetail = installmentDetailDao.findByInstallmentIdAndDetno(installment.getId(), i);
+                if (installmentDetail == null) {
+                    break;
+                }
+
+                dvalue = total - installmentDetail.getPrice();
+
+                if (dvalue <= 0) {
+                    installmentDetail.setPrice(NumberUtil.pricesScaleTwo(total));
+                    installmentDetailDao.save(installmentDetail);
+                    installmentDetailDao.deleteGtDetno(installment.getId(), i);
+
+                    Iterator<InstallmentDetail> it = installment.getInstallmentDetails().iterator();
+                    if (it.hasNext()) {
+                        InstallmentDetail installmentDetail1 = it.next();
+                        if (installmentDetail.getDetno() > i) {
+                            it.remove();
+                        }
+                    }
+
+                    break;
+                } else {
+                    total = dvalue;
+                }
+            }
+        }
+
+        installment.setPrice(purchase.getPrice());
+        installment.setCount(installment.getInstallmentDetails().size());
+
+        return installmentDao.save(installment);
+    }
+
+    @Override
+    public String validationEnableInstallment(Long purchaseId) {
+        validatePurchase(purchaseId);// 验证采购单、订单信息
+        validateBankInfo(Type.SUP.value(), Status.ALLOW.value());// 验证银行账户信息
+        validateInstallmentStore();// 验证是否设置分期权限
+        return "success";
+    }
+
+    void validateInstallmentStore() {
+        InstallmentStore installmentStore = installmentStoreDao.findByEnuuAndEnable(SystemSession.getUser().getEnterprise().getUu(), (short) 1);
+        if (installmentStore == null)
+            throw new IllegalOperatorException("当前企业没有设置分期功能权限,如有需要请联系客服");
+    }
+
+    /**
+     * 验证是否有收款账户
+     * @param type
+     * @param status
+     */
+    void validateBankInfo(Integer type, Integer status) {
+        List<BankInfo> bankInfos = bankInfoService.getEnterpriseBankInfoContainsStatus(type, status);
+        if (CollectionUtils.isEmpty(bankInfos))
+            throw new IllegalOperatorException("当前企业没有设置收款账户,请在 结算中心--收款账户信息 管理您的收款账户信息");
+    }
+
+    /**
+     * 验证采购单、订单信息
+     * @param purchaseId
+     */
+    void validatePurchase(Long purchaseId) {
+        if (SystemSession.getUser().getEnterprise() == null)
+            throw new IllegalOperatorException("当前账户为个人账户,请选择企业后再执行此操作");
+
+        Purchase purchase = purchaseDao.findOne(purchaseId);
+        if (purchase == null)
+            throw new IllegalOperatorException("订单不存在,请重新确认订单信息");
+        if (!SystemSession.getUser().getEnterprise().getUu().equals(purchase.getSellerenuu()))
+            throw new IllegalOperatorException("此订单不属于当前企业,请重新确认订单信息");
+        if (Status.TOBECONFIRMED.value() != purchase.getStatus().intValue())
+            throw new IllegalOperatorException("此订单状态不为待付款,不可修改分期信息");
+
+        Order order = orderDao.findByOrderid(purchase.getOrderid());
+        if (order == null)
+            throw new IllegalOperatorException("订单不存在,请重新确认订单信息");
+        if (Status.TOBEPAID.value() != order.getStatus().intValue() && Status.TOBECONFIRMED.value() != order.getStatus().intValue())
+            throw new IllegalOperatorException("此订单状态不为待付款,不可修改分期信息");
+    }
+}

+ 98 - 0
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/InstallmentStoreServiceImpl.java

@@ -0,0 +1,98 @@
+package com.uas.platform.b2c.fa.payment.service.impl;
+
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.fa.payment.dao.InstallmentStoreDao;
+import com.uas.platform.b2c.fa.payment.model.InstallmentStore;
+import com.uas.platform.b2c.fa.payment.service.InstallmentStoreService;
+import com.uas.platform.b2c.prod.store.dao.StoreInDao;
+import com.uas.platform.b2c.prod.store.model.StoreIn;
+import com.uas.platform.core.exception.IllegalOperatorException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 分期权限店铺service实现类
+ * @author wangyc
+ *
+ * @version 2017/9/7 11:23 wangyc
+ */
+@Service
+public class InstallmentStoreServiceImpl implements InstallmentStoreService{
+
+    private final InstallmentStoreDao installmentStoreDao;
+
+    private final StoreInDao storeInDao;
+
+    @Autowired
+    public InstallmentStoreServiceImpl(InstallmentStoreDao installmentStoreDao, StoreInDao storeInDao) {
+        this.installmentStoreDao = installmentStoreDao;
+        this.storeInDao = storeInDao;
+    }
+
+    @Override
+    public InstallmentStore saveStore(String storeUuid) {
+        StoreIn storeIn = storeInDao.findByUuid(storeUuid);
+        if (storeIn == null)
+            throw new IllegalOperatorException("此店铺不存在,请重新确认店铺信息");
+
+        InstallmentStore installmentStore = installmentStoreDao.findByStoreUuid(storeUuid);
+        if (installmentStore != null) {
+            throw new IllegalOperatorException("店铺: " + storeIn.getStoreName() + " 已存在权限列表中,如需维护请找到该店铺进行维护");
+        } else {
+            installmentStore = new InstallmentStore();
+        }
+
+        installmentStore.setEnable((short) 1);
+        installmentStore.setEnuu(storeIn.getEnUU());
+        installmentStore.setStoreId(storeIn.getId());
+        installmentStore.setStoreUuid(storeUuid);
+
+        return installmentStoreDao.save(installmentStore);
+    }
+
+    @Override
+    public void deleteStore(String storeUuid) {
+        InstallmentStore installmentStore = installmentStoreDao.findByStoreUuid(storeUuid);
+        if (installmentStore == null)
+            throw new IllegalOperatorException("此店铺并不存在权限列表中,无需删除");
+        installmentStoreDao.delete(installmentStore.getId());
+    }
+
+    @Override
+    public InstallmentStore capsOFF(String storeUuid) {
+        return toggleStore(storeUuid, (short) 0);
+    }
+
+    @Override
+    public InstallmentStore capsON(String storeUuid) {
+        return toggleStore(storeUuid, (short) 1);
+    }
+
+    /**
+     * 启用/禁用店铺
+     * @param enable
+     * @return
+     */
+    public InstallmentStore toggleStore(String storeUuid, short enable) {
+        InstallmentStore installmentStore = installmentStoreDao.findByStoreUuid(storeUuid);
+        if (installmentStore == null)
+            throw new IllegalOperatorException("此店铺并不存在权限列表中,无需删除");
+
+        installmentStore.setEnable(enable);
+
+        return installmentStoreDao.save(installmentStore);
+    }
+
+    @Override
+    public String capsOFFVerify() {
+        if (SystemSession.getUser().getEnterprise() == null)
+            throw new IllegalOperatorException("当前用户为个人用户,请选择企业进行分期操作");
+
+        InstallmentStore installmentStore = installmentStoreDao.findByEnuuAndEnable(SystemSession.getUser().getEnterprise().getUu(), (short) 1);
+        if (installmentStore == null) {
+            return "fail";
+        } else {
+            return "success";
+        }
+    }
+}

+ 22 - 0
src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java

@@ -576,6 +576,28 @@ public class OrderController {
 		return orderService.releaseOrder(orderid, reason);
 	}
 
+	/**
+	 * 买家同意卖家发起的取消订单申请
+	 * @param orderid
+	 * @return
+	 */
+	@RequestMapping(value = "simpleinfo/ones/{orderid}/release/audit", method = RequestMethod.PUT)
+	public String aduitReleaseOrder(@PathVariable String orderid) {
+		logger.log("买家订单管理", "同意取消订单申请", "根据订单号: " + orderid + "取消订单,释放库存");
+		return orderService.aduitReleaseOrder(orderid);
+	}
+
+	/**
+	 * 买家不同意卖家发起的取消订单申请
+	 * @param orderid
+	 * @return
+	 */
+	@RequestMapping(value = "simpleinfo/ones/{orderid}/release/unaudit", method = RequestMethod.PUT)
+	public String unaduitReleaseOrder(@PathVariable String orderid) {
+		logger.log("买家订单管理", "不同意取消订单申请");
+		return orderService.unaduitReleaseOrder(orderid);
+	}
+
 	/**
 	 * 失效订单 (因确认是订单批次库存不足)
 	 *

+ 15 - 2
src/main/java/com/uas/platform/b2c/trade/order/controller/PurchaseController.java

@@ -278,10 +278,10 @@ public class PurchaseController {
 	 * @return the purchase
 	 */
 	@RequestMapping(value = "/{id}/ensurePaid", method = RequestMethod.PUT)
-	public Purchase ensurePaid(@PathVariable Long id) {
+	public Purchase ensurePaid(@PathVariable Long id, Long installmentDetailId) {
 		assert logger != null;
 		logger.log("采购单管理", "确认付款,采购单id: " + id);
-		return purchaseService.ensurePaid(id);
+		return purchaseService.ensurePaid(id, installmentDetailId);
 	}
 
 	/**
@@ -600,6 +600,19 @@ public class PurchaseController {
 		return purchaseService.findOrderIdByPuId(purchaseId);
 	}
 
+	/**
+	 * 卖家取消订单 释放库存
+	 *
+	 * @param purchaseId the purchaseId
+	 * @param reason  the reason
+	 * @return the string
+	 */
+	@RequestMapping(value = "simpleinfo/ones/{purchaseId}/release", method = RequestMethod.PUT)
+	public String release(@PathVariable String purchaseId, String reason) {
+		logger.log("卖家订单管理", "取消订单", "根据订单号: " + purchaseId + "取消订单,释放库存");
+		return purchaseService.release(purchaseId, reason);
+	}
+
 //	@RequestMapping(value = "/logistics")
 //	public Logistics findOneLogistics(){
 //		return null;

+ 47 - 0
src/main/java/com/uas/platform/b2c/trade/order/model/Order.java

@@ -8,6 +8,7 @@ import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.core.constant.Status;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.StringUtilB2C;
+import com.uas.platform.b2c.fa.payment.model.Installment;
 import com.uas.platform.b2c.logistics.model.InvoiceFOrder;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus;
@@ -615,6 +616,18 @@ public class Order extends Document implements Serializable {
 	@Transient
 	private boolean selfSell;
 
+	/**
+	 * 分期信息id
+	 */
+	@Column(name = "or_installmentid")
+	private Long installmentId;
+
+	/**
+	 * 分期信息(不做关联)
+	 */
+	@Transient
+	private Installment installment;
+
 	/**
 	 * Gets expiration time.
 	 *
@@ -1229,6 +1242,22 @@ public class Order extends Document implements Serializable {
 		return this;
 	}
 
+	public Long getInstallmentId() {
+		return installmentId;
+	}
+
+	public void setInstallmentId(Long installmentId) {
+		this.installmentId = installmentId;
+	}
+
+	public Installment getInstallment() {
+		return installment;
+	}
+
+	public void setInstallment(Installment installment) {
+		this.installment = installment;
+	}
+
 	/**
 	 * Sets status.
 	 *
@@ -1447,6 +1476,24 @@ public class Order extends Document implements Serializable {
 		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
 	}
 
+	/**
+	 * 卖家确认分期付款(未完全付完)
+	 * @param uu
+	 */
+	public void setStatusToBePaidAgain(Long uu) {
+		this.status = com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value();
+		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
+	}
+
+	/**
+	 * 卖家申请取消订单(未完全付完)
+	 * @param uu
+	 */
+	public void setStatusCancelToBeConfirmed(Long uu) {
+		this.status = com.uas.platform.b2c.core.constant.Status.CANCELTOBECONFIRMED.value();
+		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
+	}
+
 	/**
 	 * 售后中(只能单次单次的售后,暂时先这么处理)
 	 *

+ 18 - 0
src/main/java/com/uas/platform/b2c/trade/order/model/OrderDetail.java

@@ -1532,6 +1532,15 @@ public class OrderDetail extends Document implements Serializable{
 		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
 	}
 
+	/**
+	 * 卖家申请取消订单(未完全付完)
+	 * @param uu
+	 */
+	public void setStatusCancelToBeConfirmed(Long uu) {
+		this.status = com.uas.platform.b2c.core.constant.Status.CANCELTOBECONFIRMED.value();
+		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
+	}
+
 	/**
 	 * Sets status unavailable return.
 	 *
@@ -1616,6 +1625,15 @@ public class OrderDetail extends Document implements Serializable{
 		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
 	}
 
+	/**
+	 * 卖家确认分期付款(未完全付完)
+	 * @param uu
+	 */
+	public void setStatusToBePaidAgain(Long uu) {
+		this.status = com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value();
+		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
+	}
+
 	/**
 	 * Sets status order take.
 	 *

+ 49 - 1
src/main/java/com/uas/platform/b2c/trade/order/model/Purchase.java

@@ -2,6 +2,7 @@ package com.uas.platform.b2c.trade.order.model;
 
 import com.uas.platform.b2c.core.utils.DateFormatUtils;
 import com.uas.platform.b2c.core.utils.DoubleArith;
+import com.uas.platform.b2c.fa.payment.model.Installment;
 import com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus;
 import com.uas.platform.core.exception.IllegalStatusException;
 import com.uas.platform.core.model.Status;
@@ -21,6 +22,7 @@ import javax.persistence.OneToMany;
 import javax.persistence.OrderBy;
 import javax.persistence.Table;
 import javax.persistence.Transient;
+import javax.persistence.*;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.HashSet;
@@ -482,7 +484,7 @@ public class Purchase extends Document implements Serializable {
 	 */
 	@Column(name = "pu_fare")
 	private Double fare;
-	
+
 	/*
 	 * 自己送货的送货人
 	 */
@@ -519,6 +521,18 @@ public class Purchase extends Document implements Serializable {
 	@Column(name = "in_sd_addr", length = 2000)
 	private String jsonSdAddress;
 
+	/**
+	 * 分期信息id
+	 */
+	@Column(name = "pu_installmentid")
+	private Long installmentId;
+
+	/**
+	 * 分期信息(不做关联)
+	 */
+	@Transient
+	private Installment installment;
+
     /** 异常相关字段end
      *******************************************************************************/
 
@@ -696,6 +710,24 @@ public class Purchase extends Document implements Serializable {
 		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
 	}
 
+	/**
+	 * 卖家确认分期付款(未完全付完)
+	 * @param uu
+	 */
+	public void setStatusToBePaidAgain(Long uu) {
+		this.status = com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value();
+		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
+	}
+
+	/**
+	 * 卖家申请取消订单(未完全付完)
+	 * @param uu
+	 */
+	public void setStatusCancelToBeConfirmed(Long uu) {
+		this.status = com.uas.platform.b2c.core.constant.Status.CANCELTOBECONFIRMED.value();
+		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
+	}
+
 	/**
 	 * Sets status comfirm disagree.
 	 *
@@ -2157,6 +2189,22 @@ public class Purchase extends Document implements Serializable {
 		return this;
 	}
 
+	public Long getInstallmentId() {
+		return installmentId;
+	}
+
+	public void setInstallmentId(Long installmentId) {
+		this.installmentId = installmentId;
+	}
+
+	public Installment getInstallment() {
+		return installment;
+	}
+
+	public void setInstallment(Installment installment) {
+		this.installment = installment;
+	}
+
 	/**
 	 * 采购单的退货状态
 	 */

+ 18 - 0
src/main/java/com/uas/platform/b2c/trade/order/model/PurchaseDetail.java

@@ -1261,6 +1261,15 @@ public class PurchaseDetail extends Document {
 		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
 	}
 
+	/**
+	 * 卖家申请取消订单(未完全付完)
+	 * @param uu
+	 */
+	public void setStatusCancelToBeConfirmed(Long uu) {
+		this.status = com.uas.platform.b2c.core.constant.Status.CANCELTOBECONFIRMED.value();
+		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
+	}
+
 	/**
 	 * Sets status unavailable return.
 	 *
@@ -1333,6 +1342,15 @@ public class PurchaseDetail extends Document {
 		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
 	}
 
+	/**
+	 * 卖家确认分期付款(未完全付完)
+	 * @param uu
+	 */
+	public void setStatusToBePaidAgain(Long uu) {
+		this.status = com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value();
+		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
+	}
+
 	/**
 	 * 售后中(只能单次单次的售后,暂时先这么处理)
 	 *

+ 22 - 0
src/main/java/com/uas/platform/b2c/trade/order/service/OrderService.java

@@ -245,6 +245,14 @@ public interface OrderService {
 	 */
 	Order ensurePayed(String orderid, Integer type, Long... param);
 
+	/**
+	 * Send message.
+	 *
+	 * @param purchase the purchase
+	 * @throws RuntimeException the runtime exception
+	 */
+	void sendMessage(com.uas.platform.b2c.trade.order.model.Purchase purchase);
+
 	/**
 	 * 批量确认收款
 	 *
@@ -397,6 +405,20 @@ public interface OrderService {
 	 */
 	String releaseOrder(String orderid, String reason);
 
+	/**
+	 * 买家同意卖家发起的取消订单申请
+	 * @param orderid 订单号
+	 * @return
+	 */
+	String aduitReleaseOrder(String orderid);
+
+	/**
+	 * 买家不同意卖家发起的取消订单申请
+	 * @param orderid 订单号
+	 * @return
+	 */
+	String unaduitReleaseOrder(String orderid);
+
 	/**
 	 * 失效订单 (因确认是订单批次库存不足)
 	 *

+ 13 - 3
src/main/java/com/uas/platform/b2c/trade/order/service/PurchaseService.java

@@ -91,12 +91,13 @@ public interface PurchaseService {
 	Purchase ensuerAccept(Long puid);
 
 	/**
-	 * 确认付款,录用转账信息
+	 * 确认付款(卖家直接确认)
 	 *
-	 * @param id the id
+	 * @param id 采购单id
+	 * @param installmentDetailId 分期id
 	 * @return purchase
 	 */
-	Purchase ensurePaid(Long id);
+	Purchase ensurePaid(Long id, Long installmentDetailId);
 
 	/**
 	 * 根据id获取采购单
@@ -412,5 +413,14 @@ public interface PurchaseService {
 	 */
 	Logistics findByLgtId(Long lgtId);
 
+	/**
+	 * 卖家取消订单,释放库存
+	 *
+	 * @param purchaseId the purchaseId
+	 * @param reason 取消原因
+	 * @return string string
+	 */
+	String release(String purchaseId, String reason);
+
 	Logistics modifyPurchaseLogistics(Long id);
 }

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

@@ -20,7 +20,11 @@ import com.uas.platform.b2c.core.utils.DoubleArith;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.NumberUtil;
 import com.uas.platform.b2c.fa.payment.dao.BankTransferDao;
+import com.uas.platform.b2c.fa.payment.dao.InstallmentDao;
+import com.uas.platform.b2c.fa.payment.dao.InstallmentDetailDao;
 import com.uas.platform.b2c.fa.payment.model.BankTransfer;
+import com.uas.platform.b2c.fa.payment.model.Installment;
+import com.uas.platform.b2c.fa.payment.model.InstallmentDetail;
 import com.uas.platform.b2c.fa.payment.service.BankInfoService;
 import com.uas.platform.b2c.fa.settlement.dao.BillDao;
 import com.uas.platform.b2c.fa.settlement.dao.BillInfoDao;
@@ -187,6 +191,10 @@ public class OrderServiceImpl implements OrderService {
     private StoreInDao storeInDao;
     @Autowired
     private SendMessageService sendMessageService;
+    @Autowired
+    private InstallmentDao installmentDao;
+    @Autowired
+    private InstallmentDetailDao installmentDetailDao;
 
     /**
      * 保存订单信息
@@ -1294,7 +1302,17 @@ public class OrderServiceImpl implements OrderService {
     public List<Order> findOnesByOrderId(String[] orderids) {
         List<Order> orders = new ArrayList<>();
         for (String id : orderids) {
-            orders.add(orderDao.findByOrderid(id));
+            Order order = orderDao.findByOrderid(id);
+            //买家中心--采购单详情页 增加分期付款信息
+            Long installmentId = order.getInstallmentId();
+            if (installmentId != null) {
+                Installment installment = installmentDao.findOne(installmentId);
+                if (installment == null) {
+                    throw new IllegalOperatorException( "订单:" + order.getOrderid() + "分期信息有误,请重新确认或联系客服" );
+                }
+                order.setInstallment(installment);
+            }
+            orders.add(order);
         }
         return orders;
     }
@@ -1346,6 +1364,13 @@ public class OrderServiceImpl implements OrderService {
     @Transactional
     public Order ensurePayed(String orderid, Integer type, Long... param) {
         Order order = orderDao.findByOrderid(orderid);
+        if (order == null)
+            throw new IllegalOperatorException("此订单不存在,请重新确认订单信息");
+
+        // 分期付款目前只支持直接付款给卖家
+        if (order.getInstallmentId() != null)
+            throw new IllegalOperatorException("此订单为直接付款给卖家,平台不可确认收款,请重新确认订单信息");
+
         if (order.getStatus().intValue() != Status.PAID.value()
                 && order.getStatus().intValue() != Status.TOBEPAID.value()) {
             throw new IllegalOperatorException(
@@ -1419,12 +1444,13 @@ public class OrderServiceImpl implements OrderService {
         return newOrder;
     }
 
-	/**
-	 * Send message.
-	 *
-	 * @param purchase the purchase
-	 * @throws RuntimeException the runtime exception
-	 */
+    /**
+     * Send message.
+     *
+     * @param purchase the purchase
+     * @throws RuntimeException the runtime exception
+     */
+	@Override
 	public void sendMessage(Purchase purchase) throws RuntimeException{
         if (purchase == null) {
             return;
@@ -1603,6 +1629,15 @@ public class OrderServiceImpl implements OrderService {
     @Override
     public Order buyerOrderDetail(String orderid) {
         Order order = orderDao.findOrderByOrderid(orderid);
+        //买家中心--订单详情页 增加分期付款信息
+        Long installmentId = order.getInstallmentId();
+        if (installmentId != null) {
+            Installment installment = installmentDao.findOne(installmentId);
+            if (installment == null) {
+                throw new IllegalOperatorException("订单:" + order.getOrderid() + "分期信息有误,请重新确认或联系客服");
+            }
+            order.setInstallment(installment);
+        }
         Set<OrderDetail> orderDetails = order.getOrderDetails();
         for (OrderDetail orderDetail : orderDetails) {
             Goods goods = goodsService.findGoodsByBatchCode(orderDetail.getBatchCode());
@@ -1851,6 +1886,13 @@ public class OrderServiceImpl implements OrderService {
         }, pageInfo);
         for (Order order : orderPage.getContent()) {
             order.setSelfSell(!order.getStoreid().equals(sysConf.getStoreid()));
+            if (order.getInstallmentId() != null) {
+                Installment installment = installmentDao.findOne(order.getInstallmentId());
+                if (installment == null) {
+                    throw new IllegalOperatorException("订单:" + order.getOrderid() + "分期信息不存在,请重新确认订单信息");
+                }
+                order.setInstallment(installment);
+            }
         }
         return orderPage;
     }
@@ -1968,6 +2010,18 @@ public class OrderServiceImpl implements OrderService {
             order.setPuExInfoMapToJson(puExInfoMap);
         }
 
+        //买家中心--订单中心 增加分期付款信息
+        for (Order order : pageOrders) {
+            Long installmentId = order.getInstallmentId();
+            if (installmentId != null) {
+                Installment installment = installmentDao.findOne(installmentId);
+                if (installment == null) {
+                    throw new IllegalOperatorException("订单:" + order.getOrderid() + "分期信息有误,请重新确认或联系客服");
+                }
+                order.setInstallment(installment);
+            }
+        }
+
         modelMap.addAttribute("content", pageOrders.getContent());
         modelMap.addAttribute("totalElements", pageOrders.getTotalElements());
         modelMap.addAttribute("totalPages", pageOrders.getTotalPages());
@@ -2141,6 +2195,71 @@ public class OrderServiceImpl implements OrderService {
         return orderPage;
     }
 
+    @Override
+    public String unaduitReleaseOrder(String orderid) {
+        Order order = orderDao.findByOrderid(orderid);
+        List<Purchase> purchase = purchaseDao.findByOrderid(orderid);
+        if (purchase == null)
+            throw new IllegalOperatorException("此订单不存在");
+        if (order == null) {
+            throw new IllegalOperatorException("此订单不存在");
+        }
+
+        if (order.getInstallmentId() == null) {
+            throw new IllegalOperatorException("此订单付款方式非直接付款给卖家,您无法取消,请重新确认订单信息");
+        }
+        Installment installment = installmentDao.findOne(order.getInstallmentId());
+        if (installment == null) {
+            throw new IllegalOperatorException("订单:" + order.getOrderid() + "分期信息有误,请重新确认或联系客服");
+        }
+
+        Long uu = SystemSession.getUser().getUserUU();
+        Set<OrderDetail> orderDetails = order.getOrderDetails();
+        for (OrderDetail orderDetail : orderDetails) {
+            if (orderDetail.getStatus().equals(com.uas.platform.b2c.core.constant.Status.CANCELTOBECONFIRMED.value())) {
+                InstallmentDetail installmentDetail = installmentDetailDao.findByInstallmentIdAndDetno(installment.getId(), installment.getCurrentNo().shortValue());
+                if (com.uas.platform.b2c.core.constant.Status.PAID.value() == installmentDetail.getStatus().intValue()) {
+                    order.setStatusPaid(uu);
+                    orderDetail.setStatusPaid(uu);
+                }
+
+                if (com.uas.platform.b2c.core.constant.Status.MONEYRECEIVED.value() == installmentDetail.getStatus().intValue()) {
+                    order.setStatusToBePaidAgain(uu);
+                    orderDetail.setStatusToBePaidAgain(uu);
+                }
+
+                if (com.uas.platform.b2c.core.constant.Status.TOBEPAID.value() == installmentDetail.getStatus().intValue()) {
+                    order.setStatusToBePaidAgain(uu);
+                    orderDetail.setStatusToBePaidAgain(uu);
+                }
+
+            }
+        }
+
+        for (Purchase purchase1 : purchase) {
+            int puStatus = purchase1.getStatus().intValue();
+            purchase1.setStatusToBePaidAgain(uu);
+            for (PurchaseDetail detail : purchase1.getPurchaseDetails()) {
+                if (puStatus == detail.getStatus().intValue()) {
+                    detail.setStatusToBePaidAgain(uu);
+                }
+            }
+        }
+
+        purchaseDao.save(purchase);
+        orderDao.save(order);
+        return "success";
+    }
+
+    @Override
+    public String aduitReleaseOrder(String orderid) {
+        Order order = orderDao.findByOrderid(orderid);
+        if (order == null) {
+            throw new IllegalOperatorException("此订单不存在");
+        }
+        return releaseOrder(orderid, order.getUnavailableReason());
+    }
+
     /**
      * 取消订单,释放库存
      *
@@ -2156,10 +2275,17 @@ public class OrderServiceImpl implements OrderService {
             throw new IllegalOperatorException("此订单不存在");
         }
         Set<Integer> status = new HashSet<>();
-        Collections.addAll(status, Status.TOBECONFIRMED.value(), Status.TOBEPAID.value(), Status.CONFIRMED.value());
+        Collections.addAll(status, Status.TOBECONFIRMED.value(), Status.TOBEPAID.value(), Status.CONFIRMED.value(), com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value(), com.uas.platform.b2c.core.constant.Status.PAID.value(), com.uas.platform.b2c.core.constant.Status.CANCELTOBECONFIRMED.value());
         if (!status.contains(order.getStatus())) {
             throw new IllegalOperatorException("此订单已付款,不可取消订单");
         }
+        // 买家取消订单验证
+        if (order.getInstallmentId() != null) {
+            Installment installment = installmentDao.findOne(order.getInstallmentId());
+            if (installment == null) {
+                throw new IllegalOperatorException("此订单分期信息有误,请重新确认订单信息");
+            }
+        }
         Set<String> uuids = new HashSet<>();
         Long uu = SystemSession.getUser().getUserUU();
         order.setStatusUnAvailablePersonal(uu);
@@ -2197,7 +2323,6 @@ public class OrderServiceImpl implements OrderService {
         return "success";
     }
 
-
     // TODO 查询接口 支持类型 :现货
     @Override
     public ModelMap findUserVenderByCode(String orderid) {

+ 283 - 32
src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseServiceImpl.java

@@ -15,6 +15,11 @@ import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.support.log.TradeBufferedLogger;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.NumberUtil;
+import com.uas.platform.b2c.fa.payment.dao.InstallmentDao;
+import com.uas.platform.b2c.fa.payment.dao.InstallmentDetailDao;
+import com.uas.platform.b2c.fa.payment.model.Installment;
+import com.uas.platform.b2c.fa.payment.model.InstallmentDetail;
+import com.uas.platform.b2c.fa.payment.service.InstallmentService;
 import com.uas.platform.b2c.fa.settlement.dao.BillDao;
 import com.uas.platform.b2c.fa.settlement.dao.BillInfoDao;
 import com.uas.platform.b2c.fa.settlement.model.Bill;
@@ -32,16 +37,8 @@ import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 import com.uas.platform.b2c.prod.store.model.StoreIn;
 import com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus;
-import com.uas.platform.b2c.trade.order.dao.OrderDao;
-import com.uas.platform.b2c.trade.order.dao.OrderDetailDao;
-import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
-import com.uas.platform.b2c.trade.order.dao.PurchaseDetailDao;
-import com.uas.platform.b2c.trade.order.dao.PurchaseModifyingHistoryDao;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.b2c.trade.order.model.OrderDetail;
-import com.uas.platform.b2c.trade.order.model.Purchase;
-import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
-import com.uas.platform.b2c.trade.order.model.PurchaseModifyingHistory;
+import com.uas.platform.b2c.trade.order.dao.*;
+import com.uas.platform.b2c.trade.order.model.*;
 import com.uas.platform.b2c.trade.order.service.OrderService;
 import com.uas.platform.b2c.trade.order.service.PurchaseDetailService;
 import com.uas.platform.b2c.trade.order.service.PurchaseService;
@@ -74,15 +71,7 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 
 import static com.uas.platform.b2c.trade.util.Preconditions.checkArgument;
 import static com.uas.platform.b2c.trade.util.Preconditions.checkNotNull;
@@ -153,6 +142,12 @@ public class PurchaseServiceImpl implements PurchaseService {
     private PurchaseModifyingHistoryDao purchaseModifyingHistoryDao;
 	@Autowired
 	private LogisticsDao logisticsDao;
+	@Autowired
+	private InstallmentDao installmentDao;
+    @Autowired
+    private InstallmentDetailDao installmentDetailDao;
+	@Autowired
+	private InstallmentService installmentService;
 
 	@Override
 	public Purchase save(Purchase purchase) {
@@ -624,19 +619,128 @@ public class PurchaseServiceImpl implements PurchaseService {
 	}
 
 	@Override
-	public Purchase ensurePaid(Long id) {
-		// TODO 这里需要前台加入录用银行转账信息
+	public Purchase ensurePaid(Long id, Long installmentDetailId) {
 		Purchase purchase = purchaseDao.findOne(id);
-		if (!purchase.getStatus().equals(Status.TOBEPAID.value())) {
-			throw new IllegalAccessError("采购单不为待付款状态,不能确认付款");
-		}
-		Long uu = SystemSession.getUser().getUserUU();
-		// 关联卖家出货单改为已收款
-		InvoiceFPurchase iFpurchase = invoiceFPurchaseDao.findByInvoiceid(purchase.getInid());
-		iFpurchase.setStatusMoneyreceived(uu);
-		purchase.setPaid(uu);
-		invoiceFPurchaseDao.save(iFpurchase);
-		return purchaseDao.save(purchase);
+		if (purchase == null)
+			throw new IllegalOperatorException("此订单不存在,请重新确认订单信息");
+        Order order = orderDao.findByOrderid(purchase.getOrderid());
+        if (order == null)
+            throw new IllegalOperatorException("此订单不存在,请重新确认订单信息");
+
+        // 分期付款目前只支持直接付款给卖家
+        if (order.getInstallmentId() == null)
+            throw new IllegalOperatorException("此订单为向平台付款,您不可确认收款,请重新确认订单信息");
+
+        if (order.getStatus().intValue() != Status.PAID.value()
+                && order.getStatus().intValue() != Status.TOBEPAID.value()) {
+            throw new IllegalOperatorException(
+                    "订单" + order.getOrderid() + "的状态是" + Status.valueOf(order.getStatus()).getPhrase() + ",不能确认收款");
+        }
+
+        InstallmentDetail installmentDetail = installmentDetailDao.findOne(installmentDetailId);
+
+        if (installmentDetail == null)
+            throw new IllegalOperatorException("对应分期信息不存在,请重新确认分期信息");
+        Installment installment = installmentDetail.getInstallment();
+        if (!installment.getId().equals(purchase.getInstallmentId()))
+            throw new IllegalOperatorException("此订单与此分期信息不符,请重新确认订单信息");
+        if (com.uas.platform.b2c.core.constant.Status.PAID.value() != installment.getStatus().intValue())
+            throw new IllegalOperatorException("此订单分期不为待确认付款状态,请重新确认分期信息");
+        if (!installment.getCurrentNo().equals(installmentDetail.getDetno()))
+            throw new IllegalOperatorException("此次付款分期与应付分期信息不符,请重新确认分期信息");
+        if (com.uas.platform.b2c.core.constant.Status.PAID.value() != installmentDetail.getStatus().intValue())
+            throw new IllegalOperatorException("此次分期不为待确认付款状态,请重新确认分期信息");
+
+        installmentDetail.setStatus(com.uas.platform.b2c.core.constant.Status.MONEYRECEIVED.value());
+        installmentDetail.setEnsureDate(new Date());
+
+        Boolean isReceived = false;
+        if (installmentDetail.getDetno().equals(installment.getCount().shortValue())) {
+            installment.setStatus(com.uas.platform.b2c.core.constant.Status.MONEYRECEIVED.value());
+            isReceived = true;
+        } else {
+            installment.setCurrentNo((short) (installment.getCurrentNo() + 1));
+        }
+
+        Long userUU = SystemSession.getUser().getUserUU();
+
+        order.setPaytype(Type.Payment_CompanyTransfer_Code.value());
+        Set<OrderDetail> orderDetails = order.getOrderDetails();
+        for (OrderDetail orderDetail : orderDetails) {
+            Goods goods = goodsDao.findByBatchCode(orderDetail.getBatchCode());
+            // 更新改订单涉及批次的上次更新时间,以延长批次有效期
+            if (goods != null) {
+                if (goods.getSourceId() == null) {
+                    goodsService.updateAvailableDays(goods, GoodsHistory.OperateType.OrderPaied, userUU);
+                }
+            }
+            // 修改明细的状态,设置为等待卖家同意
+            if ((orderDetail.getStatus().intValue() == Status.PAID.value()) || (orderDetail.getStatus().intValue() == Status.TOBEPAID.value()) || (orderDetail.getStatus() == com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value())) {
+                if (isReceived) {
+                    orderDetail.setStatusMonecyReceviced(userUU);
+                } else {
+                    orderDetail.setStatusToBePaidAgain(userUU);
+                }
+            } else if ((orderDetail.getStatus().intValue() != Status.UNAVAILABLE_DISAGREE.value()) && (orderDetail.getStatus().intValue() != Status.TOBEREFUNDED.value())
+                    && (orderDetail.getStatus().intValue() != Status.UNAVAILABLE_PERSONAL.value())) {
+                throw new IllegalOperatorException("当前的订单存在明细行状态不正常:" + orderDetail.getDetailid() + " 状态是"
+                        + Status.valueOf(orderDetail.getStatus()).getPhrase());
+            }
+        }
+
+        // 设置为等待卖家同意
+        if (isReceived) {
+            order.setStatusMonecyReceviced(userUU);
+        } else {
+            order.setStatusToBePaidAgain(userUU);
+        }
+
+        order.setPaytime(new Date());
+        Order newOrder = orderDao.save(order);
+
+        ArrayList<Integer> statusList = new ArrayList<>();
+        Collections.addAll(statusList, Status.TOBECONFIRMED.value(), Status.PAID.value(), com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value());
+
+        if (statusList.contains(purchase.getStatus())) {
+            if (isReceived) {
+                purchase.setStatusComfirmed(userUU);
+            } else {
+                purchase.setStatusToBePaidAgain(userUU);
+            }
+
+            // 设置明细的状态
+            Set<PurchaseDetail> purchaseDetails = purchase.getPurchaseDetails();
+            for (PurchaseDetail purchaseDetail : purchaseDetails) {
+                if (statusList.contains(purchaseDetail.getStatus())) {
+                    if (isReceived) {
+                        purchaseDetail.setStatusComfirmed(userUU);
+                    } else {
+                        purchaseDetail.setStatusToBePaidAgain(userUU);
+                    }
+                } else if ((purchaseDetail.getStatus().intValue() != Status.UNAVAILABLE_DISAGREE.value())
+                        && (purchaseDetail.getStatus().intValue() != Status.UNAVAILABLE_PERSONAL.value())) {
+                    throw new IllegalOperatorException("存在采购单明细状态异常:" + purchaseDetail.getDetailid() + ", 状态是:"
+                            + Status.valueOf(purchaseDetail.getStatus()).getPhrase());
+                }
+            }
+
+            purchase.setSendstatus(Status.NOT_UPLOAD.value());
+            purchaseDao.save(purchase);
+            //发送短信,异常不作处理
+			if (purchase.getInstallmentId() == null) {
+				try {
+					orderService.sendMessage(purchase);
+				}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() + ",是异常状态");
+        }
+
+        installmentDetailDao.save(installmentDetail);
+        installmentDao.save(installment);
+        return purchase;
 	}
 
 	@Override
@@ -1089,6 +1193,19 @@ public class PurchaseServiceImpl implements PurchaseService {
 		setExceptionStatus(pageInfo, exceptionType);
 
 		Page<Purchase> purchasePage = getPurchaseByStatus(pageInfo, null, status, isProof);
+
+		//卖家中心--订单中心 增加分期付款信息
+		for (Purchase purchase : purchasePage) {
+			Long installmentId = purchase.getInstallmentId();
+			if (installmentId != null) {
+				Installment installment = installmentDao.findOne(installmentId);
+				if (installment == null) {
+					throw new IllegalOperatorException("订单:" + purchase.getPurchaseid() + "分期信息有误,请重新确认或联系客服");
+				}
+				purchase.setInstallment(installment);
+			}
+		}
+
 		modelMap.put("totalElements", purchasePage.getTotalElements());
 		modelMap.put("totalPages", purchasePage.getTotalPages());
 		modelMap.put("content", purchasePage.getContent());
@@ -1227,6 +1344,15 @@ public class PurchaseServiceImpl implements PurchaseService {
 			return new ResultMap(CodeType.NO_INFO, "采购单编号不能为空");
 		}
 		Purchase purchase = purchaseDao.findByPurchaseid(purchaseId);
+		//卖家中心--采购单详情页 增加分期付款信息
+		Long installmentId = purchase.getInstallmentId();
+		if (installmentId != null) {
+			Installment installment = installmentDao.findOne(installmentId);
+			if (installment == null) {
+				throw new IllegalOperatorException("订单:" + purchase.getPurchaseid() + "分期信息有误,请重新确认或联系客服");
+			}
+			purchase.setInstallment(installment);
+		}
 		Long enUU = SystemSession.getUser().getEnterprise().getUu();
 		if (!Objects.equals(enUU, purchase.getSellerenuu())) {
 			return new ResultMap(CodeType.NOT_PERMIT, "非法获取操作");
@@ -1343,6 +1469,26 @@ public class PurchaseServiceImpl implements PurchaseService {
 
 	@Override
 	public String modifyPurchaseDetailUnitPrice(List<PurchaseModifyingHistory> list){
+		//卖家改价验证
+		if (!CollectionUtils.isEmpty(list)) {
+			PurchaseModifyingHistory purchaseModifyingHistory = list.get(0);
+			PurchaseDetail purchaseDetail = purchaseDetailDao.findByDetailid(purchaseModifyingHistory.getDetailid());
+			Purchase purchase = purchaseDetail.getPurchase();
+			if (purchase != null) {
+				if (purchase.getInstallmentId() != null) {// 验证分期
+					Installment installment = installmentDao.findOne(purchase.getInstallmentId());
+					if (installment != null) {
+						if (com.uas.platform.b2c.core.constant.Status.TOBEPAID.value() != installment.getStatus()) {
+							throw new IllegalOperatorException( "此订单已付款,不可改价" );
+						}
+					} else {
+						throw new IllegalOperatorException( "此订单分期信息有误,请重新确认订单信息" );
+					}
+				}
+			} else {
+				throw new IllegalOperatorException( "此订单不存在,请重新确认订单信息" );
+			}
+		}
 		Iterator<PurchaseModifyingHistory> it = list.iterator();
 		while(it.hasNext()){
 			PurchaseModifyingHistory data = it.next();
@@ -1351,7 +1497,6 @@ public class PurchaseServiceImpl implements PurchaseService {
 			PurchaseDetail purchaseDetail = purchaseDetailDao.findByDetailid(purchaseDetailid);
 			Integer status = purchaseDetail.getStatus();
 			Integer dd = Status.TOBECONFIRMED.value();
-			System.out.println(!purchaseDetail.getStatus().equals(Status.TOBECONFIRMED.value()));
 			if(!purchaseDetail.getStatus().equals(Status.TOBECONFIRMED.value())){
 				throw new IllegalOperatorException("当前状态是:" + Status.valueOf(purchaseDetail.getStatus()).getPhrase() + ",不能修改采购单明细单价");
 			}
@@ -1442,6 +1587,14 @@ public class PurchaseServiceImpl implements PurchaseService {
 			history.setModifyingUnitPrice(modifyingUnitPrice);
 			purchaseModifyingHistoryDao.save(history);
 		}
+
+		if (CollectionUtils.isNotEmpty(list)) {
+			PurchaseModifyingHistory purchaseModifyingHistory = list.get(0);
+			PurchaseDetail purchaseDetail = purchaseDetailDao.findByDetailid(purchaseModifyingHistory.getDetailid());
+			Purchase purchase = purchaseDetail.getPurchase();
+			if (purchase.getInstallmentId() != null)
+				installmentService.updateAfterModifyPurchasePrice(list.get(0).getDetailid());
+		}
 		return "success";
 	}
 
@@ -1460,6 +1613,104 @@ public class PurchaseServiceImpl implements PurchaseService {
 		return logisticsDao.findOne(lgtId);
 	}
 
+	/**
+	 * 卖家取消订单,释放库存
+	 *
+	 * @param purchaseId
+	 * @return string string
+	 */
+	@Transactional
+	@Override
+	public String release(String purchaseId,  String reason) {
+		Purchase purchase = purchaseDao.findByPurchaseid(purchaseId);
+		if (purchase == null)
+			throw new IllegalOperatorException("订单不存在");
+		Order order = orderDao.findByOrderid(purchase.getOrderid());
+		if (order == null) {
+			throw new IllegalOperatorException("此订单不存在");
+		}
+		if (SystemSession.getUser().getEnterprise() == null) {
+			throw new IllegalOperatorException("您的企业信息有误,请重新选择企业");
+		}
+
+		if (purchase.getInstallmentId() == null) {
+			throw new IllegalOperatorException("此订单付款方式非直接付款给卖家,您无法取消,请重新确认订单信息");
+		}
+		Installment installment = installmentDao.findOne(purchase.getInstallmentId());
+		if (installment == null) {
+			throw new IllegalOperatorException("订单:" + order.getOrderid() + "分期信息有误,请重新确认或联系客服");
+		}
+		purchase.setInstallment(installment);
+        if (!SystemSession.getUser().getEnterprise().getUu().equals(purchase.getInstallment().getSellerenuu())) {
+            throw new IllegalOperatorException("该订单不属于当前企业,请重新确认信息");
+        }
+
+		Date sysDate = new Date();
+		Long uu = SystemSession.getUser().getUserUU();
+		InstallmentDetail installmentDetail = installmentDetailDao.findByInstallmentIdAndDetno(installment.getId(), (short) 1);
+		if (sysDate.after(installmentDetail.getDeadline()) || com.uas.platform.b2c.core.constant.Status.PAID.value() == installment.getStatus().intValue()) {// 当前时间已将超过一期的截止时间
+			if (com.uas.platform.b2c.core.constant.Status.TOBEPAID.value() == installment.getStatus().intValue()) {// 买家未付款,直接取消
+				Set<String> uuids = new HashSet<>();
+				order.setStatusUnAvailablePersonal(uu);
+				order.setUnavailableTime(new Date());
+				order.setUnavailableReason(reason);
+				Set<OrderDetail> orderDetails = order.getOrderDetails();
+				for (OrderDetail orderDetail : orderDetails) {
+					if (orderDetail.getStatus().equals(Status.CONFIRMED.value())
+							|| orderDetail.getStatus().equals(Status.TOBEPAID.value())) {
+						uuids.add(orderDetail.getUuid());
+						orderDetail.setStatusUnAvailablePersonal(uu);
+						goodsService.releaseReserve(orderDetail.getBatchCode(), orderDetail.getNumber());
+					}
+				}
+
+				List<Purchase> purchases = purchaseDao.findByOrderid(order.getOrderid());
+				if (!org.springframework.util.CollectionUtils.isEmpty(purchases)) {
+					for (Purchase purchase1: purchases) {
+						int puStatus = purchase1.getStatus().intValue();
+						purchase1.setStatusUnAvailablePersonal(uu);
+						purchase1.setUnavailableTime(new Date());
+						for (PurchaseDetail detail : purchase1.getPurchaseDetails()) {
+							if (puStatus == detail.getStatus().intValue()) {
+								detail.setStatusUnAvailablePersonal(uu);
+								detail.setUnavailableTime(new Date());
+							}
+						}
+					}
+				}
+				purchaseDao.save(purchases);
+				orderDao.save(order);
+				for (String uuid : uuids) {
+					goodsService.updateComponentTradeInfos(uuid);
+				}
+			} else {// 买家已付款,卖家发起取消申请
+				Set<OrderDetail> orderDetails = order.getOrderDetails();
+				order.setStatusCancelToBeConfirmed(uu);
+				order.setUnavailableReason(reason);
+				for (OrderDetail orderDetail : orderDetails) {
+					if (orderDetail.getStatus().equals(com.uas.platform.b2c.core.constant.Status.PAID.value())
+							|| orderDetail.getStatus().equals(com.uas.platform.b2c.core.constant.Status.TOBEPAIDAGAGIN.value())) {
+						orderDetail.setStatusCancelToBeConfirmed(uu);
+					}
+				}
+
+				int puStatus = purchase.getStatus().intValue();
+				purchase.setStatusCancelToBeConfirmed(uu);
+				for (PurchaseDetail detail : purchase.getPurchaseDetails()) {
+					if (puStatus == detail.getStatus().intValue()) {
+						detail.setStatusCancelToBeConfirmed(uu);
+					}
+				}
+				purchaseDao.save(purchase);
+				orderDao.save(order);
+			}
+		} else {
+			throw new IllegalOperatorException("买家未逾期付款,您不可取消");
+		}
+
+		return "success";
+	}
+
 	@Override
 	public Logistics modifyPurchaseLogistics(Long id) {
 		return null;

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

@@ -0,0 +1,555 @@
+.down-payment{
+    width: 100%;
+    margin:0 auto;
+    background: #fff;
+    display: inline-block;
+    padding-bottom: 70px;
+}
+.down-payment .content{
+    width: 1000px;
+    margin: 0 auto;
+    border: #89aefa 1px solid;
+    margin-top: 15px;
+    padding-bottom: 30px;
+}
+.payment-title{
+    width: 100%;
+    height: 42px;
+    line-height: 42px;
+    font-size: 14px;
+    background: #f9f9fa;
+    padding-left: 10px;
+}
+.payment-title em{
+    color: #fe3e3c;
+}
+.common-title{
+    width: 100%;
+    height: 40px;
+    line-height: 40px;
+    font-size: 14px;
+    font-weight: bold;
+    padding-left: 10px;
+    margin-top: 20px;
+}
+.common-title.margin-top-none{
+    margin-top: 2px;
+}
+.down-payment .order-list{
+    width: 100%;
+    margin: 0 auto;
+    background: #f5f8fe;
+}
+.down-payment .order-list ul{
+    width: 100%;
+    margin: 0 auto;
+    display: inline-block;
+}
+.down-payment .order-list li{
+    width: 25%;
+    height: 42px;
+    /*background: #f9f9fa;*/
+    line-height: 42px;
+    float: left;
+}
+.down-payment .payment-style ul li.no-count span{
+    margin-left: 28px;
+}
+.down-payment .payment-style ul li.no-count span i{
+    font-size: 16px;
+    color: #5078cb;
+    margin-right: 5px;
+}
+.down-payment .payment-style ul li.no-count span a{
+    color: #5078cb;
+}
+.down-payment .order-list li a{
+    font-size: 14px;
+}
+.down-payment .order-list li a:hover{
+    color: #5078cb;
+}
+.down-payment .order-list li a em{
+    display: inline-block;
+    width: 15px;
+    height: 15px;
+    background: #89aefa;
+    border-radius: 2px;
+    text-align: center;
+    font-size: 12px;
+    color: #fff;
+    line-height: 15px;
+    margin: 0 10px 0 28px;
+    position: relative;
+    top: -1px;
+}
+.check-act input{
+    display: none;
+}
+.check-act label{
+    width: 12px;
+    height: 12px;
+    display: inline-block;
+    background: url(../img/icon/check-rule.png) no-repeat;
+    position: relative;
+    top: 15px;
+    margin-right: 10px;
+    margin-left: 28px;
+}
+.check-act label{
+    background-position: 0 0;
+}
+.check-act input:checked + label{
+    background-position: -15px 0;
+}
+.word-in-10 {
+    max-width: 152px;
+    display: inline-block;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+.down-payment .payment-style{
+    width:100%;
+    margin: 0 auto;
+    background: #f5f8fe;
+}
+.down-payment .payment-style ul{
+    width: 100%;
+    margin: 0 auto;
+    display: inline-block;
+}
+.down-payment .payment-style ul li{
+    width: 100%;
+    float: left;
+    height: 42px;
+    line-height: 42px;
+    font-size: 14px;
+}
+.down-payment .payment-style ul li div{
+    float: left;
+}
+.down-payment .payment-style ul li label{
+    float: left;
+}
+.down-payment .payment-style ul li .tip-content{
+    position: relative;
+}
+.down-payment .payment-style ul li div{
+    margin-right: 30px;
+}
+.down-payment .payment-style ul li .tip-content img{
+    position: relative;
+    top: -2px;
+}
+.down-payment .payment-style ul li .tip-content img:hover + .tip-content-01{
+    display: inline-block;
+}
+.down-payment .payment-style ul li .tip-content .tip-content-01{
+    display: none;
+    position: absolute;
+    left: -82px;
+    top: 40px;
+    width: 233px;
+    height: 80px;
+    border: #89aefa 1px solid;
+    box-shadow: 1px 1px 5px #999;
+    font-size: 12px;
+    color: #666;
+    line-height: 20px;
+    padding-left: 11px;
+    padding-top: 7px;
+    background: #fff;
+    z-index: 500;
+}
+.down-payment .pay-price{
+    width: 100%;
+    margin: 0 auto;
+    display: inline-block;
+    padding-right: 14px;
+}
+.down-payment .pay-price div.row{
+    font-size: 16px;
+    margin: 0;
+    margin-top: 20px;
+}
+.down-payment .pay-price div.row em{
+    font-size: 18px;
+    color: #e41515;
+    font-weight: bold;
+}
+.down-payment .pay-price div.row button{
+    border: none;
+    width: 64px;
+    height: 30px;
+    line-height: 30px;
+    background: #5078cb;
+    text-align: center;
+    color: #fff;
+    float: right;
+    font-size: 14px;
+}
+
+/*立即支付*/
+.payment-style ul.payment-80{
+   max-height: 80px;
+}
+.payment-style ul.payment-80 li{
+    height: 35px;
+    line-height: 35px;
+}
+.payment-style ul.payment-80 .check-act label{
+    top: 12px;
+}
+.payment-detail{
+    width: 100%;
+    margin: 0 auto;
+    background: #f5f8fe;
+}
+.payment-detail ul{
+    width: 100%;
+    margin: 0 auto;
+    padding: 18px 0 18px 28px;
+    display: inline-block;
+}
+.payment-detail ul li{
+    width: 100%;
+    float: left;
+    font-size: 14px;
+    margin-bottom: 16px;
+}
+.payment-detail ul li:last-child{
+    margin-bottom: 0;
+}
+.payment-detail ul li span:nth-child(2){
+    margin: 0 50px 0 25px;
+}
+.payment-detail ul li em img{
+    position: relative;
+    top: -3px;
+}
+.change-count{
+    width: 70px;
+    height: 22px;
+    border: none;
+    line-height: 22px;
+    border-radius: 2px;
+    color: #fff;
+    background: #ff8522;
+}
+.common-title.margin-top-8{
+    margin-top: 8px;
+}
+.payment-upload{
+    width: 100%;
+    margin: 0 auto;
+    background: #f5f8fe;
+    margin-top: -2px;
+}
+.payment-upload ul{
+    width: 100%;
+    margin: 0 auto;
+    display: inline-block;
+    padding-left: 28px;
+    padding-top: 15px;
+}
+.payment-upload ul li{
+    width: 114px;
+    float: left;
+    margin-left: 40px;
+}
+.payment-upload ul li:first-child{
+    margin-left: 0;
+}
+.payment-upload ul li .upload{
+    width: 114px;
+    height: 114px;
+    background: #fff;
+    position: relative;
+    overflow: hidden;
+}
+.payment-upload ul li .upload .img{
+    width: 100%;
+    height: 100%;
+    text-align: center;
+}
+.payment-upload ul li .upload .img img{
+    width: 114px;
+    height: 114px;
+}
+.payment-upload ul li .price{
+    width: 114px;
+    height: 26px;
+    margin: 0 auto;
+    margin-top: 26px;
+}
+.payment-upload ul li .price em{
+    width: 21px;
+    height: 26px;
+    display: inline-block;
+    text-align: center;
+    line-height: 26px;
+    color: #fff;
+    background: #5078cb;
+    float: left;
+    border-bottom-left-radius: 2px;
+    border-top-left-radius: 2px;
+}
+.payment-upload ul li .price input{
+    width: 93px;
+    height: 26px;
+    padding: 0;
+    line-height: 26px;
+    float: right;
+    border-radius: 0;
+    text-align: center;
+    font-size: 12px;
+}
+.img-specifications{
+    width: 100%;
+    padding: 14px 28px;
+    color: #999;
+    font-size: 12px;
+}
+.down-payment .pay-price div.stage{
+    margin-top: 0;
+}
+.down-payment .pay-price div.stage .content{
+    width: 250px;
+    float: right;
+    border: none;
+    margin-top: 0;
+    padding-bottom: 0;
+}
+.down-payment .pay-price div.stage p{
+    height: 30px;
+    font-size: 14px;
+    line-height: 30px;
+    background: #f5f8fe;
+}
+.down-payment .pay-price div.stage p em{
+    font-size: 14px;
+    color: #333;
+}
+.down-payment .pay-price div.stage p.total{
+    background: #fff;
+    font-size: 16px;
+    margin-top: 5px;
+}
+.down-payment .pay-price div.stage p.total em{
+    font-size: 18px;
+}
+.down-payment .pay-price div.stage p span{
+    width: 60px;
+    text-align: right;
+    display: inline-block;
+    margin-left: 55px;
+}
+.red{
+    color: #e41515 !important;
+}
+.bule{
+    color: #5078cb !important;
+}
+
+.deal-btn{
+    width: 100%;
+    margin: 0 auto;
+    text-align: center;
+    margin-top: 18px;
+}
+.deal-btn a{
+    width: 70px;
+    height: 30px;
+    display: inline-block;
+    text-align: center;
+    line-height: 30px;
+    font-size: 14px;
+}
+.deal-btn a.off{
+    background: #cdcccc;
+    color: #fff;
+    margin-right: 8px;
+}
+.deal-btn a.ok{
+    background: #5078cb;
+    color: #fff;
+}
+.deal-btn a:hover{
+    background: #337ab7;
+    color: #fff;
+}
+.down-payment .pay-price div.row .deal-btn{
+    margin-top: 12px;
+}
+.down-payment .pay-price div.row .deal-btn a{
+    float: right;
+}
+.down-payment .pay-price div.row .deal-btn a.off{
+    margin-right: 10px;
+}
+.down-payment .hover-show{
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    left: 0;
+    top: 100%;
+    background: rgba(0,0,0,.35);
+}
+.payment-upload ul li .upload:hover .hover-show{
+    top: 0;
+}
+.down-payment .hover-show a{
+    display: inline-block;
+    width: 100%;
+    height: 100%;
+    font-size: 14px;
+    color: #fff;
+    text-align: center;
+    line-height: 114px;
+}
+.down-payment .hover-show a i{
+    margin-right: 5px;
+}
+.down-payment .hover-show span.delete{
+    position: absolute;
+    z-index: 100;
+    display: inline-block;
+    width: 30px;
+    height: 30px;
+    right: 0;
+    top: 0;
+    color: #fff;
+    font-size: 14px;
+    line-height: 30px;
+    text-align: center;
+}
+.down-payment .hover-show span.delete i{
+    font-size: 18px;
+}
+/*修改扫描单*/
+.payment-upload-list{
+    width: 100%;
+    margin: 0 auto;
+    background: #ecf2fd;
+    display: inline-block;
+    padding: 15px 0 0 10px;
+}
+.payment-upload-list .item{
+    width: 140px;
+    float: left;
+    margin: 0 7px;
+}
+.payment-upload-list .item .img-list{
+    width: 100%;
+    height: 114px;
+    margin: 0 auto;
+}
+.payment-upload-list .item .img-list div{
+    float: left;
+}
+.payment-upload-list .item .img-list .img{
+    width: 114px;
+    height: 114px;
+    border: solid 1px rgb(212, 212, 212);
+    position: relative;
+    overflow: hidden;
+    background: #fff;
+}
+.payment-upload-list .item .img-list .number{
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 47px;
+    height: 47px;
+    display: inline-block;
+    background: url("../img/icon/nummber-bg.png") no-repeat center;
+    z-index: 20;
+}
+.payment-upload-list .item .img-list .number em{
+    line-height: 30px;
+    font-size: 12px;
+    color: #fff;
+    transform: rotate(-45deg);
+    display: inline-block;
+    position: relative;
+    left: -3px;
+}
+.payment-upload-list .item .img-list div.prev,.payment-upload-list .item .img-list div.next{
+    width: 10px;
+    height: 16px;
+    font-size: 28px;
+    position: relative;
+    top: 40px;
+    color: #c9c9c7;
+}
+.payment-upload-list .item .img-list div.prev:hover,.payment-upload-list .item .img-list div.next:hover{
+    color: #5078cb;
+}
+.payment-upload-list .item .img-list div.prev{
+    margin-right: 3px;
+}
+.payment-upload-list .item .img-list div.next{
+    margin-left: 3px;
+}
+.payment-upload-list .item .img-list .list,.payment-upload-list .item .img-list .list img{
+    width: 114px;
+    height: 114px;
+    margin: 0 auto;
+    position: relative;
+}
+.payment-upload-list .item .img-list .list span{
+    width: 114px;
+    height: 114px;
+    display: inline-block;
+}
+.payment-upload-list .item .img-list .list:hover .hover-show{
+    top: 0;
+}
+.payment-upload-list .item .price-input{
+    width: 114px;
+    height: 26px;
+    line-height: 26px;
+    margin-left: 13px;
+}
+.payment-upload-list .item .price-input input{
+    height: 26px;
+    text-align: center;
+    font-size: 14px;
+    color: #5078cb;
+    border: #5078cb 1px solid;
+    background: #fff;
+    border-radius: 0;
+    cursor: default;
+}
+.payment-upload-list .item .time{
+    width:100%;
+    font-size: 12px; color: #999999;
+    text-align: left;
+    margin: 16px 0 15px 13px;
+}
+.payment-upload-list .item .small-img{
+    width: 114px;
+    height: 15px;
+    margin: 4px 0 8px 13px;
+}
+.payment-upload-list .item  .small-img span{
+    width: 15px;
+    height: 15px;
+    display: inline-block;
+    overflow: hidden;
+    border: #e0dddd 1px solid;
+    background: #e0dddd;
+    float: left;
+    margin-left: 4.5px;
+}
+.payment-upload-list .item  .small-img span:first-child{
+    margin-left: 0;
+}
+.payment-upload-list .item .small-img span.active,.payment-upload-list .item .small-img span:hover{
+    border: #5078cb 1px solid;
+}
+.payment-upload-list .item .small-img span img{
+    width: 15px;
+    height: 15px;
+}

binární
src/main/webapp/resources/img/icon/icon-no.png


binární
src/main/webapp/resources/img/icon/icon-xiala.png


binární
src/main/webapp/resources/img/icon/icon-yes.png


binární
src/main/webapp/resources/img/icon/img.png


binární
src/main/webapp/resources/img/icon/nummber-bg.png


binární
src/main/webapp/resources/img/icon/pay-ok-icon.png


binární
src/main/webapp/resources/img/icon/payment-add.png


binární
src/main/webapp/resources/img/icon/payment-upload.png


+ 9 - 0
src/main/webapp/resources/js/common/query/bankInfo.js

@@ -33,6 +33,15 @@ define(['ngResource'], function(ngResource) {
 					status : 104
 				}
 			},
+			getSaleEeterprise : {
+				url : 'trade/bankInfo/sale/enterprise/:enuu',
+				method: 'GET',
+				isArray : true,
+				params : {
+					type : 'sup',
+					status : 104
+				}
+			},
 			getPageStatusBankInfo : {
 				url : 'trade/bankInfo/page/bankinfo',
 				method : 'GET'

+ 27 - 0
src/main/webapp/resources/js/common/query/installments.js

@@ -0,0 +1,27 @@
+define([ 'ngResource' ], function() {
+    angular.module('installmentServices', [ 'ngResource' ]).factory('Installment', ['$resource', 'BaseService', function($resource, BaseService) {
+        var rootPath = BaseService.getRootPath();
+        return $resource('/trade/installments', {}, {
+            // 新增分期信息
+            addInstallment: {
+                url: rootPath + '/trade/installments',
+                method: 'POST'
+            },
+            // 更新分期信息
+            updateInstallment: {
+                url: rootPath + '/trade/installments',
+                method: 'PUT'
+            },
+            // 删除分期信息
+            deleteInstallment: {
+                url: rootPath + '/trade/installments/:purchaseId',
+                method: 'DELETE'
+            },
+            // 验证是否能启用分期信息
+            validationCount: {
+                url: rootPath + '/trade/installments/:purchaseId/validate',
+                method: 'GET'
+            }
+        });
+    }])
+});

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

@@ -300,7 +300,8 @@ define([ 'ngResource' ], function() {
                 method : 'PUT'
             }
         });
-    }]).factory('OrderSimpleInfo', ['$resource', function($resource) {
+    }]).factory('OrderSimpleInfo', ['$resource','BaseService', function($resource, BaseService) {
+        var rootPath = BaseService.getRootPath();
         //获取order的分页数据
         return $resource('trade/order/simpleinfo', {}, {
             //获得所有简单数据
@@ -369,6 +370,16 @@ define([ 'ngResource' ], function() {
             getBuyPayRecord : {
                 url : 'trade/order/payRecord',
                 method : 'GET'
+            },
+            // 买家同意取消订单申请
+            userAuditCancelOrder : {
+                url : rootPath + '/trade/order/simpleinfo/ones/:orderid/release/audit',
+                method : 'PUT'
+            },
+            // 买家不同意取消订单申请
+            userUnauditCancelOrder : {
+                url : rootPath + '/trade/order/simpleinfo/ones/:orderid/release/unaudit',
+                method : 'PUT'
             }
         });
     }]);

+ 10 - 0
src/main/webapp/resources/js/common/query/purchase.js

@@ -227,6 +227,16 @@ define([ 'ngResource' ], function() {
 			getPurchaseByOrder : {
 				url : 'trade/purchase/orderid/:orderid',
 				method : 'GET'
+			},
+			// 确认收款
+			confirmPaymentInstallment : {
+				url : rootPath +'/trade/purchase/:id/ensurePaid',
+				method : 'PUT'
+			},
+			// 取消订单
+			sellerCancelOrder : {
+				url : rootPath +'/trade/purchase/simpleinfo/ones/:purchaseId/release',
+				method : 'PUT'
 			}
 		});
 	}]);

+ 6 - 0
src/main/webapp/resources/js/usercenter/app.js

@@ -407,6 +407,12 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 			templateUrl : 'static/view/usercenter/forstore/show_rate.html',
 			controller : 'showRateCtrl',
 			controllerUrl : 'app/controllers/forstore/show_rate_ctrl'
+		})).state('downPayment', angularAMD.route({
+			// 线下付款
+			url : '/downPayment/:orderid',
+			templateUrl : 'static/view/usercenter/forstore/buyer_down_payment.html',
+			controller : 'downPaymentCtrl',
+			controllerUrl : 'app/controllers/forstore/buyer_down_payment_ctrl'
 		}));
 	}]);
 

+ 144 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_down_payment_ctrl.js

@@ -0,0 +1,144 @@
+define([ 'app/app' ], function(app) {
+
+    app.register.controller('downPaymentCtrl', ['$scope', '$rootScope', '$anchorScroll', '$location','SessionService', 'bankInfoService','$modal', 'toaster', 'bankTransferService', '$filter', 'ngTableParams', 'BaseService', 'OrderSimpleInfo', '$state', '$stateParams', 'Order', 'SmoothScroll', 'EncryptionService', function($scope, $rootScope, $anchorScroll, $location,SessionService, bankInfoService, $modal, toaster, bankTransferService, $filter, ngTableParams, BaseService, OrderSimpleInfo, $state, $stateParams, Order, SmoothScroll, EncryptionService) {
+        BaseService.scrollBackToTop();
+
+        $scope.type = "PAIDTOPLATFORM";
+        $scope.orderList = '';
+        if($stateParams.orderid) {
+            Order.get({orderid : $stateParams.orderid}, function(data) {
+                var arr = new Array();
+                $scope.$$bankTransfer = {};
+                $scope.$$bankTransfer.total = 0.0;
+                for(var i = 0; i < data.length; i++) {
+                    arr.push(data[i].orderid);
+                    $scope.$$bankTransfer.total = $scope.$$bankTransfer.total + data[i].ensurePrice;
+                }
+                $scope.$$bankTransfer.currency =  data[0].currency;
+                $scope.orderNum = arr.join(',');
+                $scope.orderList = arr;
+
+                // 日期换算
+                $scope.availabletime = '';
+                $scope.availabletime = data[0].availabletime;
+                $scope.creattime = '';
+                $scope.creattime = data[0].creattime;
+                var SurplusTime = $scope.availabletime - $scope.creattime;
+            }, function (response) {
+                toaster.pop('info', '获取订单的信息有误,请确定付款的订单');
+            })
+        }else {
+            $state.go('buyer_order');
+        }
+        
+        $scope.purKind = $rootScope.userInfo.enterprises ? false : true;//应付账户的类别, 默认是企业
+        $scope.saleKind = false;//应收账户的类别,默认是企业
+        var ids=SessionService.get("ids");
+
+        var page = Number(SessionService.get("page")) || 1;
+        var count = Number(SessionService.get("count")) || 20;
+        SessionService.unset("ids");
+        SessionService.unset("page");
+        SessionService.unset("count");
+        var hideBankFilter = $filter("hideBankFilter");
+        $scope.isSelectAll = false;
+        $scope.isSelect = false;
+        $scope.orderArray = []; //存放订单链
+        $scope.total = 0;
+        $scope.currencyName = ''; //存放当前币别
+
+        $scope.nowTime = new Date().getTime();
+
+        //解析数据,从返回的数据中找到要解析的数据
+        var resolveData = function(data) {
+            var arr = new Array();
+            for(var key in data) {
+                var numb= Number(key);
+                if(angular.isNumber(numb)&&(!isNaN(numb))) {
+                    arr.push(data[key]);
+                }
+            }
+            return arr;
+        };
+
+        //获取管理平台账户信息
+        var getOriginalData = function(data) {
+            var result = {};
+            if(data&&data.length) {
+                result = data[0];
+            }else {
+                result = null;
+            }
+            return result;
+        };
+        var getSellerAccount = function() {
+            bankInfoService.getAdminEnterAccount('', function(data) {
+                $scope.saleAccountInfos = resolveData(data);
+                angular.forEach($scope.saleAccountInfos, function(saleAccountInfo) {
+                    saleAccountInfo.filterAccount = hideBankFilter(saleAccountInfo.number);
+                });
+                $scope.saleAccount = getOriginalData($scope.saleAccountInfos);
+            }, function(res) {
+                toaster.pop('error', '错误', '获取卖家企业账户信息失败');
+            });
+        };
+        getSellerAccount();
+
+        // 确认订单
+        //订单加密解析器
+        var enIdFilter = $filter('EncryptionFilter');
+        $scope.confirmOrder = function () {
+            $state.go('order_transfer', {orderid : $stateParams.orderid});
+        };
+
+        $scope.buyExpose = false;
+        $scope.salexpose = false;
+        //expose代表展开的状态,isBuyd代表当前操作的数据
+        $scope.doExpose = function(expose, isBuy) {
+            if(isBuy) {
+                $scope.buyExpose = expose;
+            }else {
+                $scope.salexpose = expose;
+            }
+        }
+
+        //获取当前时间
+        var getTodayDate = function(){
+            var date = new Date();
+            $scope.maxDate = date;
+        };
+        getTodayDate();
+    }]);
+    /**
+     * 与现在的时间对比,距离多少天多少小时
+     */
+    app.register.filter('restTime', function () {
+        var day = 0, hours = 0, minute = 0;
+        return function (time) {
+            if(!time) {
+                return null;
+            }
+            var nowTime = new Date();
+            var s1 = time - nowTime.getTime();
+            var totalHours = s1/(1000*60*60);//算多少个小时
+            day = parseInt(totalHours) / 24;
+            hours = parseInt(totalHours) % 24;
+            minute = parseInt(hours)% 60;
+            return parseInt(day) + "天" + parseInt(hours) + "小时";
+        }
+    });
+
+    /**
+     * totalHours传入小时,被减去minuesTime转换成天数
+     * 返回格式时  x天y小时
+     */
+    app.register.filter('hoursToDay', function () {
+        var day = 0, hours = 0;
+        return function (totalHours, minuesdTime) {
+            var h = minuesdTime - totalHours;
+            day = parseInt(h) / 24;
+            hours = parseInt(h) % 24;
+            return "还剩 " + parseInt(day) + "天" + parseInt(hours) + "小时";
+        }
+    });
+});

+ 60 - 2
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_order_ctrl.js

@@ -78,9 +78,9 @@ define(['app/app'], function (app) {
 			var state = null;
 			switch($scope.status) {
 				case 'all' : // 全部
-					state = '503-504-505-406-407-403-408-404-405-520-523-522-602-603-315-604-605-606'; break;
+					state = '503-504-524-525-505-406-407-403-408-404-405-520-523-522-602-603-315-604-605-606'; break;
 				case 'tobepaid' : // 待付款
-					state = '503-504'; break; // 504-已付款, 放在待付款下面,商城确认收款后再放到待发货
+					state = '503-504-524-525'; break; // 504-已付款, 放在待付款下面,商城确认收款后再放到待发货
 				case 'tobedeliver' : // 待发货
 					state = '505-406-407-403-408'; break;
 				case 'tobereceive' : // 待收货
@@ -177,6 +177,28 @@ define(['app/app'], function (app) {
 				$scope.accumulateNotifyTime($scope.currenctOrders);
 				$scope.param.currentPage = data.number;
 				$scope.acculatePages(data.number, data.totalPages);
+
+				angular.forEach($scope.currenctOrders, function (data) {
+					// 循环判断一期都没有付款并且延期的
+					if (data.installmentId && data.installment.status == 503) {
+						angular.forEach(data.installment.installmentDetails, function (detailslist) {
+							var nowTime = new Date();
+							if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
+								data.Overtime = true;
+							}
+						})
+					}
+					if (data.installmentId && data.installment.status == 504) {
+						angular.forEach(data.installment.installmentDetails, function (detailslist) {
+							if (detailslist.status == 504) {
+								data.againUpload = true;
+							}
+						})
+					}
+					// 循环判断已付款未收款卖家可取消的
+
+				});
+
 			}, function(response) {
 				toaster.pop('error', '获取订单失败,请重新刷新界面,' + response.data);
 			});
@@ -276,6 +298,38 @@ define(['app/app'], function (app) {
 			loadData();
 		};
 
+		// 同意卖家取消订单
+		$scope.requestCancelBox = false;
+		$scope.requestCancel = function (item, id) {
+			$scope.requestCancelBox = true;
+			$scope.cancleOrder = {};
+			$scope.cancleOrder = item;
+		};
+		$scope.cancelRequestCancelBox = function () {
+			$scope.requestCancelBox = false;
+		};
+		// 同意取消
+		$scope.confirmRequest = function () {
+			OrderSimpleInfo.userAuditCancelOrder({orderid: $scope.cancleOrder.orderid},null, function () {
+				toaster.pop('success', '已同意卖家取消订单申请');
+				$scope.requestCancelBox = false;
+				loadData();
+			}, function (response) {
+				toaster.pop('error', response.data);
+				$scope.requestCancelBox = false;
+			});
+		};
+		// 拒绝取消
+		$scope.cancelRequest = function () {
+			OrderSimpleInfo.userUnauditCancelOrder({orderid: $scope.cancleOrder.orderid},null, function () {
+				toaster.pop('success', '已拒绝卖家取消订单申请');
+				loadData();
+				$scope.requestCancelBox = false;
+			}, function (response) {
+				toaster.pop('error', response.data);
+				$scope.requestCancelBox = false;
+			});
+		};
 		/**
 		 * 取消订单
 		 * @param id 传入的订单id
@@ -676,11 +730,15 @@ define(['app/app'], function (app) {
 				case 501:
 				case 502:
 				case 503:
+                case 524:
 					result = '待付款';
 					break;
 				case 504:
 					result = '付款确认中';
 					break;
+				case 525:
+					result = '卖家请求取消';
+					break;
 				case 505:
 				case 406:
 				case 407:

+ 393 - 119
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_transfer_ctrl.js

@@ -1,46 +1,248 @@
 define([ 'app/app' ], function(app) {
-	
-	app.register.controller('buyerTransferCtrl', ['$scope', '$rootScope', '$anchorScroll', '$location','SessionService', 'bankInfoService','$modal', 'toaster', 'bankTransferService', '$filter', 'ngTableParams', 'BaseService', 'OrderSimpleInfo', '$state', '$stateParams', 'Order', 'SmoothScroll', 'EncryptionService', function($scope, $rootScope, $anchorScroll, $location,SessionService, bankInfoService, $modal, toaster, bankTransferService, $filter, ngTableParams, BaseService, OrderSimpleInfo, $state, $stateParams, Order, SmoothScroll, EncryptionService) {
+
+	app.register.controller('buyerTransferCtrl', ['$scope', '$rootScope', '$anchorScroll', '$location','SessionService', 'bankInfoService','$modal', 'toaster', 'bankTransferService', '$filter', 'ngTableParams', 'BaseService', 'OrderSimpleInfo', '$state', '$stateParams', 'Order', 'SmoothScroll', 'EncryptionService','NumberService' ,'$timeout', function($scope, $rootScope, $anchorScroll, $location,SessionService, bankInfoService, $modal, toaster, bankTransferService, $filter, ngTableParams, BaseService, OrderSimpleInfo, $state, $stateParams, Order, SmoothScroll, EncryptionService, NumberService, $timeout) {
 		BaseService.scrollBackToTop();
 
+		$scope.diliverPrice = [''];
+		$scope.type = "PAIDTOPLATFORM";
+		// $scope.type = "PAIDTOVENDOR";
+		$scope.selectPaymentType = function (type) {
+			$scope.type = type;
+			// console.log($scope.type);
+		};
 		if($stateParams.orderid) {
 			Order.get({orderid : $stateParams.orderid}, function(data) {
-				console.log(data);
-				var arr = new Array();
-				$scope.$$bankTransfer = {};
-				$scope.$$bankTransfer.total = 0.0;
+				var arr = [];
+				$scope.$$bankTransfer = data[0];
+
+				getSellerAccount();
+				// 分期信息
+				if ($scope.$$bankTransfer.installmentId){
+					$scope.installmentData = data[0].installment;
+					// 获取没有付款的期数
+					$scope.yesPayinstallmentDetails = [];
+					$scope.noPayinstallmentDetails = [];
+					if ($scope.installmentData.status == 504){
+						angular.forEach($scope.installmentData.installmentDetails, function (item) {
+							if (item.status == 505) {
+								$scope.yesPayinstallmentDetails.push(item);
+								item.installmentImages = item.imgs.split(",");
+								item.imgIndex = 0;
+								// 已付款价格
+								$scope.yesPayinstallmentDetails.payTatalPrice = 0;
+								angular.forEach($scope.yesPayinstallmentDetails, function (item) {
+									$scope.yesPayinstallmentDetails.payTatalPrice += item.price;
+								});
+							}else if(item.status == 504){
+								$scope.noPayinstallmentDetails.push(item);
+								item.installmentImages = item.imgs.split(",");
+
+								// 存放当前未付款图片
+								$scope.arrList = item.installmentImages;
+                                $scope.diliverPrice = item.pricesArr.split(',');
+								$scope.installmentNoPayImg = [];
+								angular.forEach($scope.arrList, function (data) {
+									$scope.installmentNoPayImg.push({imageUrl: data})
+								});
+							}
+						})
+					}
+				}
+				if ($scope.$$bankTransfer.installmentId) {
+					$scope.type = "PAIDTOVENDOR";
+				}
+				$scope.$$bankTransfer.total = 0;
 				for(var i = 0; i < data.length; i++) {
-					arr.push(data[i].orderid);
-					$scope.$$bankTransfer.total = $scope.$$bankTransfer.total + data[i].ensurePrice;
+					var item = data[i];
+					arr.push(item.orderid);
+					$scope.$$bankTransfer.total += item.ensurePrice;
 				}
-				$scope.$$bankTransfer.currency =  data[0].currency;
 				$scope.orderNum = arr.join(',');
+                // $scope.installmentData
+
 			}, function (response) {
 				toaster.pop('info', '获取订单的信息有误,请确定付款的订单');
 			})
 		}else {
 			$state.go('buyer_order');
 		}
+		// 取消
+        $scope.loadPage = function () {
+            $state.go('buyer_order');
+        };
+		// 分期付款功能开发
+		$scope.loadPersonal = function () {
+			bankInfoService.getBuyPersonalBank('', function(data) {
+				$scope.buyAccountInfos = resolveData(data);
+				angular.forEach($scope.buyAccountInfos, function(buyAccountInfo) {
+					buyAccountInfo.filterAccount = hideBankFilter(buyAccountInfo.number);
+				});
+				$scope.buyAccount = getOriginalData($scope.buyAccountInfos);
+			}, function(error) {
+				toaster.pop('error', '错误', '提取个人账户信息失败');
+			});
+		};
+		$scope.loadPersonal();
+		// 更换账户
+		$scope.changebuyAccountBox = false;
+		$scope.changebuyAccount = function () {
+			$scope.changebuyAccountBox = true;
+		};
+		$scope.buyerLists = {};
+		$scope.selectItem = function (item) {
+			angular.forEach($scope.buyAccountInfos, function (data) {
+				if(data.id != item.id) {
+					data.isFalse = false;
+				}
+			});
+			$scope.buyerLists = $scope.buyAccountInfos;
+			item.isFalse = !item.isFalse;
+		};
+		$scope.confirmChange = function (){
+			$scope.changebuyAccountBox = false;
+			angular.forEach($scope.buyerLists, function (item) {
+				if (item.isFalse == true) {
+					$scope.buyAccount = item;
+				}
+			});
+		};
+		// 取消
+		$scope.cancelChange = function () {
+			$scope.changebuyAccountBox = false;
+		};
+		// 上传图片
+		$scope.imagesList = [{imageUrl: ''}];
+		// 循环水单价格
+		$scope.waterPriceList = [{price: ''}];
+		$scope.addUploadImg = function () {
+			$scope.imagesList.push({imageUrl: ''});
+			document.onclick = function () {}
+			$scope.diliverPrice.push('');
+			$scope.waterPriceList.push({price: ''});
+			var id = 'uploadImg-'+($scope.imagesList.length-1);
+			$timeout(function(){
+				angular.element('#'+id+' input').click();
+			},1);
+		};
+		// 删除图片
+		$scope.deleteProofInfo = function (index) {
+			// if ($scope.imagesList.length == 1) {
+			// 	$scope.imagesList[index].imageUrl = '';
+			// } else {
+			// 	$scope.imagesList.splice(index, 1);
+			// }
+			$scope.imagesList[index] = {};
+			// console.log($scope.imagesList);
+		};
+		$scope.deleteimg = function (index) {
+			$scope.installmentNoPayImg[index] = {};
+		};
 
+		$scope.addUploadImgNopay = function (event) {
+			// 订单中心的document点击事件
+			document.onclick = function () {}
+
+			$scope.installmentNoPayImg.push({imageUrl: ''});
+			var id = 'upload-'+($scope.installmentNoPayImg.length-1);
+			console.log(id);
+			$timeout(function(){
+				angular.element('#'+id+' input').click();
+			},1);
+		};
+		/**
+		 * 上传付款截图
+		 */
+		$scope.onUploadPayment = function ($data, index) {
+			if (!$data || !$data.path) {
+				toaster.pop('error', '您还没有上传新的单据');
+				return ;
+			}
+			var id = 'uploadImg-'+($scope.imagesList.length-1);
+			$timeout(function(){
+				angular.element('#'+id+' input').click();
+			},1);
+			$scope.imageUrl = $data.path;
+			$scope.imagesList[index].imageUrl = $scope.imageUrl;
+			// console.log($scope.imagesList);
+		};
+		$scope.onUploadPaymentImg = function ($data, index) {
+			if (!$data || !$data.path) {
+				toaster.pop('error', '您还没有上传新的单据');
+				return ;
+			}
+			$scope.imageUrl = $data.path;
+			$scope.installmentNoPayImg[index].imageUrl = $scope.imageUrl;
+		};
+		/**
+		 * 查看大图
+		 *
+		 * @param imgUrl		图片链接
+		 */
+		$scope.showImg = showImg;
+		function showImg(imgUrl) {
+			var src = imgUrl, box = $('#image-box'), modal = $('.modal-content');
+			box.show();
+			box.find('img').attr('src', src);
+			box.find('a').click(function(){
+				box.hide();
+			});
+			box.dblclick(function(){
+				box.hide();
+			});
+		}
+
+		// 分期明细
+		$scope.numArray = {
+			'1': '一',
+			'2': '二',
+			'3': '三',
+			'4': '四',
+			'5': '五'
+		};
+
+		// 切换效果
+		$scope.changeImg = function (installmentImg, index) {
+			angular.forEach(installmentImg.installmentImages, function (data,a) {
+				if (index == a){
+					installmentImg.imgIndex = a;
+				}
+			});
+		};
+		$scope.changePrev = function (installmentImg) {
+			if (installmentImg.imgIndex == 0) {
+				installmentImg.imgIndex = 0
+			}else if(installmentImg.imgIndex > 0){
+				installmentImg.imgIndex -= 1;
+			}
+		};
+		$scope.changeNext = function (installmentImg, index) {
+			if (installmentImg.imgIndex == installmentImg.installmentImages.length-1) {
+				installmentImg.imgIndex = 0
+			}else {
+				installmentImg.imgIndex += 1;
+			}
+		};
+		//controller
+		// 分期付款结束
 		$scope.purKind = $rootScope.userInfo.enterprises ? false : true;//应付账户的类别, 默认是企业
 		$scope.saleKind = false;//应收账户的类别,默认是企业
 		var ids=SessionService.get("ids");
-		
+
 		var page = Number(SessionService.get("page")) || 1;
 		var count = Number(SessionService.get("count")) || 20;
 		SessionService.unset("ids");
 		SessionService.unset("page");
 		SessionService.unset("count");
 		var hideBankFilter = $filter("hideBankFilter");
-		
+
 		$scope.isSelectAll = false;
 		$scope.isSelect = false;
 		$scope.orderArray = []; //存放订单链
 		$scope.total = 0;
 		$scope.currencyName = ''; //存放当前币别
-		
+
 		$scope.nowTime = new Date().getTime();
-		
+
 		//解析数据,从返回的数据中找到要解析的数据
 		var resolveData = function(data) {
 			var arr = new Array();
@@ -52,7 +254,7 @@ define([ 'app/app' ], function(app) {
 			}
 			return arr;
 		};
-		
+
 		$scope.pay = function(order) {
 			if(order.availabletime < new Date().getTime()) {
 				toaster.pop("error", '错误', '此订单已过期,已失效');
@@ -65,14 +267,14 @@ define([ 'app/app' ], function(app) {
 			$scope.showMe = true;
 			SmoothScroll.scrollTo(null, 'O', -68);
 		};
-		
+
 		//返回修改
 		$scope.alterPay = function() {
 			$location.hash('toptip');
 			$anchorScroll();
 			$scope.showMe = false;
-		}
-		
+		};
+
 		$scope.batchPay = function() {
 			if(!$scope.orderNum) {
 				toaster.pop("error", '错误', '请选择要付款的单');
@@ -82,7 +284,7 @@ define([ 'app/app' ], function(app) {
 			$anchorScroll();
 			$scope.showMe = true;
 		};
-		
+
 		var getOriginalData = function(data) {
 			var result = {};
 			if(data&&data.length) {
@@ -92,7 +294,7 @@ define([ 'app/app' ], function(app) {
 			}
 			return result;
 		};
-		
+
 		$scope.selectAll = function() {
 			$scope.isSelectAll = !$scope.isSelectAll;
 			$scope.orderArray = [];
@@ -121,7 +323,7 @@ define([ 'app/app' ], function(app) {
 			}
 			$scope.orderNum = $scope.orderArray.join(',');
 		};
-		
+
 		$scope.doSelect = function(order) {
 			var result = true;
 			if(order.isSelect) {
@@ -166,61 +368,70 @@ define([ 'app/app' ], function(app) {
 			$scope.isSelectAll = result;
 			$scope.orderNum = $scope.orderArray.join(',');
 		}
-		
-		//根据单选框的状态,提取不同的数据
-		var getBuyAccount = function() {
-			if(!$scope.purKind) {
-				bankInfoService.getBuyEnterpriseBank('', function(data) {
-					$scope.buyAccountInfos = resolveData(data);
-					angular.forEach($scope.buyAccountInfos, function(buyAccountInfo) {
-						buyAccountInfo.filterAccount = hideBankFilter(buyAccountInfo.number);
-					});
-					$scope.buyAccount = getOriginalData($scope.buyAccountInfos);
-				}, function(error) {
-					toaster.pop('error', '错误', '提取企业账户信息失败');
-				});
-			}else {
-				bankInfoService.getBuyPersonalBank('', function(data) {
-					$scope.buyAccountInfos = resolveData(data);
-					angular.forEach($scope.buyAccountInfos, function(buyAccountInfo) {
-						buyAccountInfo.filterAccount = hideBankFilter(buyAccountInfo.number);
-					});
-					$scope.buyAccount = getOriginalData($scope.buyAccountInfos);
-				}, function(error) {
-					toaster.pop('error', '错误', '提取个人账户信息失败');
-				});
-			}
-		};
-		
-		//开始时,就获取账户信息
-		getBuyAccount();
-		
+
+		// //根据单选框的状态,提取不同的数据
+		// var getBuyAccount = function() {
+		// 	if(!$scope.purKind) {
+		// 		bankInfoService.getBuyEnterpriseBank('', function(data) {
+		// 			$scope.buyAccountInfos = resolveData(data);
+		// 			angular.forEach($scope.buyAccountInfos, function(buyAccountInfo) {
+		// 				buyAccountInfo.filterAccount = hideBankFilter(buyAccountInfo.number);
+		// 			});
+		// 			$scope.buyAccount = getOriginalData($scope.buyAccountInfos);
+		// 		}, function(error) {
+		// 			toaster.pop('error', '错误', '提取企业账户信息失败');
+		// 		});
+		// 	}else {
+		// 		bankInfoService.getBuyPersonalBank('', function(data) {
+		// 			$scope.buyAccountInfos = resolveData(data);
+		// 			angular.forEach($scope.buyAccountInfos, function(buyAccountInfo) {
+		// 				buyAccountInfo.filterAccount = hideBankFilter(buyAccountInfo.number);
+		// 			});
+		// 			$scope.buyAccount = getOriginalData($scope.buyAccountInfos);
+		// 		}, function(error) {
+		// 			toaster.pop('error', '错误', '提取个人账户信息失败');
+		// 		});
+		// 	}
+		// };
+		//
+		// //开始时,就获取账户信息
+		// getBuyAccount();
+
 		//获取管理平台账户信息
 		var getSellerAccount = function() {
-			if(!$scope.saleKind) {
-				bankInfoService.getAdminEnterAccount('', function(data) {
-					$scope.saleAccountInfos = resolveData(data);
-					angular.forEach($scope.saleAccountInfos, function(saleAccountInfo) {
-						saleAccountInfo.filterAccount = hideBankFilter(saleAccountInfo.number);
-					});
-					$scope.saleAccount = getOriginalData($scope.saleAccountInfos);
-				}, function(res) {
-					toaster.pop('error', '错误', '获取卖家企业账户信息失败');
+			// 平台账户
+			bankInfoService.getAdminEnterAccount('', function(data) {
+				$scope.saleAccountInfos = resolveData(data);
+				angular.forEach($scope.saleAccountInfos, function(saleAccountInfo) {
+					saleAccountInfo.filterAccount = hideBankFilter(saleAccountInfo.number);
 				});
-			}else {
-				bankInfoService.getAdminPersAccount('', function(data) {
-					$scope.saleAccountInfos = resolveData(data);
-					angular.forEach($scope.saleAccountInfos, function(saleAccountInfo) {
-						saleAccountInfo.filterAccount = hideBankFilter(saleAccountInfo.number);
-					});
-					$scope.saleAccount = getOriginalData($scope.saleAccountInfos);
-				}, function(res) {
-					toaster.pop('error', '错误', '获取卖家个人账户信息失败');
+				$scope.saleAccount = getOriginalData($scope.saleAccountInfos);
+			}, function(res) {
+				toaster.pop('error', '错误', '获取卖家企业账户信息失败');
+			});
+			// 卖家私人账户
+			// bankInfoService.getAdminPersAccount('', function(data) {
+			// 	$scope.saleAccountInfos = resolveData(data);
+			// 	angular.forEach($scope.saleAccountInfos, function(saleAccountInfo) {
+			// 		saleAccountInfo.filterAccount = hideBankFilter(saleAccountInfo.number);
+			// 	});
+			// 	$scope.salePerAccount = getOriginalData($scope.saleAccountInfos);
+			// }, function(res) {
+			// 	toaster.pop('error', '错误', '获取卖家个人账户信息失败');
+			// });
+			//
+			bankInfoService.getSaleEeterprise({enuu: $scope.$$bankTransfer.sellerenuu},{}, function(data) {
+				$scope.saleAccountInfos = resolveData(data);
+				angular.forEach($scope.saleAccountInfos, function(saleAccountInfo) {
+					saleAccountInfo.filterAccount = hideBankFilter(saleAccountInfo.number);
 				});
-			}
-		}
-		
-		getSellerAccount();
+				$scope.salePerAccount = getOriginalData($scope.saleAccountInfos);
+			}, function(res) {
+				toaster.pop('error', '错误', '获取卖家个人账户信息失败');
+			});
+		};
+
+		// getSellerAccount();
 
 		$scope.set = function(data, isBuy) {
 			if(isBuy) {
@@ -236,7 +447,7 @@ define([ 'app/app' ], function(app) {
 			}
 
 		};
-		
+
 		// 搜索框内容转换成大写
 		var t;
 		var setTime = function() {
@@ -251,19 +462,19 @@ define([ 'app/app' ], function(app) {
 				$scope.keyword = angular.uppercase($scope.keyword);
 			}
 		};
-		
+
 		$scope.upper = function() {
 			$scope.time = 1;
 			clearTimeout(t);
 			setTime();
 		}
-		
+
 		// 根据搜索框输入信息搜索对应订单
 		$scope.searchFor = function() {
 			$scope.keyword = angular.uppercase($scope.keyword);
 			$scope.tobePaidTableParams.reload();
 		}
-		
+
 		$scope.tobePaidTableParams = new ngTableParams({
 			page : page,
 			count : count,
@@ -286,7 +497,7 @@ define([ 'app/app' ], function(app) {
 					$scope.orderNum = ""; //单号的链接字符串
 					$scope.orderArray = []; //存放
 					$scope.total = 0;
-					
+
 					if(ids) {
 						var arr = ids.split('-');
 						var result = true;
@@ -303,7 +514,7 @@ define([ 'app/app' ], function(app) {
 							if(!order.isSelect) {
 								result = false;
 							}
-						});				
+						});
 						$scope.isSelectAll = result;
 						$scope.orderNum = $scope.orderArray.join(',');
 						if($scope.orderNum) {
@@ -313,7 +524,7 @@ define([ 'app/app' ], function(app) {
 				});
 			}
 		});
-		
+
 		//跳出模态框,data有数据代表编辑,data为空则代表新增。
 		$scope.bankInfo = function(data) {
 			var modalInstance = $modal.open({
@@ -326,7 +537,7 @@ define([ 'app/app' ], function(app) {
 				}
 			});
 		};
-		
+
 		//新增账户
 		$scope.newAccount = function(data) {
 			var modalInstance = $modal.open({
@@ -343,7 +554,7 @@ define([ 'app/app' ], function(app) {
 					}
 				}
 			});
-			
+
 			modalInstance.result.then(function(account) {
 				if(account.kind) {
 					bankInfoService.saveBuyPersonalBank({}, account, function(data) {
@@ -364,10 +575,10 @@ define([ 'app/app' ], function(app) {
 					});
 				}
 			}, function() {
-				
+
 			});
 		};
-		
+
 		$scope.deleteAccount = function(buyAccount) {
 			var  isSure = confirm('确认删除本银行账户?删除后无法恢复,请谨慎操作');
 			if(isSure){
@@ -379,8 +590,34 @@ define([ 'app/app' ], function(app) {
 				})
 			}
 		}
-		
+
+		$scope.onDiliverPriceChange = function (index) {
+			if (!($scope.diliverPrice[index] > 0)) {
+				$scope.diliverPrice[index] = '';
+				toaster.pop('info', '提示', '分期金额必须大于0');
+			}
+		}
+
+
 		$scope.confirm = function() {
+			var imageArray = [];
+			if ($scope.$$bankTransfer.installmentId && $scope.noPayinstallmentDetails.length > 0) {
+				$scope.imagesList = $scope.installmentNoPayImg;
+			}
+			for (var i = 0; i< $scope.imagesList.length; i++) {
+				if ($scope.imagesList.length <= 6) {
+					if ($scope.imagesList[i].imageUrl && $scope.imagesList[i].imageUrl != '') {
+						if ($scope.type == "PAIDTOVENDOR" && $scope.diliverPrice[i] == '') {
+							toaster.pop('info','提示','请输入付款截图下对应的付款金额');
+							return;
+						}
+						imageArray.push($scope.imagesList[i].imageUrl);
+					}
+				}
+			}
+			// console.log($scope.diliverPrice);
+			// console.log($scope.imagesList);
+			var str = imageArray.join(",");
 			if(angular.isUndefined($scope.orderNum) || angular.equals($scope.orderNum,'') || angular.equals($scope.$$bankTransfer.total, 0)) {
 				toaster.pop('info', '提示', '没有选择要付款的订单,或付款总额为0');
 				return ;
@@ -393,37 +630,74 @@ define([ 'app/app' ], function(app) {
 				toaster.pop('info', '提示', '请选择卖家账户');
 				return ;
 			}
-			if(!$scope.transferTime) {
-				toaster.pop('info', '提示', '请选择付款日期');
+			if(!str || str == ''){
+				toaster.pop('info', '提示', '请选择付款截图');
 				return ;
 			}
-			if(!$scope.imageUrl){
-                toaster.pop('info', '提示', '请选择付款截图');
-                return ;
-            }
+
+			if ($scope.type == "PAIDTOVENDOR") {
+				var firstItem = {};
+				var firstFlag = false;
+				angular.forEach($scope.installmentData.installmentDetails, function (item) {
+					if (!firstFlag) {
+						if (item.status != 505) {
+							firstItem = item;
+							firstFlag = true;
+						}
+					}
+				});
+
+				var tmpPrice = 0;
+				angular.forEach($scope.diliverPrice, function (item) {
+					if (item != '') {
+						tmpPrice = NumberService.add(tmpPrice, parseFloat(item));
+					}
+				})
+
+				if (firstItem.price != tmpPrice) {
+					toaster.pop('info', '提示', '付款金额为空或不等于分期金额,请重新确认');
+					return;
+				}
+			}
+
+			var transfer = {};
+			if ($scope.$$bankTransfer.installment){
+				var installmentDetailId = '';
+				angular.forEach($scope.$$bankTransfer.installment.installmentDetails, function (installmentDetail) {
+					if (installmentDetail.detno == $scope.$$bankTransfer.installment.currentNo)
+						installmentDetailId = installmentDetail.id;
+				})
+				transfer.installmentDetailId = installmentDetailId;
+			};
+			if ($scope.type == 'PAIDTOVENDOR'){
+				$scope.saleAccount = $scope.salePerAccount;
+			}
+			// console.log($scope.saleAccount);
 			var buyAccount = angular.copy($scope.buyAccount);
 			var saleAccount = angular.copy($scope.saleAccount);
 			delete saleAccount.filterAccount;
 			delete buyAccount.filterAccount;
 			var jsonPament = angular.toJson(buyAccount);
 			var jsonReceive = angular.toJson(saleAccount);
-			var transfer = {};
 			transfer.jsonPament = jsonPament;
 			transfer.jsonReceive = jsonReceive;
-			transfer.imgUrl = $scope.imageUrl;
-			transfer.transferTime = $scope.transferTime.getTime();
+			// console.log(transfer.jsonReceive)
+			transfer.imgUrl = str;
+			transfer.type = $scope.type;
+			// transfer.transferTime = $scope.transferTime.getTime();
 			transfer.total = $scope.$$bankTransfer.total;
+            transfer.pricesArr = $scope.diliverPrice.join(',');
 			bankTransferService.saveTransfer({order: $scope.orderNum.split(',').join('-')}, transfer, function(data) {
-				toaster.pop('success', '信息保存成功');
+				toaster.pop('success', '提交成功');
 				$state.go('buyer_order');
 			}, function(response) {
-				toaster.pop("error", '失败', '信息保存失败:' + response.data);
+				toaster.pop("error", '失败', '提交失败:' + response.data);
 			});
 		}
 
 		$scope.buyExpose = false;
 		$scope.salexpose = false;
-		//expose代表展开的状态,isBuyd代表当前操作的数据
+		//expose代表展开的状态,isBuy代表当前操作的数据
 		$scope.doExpose = function(expose, isBuy) {
 			if(isBuy) {
 				$scope.buyExpose = expose;
@@ -432,16 +706,16 @@ define([ 'app/app' ], function(app) {
 			}
 		}
 
-        /**
-         * 上传付款截图
-         */
-        $scope.onUploadPayment = function ($data) {
-            if (!$data || !$data.path) {
-                toaster.pop('error', '付款截图上传失败');
-                return ;
-            }
-            $scope.imageUrl = $data.path;
-        };
+		// /**
+		//  * 上传付款截图
+		//  */
+		// $scope.onUploadPayment = function ($data) {
+		//     if (!$data || !$data.path) {
+		//         toaster.pop('error', '付款截图上传失败');
+		//         return ;
+		//     }
+		//     $scope.imageUrl = $data.path;
+		// };
 
 		$scope.select = function(account, isBuy) {
 			if(isBuy) {
@@ -450,7 +724,7 @@ define([ 'app/app' ], function(app) {
 				$scope.saleAccount = account;
 			}
 		}
-		
+
 		//获取当前时间
 		var getTodayDate = function(){
 			var date = new Date();
@@ -458,7 +732,7 @@ define([ 'app/app' ], function(app) {
 		};
 		getTodayDate();
 	}]);
-	
+
 	app.register.controller('timeCtrl', ['$scope', '$modalInstance', function($scope, $modalInstance) {
 		$scope.time = 5;
 		var setTime = function() {
@@ -473,19 +747,19 @@ define([ 'app/app' ], function(app) {
 				$scope.closeNow();
 			}
 		};
-		
+
 		setTime();
-		
+
 		$scope.closeNow = function() {
 			$modalInstance.close($scope.time);
 		};
-		
+
 		$scope.dismiss = function() {
 			$modalInstance.dismiss();
 		};
 	}]);
-	
-	
+
+
 	app.register.controller('BankInfoCtrl', ['$scope', '$modalInstance', 'account', 'kind', function($scope, $modalInstance, account, kind){
 		$scope.account = account;
 		if($scope.account) {
@@ -502,22 +776,22 @@ define([ 'app/app' ], function(app) {
 			$scope.account = {};
 			$scope.account.currency = 'RMB'; // 默认银行卡币别是人民币
 		}
-		
+
 		$scope.set = function(kind) {
 			$scope.kind = kind;
 		}
-		
+
 		$scope.confirm = function() {
 			$scope.account.kind = $scope.kind;
 			$modalInstance.close($scope.account);
 		}
-		
+
 		$scope.cancel = function() {
 			$modalInstance.dismiss();
 		}
-		
+
 	}]);
-	
+
 	app.register.controller('ImageInsertCtrl', ['$scope', '$modalInstance', 'SmoothScroll', function($scope, $modalInstance, SmoothScroll) {
 		$scope.image = {src: null};
 		// 图片上传成功之后
@@ -529,12 +803,12 @@ define([ 'app/app' ], function(app) {
 				$scope.image.thumb = path;
 			});
 		};
-		
+
 		$scope.close = function() {
 			$modalInstance.dismiss();
 			SmoothScroll.scrollTo(null, 'O', -68);
 		};
-		
+
 		$scope.confirm = function() {
 			$modalInstance.close($scope.image);
 			$scope.imageUrl = null;

+ 6 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -588,7 +588,12 @@ define(['app/app'], function(app) {
 						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('-'))});
+							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');

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

@@ -1,4 +1,4 @@
-define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods','common/query/rate', 'common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery', 'angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage'], function(angularAMD) {
+define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments'], function(angularAMD) {
 	'use strict';
 	/**
 	 * 自定义Array对象的属性last 方法
@@ -8,7 +8,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		return this.length > 0 ? this[this.length - 1] : null;
 	};
 
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices']);
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices']);
 	//初始化,启动时载入app
 	app.init = function() {
 		angularAMD.bootstrap(app);

+ 285 - 10
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_detail.js

@@ -1,7 +1,7 @@
 
 define(['app/app'], function(app) {
 	"use strict";
-	app.register.controller('purchaseDetailCtrl', ['$scope', 'Order', 'Logistics', 'ComponentActive', 'toaster', '$stateParams', '$state', 'Purchase', 'KdnLogistics', '$rootScope', 'NumberService', function($scope, Order, Logistics, ComponentActive, toaster, $stateParams, $state, Purchase, KdnLogistics, $rootScope, NumberService) {
+	app.register.controller('purchaseDetailCtrl', ['$scope', 'Order', 'Logistics', 'ComponentActive', 'toaster', '$stateParams', '$state', 'Purchase', 'KdnLogistics', '$rootScope', 'NumberService', 'Installment', function($scope, Order, Logistics, ComponentActive, toaster, $stateParams, $state, Purchase, KdnLogistics, $rootScope, NumberService, Installment) {
 
 		// 保存采购单编号信息
 		$scope.purchaseId = $stateParams.purchaseId;
@@ -36,6 +36,7 @@ define(['app/app'], function(app) {
 		 *
 		 * @param status	采购单状态码
 		 */
+        $scope.startDate = new Date()
 		$scope.getTimeOfStatus = function (status) {
 			var time = null;
 			angular.forEach($scope.purchase.purchaseHistory, function (history) {
@@ -45,6 +46,265 @@ define(['app/app'], function(app) {
 			});
 			return time;
 		};
+		// 分期付款
+		$scope.isShow = false;
+		$scope.cancelInstallmentBox = false;
+		$scope.showNoAccountBox = false;
+		$scope.setShowNoAccountBox = function (flag) {
+			$scope.showNoAccountBox = flag;
+		}
+		$scope.switchToggle = function () {
+			$scope.isChange = false;
+			if ($scope.purchase.installmentId){
+				if ($scope.isShow == true) {
+					$scope.cancelInstallmentBox = true;
+				}
+			} else {
+				if (!$scope.isShow) {
+					Installment.validationCount({purchaseId : $scope.purchase.id}, null, function (data) {
+						$scope.isShow = true;
+					}, function (error) {
+						// toaster.pop('error', error.data);
+						$scope.setShowNoAccountBox(true);
+						$scope.isShow = false;
+					});
+				} else {
+					$scope.isShow = false;
+				}
+				// $scope.isShow = !$scope.isShow;
+				// if ($scope.isShow == true) {
+				// }
+
+			}
+			// 验证是否能启用分期信息
+
+
+		};
+		$scope.cancelInstallment = function () {
+			$scope.cancelInstallmentBox = false;
+		};
+		// 删除分期
+		$scope.confirmInstallment = function (purchaseid) {
+			Installment.deleteInstallment({purchaseId: purchaseid}, null, function () {
+				toaster.pop('success', '删除分期成功');
+				$scope.cancelInstallmentBox = false;
+				$scope.updatePurchase();
+				$scope.isShow = false;
+				$scope.installmentDetails = [{price: '',deadline: '','detno': 1, 'deadlineShow': false}];
+			}, function (response) {
+				toaster.pop('error', response.data);
+			});
+		};
+		$scope.numArray = {
+			'1': '一',
+			'2': '二',
+			'3': '三',
+			'4': '四',
+			'5': '五'
+		};
+		// 新增一条分期付款
+		$scope.installmentDetails  = [{price: '','detno': 1,'deadline': '', 'deadlineShow': false}];
+		$scope.addInstallment = function () {
+			$scope.installmentDetails.push({price: '','detno': $scope.installmentDetails.length + 1, 'deadline': '','deadlineShow': false});
+		};
+		// 删除一条分期付款
+		$scope.deleteInstallment = function (index) {
+			$scope.installmentDetails.splice(index, 1);
+			for (var i = index; i < $scope.installmentDetails.length; i++){
+				$scope.installmentDetails[i].detno -= 1;
+			}
+		};
+
+		// 打开日期选择框
+		$scope.openDatePicker = function ($event, item, openParam) {
+			$event.preventDefault();
+			$event.stopPropagation();
+			item[openParam] = !item[openParam];
+			if ($scope.purchase.installment) {
+				angular.forEach($scope.purchase.installment.installmentDetails, function (tmpItem) {
+					if (tmpItem != item) {
+						tmpItem[openParam] = false;
+					}
+				});
+			}
+		};
+		//小数位监控
+		$scope.inputInstallmentPrice = function (item, price) {
+			if (price.split('.').length>1&&price.split('.').last().length > 2) {
+				item.price = item.price.substring(0, item.price.length-1);
+			}
+		}
+		// 监控价格
+		$scope.changeInstallmentPrice = function (item, price, index) {
+			if (price == '') {
+				toaster.pop('warning', '提示', '支付金额不能为空');
+			} else if (isNaN(price)) {
+				toaster.pop('warning', '提示', '金额应该为数字');
+				item.price = '';
+			} else if (price <= 0) {
+				toaster.pop('warning', '提示', '输入金额应该大于0');
+				item.price = '';
+			} else if (price.split('.').length>1&&price.split('.').last().length > 2) {
+				toaster.pop('warning', '提示', '输入小数点位数不能大于2');
+			} else if (price > $scope.purchase.ensurePrice) {
+				toaster.pop('warning', '提示', '输入金额不得大于或等于总支付金额');
+			}
+			// $scope.totalNum();
+			// if(index == $scope.installmentDetails.length -1){
+			// 	return ;
+			// }else {
+			// 	$scope.installmentDetails[$scope.installmentDetails.length -1].price = $scope.purchase.price - $scope.totalPrice;
+			// }
+		};
+		// 时期
+		// $scope.changeBlurDeadline = function (item, index) {
+		// 	if (item.deadline && item.deadline.getTime() <= $scope.installmentDetails[index-1].deadline.getTime()) {
+		// 		toaster.pop('warning', '提示', '付款时间后一期须大于前一期');
+		// 	}
+		// };
+		$scope.changeEndDate = function (item, first, last) {
+			if (typeof item.deadline == 'undefined') {
+				alert("日期格式错误,请重新输入!");
+				item.deadline = '';
+				return;
+			}
+			if (item.deadline) {
+				item.deadline = item.deadline.toString().replace(/[0-9]{2}:[0-9]{2}:[0-9]{2}/g, '23:59:59');
+				item.deadline = new Date(formatDateTime(new Date(item.deadline.toString())));
+			}
+			var nowTime = new Date();
+			if (item.deadline < nowTime){
+				item.deadline = '';
+				toaster.pop('warning','付款时间要大于今天的日期');
+				return ;
+			}
+			if (first != 'first' && first.deadline != ''){
+				if (item.deadline <= first.deadline){
+					item.deadline = '';
+					toaster.pop('warning','付款时间后一期须大于前一期');
+					return ;
+				}
+			}
+			if (last != 'last' && last.deadline != ''){
+				if (item.deadline >= last.deadline){
+					item.deadline = '';
+					toaster.pop('warning','付款时间前一期须小于后一期');
+					return ;
+				}
+			}
+		};
+		var formatDateTime = function (date) {
+			var y = date.getFullYear();
+			var m = date.getMonth() + 1;
+			m = m < 10 ? ('0' + m) : m;
+			var d = date.getDate();
+			d = d < 10 ? ('0' + d) : d;
+			var h = date.getHours();
+			var minute = date.getMinutes();
+			var sec = date.getSeconds();
+			minute = minute < 10 ? ('0' + minute) : minute;
+			return y + '-' + m + '-' + d+' '+h+':'+minute+':'+sec;
+		};
+		$scope.totalPrice = 0;
+		$scope.totalNum = function () {
+			$scope.totalPrice = 0;
+			angular.forEach($scope.installmentDetails, function (item) {
+				$scope.totalPrice += Number(item.price);
+			})
+		};
+		// 保存分期付款
+		$scope.saveInstallment = function (installmentDetails) {
+			// if(!$scope.changeBlurDeadline(installmentDetails)){
+			// 	return ;
+			// }
+			$scope.totalNum();
+			for (var i = 0; i < installmentDetails.length; i++) {
+				if (!installmentDetails[i].price) {
+					toaster.pop('warning', '提示', '支付金额不能为空');
+				}
+				if (!installmentDetails[i].deadline) {
+					toaster.pop('warning', '提示', '付款时间不能为空');
+					return ;
+				}
+			}
+			if ($scope.totalPrice.toFixed(2) != $scope.purchase.ensurePrice) {
+				toaster.pop('warning', '提示', '输入金额须等于总支付金额');
+				return ;
+			}
+			$scope.installment = {};
+			$scope.installment.installmentDetails = installmentDetails;
+			var obj = {
+				installment: $scope.installment,
+				purchaseId: $scope.purchase.id
+			};
+			Installment.addInstallment(null, obj, function(data){
+				$scope.installments = data;
+				toaster.pop('success', '提示', '新增分期成功');
+				$scope.installmentBox = true;
+				$scope.updatePurchase()
+			}, function (response) {
+				toaster.pop('error', response.data);
+			});
+		};
+		// 取消保存
+		$scope.cancelSwitch = function () {
+			$scope.isShow = false;
+			$scope.installmentDetails = [{price: '',deadline: '','detno': 1, 'deadlineShow': false}];
+		};
+		$scope.installmentBox = false;
+		// 更新分期
+		$scope.editBox = false;
+		$scope.editInstallment = function () {
+			$scope.editBox = true;
+			$scope.isChange = false;
+		};
+		// 取消编辑
+		$scope.cancelEdit = function () {
+			$scope.editBox = false;
+			$scope.updatePurchase()
+		};
+		//更新分期信息
+		$scope.updateInstallment = function (item) {
+			// 计算金额
+			$scope.totalPrice = 0;
+			angular.forEach(item.installmentDetails, function (item) {
+				$scope.totalPrice = NumberService.add($scope.totalPrice, Number(item.price));
+			});
+			for (var i = 0; i < item.installmentDetails.length; i++) {
+				if (item.installmentDetails[i].price == '') {
+					toaster.pop('warning', '提示', '支付金额不能为空');
+					return ;
+				} else if (!item.installmentDetails[i].deadline) {
+					toaster.pop('warning', '提示', '付款日期不能为空');
+					return ;
+				}
+			}
+			if ($scope.totalPrice != $scope.purchase.ensurePrice) {
+				toaster.pop('warning', '提示', '输入金额须等于总支付金额');
+				return ;
+			}
+			var obj = {
+				installment: item,
+				purchaseId: $scope.purchase.id
+			};
+			Installment.updateInstallment(null, obj, function(){
+				toaster.pop('success', '提示', '修改分期成功');
+				$scope.editBox = false;
+			}, function (response) {
+				toaster.pop('error', response.data);
+			});
+		}
+		// 编辑新增一条数据
+		$scope.addInstallmentList = function () {
+			$scope.purchase.installment.installmentDetails.push({price: '',deadline: '','detno': $scope.purchase.installment.installmentDetails.length + 1, 'deadlineShow': false});
+		};
+		// 编辑删除数据一条数据
+		$scope.deleteInstallmentlist = function (index) {
+			$scope.purchase.installment.installmentDetails.splice(index, 1);
+			for (var i = index; i < $scope.purchase.installment.installmentDetails.length; i++){
+				$scope.purchase.installment.installmentDetails[i].detno -= 1;
+			}
+		}
 		// 联系卖家弹框
 		$scope.contactBNox = false;
 		$scope.contactSeller = function () {
@@ -165,19 +425,22 @@ define(['app/app'], function(app) {
 
 
 		// 检测采购单编号ID是否存在,如果不存在跳转卖家中心首页
-		if (!$scope.purchaseId || $scope.purchaseId == '') {
-			$scope.error('订单编号ID不能为空');
-		} else {
-
-			/**
-			 * 根据采购单编号ID获取采购单信息
-			 */
+		$scope.updatePurchase = function () {
 			Purchase.findPurchaseByPurchaseId({ purchaseId : $scope.purchaseId }, null, function (result) {
 				if (!result.success) {
 					$scope.error(result.message);
 					return ;
 				}
 				$scope.purchase = result.data;
+				$scope.purchase.installment = result.data.installment
+				if ($scope.purchase.installment) {
+					$scope.isShow = true;
+				}
+				if ($scope.purchase.installment) {
+					$scope.installmentBox = true
+				}else {
+					$scope.installmentBox = false
+				}
 				$scope.purchase.purchaseHistory = angular.fromJson($scope.purchase.statushistory);
 				$scope.purchase.currentTotal = $scope.purchase.price;
 				if ($scope.purchase.jsonRule){
@@ -199,7 +462,7 @@ define(['app/app'], function(app) {
 
 				// 计算
 				$scope.purchase.price += $scope.freight;
-                $scope.purchase.price = Number(NumberService.toCeil($scope.purchase.price, 2));
+				$scope.purchase.price = Number(NumberService.toCeil($scope.purchase.price, 2));
 
 				$scope.purchase.invoiceInfo = angular.fromJson($scope.purchase.invoiceAddress)
 
@@ -207,7 +470,14 @@ define(['app/app'], function(app) {
 				$scope.error('获取订单信息请求失败');
 			});
 		}
-
+		if (!$scope.purchaseId || $scope.purchaseId == '') {
+			$scope.error('订单编号ID不能为空');
+		} else {
+			$scope.updatePurchase()
+			/**
+			 * 根据采购单编号ID获取采购单信息
+			 */
+		}
 		$scope.updateTotal = function (data) {
 			if (data.currentTaxUnitPrice == null){
 				data.currentTaxUnitPrice = 0.000001;
@@ -238,6 +508,11 @@ define(['app/app'], function(app) {
 		$scope.isChange = false;
 		$scope.changePrice = function () {
             $scope.isChange = true;
+			if ($scope.installmentBox) {
+				$scope.cancelEdit();
+			} else {
+				$scope.cancelSwitch();
+			}
 			angular.forEach($scope.purchase.purchaseDetails, function (detail) {
 				detail.currentTaxUnitPrice = detail.taxUnitPrice;
 			});

+ 192 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -70,6 +70,7 @@ define(['app/app'], function (app) {
             404: '待收货',
             405: '待收款', /*已收货:卖家没有已收货状态,商城收货后,应该是待收款状态*/
             503: '待收款',
+            524: '待收款',
             514: '待收款',
             520: '已完成',
             602: '已失效',
@@ -102,7 +103,7 @@ define(['app/app'], function (app) {
                     state = '';
                     break;
                 case 'tobeconfirmed' :
-                    state = '501-504';
+                    state = '501-504-524-525';
                     break;
                 case 'comfirmed':
                     // TODO huxz 点击填写物流转出货单,填写完物流信息变为待收货状态
@@ -153,6 +154,7 @@ define(['app/app'], function (app) {
             window.open(rootPath + '/report/print?reportName=' + type + '&whereCondition=' + "where trade$purchase.id=" + purchase.id);
         };
 
+
         $scope.setActive = function (status) {
             window.sessionStorage.removeItem("exceptionType");
             window.sessionStorage.setItem('purchaseState', status);
@@ -495,8 +497,10 @@ define(['app/app'], function (app) {
             $scope.orderTableParams.page(1);
             $scope.orderTableParams.reload();
         };
-
-
+        // 重新加载数据
+        $scope.reload = function () {
+            $scope.orderTableParams.reload();
+        };
         $scope.orderTableParams = new ngTableParams($scope.tableParams, {
             total: 0,
             getData: function ($defer, params) {
@@ -546,6 +550,28 @@ define(['app/app'], function (app) {
                         }
 
                         $scope.purchases = page.content;
+                        angular.forEach($scope.purchases, function (data) {
+                            if (data.installmentId && data.installment.status == 504) {
+                                angular.forEach(data.installment.installmentDetails, function (list) {
+                                    if (list.detno == data.installment.currentNo) {
+                                        if (list.status == 504) {
+                                            data.installmentDetailPaid = true;
+                                        }
+                                    }
+                                })
+                            }
+                            // 循环判断一期都没有付款并且延期的
+                            if (data.installmentId && data.installment.status == 503) {
+                                angular.forEach(data.installment.installmentDetails, function (detailslist) {
+                                    var nowTime = new Date();
+                                    if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
+                                        data.Overtime = true;
+                                    }
+                                })
+                            }
+                            // 循环判断已付款未收款卖家可取消的
+
+                        });
                         $scope.requestOver = 0;
                         angular.forEach($scope.purchases, function (order) {
                             Rate.getRateVendor({orderId:order.orderid},{},function (data) {
@@ -618,7 +644,131 @@ define(['app/app'], function (app) {
             }
         });
         $scope.orderTableParams.reload();
+        // 确认收款
+        // 分期明细
+        $scope.numArray = {
+            '1': '一',
+            '2': '二',
+            '3': '三',
+            '4': '四',
+            '5': '五'
+        };
+        $scope.confirmPaymentBox = false;
+        $scope.confirmPayment = function (item,id) {
+            angular.forEach($scope.purchases, function (data) {
+                if(data.id != id) {
+                    data.confirmPaymentBox = false;
+                }
+            });
+            $scope.purchaseInstallment = item;
+            $scope.purchasesId = item.id;
+            $scope.confirmPaymentBox = true;
+            // 获取分期付款进行到哪一步
+            // 存放分期详情列表
+            $scope.installmentDetails = item.installment.installmentDetails;
+            if (item.installmentId && item.installment.status == 504) {
+                $scope.currencyNAME = item.currency;
+                angular.forEach(item.installment.installmentDetails, function (list) {
+                    if (list.detno == item.installment.currentNo) {
+                        $scope.installmentDetailsList = list;
+                        $scope.changeList = '';
+                        $scope.installmentDetailsList.installmentImages = $scope.installmentDetailsList.imgs.split(",");
+                        $scope.changeList = $scope.installmentDetailsList.installmentImages;
+                    }
+                })
+            };
+        };
+        $scope.cancelPayment = function () {
+            $scope.confirmPaymentBox = false;
+        };
+        // 确认收款
+        $scope.confirmPaymentOk = function (installmentDetails) {
+            var installmentDetailId = '';
+            angular.forEach(installmentDetails, function (installmentDetail) {
+                if (installmentDetail.detno == $scope.purchaseInstallment.installment.currentNo)
+                    installmentDetailId = installmentDetail.id;
+            });
+            Purchase.confirmPaymentInstallment({id: $scope.purchasesId,installmentDetailId: installmentDetailId}, null, function () {
+                toaster.pop('success', '收款成功');
+                $scope.confirmPaymentBox = false;
+                $scope.orderTableParams.reload();
+            }, function (response) {
+                toaster.pop('error', response.data);
+            });
+        };
+        // 切换效果
+        $scope.imgIndex = 0;
+        $scope.changeImg = function (installmentImg, index) {
+            $scope.imgIndex = index;
+        };
+        $scope.changePrev = function () {
+            if ($scope.imgIndex == 0) {
+                $scope.imgIndex = 0
+            }else if($scope.imgIndex > 0){
+                $scope.imgIndex -= 1;
+            }
+        };
+        $scope.changeNext = function (installmentImg) {
+            if ($scope.imgIndex == installmentImg.length-1) {
+                $scope.imgIndex = 0
+            }else {
+                $scope.imgIndex += 1;
+            }
+        };
+        /**
+         * 查看大图
+         *
+         * @param imgUrl		图片链接
+         */
+        $scope.showImg = showImg;
+        function showImg(imgUrl) {
+            var src = imgUrl, box = $('#image-box'), modal = $('.modal-content');
+            box.show();
+            box.find('img').attr('src', src);
+            box.find('a').click(function(){
+                box.hide();
+            });
+            box.dblclick(function(){
+                box.hide();
+            });
+        }
 
+        // 取消订单
+        $scope.sellerCancelOrder = function (data, purchaseid) {
+            console.log(data);
+            if(!purchaseid) {
+                return ;
+            }
+            if (data.installmentId && data.installment.status == 503) {
+                angular.forEach(data.installment.installmentDetails, function (detailslist) {
+                    var nowTime = new Date();
+                    console.log(detailslist.deadline);
+                    console.log(nowTime.getTime())
+                    if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
+                        Purchase.sellerCancelOrder({purchaseId : purchaseid, reason : ''}, null, function () {
+                            toaster.pop('success','取消订单成功');
+                            $scope.orderTableParams.reload();
+                            return ;
+                        });
+                    }
+                })
+            }else {
+                $modal.open({
+                    templateUrl: 'static/view/vendor/modal/cancelOrder_modal.html',
+                    size : 'md',
+                    controller : 'cancelControler',
+                    resolve : {
+                        purchaseid : function () {
+                            return purchaseid;
+                        }
+                    }
+                }).result.then(function () {
+                    $scope.reload();
+                }, function () {
+                    toaster.pop('info', '提示 ' + '您取消了对订单的操作');
+                });
+            }
+        };
         // 收退货
         $scope.receivingDialogShow = {};
         // 确认收退货:知道
@@ -1449,6 +1599,12 @@ define(['app/app'], function (app) {
                 case 501:
                     result = '待买家付款';
                     break;
+                case 524:
+                    result = '待买家付款';
+                    break;
+                case 525:
+                    result = '卖家发起取消,待确认';
+                    break;
                 case 504:
                     result = '付款确认中';
                     break;
@@ -1502,4 +1658,37 @@ define(['app/app'], function (app) {
             return "还剩 " + parseInt(day) + "天" + parseInt(hours) + "小时";
         }
     });
+    app.register.controller('cancelControler', ['$scope','purchaseid', 'Purchase', '$modalInstance', 'toaster', '$window', function ($scope, purchaseid, Purchase, $modalInstance, toaster, $window) {
+        $scope.reloadRoute = function () {
+            $window.location.reload();
+        };
+        $scope.purchase = {};
+        $scope.purchaseid = purchaseid;
+
+        /**
+         * 确认取消订单
+         */
+        $scope.confirm = function () {
+            if(!$scope.purchase.reason) {
+                toaster.pop('info','请选择取消订单的原因');
+                return ;
+            }
+            Purchase.sellerCancelOrder({purchaseId : purchaseid, reason : $scope.purchase.reason}, null, function () {
+                toaster.pop('success','操作成功,等待卖家确认');
+                $modalInstance.close();
+                // $scope.reloadRoute();
+            }, function (res) {
+                console.log(res);
+                toaster.pop('error','取消订单失败,请重新操作');
+            });
+        }
+
+        /**
+         * 取消操作
+         */
+        $scope.cancel = function () {
+            $modalInstance.dismiss();
+        }
+
+    }]);
 });

+ 1 - 1
src/main/webapp/resources/view/admin/trade/trade_order.html

@@ -209,7 +209,7 @@
 							<td class="text-center">{{order.status | statusAndTypeFilter}}</td>
 							<td class="text-center">
 								<a ng-if="order.status==504 || order.status==503" ng-show="active=='tobereceived'" style="position: relative;">
-									<button type="button" class="btn btn-default btn-sm" ng-click="ensurePay(order)">确认收款</button>
+									<button type="button" ng-if="order.status==504 && !order.installmentId" class="btn btn-default btn-sm" ng-click="ensurePay(order)">确认收款</button>
 									<button ng-if="order.status==504" type="button" class="btn btn-default btn-sm" ng-click="showAuditFailureModal(order)">审核不通过</button>
 									<div class="audit-failure-modal" ng-if="order.dislayModal">
 										<div class="title">审核不通过的原因</div>

+ 45 - 0
src/main/webapp/resources/view/usercenter/forstore/buyer_down_payment.html

@@ -0,0 +1,45 @@
+<link rel="stylesheet" href="static/css/pay.css" />
+<!--右侧主体部分-->
+<div class="user_right fr">
+    <div class="down-payment">
+        <div class="content">
+            <div class="payment-title">请您在 <em ng-bind="availabletime | restTime"></em> 内,完成支付,否则订单会被自动取消</div>
+            <div class="common-title">订单号</div>
+            <div class="order-list">
+                <ul>
+                    <li ng-repeat="list in orderList">
+                        <a href="user#/transfer/{{list}}" target="_blank"><em ng-bind="$index+1"></em>{{list}}</a>
+                    </li>
+                </ul>
+            </div>
+            <div class="common-title">收款账户</div>
+            <div class="payment-style">
+                <ul style="height: 80px">
+                    <li style="margin-top: 5px;">
+                        <label class="check-act">
+                            <input type="radio" id="2" name="name" value="2" ng-checked="type == 'PAIDTOPLATFORM'"/>
+                            <label for="2"></label>
+                            <em>平台代收</em>
+                        </label>
+                        <div class="tip-content" style="margin-right: 45px;">
+                            <img src="static/img/common/notice-tip.png" />
+                            <div class="tip-content-01" style="top: 33px;">
+                                选择【平台代收】,货款将由优软商城<br/>
+                                在银行开立的第三方账户暂为保管,待<br/>
+                                您确认收货后,优软商城再和卖家结清。
+                            </div>
+                        </div>
+                        <div ng-bind="saleAccount.number">125963528469526354</div>
+                        <div ng-bind="saleAccount.accountname">开户人名称</div>
+                    </li>
+                </ul>
+            </div>
+        </div>
+        <div class="pay-price">
+            <div class="row">
+                <div class="fr">总价: <em>{{$$bankTransfer.total | formateNumber : 2 | currencySysmbol : $$bankTransfer.currency}}</em></div>
+            </div>
+            <div class="row" style="margin-top: 12px;" ng-click="confirmOrder()"><button>确认</button></div>
+        </div>
+    </div>
+</div>

+ 228 - 7
src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

@@ -269,16 +269,17 @@
 	.operate-height {
 		height: 31px;
 		line-height: 31px;
+		position: relative;
 	}
 
 	.ship-notify {
 		position: absolute;
 		line-height: 20px;
-		left: 30px;
+		left: 0;
 		top: 32px;
 		z-index: 155;
 		width: 140px;
-		border: 2px solid #3A75E6;
+		border: 1px solid #3A75E6;
 		padding: 5px 10px;
 		color: #1C54CA;
 	}
@@ -293,8 +294,8 @@
 		-moz-transform: rotate(44deg);
 		-webkit-transform: rotate(44deg);
 		-o-transform: rotate(44deg);
-		top: -7px;
-		left: 82px;
+		top: -6px;
+		left: 113px;
 	}
 
 	.ship-notify .content {
@@ -309,6 +310,7 @@
 		display: inline-block;
 		width: 20px;
 		height: 30px;
+		position: absolute;
 	}
 
 	.notice-ship-tip {
@@ -578,6 +580,103 @@
 	.border-bt-16:nth-of-type(1){
 		border-top: none;
 	}
+
+	/*补充*/
+	.operate-height .ship-btn:hover + .ship-content,.operate-height .ship-btn:hover + .pay{
+		display: inline-block !important;
+	}
+	.ship-content,.pay{
+		display: none;
+		width: 165px;
+	}
+	.ship-content .content{
+		font-size: 12px;
+		color: #333;
+		padding: 5px;
+	}
+	.pay{
+		min-width: 275px;
+		right: 0;
+		left: inherit;
+		padding: 0;
+	}
+	.pay .arrow{
+		right: 34px;
+		left: inherit;
+	}
+	.pay .content{
+		padding: 0;
+		margin: 0;
+	}
+	.pay .content .title{
+		width: 100%;
+		height: 28px;
+		text-align: center;
+		line-height: 28px;
+		background: #f6f9ff;
+		font-size: 14px;
+	}
+	.pay .content .title em{
+		font-weight: bold;
+		color: #333;
+	}
+	.color999{
+		color: #999 !important;
+	}
+	.color333{
+		color: #333 !important;
+	}
+	.red{
+		color: #f00 !important;
+	}
+	.pay .content ul{
+		width: 100%;
+		margin: 0 auto;
+		display: inline-block;
+		padding-top: 5px;
+	}
+	.pay .content ul li{
+		width: 100%;
+		float: left;
+		height: 20px;
+		line-height: 20px;
+		font-size: 12px;
+	}
+	.pay .content ul li em{
+		width: 14px;
+		height: 14px;
+		display: inline-block;
+		border-radius: 100%;
+		line-height: 14px;
+		color: #fff;
+		background: #5078cb;
+		float: left;
+		position: relative;
+		top: 3px;
+		margin-left: 20px;
+		text-align: left;
+		padding-left: 3px;
+	}
+	.pay .content ul li div{
+		float: left;
+		margin: 0 5px;
+	}
+	.pay .content ul li div.price{
+		color: #f00;
+		max-width: 105px;
+		text-align: left;
+		min-width: 60px;
+	}
+	.pay .content ul li div.status{
+		color: #5078cb;
+	}
+	.pay .content .tip-01{
+		width: 100%;
+		height: 28px;
+		line-height: 28px;
+		background: #eff0f2;
+		font-size: 12px;
+	}
 </style>
 <div class="user_right fr">
 	<!--订单中心-->
@@ -753,19 +852,57 @@
 						</span>
 						<span class="oder_deal" ng-class="{'order-border-bottom-solid' : $index == order.orderDetails.length -1 || $index==2}">
                             <div ng-if="$index == 0">
+								<a class="operate-height" href="user#/order/pay/{{order.orderid | EncryptionFilter}}" ng-if="(order.status == 503 || order.status == 501) && order.auditPayFailReason == null && !order.installmentId" style="display: block;">
                                 <a ng-if="(order.status == 405 || order.status == 520) && !order.rateStatus" class="operate-height" target="_blank" href="user#/rate/firstRate/{{order.orderid | EncryptionFilter}}" style="display: block;">
                                   <em class="order-operation">评价</em>
                               	</a>
 								<a ng-if="order.rateStatus == 523" class="operate-height" target="_blank" href="user#/rate/addRate/{{order.orderid | EncryptionFilter}}" style="display: block;">
                                   <em class="order-operation">追加评价</em>
                               	</a>
-                              <a class="operate-height" href="user#/order/pay/{{order.orderid | EncryptionFilter}}" ng-if="(order.status == 503 || order.status == 501) && order.auditPayFailReason == null" style="display: block;">
+                              <a class="operate-height" href="user#/order/pay/{{order.orderid | EncryptionFilter}}" ng-if="!order.installmentId&&(order.status == 503 || order.status == 501) && order.auditPayFailReason == null" style="display: block;">
                                   <em class="order-operation">立即付款</em>
+								</a>
+								<a ng-click="requestCancel(order, order.orderid)" ng-if="order.status == 525" class="operate-height">
+									<em class="order-operation">卖家请求取消</em>
+								</a>
+                              <a class="operate-height" href="user#/transfer/{{order.orderid | EncryptionFilter}}" ng-if="order.installmentId&&(order.status==503||order.status==504||order.status==524) && order.installment.status != 505 && !order.againUpload" style="display: block;">
+                                  <em class="order-operation">立即付款</em>
+								  <!--分期付款-->
+								  <div class="ship-btn seller-ship-tip" style="position: absolute;">
+                                     <img src="static/img/common/notice-tip.png"/>
+                                  </div>
+                                  <div class="pay ship-content ship-notify">
+                                      <div class="arrow" style="right: 27px;"></div>
+                                      <div class="content">
+										  <div class="title">货款共计
+											  <em ng-bind="order.installment.price | currencySysmbol : detail.currencyName">¥9000</em>
+											  &nbsp;&nbsp;&nbsp;&nbsp;分
+											  <em style="color: #5078cb;" ng-bind="order.installment.count">5</em> 期
+										  </div>
+										  <ul>
+											  <li ng-repeat="item in order.installment.installmentDetails">
+												  <em ng-bind="$index+1">1</em>
+												  <div class="price" ng-class="{'color333': item.status == 505}" ng-bind="item.price | currencySysmbol : detail.currencyName">¥13131</div>
+												  <div class="time" ng-class="{'color999': item.status == 505}">{{item.deadline | date : 'yyyy-MM-dd'}}前</div>
+												  <div class="color999 status" ng-if="item.status == 505">已付</div>
+												  <div class="status" ng-if="item.status != 505">待付</div>
+											  </li>
+									  </ul>
+										<div class="tip-01" ng-if="order.installment.status == 503"><em class="red">*</em>若第一期款项逾期未付,卖家有权利取消订单</div>
+									 </div>
+                                  </div>
                               </a>
-                              <a class="operate-height" href="user#/transfer/{{order.orderid | EncryptionFilter}}" ng-if="order.status == 503 && order.auditPayFailReason" style="display: block;">
+                              <a class="operate-height" href="user#/transfer/{{order.orderid | EncryptionFilter}}" ng-if="order.installmentId&&(order.status==503||order.status==504||order.status==524) && order.installment.status != 505 && order.againUpload" style="display: block;">
                                   <em class="order-operation">重新上传</em>
+								  <div class="ship-btn seller-ship-tip">
+                                     <img src="static/img/common/notice-tip.png"/>
+                                  </div>
+                                  <div class="ship-content ship-notify">
+                                      <div class="arrow"></div>
+                                      <div class="content">若单据上传有误或不清晰,等情况,可重新上传。</div>
+                                  </div>
                               </a>
-                              <div ng-if="order.status == 503" class="clock-mind">
+                              <div ng-if="order.status == 503 && !order.installmentId" class="clock-mind">
                                   <i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp; <em ng-bind="order.availabletime | restTime"></em>
                               </div>
 								<!--<div ng-if="order.status == 520" class="clock-mind">
@@ -857,6 +994,90 @@
 		</div>
 	</div>
 </div>
+<!--同意取消订单-->
+<div class="com-out-box" ng-if="requestCancelBox">
+	<div class="title">
+		<a ng-click="cancelRequestCancelBox()">&times;</a>
+	</div>
+	<div class="content">
+		<p><i class="fa fa-exclamation-circle"></i>卖家请求取消此订单<br/>
+			取消原因:{{cancleOrder.unavailableReason}}
+		</p>
+		<p>请先联系卖家处理售后事宜,否则<br/>请勿点击【同意取消】</p>
+		<div class="deal-btn">
+			<a ng-click="confirmRequest()">同意取消</a>
+			<a ng-click="cancelRequest()" style="background: #d0cfcf; color: #666">拒绝取消</a>
+		</div>
+	</div>
+</div>
+<style>
+	.com-out-box{
+		position: fixed;
+		z-index: 2;
+		height: 180px;
+		opacity: 1;
+		background-color: white;
+		width: 300px;
+		-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+		box-shadow: 0 5px 15px rgba(0,0,0,.5);
+		margin: -150px 0 0 -90px;
+		top: 55%;
+		left: 50%;
+	}
+	.com-out-box .title{
+		height: 30px;
+		background-color: #5078cb;
+		text-align: right;
+		line-height: 30px;
+	}
+	.com-out-box .title a{
+		color: white;
+		font-size: 28px;
+		position: relative;
+		top: -2px;
+		right: 8px;
+	}
+	.com-out-box .content p{
+		font-size: 14px;
+		text-align: center;
+		line-height:20px;
+	}
+	.com-out-box .content p:first-child{
+		margin-top: 10px;
+		line-height: 24px;
+	}
+	.com-out-box .content p:nth-child(2){
+		font-size: 12px;
+		color: #f00;
+	}
+	.com-out-box .content p i{
+		color: #5078cb;
+		font-size: 18px;
+		margin-right: 8px;
+	}
+	.com-out-box .content div{
+		width: 100%;
+		margin: 0 auto;
+		text-align: center;
+		margin-top: 10px;
+	}
+	.com-out-box .content div a{
+		width: 78px;
+		display: inline-block;
+		height: 28px;
+		line-height: 28px;
+		text-align: center;
+		font-size: 14px;
+		color: #fff;
+		background: #5078cb;
+	}
+	.com-out-box .content div a:first-child{
+		margin-right: 10px;
+	}
+	.com-out-box .content div a:hover{
+		background: #337ab7;
+	}
+</style>
 <script>
 	$(function(){
 		//产品字数超过两行时改变样式

+ 278 - 580
src/main/webapp/resources/view/usercenter/forstore/buyer_transfer.html

@@ -1,605 +1,303 @@
-<style>
-.searchGroup {
-	margin-top: 20px;
-	margin-bottom: 10px;
-}
-
-.btn-primary {
-	color: #fff;
-	background-color: #7bb4e1;
-	border-color: #7bb4e1;
-}
-
-.account-info-line {
-	padding: 5px;
-	margin-bottom: 5px;
-	margin-top: 5px;
-}
-
-.marginltb {
-	margin-left: 20px;
-	margin-top: 10px;
-	margin-bottom: 10px;
-}
-
-.containerrow {
-	display: inline-block;
-	width: 100%;
-	padding-right: 0px;
-}
-
-.minTitle {
-	margin-bottom: 15px;
-	margin-top: 15px;
-	font-weight: 600;
-	font-size: 15px;
-}
-
-.paddingzero {
-	padding-left: 0px;
-	padding-right: 0px;
-}
-
-.marginleftrightzero {
-	margin-left: 0px;
-	margin-right: 0px;
-}
-.marginleftrightzero:hover{
-	background: none !important;
-	cursor: default !important;
-}
-.marginbot30 {
-	margin-bottom: 30px;
-}
-
-.total {
-	margin-right: 10px;
-	font-size: 20px;
-}
-
-.marginbot15 {
-	margin-bottom: 15px;
-}
-
-.orderDiv {
-	font-size: 15px;
-}
-
-.block {
-	background-color: white;
-	padding-left: 15px;
-	padding-right: 15px;
-	font-size: 14px;
-	font-family: "microsoft yahei";
-}
-
-h4 {
-	font-size: 20px;
-	font-weight: 600;
-}
-
-.btn-primary:hover {
-	color: #fff;
-	background-color: #f39800;
-	border-color: #f39800;
-	border-left-color: #fff;
-	border-right-color: #fff;
-}
-
-.btn-primary:active {
-	color: #fff;
-	background-color: #f39800;
-	border-color: #f39800;
-}
-
-.tr-default {
-	color: #fff;
-	background-color: #7bb4e1;
-}
-
-.totalNum {
-	font-weight: bold;
-	color: #f39800;
-}
-
-.price {
-	color: #f39800;
-	font-weight: bold;
-	font-size: 14px;
-}
-
-td {
-	line-height: 1.1;
-}
-
-.order_start label {
-	display: inline;
-	/* font-weight: normal; */
-}
-
-.order-start {
-	padding-left: 30px !important;
-}
-
-.order-start input[type="checkbox"] {
-	display: inline;
-}
-
-.order-start input[type="radio"] {
-	display: none;
-}
-
-input[type="radio"]+label, input[type="checkbox"]+label {
-	background-color: #FFF;
-	border: 1px solid #C1CACA;
-	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px
-		rgba(0, 0, 0, 0.05);
-	padding: 6px;
-	display: inline-block;
-	position: relative;
-	vertical-align: text-bottom;
-}
-
-input[type="radio"]:checked+label:after, input[type="checkbox"]:checked+label:after
-	{
-	content: '\2714';
-	clear: both;
-	display: block;
-	position: absolute;
-	top: 0px;
-	left: 0px;
-	color: #FFF;
-	background-color: #7bb4dc;
-	width: 100%;
-	height: 100%;
-	text-align: center;
-	font-size: 14px;
-	vertical-align: text-top;
-}
-
-.order-start label {
-	margin-bottom: 0px;
-}
-
-.border-account {
-	border-bottom: 1px dashed #C1BABA;
-	border-top: 1px dashed #C1BABA;
-	margin-top: 10px;
-}
-
-.account-line:HOVER {
-	background-color: #E6E5E5;
-	cursor: pointer;
-}
-
-.action-tag {
-	color: rgb(113, 142, 208);
-	padding-top: 10px;
-	font-family: "microsoft yahei";
-}
-
-.action-tag:HOVER {
-	text-decoration: none;
-	color: #202123;
-}
-
-.modify-account {
-	color: rgb(243, 154, 2);
-}
-
-.modify-account:HOVER {
-	color: #202123;
-}
-
-.margin-top-5 {
-	margin-top: 5px;
-}
-
-.margin-left-37 {
-	margin-left: 37px;
-}
-
-.padding-left-right-zero {
-	padding-left: 0px !important;
-	padding-right: 0px !important;
-}
-
-.padding-left-30 {
-	padding-left: 30px;
-}
-
-table>tbody>tr>td .btn-primary {
-	width: 70px;
-}
-
-.price {
-	color: #f39800;
-	font-weight: bold;
-	font-size: 14px;
-}
-
-.detail-icon {
-	padding-left: 15px;
-}
-.location ul {
-    border-bottom: solid 1px #ddd;
-}
-.previewImage{
-	max-width: 100px;
-	max-height:100px;
-}
-
-.preview{
-	width:100px;
-	height:100px;
-	border: 1px solid #ccc;
-	overflow: hidden;
-}
-
-.location {
-    line-height: 28px;
-}
-
-.font-size-12 {
-	font-size: 12px !important;
-}
-
-.notice {
-	color: #ff7800;
-}
-.input-append input{
-	display: block;
-	width: 100%;
-	height: 34px;
-	padding: 6px 12px;
-	font-size: 14px;
-	line-height: 1.42857143;
-	color: #555;
-	background-color: #fff;
-	background-image: none;
-	border: 1px solid #ccc;
-	border-radius: 4px;
-	-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-	box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-	-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
-	-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
-	transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
-	float: left;
-}
-.ok-btn{
-	width: 128px;
-	height: 52px;
-	display: inline-block;
-	background: #5078cb;
-	text-align: center;
-	color: #fff;
-	font-size: 16px;
-	font-weight: bold;
-	border-radius: inherit;
-}
-</style>
-<!--<div class="location ng-scope">-->
-	<!--<ul class="list-unstyled list-inline">-->
-		<!--<li class="text-bold">您当前的位置:</li>-->
-		<!--<li>买家中心 <i class="fa fa-angle-double-right"></i></li>-->
-		<!--<li>交易信息<i class="fa fa-angle-double-right"></i></li>-->
-		<!--<li>填写银行转账信息</li>-->
-	<!--</ul>-->
-<!--</div>-->
-<div>
-<!--	<div>
-		<div class="row searchGroup">
-			<div class="col-xs-3">
-				<h4>未付款,填写转账信息</h4>
-			</div>
-			<div class="col-xs-6">
-				<div class="input-group">
-					<input type="search"
-						class="form-control ng-pristine ng-untouched ng-valid"
-						ng-search="searchFor()" ng-change="upper()" ng-model="keyword"
-						placeholder="请输入订单号查询"> <span class="input-group-btn">
-						<button ng-click="searchFor()" class="btn btn-primary"
-							type="button">搜索</button>
-					</span>
-				</div>
-			</div>
-		</div>
-		<div>
-			<div class="col-xs-1">
-				<p style="margin-top: 8px; font-weight: bold;">
-					共<span class="totalNum">{{tobePaidTableParams.total()}}</span>条
-				</p>
+<link rel="stylesheet" href="static/css/pay.css" />
+<!--右侧主体部分-->
+<div class="user_right fr">
+	<div class="down-payment">
+		<div class="content">
+			<div class="common-title margin-top-none">付款账户</div>
+			<div class="payment-style">
+				<ul>
+					<li ng-if="buyAccount">
+						<label class="check-act" style="margin-right: 64px;">
+							<input type="radio" id="1" name="1" checked/>
+							<label for="1"></label>
+							<em class="word-in-10" ng-bind="buyAccount.bankname" title="{{buyAccount.bankname}}"></em>
+						</label>
+						<div ng-bind="buyAccount.filterAccount"></div>
+						<div ng-bind="buyAccount.accountname"></div>
+						<div ng-if="buyAccountInfos.length > 1"><button class="change-count" ng-click="changebuyAccount(buyAccount.id)">更换账户</button></div>
+					</li>
+					<li class="no-count" ng-if="!buyAccount">
+						<span><i class="fa fa-exclamation-circle"></i>暂未设置付款账户,前往  <a href="user#/payCenter" target="_blank">设置付款账户</a></span>
+					</li>
+				</ul>
 			</div>
-		</div>
-		</br>
-		<table ng-table="tobePaidTableParams"
-			class="table table-bordered table-striped">
-			<thead>
-				<tr class="tr-default">
-					<th width="70" class="text-center">
-						<div>序号</div> <input type="checkBox" ng-checked="isSelectAll"
-						ng-click="selectAll()" ng-disabled="showMe">
-					</th>
-					<th width="auto" class="text-center">订单详情</th>
-					<th width="114" class="text-center">单价</th>
-					<th width="114" class="text-center">金额</th>
-					<th width="100" class="text-center">税金</th>
-					<th width="100" class="text-center">价税合计</th>
-					<th width="80" class="text-center">订单状态</th>
-					<th width="60" class="text-center">操作</th>
-				</tr>
-			</thead>
-			<tbody ng-repeat="order in $data">
-				<tr>
-					<td rowspan="2" class="tdcenter">
-						<div>{{$index+1}}</div>
-						<div>
-							<input type="checkBox" ng-checked="order.isSelect"
-								ng-model="order.isSelect" ng-disabled="showMe"
-								ng-click="doSelect(order)">
-						</div>
-					</td>
-					<td colspan="8">
-						<div class="row">
-							<div class="col-sm-8 text-muted">
-								<span> <i class="fa fa-clock-o"></i> <span
-									ng-bind="order.creattime | date: 'yyyy-MM-dd HH:mm'"
-									class="text-num"></span>
-								</span> <span>订单号: <a
-									ng-href="user/home/order/{{order.orderid | EncryptionFilter}}"
-									ng-bind="order.orderid"></a>
-								</span> <span class="text-inverse">过期时间: <span
-									ng-bind="order.availabletime | date: 'yyyy-MM-dd HH:mm'"></span>
-								</span>
+			<div class="common-title margin-top-8">收款账户</div>
+			<div class="payment-style">
+				<ul class="payment-80">
+					<li ng-if="!($$bankTransfer.installmentId && $$bankTransfer.installment.status != 503)">
+						<label class="check-act" ng-click="selectPaymentType('PAIDTOPLATFORM')">
+							<input type="radio" id="2" name="name" value="2" ng-checked="type == 'PAIDTOPLATFORM'"/>
+							<label for="2"></label>
+							<em>平台代收</em>
+						</label>
+						<div class="tip-content" style="margin-right: 45px;">
+							<img src="static/img/common/notice-tip.png" />
+							<div class="tip-content-01" style="top: 33px;">
+								选择【平台代收】,货款将由优软商城<br/>
+								在银行开立的第三方账户暂为保管,待<br/>
+								您确认收货后,优软商城再和卖家结清。
 							</div>
-							<div class="col-sm-4 text-muted text-num text-right">
-								<span class="price">币别:<span ng-bind="order.currency"></span></span>
-								&nbsp;产品总数:<span ng-bind="order.qty"></span>
+						</div>
+						<div ng-if="type == 'PAIDTOPLATFORM'" ng-bind="saleAccount.bankname" title="{{saleAccount.bankname}}" class="word-in-10"></div>
+						<div ng-if="type == 'PAIDTOPLATFORM'" ng-bind="saleAccount.number"></div>
+						<div ng-if="type == 'PAIDTOPLATFORM'" ng-bind="saleAccount.accountname"></div>
+					</li>
+					<li ng-if="$$bankTransfer.installmentId">
+						<label class="check-act" ng-click="selectPaymentType('PAIDTOVENDOR')">
+							<input type="radio" id="3" name="name" value="3" ng-checked="type == 'PAIDTOVENDOR'"/>
+							<label for="3"></label>
+							<em>付款给卖家</em>
+						</label>
+						<div class="tip-content">
+							<img src="static/img/common/notice-tip.png" />
+							<div class="tip-content-01" style="top: 33px;height: 95px; left: -95px;">
+								<em class="red">风险提示:</em><br/>
+								选择【付款给卖家】,货款将直接支付<br/>
+								到卖家的账户,该笔交易中因此直接或<br/>
+								间接导致的损失,由用户自己承担。
 							</div>
 						</div>
-					</td>
-				</tr>
-				<tr>
-					<td colspan="3">
-						<div class="row cmp-item"
-							ng-repeat="orderDetail in order.orderDetails">
-							<div class="col-sm-6">
-								<div class="p-img">
-									<a href="product/component/{{orderDetail.uuid}}/"> <img
-										src="" lazy-load="{{orderDetail.img}}" height="78px"
-										width="78px">
-									</a>
-								</div>
-								<div>
-									<div>
-										<a class="f16 text-bold" style="display: block;"
-											href="product/component/{{orderDetail.uuid}}/"
-											ng-bind="orderDetail.cmpCode"></a> <span
-											ng-bind="orderDetail.brName"></span>
-									</div>
-									<div>
-										<i class="iconfont icon-kind f14"></i><span
-											ng-bind="orderDetail.kiName"></span>
-									</div>
-									<div ng-if="orderDetail.returnInWeek">
-	        							<img class="detail-icon" alt="支持7天无理由退货" src="static/img/product/seven-day-back.jpg" title="支持7天无理由退货">&nbsp;
-	        						</div>
+						<div ng-if="type == 'PAIDTOVENDOR'" ng-bind="salePerAccount.bankname" title="{{salePerAccount.bankname}}" class="word-in-10"></div>
+						<div ng-if="type == 'PAIDTOVENDOR'" ng-bind="salePerAccount.number"></div>
+						<div ng-if="type == 'PAIDTOVENDOR'" ng-bind="salePerAccount.accountname"></div>
+					</li>
+				</ul>
+			</div>
+			<div class="common-title margin-top-8" ng-if="type == 'PAIDTOVENDOR'">分期付款明细</div>
+			<div class="payment-detail" ng-if="type == 'PAIDTOVENDOR'">
+				<ul>
+					<li ng-repeat="installmentDetail in installmentData.installmentDetails">
+						<span>第{{numArray[$index+1]}}期</span>
+						<span ng-bind="installmentDetail.price | currencySysmbol : $$bankTransfer.currency" style="width: 120px; display: inline-block; margin-right: 20px;"></span>
+						<span>要求付款日期  {{installmentDetail.deadline | date : 'yyyy-MM-dd'}}</span>
+						<em ng-if="installmentDetail.status == 505"><img src="static/img/icon/pay-ok-icon.png"/></em>
+					</li>
+				</ul>
+			</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">
+						<div class="prev" ng-click="changePrev(installmentImg)"><i class="fa fa-angle-left"></i></div>
+						<div class="img">
+							<div class="number"><em>第{{numArray[$index+1]}}期</em></div>
+							<div class="list" ng-repeat="img in installmentImg.installmentImages track by $index" ng-if="installmentImg.imgIndex == $index">
+								<span><img ng-src="{{img}}"/></span>
+								<div class="hover-show">
+									<!-- 图片预览 -->
+									<a ng-click="showImg(img)"><i class="fa fa-search"></i>查看</a>
 								</div>
 							</div>
-							<div class="col-sm-3 text-num text-center">
-								<div class="text-num text-bold f16">
-									<span ng-bind="orderDetail.taxUnitprice | number:6"></span>
-								</div>
-								<div class="text-num text-muted">
-									×<span ng-bind="orderDetail.number"></span>
-								</div>
-								<div>
-									<span ng-if="orderDetail.tax">单价含税<span ng-bind="orderDetail.tax"></span>%</span>
-								</div>
+						</div>
+						<div class="next" ng-click="changeNext(installmentImg, $index)"><i class="fa fa-angle-right"></i></div>
+					</div>
+					<div class="small-img">
+						<span ng-class="{'active': installmentImg.imgIndex == $index}" ng-repeat="img in installmentImg.installmentImages track by $index">
+							<img ng-src="{{img}}" ng-click="changeImg(installmentImg, $index)"/>
+						</span>
+					</div>
+					<div class="price-input"><input type="text" class="form-control" value="{{installmentImg.price | currencySysmbol : $$bankTransfer.currency}}" readonly/></div>
+					<div class="time" ng-bind="installmentImg.deadline | date: 'yyyy-MM-dd HH:mm:ss'">2017-08-24 14:56:20</div>
+				</div>
+			</div>
+			<div class="payment-upload">
+				<ul ng-if="noPayinstallmentDetails.length == 0 || !noPayinstallmentDetails || $$bankTransfer.installment.status == 505">
+					<li ng-repeat="images in imagesList track by $index">
+						<div class="upload" id="uploadImg-{{$index}}">
+							<div class="img" ng-if="!images.imageUrl || images.imageUrl == ''" image-upload  data-src="static/img/icon/payment-upload.png" on-success="onUploadPayment($data, $index)">
 							</div>
-							<div>
+							<div class="img" ng-if="images.imageUrl || images.imageUrl != ''">
+								<img ng-src="{{images.imageUrl}}"/>
 							</div>
-							<div class="col-sm-3 text-num price text-center">
-								<div>
-									<span ng-bind="orderDetail.price | number"></span>
-								</div>
+							<div class="hover-show" ng-if="images.imageUrl">
+								<span class="delete" title="删除" ng-click="deleteProofInfo($index)"><i class="fa fa-trash"></i></span>
+								<!-- 图片预览 -->
+								<a ng-click="showImg(images.imageUrl)"><i class="fa fa-search"></i>查看</a>
 							</div>
 						</div>
-					</td>
-					<td class="text-center tdcenter">
-						<div class="text-theme f14 text-num">
-							<span ng-bind="order.taxes | number"></span>
-						</div>
-					</td>
-					<td class="text-center tdcenter">
-						<div class="text-inverse text-bold f16 text-num">
-							<span ng-bind="order.price | number"></span>
+						<div class="price" ng-if="type == 'PAIDTOVENDOR'">
+							<em ng-bind="$$bankTransfer.currency == 'USD'?'$':'¥'"></em>
+							<input type="text" class="form-control" ng-model="diliverPrice[$index]" ng-blur="onDiliverPriceChange($index)"  placeholder="请输入金额"/>
 						</div>
-					</td>
-					<td class="text-center tdcenter">
-						<div>
-							<span ng-bind="order.status | statusAndTypeFilter"
-								class="text-muted"></span>
+					</li>
+					<li ng-click="addUploadImg()" ng-if="imagesList.length < 6">
+						<div class="upload">
+							<div class="img">
+								<img src="static/img/icon/payment-add.png">
+							</div>
 						</div>
-					</td>
-					<td class="tdcenter"
-						ng-hide="active=='paid'|| active=='unavailable'">
-						<button ng-show="!(order.availabletime < nowTime)"
-							class="btn btn-primary btn-sm" ng-click="pay(order)"
-							ng-disabled="showMe">付款</button>
-					</td>
-				</tr>
-				<tr ng-if="!order" class="text-center">
-					<td colspan="5" class="text-center"
-						style="line-height: 40px; font-size: 20px;"><i
-						class="fa fa-smile-o fa-lg"></i> 当前没有对应的订单信息</td>
-				</tr>
-			</tbody>
-		</table>
-		<div  id="O">
-			<button class="btn btn-primary" ng-click="batchPay()"
-				ng-disabled="!orderNum" ng-show="!showMe">批量付款</button>
-			<button class="btn btn-primary" ng-show="showMe"
-				ng-click="alterPay()">重新勾选</button>
-		</div>
-		<a id="anchorScroll" style="color: white;"></a>
-	</div>-->
-	<div class="user_right fr block">
-		<div class="fill-info">
-			<div class="orderDiv" id="O">
-				<div class="marginbot30">
-					<div class="minTitle">订单号</div>
-					<div class="margin-left-37" ng-bind="orderNum"></div>
-				</div>
-				<div class="marginbot30">
-					<div class="minTitle">买家应付账户</div>
-					<div class="margin-left-37">
-						<label class="radio-inline" ng-click="set(true, true)"> <input
-							type="radio" name="inlineRadioOptions" id="inlineRadio1"
-							value="option1" ng-checked="purKind"> 个人账户
-						</label> <label ng-if="userInfo.enterprises" class="radio-inline" ng-click="set(false, true)"
-							style="margin-left: 30px;"> <input type="radio"
-							name="inlineRadioOptions" id="inlineRadio2" value="option2"
-							ng-checked="!purKind"> 企业账户
-						</label> <span role="button" class="pull-right action-tag"
-							ng-click="newAccount()" style="padding-top: 0px;"><i
-							class="fa fa-plus-square"></i>&nbsp;新增账户</span>
-					</div>
-					<div class="border-account">
-						<div class="containerrow">
-							<div ng-if="buyExpose"
-								class="row paddingzero marginleftrightzero account-line account-info-line"
-								ng-click="select(accountInfo, true)"
-								ng-repeat="accountInfo in buyAccountInfos">
-								<div class="col-md-4 order-start">
-									<input type="radio"
-										ng-checked="accountInfo.id == buyAccount.id"
-										id="{{accountInfo.id}}" name="buyAccount"><label
-										for="{{accountInfo.id}}"></label> &nbsp;<span
-										ng-bind="accountInfo.accountname"></span>
-								</div>
-								<div class="col-md-5">
-									<span ng-bind="accountInfo.filterAccount"></span>&nbsp; &nbsp;
-									<span ng-bind="accountInfo.bankname"></span>&nbsp;&nbsp;<i
-										class="fa fa-credit-card"></i>
-								</div>
-								<div class="text-right col-md-3">
-									<span role="button" class="modify-account"
-										ng-click="newAccount(accountInfo)"> <i
-										class="fa fa-edit"></i>&nbsp;编辑
-									</span> <span role="button" class="modify-account"
-										ng-click="deleteAccount(accountInfo)"> <i
-										class="fa fa-remove"></i>&nbsp;删除
-									</span>
-								</div>
+					</li>
+				</ul>
+				<ul ng-if="noPayinstallmentDetails">
+					<li ng-repeat="images in installmentNoPayImg track by $index">
+						<div class="upload" id="upload-{{$index}}">
+							<div class="img" ng-if="!images.imageUrl || images.imageUrl == ''" image-upload data-src="static/img/icon/payment-upload.png" on-success="onUploadPaymentImg($data, $index)">
 							</div>
-							<div ng-if="!buyExpose&&buyAccount"
-								class="row paddingzero marginleftrightzero account-line account-info-line">
-								<div class="col-md-4 order-start">
-									<input type="radio" ng-checked="buyAccount.id == buyAccount.id"
-										id="{{buyAccount.id}}"><label for="{{buyAccount.id}}"></label>
-									&nbsp;<span ng-bind="buyAccount.accountname"></span>
-								</div>
-								<div class="col-md-5">
-									<span ng-bind="buyAccount.filterAccount"></span>&nbsp; &nbsp; <span
-										ng-bind="buyAccount.bankname"></span>&nbsp;&nbsp;<i
-										class="fa fa-credit-card"></i>
-								</div>
-								<div class="text-right col-md-3">
-									<span role="button" class="modify-account"
-										ng-click="newAccount(buyAccount)"> <i
-										class="fa fa-edit"></i>&nbsp;编辑
-									</span> <span role="button" class="modify-account"
-										ng-click="deleteAccount(buyAccount)"> <i
-										class="fa fa-remove"></i>&nbsp;删除
-									</span>
-								</div>
+							<div class="img" ng-if="images.imageUrl || images.imageUrl != ''">
+								<img ng-src="{{images.imageUrl}}"/>
 							</div>
-							<div ng-if="!buyAccount"
-								class="row paddingzero marginleftrightzero text-center account-line account-info-line notice">没有对应的账户信息,请新增相应的账户信息
+							<div class="hover-show" ng-if="images.imageUrl">
+								<span class="delete" title="删除" ng-click="deleteimg($index)"><i class="fa fa-trash"></i></span>
+								<!-- 图片预览 -->
+								<a ng-click="showImg(images.imageUrl)"><i class="fa fa-search"></i>查看</a>
 							</div>
 						</div>
-						<div ng-if="buyAccountInfos.length>1"
-							class="pull-right action-tag">
-							<span role="button" ng-if="!buyExpose"
-								ng-click="doExpose(true, true)"><i
-								class="fa fa-angle-double-down"></i>&nbsp;展开列表</span> <span
-								role="button" ng-if="buyExpose" ng-click="doExpose(false, true)"><i
-								class="fa fa-angle-double-up"></i>&nbsp;收起列表</span>
+						<div class="price" ng-if="type == 'PAIDTOVENDOR'">
+							<em ng-bind="$$bankTransfer.currency == 'USD'?'$':'¥'"></em>
+							<input type="text" class="form-control" ng-model="diliverPrice[$index]" ng-blur="onDiliverPriceChange($index)"  placeholder="请输入金额"/>
 						</div>
-					</div>
-				</div>
-				<div class="marginbot30">
-					<div class="minTitle">商城应收帐户</div>
-					<div class="margin-left-37 margintop15">
-						<label class="radio-inline"> 
-							<input type="radio" name="saleAccounts" ng-checked="saleKind" ng-click="set(true, false)"> 对私账户
-						</label> 
-						<label class="radio-inline" style="margin-left: 30px;"> 
-							<input type="radio" name="saleAccounts" ng-checked="!saleKind" ng-click="set(false, false)"> 对公账户
-						</label>
-					</div>
-					<div class="border-account">
-						<div class="containerrow">
-							<div ng-if="salexpose"
-								class="row marginleftrightzero account-line account-info-line"
-								ng-click="select(saleAccountInfo)"
-								ng-repeat="saleAccountInfo in saleAccountInfos">
-								<div class="col-md-4 order-start">
-									<input type="radio"
-										ng-checked="saleAccountInfo.id == saleAccount.id"
-										id="{{saleAccountInfo.id}}" name="saleAccount"><label
-										for="{{saleAccountInfo.id}}"></label> &nbsp;<span
-										ng-bind="saleAccountInfo.accountname"></span>
-								</div>
-								<div class="col-md-8">
-									<span ng-bind="saleAccountInfo.filterAccount"></span> &nbsp;
-									&nbsp; <span ng-bind="saleAccountInfo.bankname"></span>&nbsp;
-									&nbsp;<i class="fa fa-credit-card"></i>
-								</div>
-							</div>
-							<div ng-if="!salexpose"
-								class="row marginleftrightzero account-info-line">
-								<div class="col-md-4 order-start">
-									<input type="radio"
-										ng-checked="saleAccount.id == saleAccount.id"
-										id="{{saleAccount.id}}" name="saleAccount"><label
-										for="{{saleAccount.id}}"></label> &nbsp;<span
-										ng-bind="saleAccount.accountname"></span>
-								</div>
-								<div class="col-md-8">
-									<span ng-bind="saleAccount.number"></span> &nbsp; &nbsp;
-									<span ng-bind="saleAccount.bankname"></span>&nbsp; &nbsp;<i
-										class="fa fa-credit-card"></i>
-								</div>
+					</li>
+					<li ng-click="addUploadImgNopay($event)" ng-if="installmentNoPayImg.length < 6 && $$bankTransfer.installmentId">
+						<div class="upload">
+							<div class="img">
+								<img src="static/img/icon/payment-add.png">
 							</div>
 						</div>
-					</div>
-				</div>
-				<div class="row marginbot30">
-					<div class="minTitle col-md-2 margin-top-5">转账日期</div>
-					<div class="col-md-10">
-						<datetrigger name="transferTime" model="transferTime"
-							format="yyyy年MM月dd日" class="col-md-5" max-date="maxDate"
-							style="line-height: 28px; border-radius: 5px; width: 70%; font-size: 15px;"></datetrigger>
-					</div>
+					</li>
+				</ul>
+				<div ng-if="type == 'PAIDTOVENDOR'" class="img-specifications">仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M,每期最多可上传6张图片</div>
+				<div ng-if="type == 'PAIDTOPLATFORM'" class="img-specifications">仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M,最多可上传6张图片</div>
+			</div>
+		</div>
+		<div class="pay-price">
+			<div class="stage row">
+				<div class="content">
+					<p ng-if="type == 'PAIDTOVENDOR'"><span>已支付:</span><em ng-bind="yesPayinstallmentDetails.payTatalPrice | formateNumber : 2 | currencySysmbol : $$bankTransfer.currency">¥500</em></p>
+					<p ng-if="type == 'PAIDTOVENDOR'"><span>待支付:</span><em class="bule" ng-bind="$$bankTransfer.total - yesPayinstallmentDetails.payTatalPrice | formateNumber : 2 | currencySysmbol : $$bankTransfer.currency">¥513131.32</em></p>
+					<p class="total"><span>总价:</span><em class="red">{{$$bankTransfer.total | formateNumber : 2 | currencySysmbol : $$bankTransfer.currency}}</em></p>
 				</div>
-				<div class="marginbot30">
-					<div class="minTitle marginbot15">交易图片</div>
-					<div class="marginltb">
-						<label>付款截图:</label>
-						<div>
-							<div  image-upload data-src="static/img/vendor/images/upload.png" on-success="onUploadPayment($data)"></div>
-							<span class="help-block font-size-12 text-inverse">建议图片大小在3M以内,支持图片格式jpg、png、gif</span>
-						</div>
-					</div>
+			</div>
+			<div class="row" style="margin-top: 0;">
+				<div class="deal-btn">
+					<a ng-click="confirm()" class="ok">确认</a>
+					<a ng-click="loadPage()" class="off">取消</a>
 				</div>
 			</div>
 		</div>
-		<div class="text-right marginbot15 margintop15">
-			<span class="total">总价:&nbsp;<span style="color: #e64040">{{$$bankTransfer.total | number : 2 | currencySysmbol : $$bankTransfer.currency}}</span></span>
-			<button class="ok-btn btn btn-primary btn-lg" ng-click="confirm()"
-				ng-disabled="!$$bankTransfer.total||!buyAccount||!saleAccount||!transferTime||!imageUrl">确认</button>
+	</div>
+</div>
+<!--更换账户-->
+<div class="change-count-box" ng-if="changebuyAccountBox">
+	<div class="content-box">
+		<div class="head">
+			<a ng-click="cancelChange()">&times</a>
+		</div>
+		<div class="content-table">
+			<ul>
+				<li ng-repeat="item in buyAccountInfos">
+					<label class="check-act">
+						<input type="radio" id="{{item.id}}" name="name01" ng-click="selectItem(item)" ng-checked="isFalse || item.id == buyAccount.id"/>
+						<label for="{{item.id}}"></label>
+						<em ng-bind="item.bankname">中国银行</em>
+					</label>
+					<span class="width150" ng-bind="item.filterAccount">125963528469526354</span>
+					<span class="width80" ng-bind="item.accountname">开户人名称</span>
+				</li>
+			</ul>
+			<div class="deal-btn">
+				<a ng-click="cancelChange()" class="off">取消</a>
+				<a ng-click="confirmChange()" class="ok">确认</a>
+			</div>
 		</div>
 	</div>
-</div>
+</div>
+<style>
+	.preview input{
+		opacity: 0;
+		display: inline-block !important;
+		width: 114px;
+		height: 114px;
+		position: absolute;
+		left: 0;
+		top: 0;
+	}
+.change-count-box{
+	position: fixed;
+	z-index: 2;
+	/*height: 258px;*/
+	opacity: 1;
+	background-color: white;
+	width: 436px;
+	box-shadow: 1px 0px 15px rgba(144, 140, 140, 0.5);
+	margin: -240px 0 0 -218px;
+	top: 55%;
+	left: 50%;
+	border-radius: 5px;
+	padding-bottom: 20px;
+}
+.change-count-box .content-box{
+	width: 100%;
+	margin: 0 auto;
+}
+.change-count-box .content-box .head{
+	width: 100%;
+	height: 26px;
+}
+.change-count-box .content-box .head a{
+	float: right;
+	font-size: 18px;
+	color: #dfdddd;
+	margin: 1px 5px;
+}
+.change-count-box .content-box .content-table{
+	width: 406px;
+	margin: 0 auto;
+
+}
+.change-count-box .content-box .content-table ul{
+	width: 100%;
+	max-height: 170px;
+	overflow-y: auto;
+	display: inline-block;
+	margin: 0 auto;
+}
+.change-count-box .content-box .content-table ul li{
+	width: 100%;
+	float: left;
+	height: 34px;
+	line-height: 34px;
+	font-size: 14px;
+}
+ .change-count-box .content-box .content-table ul li:nth-child(odd){
+	background: #f5f8fe;
+ }
+.change-count-box .content-box .content-table ul li:nth-child(even){
+   background: #eaf1ff;
+}
+.change-count-box .content-box .content-table ul li .check-act{
+	margin-right: 0;
+	float: left;
+}
+.change-count-box .content-box .content-table ul li .check-act label{
+	margin-left: 10px;
+	top: 6px;
+	margin-right: 5px;
+}
+.change-count-box .content-box .content-table ul li .check-act{
+	width: 130px;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+	margin: 0;
+}
+.change-count-box .content-box .content-table ul li span{
+	display: inline-block;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+	line-height: 34px;
+	height: 30px;
+}
+.change-count-box .content-box .content-table ul li span.width150{
+	width: 90px;
+	margin: 0 30px;
+}
+.change-count-box .content-box .content-table ul li span.width80{
+	width: 80px;
+}
+.change-count-box .content-box .content-table .deal-btn a {
+	width: 60px;
+	height: 26px;
+	line-height: 26px;
+}
+</style>

+ 385 - 4
src/main/webapp/resources/view/vendor/forstore/purchase_detail.html

@@ -33,16 +33,17 @@
 		margin-left: 20px;
 	}
 	#oder-detail .oder_xq_list dl .change-price span{
-		width: 74px;
-		height: 30px;
+		width: 60px;
+		height: 26px;
 		display: inline-block;
 		text-align: center;
 		background: #5078cb;
-		line-height: 30px;
+		line-height: 26px;
 		color: #fff;
 		font-size: 14px;
 		/*margin-right: 5px;*/
 		float: right;
+		margin-top: 4px;
 	}
 	#oder-detail .oder_xq_list dl .change-price span:hover{
 		cursor: pointer;
@@ -376,6 +377,9 @@
 	.oder_xq_list dl span .contact_btn:hover{
 		color: #fff !important;
 	}
+	 input[type=text]::-ms-clear, input[type=text]::-ms-reveal{
+		 display: none;
+	 }
 </style>
 <div class="user_right fr">
 	<!--叮当详情-->
@@ -410,7 +414,7 @@
 			</ul>
 		</div>-->
 		<!--订单信息-->
-		<div class="logistics_list01" style="margin-top: 0;">
+		<div class="logistics_list01 clearfix" style="margin-top: 0;">
 			<div class="log_menu">
 				<!--<span>订单信息<b>订单号:{{purchase.orderid}} <em><font style="color: #333; margin-left: 20px">订单状态:</font>{{purchase.status | purchaseStatus}}</em></b></span>-->
 				<span ng-if="purchase.status != 602 && purchase.status != 603 && purchase.status != 604 && purchase.status != 605 && purchase.status != 606 && purchase.status != 315">订单信息<b>订单号:{{purchase.orderid}}<em style="margin-left: 25px;"><font style="color: #333;">订单状态:</font>{{purchase.status | purchaseStatus}}</em></b></span>
@@ -573,6 +577,281 @@
 					</dd>
 				</dl>
 			</div>
+			<style>
+				.direct-collection{
+					width: 734px;
+					float: left;
+					margin-bottom: 20px;
+					position: relative;
+					margin-top: -57px;
+				}
+				.direct-collection .head{
+					width: 734px;
+					height: 30px;
+					margin: 0 auto;
+					background-color: #fffbf6;
+					border: solid 1px #ffe8d6;
+					padding-left: 14px;
+					font-size: 14px;
+					line-height: 30px;
+					margin-left: 10px;
+				}
+				.direct-collection .head em{
+					color: #ff8522;
+				}
+				.direct-collection .head span{
+					width: 25px;
+					display: inline-block;
+					margin-left: 10px;
+				}
+				.direct-collection .head span button{
+					position: relative;
+					top: 3px;
+					width: 35px;
+					border: none;
+					height: 18px;
+					background: url("static/img/icon/icon-yes.png") no-repeat center;
+					float: left;
+				}
+				.direct-collection .head span button.active{
+					background: url("static/img/icon/icon-no.png") no-repeat center;
+				}
+				.direct-collection .content-box{
+					width: 100%;
+					height: auto;
+					background-color: #fffbf6;
+					margin:10px 0 0 10px;
+					display: inline-block;
+				}
+				.direct-collection .content-box ul{
+					width: 100%;
+					margin: 0 auto;
+				}
+				.direct-collection .content-box ul li.line{
+					width: 100%;
+					float: left;
+					height: 26px;
+					line-height: 26px;
+					font-size: 14px;
+					margin-top: 14px;
+				}
+				.direct-collection .content-box ul li.line:last-child{
+					margin-bottom: 10px;
+				}
+				.direct-collection .content-box ul li.line span{
+					float: left;
+					display: inline-block;
+					height: 26px;
+				}
+				.direct-collection .content-box ul li.line span.price{
+					position: relative;
+					width: 125px;
+					margin: 0 36px 0 14px;
+				}
+				.direct-collection .content-box ul li.line span.price em{
+					display: inline-block;
+					width: 21px;
+					height: 26px;
+					background-color: #5078CB;
+					border-radius: 2px 0 0 2px;
+					font-size: 14px;
+					line-height: 26px;
+					color: #fff;
+					text-align: center;
+				}
+				.direct-collection .content-box ul li.line span.price p{
+					width: 125px;
+					border: solid 1px #ffe8d6;
+					height: 26px;
+					display: inline-block;
+					background: #fff;
+					text-align: center;
+					font-size: 14px;
+				}
+				.direct-collection .content-box ul li.line span.price input {
+					width: 104px;
+					height: 26px;
+					padding: 0;
+					line-height: 26px;
+					float: right;
+					border-radius: 0;
+					text-align: center;
+					font-size: 14px;
+				}
+				.direct-collection .content-box ul li.line span.time{
+					width: 140px;
+					position: relative;
+					margin: 0 0 0 14px;
+				}
+				.direct-collection .content-box ul li.line span.time p{
+					width: 125px;
+					border: solid 1px #ffe8d6;
+					height: 26px;
+					display: inline-block;
+					background: #fff;
+					text-align: center;
+					font-size: 14px;
+				}
+				.direct-collection .content-box ul li.line span:first-child{
+					margin-left: 14px;
+				}
+				.direct-collection .content-box ul li.line span.time input{
+					height: 26px;
+					padding: 0;
+					line-height: 26px;
+					/*text-align: center;*/
+					font-size: 12px;
+					border-radius: 0;
+					padding-left: 5px;
+				}
+				.direct-collection .content-box ul li.line span.time input[readonly]{
+					background: #fff;
+				}
+				.direct-collection .content-box ul li.line span.time button.open {
+					position: absolute;
+					right: 4px;
+					top: 1px;
+					width: 18px;
+					height: 24px;
+					background: url(static/img/icon/icon-xiala.png) right no-repeat transparent !important;
+					background-position-x: 100% !important;
+					border: none;
+				}
+				.direct-collection .content-box ul li.line span.add-span{
+					margin-left: 10px;
+				}
+				.direct-collection .content-box ul li.line span.add-span button{
+					border: none;
+					font-size: 18px;
+					background: none;
+				}
+				.direct-collection .content-box ul li.line span.add-span button.reduce{
+					color: #ff8522;
+					margin-right: 3px;
+				}
+				.direct-collection .content-box ul li.line span.add-span button.add{
+					color: #32b500;
+					margin-right: 3px;
+				}
+				.direct-collection .content-box ul li.line .deal-btn{
+					width: 140px;
+					float: right;
+					margin-right: 24px;
+				}
+				.direct-collection .content-box .deal-btn button{
+					width: 60px;
+					height: 26px;
+					display: inline-block;
+					text-align: center;
+					line-height: 26px;
+					font-size: 14px;
+					float: left;
+					border: none;
+				}
+				.direct-collection .content-box .deal-btn button.off{
+					background: #cdcccc;
+					color: #fff;
+					margin-right: 20px;
+				}
+				.direct-collection .content-box .deal-btn button.ok{
+					background: #5078cb;
+					color: #fff;
+				}
+				.direct-collection .content-box .deal-btn button:hover{
+					background: #337ab7;
+					color: #fff;
+				}
+				.direct-collection .content-box ul li.line em.show-img{
+					margin-left: 6px;
+				}
+				.direct-collection .content-box ul li.line em img{
+					position: relative;
+					top: -2px;
+				}
+				.direct-collection .content-box ul li.line .dropdown-menu{
+					width: 256px;
+				}
+				.direct-collection .content-box ul li.line .dropdown-menu span{
+					margin: 0;
+					height: auto;
+				}
+				.direct-collection .content-box ul li.line .dropdown-menu button{
+					border: none;
+				}
+			</style>
+			<div class="direct-collection">
+				<div class="head" ng-if="(purchase.status == 503 || purchase.status == 501)">开通  <em>【直接收款】</em> 功能,无需等待商城结算
+					<span ng-click="switchToggle(isShow)"><button ng-class="{'active': !isShow}"></button></span>
+				</div>
+				<div class="content-box" ng-if="isShow">
+					<ul>
+						<li ng-repeat="item in purchase.installment.installmentDetails" class="line" ng-if="installmentBox">
+							<span>第{{numArray[$index+1]}}期</span>
+							<span class="price" ng-if="!editBox">
+								<p ng-bind="item.price | currencySysmbol : purchase.currency"></p>
+							</span>
+							<span class="price" ng-if="editBox">
+								<em ng-bind="purchase.currency == RMB ? '$' : '¥'"></em>
+								<input type="text" class="form-control"  placeholder="请输入金额" ng-model="item.price" ng-blur="changeInstallmentPrice(item, item.price, $index)" ng-change="inputInstallmentPrice(item, item.price)"/>
+							</span>
+							<span>要求付款日期</span>
+							<span class="time" style="width: 125px;" ng-if="!editBox">
+								<p ng-bind="item.deadline | date : 'yyyy-MM-dd'"></p>
+							</span>
+							<span class="time" ng-if="editBox">
+								<input type="text" ng-model="item.deadline"
+									   class="form-control" placeholder="要求付款日期"
+									   datepicker-popup="yyyy-MM-dd HH:mm:ss"
+									   is-open="item.deadlineShow"
+									   min-date="startDate" current-text="今天" clear-text="清除" close-text="关闭"
+									   ng-click="openDatePicker($event, item, 'deadlineShow')"
+									   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+									   ng-change="changeEndDate(item, $index == 0 ? 'first' : purchase.installment.installmentDetails[$index - 1],$index == purchase.installment.installmentDetails.length -1 ? 'last' : purchase.installment.installmentDetails[$index + 1])" readonly
+								/>
+								<button class="open" ng-click="openDatePicker($event, item, 'deadlineShow')"></button>
+							</span>
+							<span class="add-span" ng-if="editBox">
+								<button class="add" ng-click="addInstallmentList()" ng-if="purchase.installment.installmentDetails.length-1 ==$index && $index+1 < 5"><i class="fa fa-plus-circle"></i></button>
+								<button class="reduce" ng-click="deleteInstallmentlist($index)" ng-if="purchase.installment.installmentDetails.length!=$index && purchase.installment.installmentDetails.length !=1;"><i class="fa fa-minus-circle"></i></button>
+							</span>
+							<em class="show-img" ng-if="item.status == 505"><img src="static/img/icon/pay-ok-icon.png"/></em>
+							<span class="deal-btn" ng-if="purchase.installment.status == 503">
+								<button ng-click="editInstallment()" ng-if="(purchase.status == 503 || purchase.status == 501) && purchase.installment.installmentDetails.length == $index+1 && !editBox" class="ok" style="float: right;">编辑</button>
+								<button ng-click="cancelEdit()" class="off" ng-if="purchase.installment.installmentDetails.length == $index+1 && editBox">取消</button>
+								<button ng-click="updateInstallment(purchase.installment)" class="ok" ng-if="purchase.installment.installmentDetails.length == $index+1 && editBox">保存</button>
+							</span>
+						</li>
+						<li ng-repeat="item in installmentDetails" class="line" ng-if="!installmentBox">
+							<span>第{{numArray[$index+1]}}期</span>
+							<span class="price">
+								<em ng-bind="purchase.currency == RMB ? '$' : '¥'"></em>
+								<input type="text" class="form-control"  placeholder="请输入金额" ng-model="item.price" ng-blur="changeInstallmentPrice(item, item.price, $index)" ng-change="inputInstallmentPrice(item, item.price)"/>
+							</span>
+							<span>要求付款日期</span>
+							<span class="time">
+								<input type="text" ng-model="item.deadline"
+									   class="form-control" placeholder="要求付款日期"
+									   datepicker-popup="yyyy-MM-dd HH:mm:ss"
+									   is-open="item.deadlineShow"
+									   min-date="startDate" current-text="今天" clear-text="清除" close-text="关闭"
+									   ng-click="openDatePicker($event, item, 'deadlineShow')"
+									   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+									   ng-change="changeEndDate(item, $index == 0 ? 'first' : installmentDetails[$index - 1],$index == installmentDetails.length -1 ? 'last' : installmentDetails[$index + 1] )" readonly
+								/>
+								<button class="open" ng-click="openDatePicker($event, item, 'deadlineShow')"></button>
+							</span>
+							<span class="add-span">
+								<button class="add" ng-click="addInstallment()" ng-if="installmentDetails.length-1 ==$index && $index+1 < 5"><i class="fa fa-plus-circle"></i></button>
+								<button class="reduce" ng-click="deleteInstallment($index)" ng-if="installmentDetails.length !=$index && installmentDetails.length != 1"><i class="fa fa-minus-circle"></i></button>
+							</span>
+							<span class="deal-btn" ng-if="installmentDetails.length == $index+1">
+								<button ng-click="cancelSwitch()" class="off">取消</button>
+								<button ng-click="saveInstallment(installmentDetails)" class="ok">保存</button>
+							</span>
+						</li>
+					</ul>
+				</div>
+			</div>
 		</div>
 		<!--物流信息-->
 		<div class="logistics_list01" ng-if="purchase.status != 602 && purchase.status != 603 && purchase.status != 604 && purchase.status != 605 && purchase.status != 606 && purchase.status != 315">
@@ -642,3 +921,105 @@
 		</div>
 	</div>
 </div>
+<!--同意取消订单-->
+<div class="com-out-box" ng-if="showNoAccountBox">
+	<div class="title">
+		<a ng-click="setShowNoAccountBox(false)">&times;</a>
+	</div>
+	<div class="content">
+		<p><i class="fa fa-exclamation-circle"></i>您还未设置收款账户,不可<br/>
+			开通【直接收款】功能。
+		</p>
+		<div class="deal-btn">
+			<a ng-click="setShowNoAccountBox(false)">确定</a>
+			<a href="vendor#/payCenter" target="_blank">设置收款账户<i class="fa fa-long-arrow-right"></i></a>
+		</div>
+	</div>
+</div>
+<div class="com-out-box" ng-if="cancelInstallmentBox">
+	<div class="title">
+		<a ng-click="cancelInstallment()">&times;</a>
+	</div>
+	<div class="content">
+		<p><i class="fa fa-exclamation-circle"></i>您确认取消此分期?<br/>取消可再次新增新的分期。
+		</p>
+		<div class="deal-btn">
+			<a ng-click="cancelInstallment()" style="background: #cdcccc">取消</a>
+			<a ng-click="confirmInstallment(purchase.id)" style="width: 60px; height: 25px; background: #5078cb; color: #fff; position: relative; top: -1px;">确定</a>
+		</div>
+	</div>
+</div>
+<style>
+	.com-out-box{
+		position: fixed;
+		z-index: 2;
+		height: 150px;
+		opacity: 1;
+		background-color: white;
+		width: 300px;
+		-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+		box-shadow: 0 5px 15px rgba(0,0,0,.5);
+		margin: -150px 0 0 -90px;
+		top: 55%;
+		left: 50%;
+	}
+	.com-out-box .title{
+		height: 30px;
+		background-color: #5078cb;
+		text-align: right;
+		line-height: 30px;
+	}
+	.com-out-box .title a{
+		color: white;
+		font-size: 28px;
+		position: relative;
+		top: -2px;
+		right: 8px;
+	}
+	.com-out-box .content p{
+		font-size: 14px;
+		text-align: center;
+		line-height:20px;
+	}
+	.com-out-box .content p:first-child{
+		margin-top: 10px;
+		line-height: 24px;
+	}
+	.com-out-box .content p:nth-child(2){
+		font-size: 12px;
+		color: #f00;
+	}
+	.com-out-box .content p i{
+		color: #5078cb;
+		font-size: 18px;
+		margin-right: 8px;
+	}
+	.com-out-box .content div{
+		width: 100%;
+		margin: 0 auto;
+		text-align: center;
+		margin-top: 10px;
+	}
+	.com-out-box .content div a{
+		width: 64px;
+		display: inline-block;
+		height: 25px;
+		line-height: 25px;
+		text-align: center;
+		font-size: 14px;
+		color: #fff;
+		background: #5078cb;
+	}
+	.com-out-box .content div a:first-child{
+		margin-right: 5px;
+	}
+	.com-out-box .content div a:hover{
+		background: #337ab7;
+	}
+	.com-out-box .content div a:last-child{
+		background: none;
+		color: #5078cb;
+		width: auto;
+		font-size: 12px;
+	}
+</style>

+ 370 - 3
src/main/webapp/resources/view/vendor/forstore/vendor_order.html

@@ -279,7 +279,7 @@
 		top: 27px;
 		z-index: 155;
 		width: 140px;
-		border: 2px solid #3A75E6;
+		border: 1px solid #3A75E6;
 		padding: 5px 10px;
 		color: #1C54CA;
 	}
@@ -618,6 +618,109 @@
 	.border-bt-16:nth-of-type(1){
 		border-top: none;
 	}
+	/*补充*/
+	.operate-height{
+		position: relative;
+		color: #333 !important;
+	}
+	.operate-height .ship-btn:hover + .ship-content,.operate-height .ship-btn:hover + .pay{
+		display: inline-block !important;
+	}
+	.ship-content,.pay{
+		display: none;
+		width: 165px;
+	}
+	.ship-content .content{
+		font-size: 12px;
+		color: #333;
+		padding: 5px;
+	}
+	.pay{
+		min-width: 275px;
+		right: 0;
+		left: -54px;
+		padding: 0;
+	}
+	.pay .arrow{
+		right: 34px;
+		left: 127px;
+	}
+	.pay .content{
+		padding: 0;
+		margin: 0;
+	}
+	.pay .content .title{
+		width: 100%;
+		height: 28px;
+		text-align: center;
+		line-height: 28px;
+		background: #f6f9ff;
+		font-size: 14px;
+	}
+	.pay .content .title em{
+		font-weight: bold;
+		color: #333;
+	}
+	.color999{
+		color: #999 !important;
+	}
+	.color333{
+		color: #333 !important;
+	}
+	.red{
+		color: #f00 !important;
+	}
+	.pay .content ul{
+		width: 100%;
+		margin: 0 auto;
+		display: inline-block;
+		padding-top: 5px;
+	}
+	.pay .content ul li{
+		width: 100%;
+		float: left;
+		height: 20px;
+		line-height: 20px;
+		font-size: 12px;
+	}
+	.pay .content ul li em{
+		width: 14px;
+		height: 14px;
+		display: inline-block;
+		border-radius: 100%;
+		line-height: 14px;
+		color: #fff;
+		background: #5078cb;
+		float: left;
+		position: relative;
+		top: 3px;
+		margin-left: 20px;
+		text-align: left;
+		padding-left: 3px;
+	}
+	.pay .content ul li div{
+		float: left;
+		margin: 0 5px;
+	}
+	.pay .content ul li div.price{
+		color: #f00;
+		max-width: 105px;
+		text-align: left;
+		min-width: 60px;
+	}
+	.pay .content ul li div.status{
+		color: #5078cb;
+	}
+	.pay .content .tip-01{
+		width: 100%;
+		height: 28px;
+		line-height: 28px;
+		background: #eff0f2;
+		font-size: 12px;
+	}
+	.sellOder .oder_list .click_shop a{
+		text-decoration: none;
+	}
 	a.closeContact:hover > i {
 		color: white !important;
 	}
@@ -1155,7 +1258,33 @@
 						<span ng-bind="detail.ensurePrice | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
 						<span class="border01 click_shop">
                             <div ng-if="$index == 0">
-                                <em ng-bind="purchase.status | VendorStatusFilter"></em><br/>
+                                <a class="operate-height">
+									<!--分期付款-->
+									<em ng-bind="purchase.status | VendorStatusFilter" ng-style="{'margin-left':purchase.installment.status != 505 && purchase.installmentId && purchase.status != 606 && purchase.status != 525?'24px':'0'}">待买家付款</em>
+										  <div class="ship-btn seller-ship-tip" ng-if="purchase.installment.status != 505 && purchase.installmentId && purchase.status != 606 && purchase.status != 525" style="position: relative;left: -4px;top: -2px;height: auto">
+											 <img src="static/img/common/notice-tip.png"/>
+										  </div>
+                                  <div class="pay ship-content ship-notify">
+                                      <div class="arrow"></div>
+                                      <div class="content">
+										  <div class="title">货款共计
+											  <em ng-bind="purchase.installment.price | currencySysmbol : detail.currencyName">¥9000</em>
+											  &nbsp;&nbsp;&nbsp;&nbsp;分
+											  <em style="color: #5078cb;" ng-bind="purchase.installment.count">5</em> 期
+										  </div>
+										  <ul>
+											  <li ng-repeat="item in purchase.installment.installmentDetails">
+												  <em ng-bind="$index+1">1</em>
+												  <div class="price" ng-class="{'color333': item.status == 505}" ng-bind="item.price | currencySysmbol : detail.currencyName">¥13131</div>
+												  <div class="time" ng-class="{'color999': item.status == 505}">{{item.deadline | date : 'yyyy-MM-dd'}}前</div>
+												  <div class="color999 status" ng-if="item.status == 505">已付</div>
+												  <div class="status" ng-if="item.status != 505">待付</div>
+											  </li>
+									  </ul>
+										  <div class="tip-01" ng-if="purchase.installment.status == 503"><em class="red">*</em>若第一期款项逾期未付,卖家有权利取消订单</div>
+									 </div>
+                                  </div><br/>
+								</a>
                                 <a href="vendor#/purchase/detail/{{purchase.purchaseid | EncryptionFilter}}" class="oder_d action-link" target="_blank">订单详情</a><br/>
                                 <em ng-if="purchase.buyerNotifyShip && (purchase.status == 502 || purchase.status == 406)" style="display: block;">买家催促发货</em>
                                 <a class="oder_d action-link" href="vendor#/logistics/query/{{purchase.purchaseid | EncryptionFilter}}" ng-if="purchase.status == 404 || purchase.status == 520 || purchase.status == 405 || purchase.status == 503 || purchase.status == 514" target="_blank">查看物流</a>
@@ -1166,6 +1295,12 @@
                         </span>
 						<span class="click_shop" style="position: relative">
                             <div ng-if="$index == 0">
+								<!--确认收款-->
+								<a class="order-operation" href="javascript:void(0)" ng-if="purchase.installmentDetailPaid && purchase.status !=525 && purchase.status !=606" ng-click="confirmPayment(purchase,purchase.purchaseid)">确认收款</a>
+								<!--取消订单-->
+								<p style="margin-top: 10px;" ng-if="purchase.installmentId && ((purchase.installment.status == 503 && purchase.Overtime) || purchase.installment.status == 504) && purchase.status !=606 && purchase.status !=525">
+									<a style="color: #333;" ng-click="sellerCancelOrder(purchase, purchase.purchaseid)">取消订单</a>
+								</p>
                                 <a class="order-operation" href="javascript:void(0)" ng-if="(purchase.status == 502 || purchase.status == 406)&&(purchase.uasPurcid == null)" ng-click="toBeShiped(purchase)">点击发货</a>
 								<a ng-if="purchase.uasPurcid" style="text-decoration: none;color: #323232;">来源UAS</a>
                                 <!--<a class="order-operation" href="javascript:void(0)" ng-if="purchase.status == 404 && purchase.lgtId&&!purchase.uasPurcid" ng-click="toBeShiped(purchase)" style="position: relative;">修改物流</a>-->
@@ -1338,7 +1473,239 @@
 		</ul>
 	</div>-->
 </div>
-
+<!--确认收款-->
+<div class="confirm-Payment-box" ng-if="confirmPaymentBox">
+	<div class="head"><a ng-click="cancelPayment()">&times;</a></div>
+	<div class="content">
+		<div class="title">
+			<i class="fa fa-exclamation-circle"></i>
+			买家于{{installmentDetailsList.paidDate | date: 'yyyy-MM-dd HH:mm:ss'}}上传新单据,<br/>
+			&nbsp;&nbsp;&nbsp;&nbsp;合计支付金额 <em ng-bind="installmentDetailsList.price | formateNumber : 2 | currencySysmbol : currencyNAME">¥452658.12</em>
+		</div>
+		<div class="payment-upload-list">
+			<div class="item">
+				<div class="img-list">
+					<div class="prev" ng-click="changePrev(changeList)"><i class="fa fa-angle-left"></i></div>
+					<div class="img">
+						<div class="number"><em>第{{numArray[installmentDetailsList.detno]}}期</em></div>
+						<div class="list" ng-repeat="img in changeList track by $index" ng-if="imgIndex == $index">
+							<span><img ng-src="{{img}}"/></span>
+							<div class="hover-show">
+								<!-- 图片预览 -->
+								<a ng-click="showImg(img)"><i class="fa fa-search"></i>查看</a>
+							</div>
+						</div>
+					</div>
+					<div class="next" ng-click="changeNext(changeList, $index)"><i class="fa fa-angle-right"></i></div>
+				</div>
+				<div class="small-img">
+						<span ng-class="{'active':imgIndex == $index}" ng-repeat="img in changeList track by $index">
+							<img ng-src="{{img}}" ng-click="changeImg(changeList, $index)"/>
+						</span>
+				</div>
+			</div>
+		</div>
+		<div class="tip"><em>*</em> 若未收到货款,请勿点击【确认收款】</div>
+		<div class="deal-btn-box">
+			<button class="off" ng-click="cancelPayment()">取消</button>
+			<button class="ok" ng-click="confirmPaymentOk(installmentDetails)">确认收款</button>
+		</div>
+	</div>
+</div>
+<style>
+	.confirm-Payment-box{
+		position: fixed;
+		top: 50%;
+		left: 50%;
+		margin: -162px 0 0 -183px;
+		width: 366px;
+		height: 324px;
+		background-color: rgba(255, 255, 255, 1);
+		box-shadow: 0px 3px 7px 0px
+		rgba(0, 0, 0, 0.19);
+		border-radius: 5px 5px 5px 5px;
+	}
+	.confirm-Payment-box .head{
+		width: 100%;
+		height: 20px;
+		line-height: 20px;
+	}
+	.confirm-Payment-box .head a{
+		color: #dfdddd;
+		float: right;
+		margin-right: 6px;
+		font-size: 16px;
+	}
+	.confirm-Payment-box .content .title{
+		width: 100%;
+		height: 34px;
+		font-size: 14px;
+		line-height: 18px;
+		padding-left: 43px;
+	}
+	.confirm-Payment-box .content .title i{
+		color: #5078cb;
+		font-size: 18px;
+	}
+	.confirm-Payment-box .content .title em{
+		color: #ea1010;
+	}
+	.confirm-Payment-box .content .tip{
+		width: 100%;
+		margin: 0 auto;
+		height: 13px;
+		font-size: 12px;
+		text-align: center;
+	}
+	.confirm-Payment-box .content .tip em{
+		color: #ea1010;
+	}
+	.confirm-Payment-box .content .deal-btn-box{
+		width: 100%;
+		margin: 0 auto;
+		text-align: center;
+		margin-top: 18px;
+	}
+	.confirm-Payment-box .content .deal-btn-box button{
+		border: none;
+		background: #5078cb;
+		height:26px;
+		line-height: 26px;
+		font-size: 14px;
+		text-align: center;
+		color: #fff;
+	}
+	.confirm-Payment-box .content .deal-btn-box button:hover{
+		background: #337ab7;
+	}
+	.confirm-Payment-box .content .deal-btn-box button.off{
+		width: 60px;
+		margin-right: 10px;
+		background: #c8c8c8;
+	}
+	.confirm-Payment-box .content .deal-btn-box button.ok{
+		width: 78px;
+	}
+	/*修改扫描单*/
+	.payment-upload-list{
+		width: 100%;
+		margin: 0 auto;
+		display: inline-block;
+		margin-top: 15px;
+	}
+	.payment-upload-list .item{
+		width: 200px;
+		margin: 0 auto;
+	}
+	.payment-upload-list .item .img-list{
+		width: 100%;
+		height: 152px;
+		margin: 0 auto;
+	}
+	.payment-upload-list .item .img-list div{
+		float: left;
+	}
+	.payment-upload-list .item .img-list .img{
+		width: 152px;
+		height: 152px;
+		border: solid 1px rgb(212, 212, 212);
+		position: relative;
+		overflow: hidden;
+		background: #fff;
+	}
+	.payment-upload-list .item .img-list .number{
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 47px;
+		height: 47px;
+		display: inline-block;
+		background: url("static/img/icon/nummber-bg.png") no-repeat center;
+		z-index: 20;
+	}
+	.payment-upload-list .item .img-list .number em{
+		line-height: 30px;
+		font-size: 12px;
+		color: #fff;
+		transform: rotate(-45deg);
+		display: inline-block;
+		position: relative;
+		left: -3px;
+	}
+	.payment-upload-list .item .img-list div.prev,.payment-upload-list .item .img-list div.next{
+		width: 13px;
+		height: 25px;
+		font-size: 38px;
+		position: relative;
+		top: 48px;
+		color: #c9c9c7;
+	}
+	.payment-upload-list .item .img-list div.prev:hover,.payment-upload-list .item .img-list div.next:hover{
+		color: #5078cb;
+	}
+	.payment-upload-list .item .img-list div.prev{
+		margin-right: 6px;
+	}
+	.payment-upload-list .item .img-list div.next{
+		margin-left: 6px;
+	}
+	.payment-upload-list .item .img-list .list,.payment-upload-list .item .img-list .list img{
+		width: 152px;
+		height: 152px;
+		margin: 0 auto;
+		position: relative;
+	}
+	.payment-upload-list .item .img-list .list span{
+		width: 152px;
+		height: 152px;
+		display: inline-block;
+	}
+	.payment-upload-list .item .img-list .list:hover .hover-show{
+		top: 0;
+	}
+	.payment-upload-list .item .small-img{
+		width: 152px;
+		height: 15px;
+		margin: 4px 0 6px 20px;
+	}
+	.payment-upload-list .item  .small-img span{
+		width: 15px;
+		height: 15px;
+		display: inline-block;
+		overflow: hidden;
+		border: #e0dddd 1px solid;
+		background: #e0dddd;
+		float: left;
+		margin-left: 12px;
+	}
+	.payment-upload-list .item  .small-img span:first-child{
+		margin-left: 0;
+	}
+	.payment-upload-list .item .small-img span.active,.payment-upload-list .item .small-img span:hover{
+		border: #5078cb 1px solid;
+	}
+	.payment-upload-list .item .small-img span img{
+		width: 15px;
+		height: 15px;
+	}
+	.payment-upload-list .hover-show{
+		position: absolute;
+		width: 100%;
+		height: 100%;
+		left: 0;
+		top: 100%;
+		background: rgba(0,0,0,.35);
+	}
+	.payment-upload-list .hover-show a{
+		display: inline-block;
+		width: 100%;
+		height: 100%;
+		font-size: 14px;
+		color: #fff;
+		text-align: center;
+		line-height: 152px;
+	}
+</style>
 <script class="ng-scope">
 	$(function(){
 		//产品字数超过两行时改变样式

+ 95 - 0
src/main/webapp/resources/view/vendor/modal/cancelOrder_modal.html

@@ -0,0 +1,95 @@
+<style>
+	#reason {
+		margin: 15px auto;
+	}
+
+	#reason label.col-md-4{
+		margin: auto 0;
+		height: 34px;
+		line-height: 34px;
+		text-align: right;
+		font-size: 16px;
+	}
+
+	#choice {
+		width: 250px;
+		margin-left: 100px;
+	}
+
+	div.modal-dialog.modal-md {
+		width: 440px !important;
+		position: fixed !important;
+		top: 150px !important;
+		left: 50% !important;
+		margin-left: -200px;
+	}
+
+	a.cancle-close {
+		float: right;
+		color: white;
+		padding-right: 10px;
+		font-size: 23px;
+		line-height: 31px;
+		height: 31px
+	}
+
+	.modal-backdrop {
+		background-color: transparent !important;
+	}
+
+	.modal-header {
+		background-color: #5078cb;
+		line-height: 31px;
+		padding: 0px !important;
+		height: 31px;
+	}
+
+	.attention {
+		font-size: 14px;
+		text-align: center;
+		line-height: 31px;
+		height: 31px;
+	}
+
+	.modal-footer .confirm {
+		width: 70px;
+		padding: 5px 10px;
+		background-color: #5078cb;
+		border: none;
+		color: white;
+		font-size: 14px;
+	}
+
+	.modal-footer .cancle-button {
+		width: 70px;
+		padding: 5px 10px;
+		background-color: #D9D5CE;
+		border: none;
+		color: #333333;
+		font-size: 14px;
+	}
+	.select-adder {
+		background: url(static/img/user/images/xiala.png) right no-repeat;
+		background-position-x: 265px;
+	}
+</style>
+<div class="modal-header">
+	<a title="关闭" class="cancle-close" ng-click="cancel()">×</a>
+</div>
+<div class="modal-body" style="height: 240px">
+	<div class="row" >
+		<div class="text-inverse attention"><img src="static/img/common/pay-attention.png" style="margin-right: 5px;"/>您确认需要取消该订单吗?取消订单后,不能恢复!</div>
+		<div id="reason" class="col-md-12 form-inline">
+			<select id="choice" class="select-adder col-md-10 col-md-offset-2 form-control" ng-model="purchase.reason" style="opacity: 1;">
+				<option value="">请选择取消订单的理由</option>
+				<option value="这个产品正在下架中">这个产品正在下架中</option>
+				<option value="未收到付款">未收到付款</option>
+				<option value="其他原因">其他原因</option>
+			</select>
+		</div>
+	</div>
+</div>
+<div class="modal-footer" style="text-align: center;">
+	<button class="confirm" ng-click="confirm()" type="button">确定</button>
+	<button class="cancle-button" ng-click="cancel()" type="button" style="margin-left: 15px;">关闭</button>
+</div>