Browse Source

删除售后的代码
处理出入库的bug

yujia 8 years ago
parent
commit
5c4924d356
48 changed files with 424 additions and 10803 deletions
  1. 70 78
      src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankTransferServiceImpl.java
  2. 1 29
      src/main/java/com/uas/platform/b2c/fa/settlement/model/Refund.java
  3. 1 27
      src/main/java/com/uas/platform/b2c/fa/settlement/model/RefundDetail.java
  4. 0 13
      src/main/java/com/uas/platform/b2c/fa/settlement/service/RefundService.java
  5. 0 71
      src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/RefundServiceImpl.java
  6. 2 231
      src/main/java/com/uas/platform/b2c/logistics/controller/InvoiceController.java
  7. 268 89
      src/main/java/com/uas/platform/b2c/logistics/model/Invoice.java
  8. 3 36
      src/main/java/com/uas/platform/b2c/logistics/model/InvoiceDetail.java
  9. 2 96
      src/main/java/com/uas/platform/b2c/logistics/model/Receipt.java
  10. 3 90
      src/main/java/com/uas/platform/b2c/logistics/model/ReceiptDetail.java
  11. 0 108
      src/main/java/com/uas/platform/b2c/logistics/service/InvoiceService.java
  12. 0 6
      src/main/java/com/uas/platform/b2c/logistics/service/impl/InvoiceFPurchaseServiceImpl.java
  13. 0 360
      src/main/java/com/uas/platform/b2c/logistics/service/impl/InvoiceServiceImpl.java
  14. 58 63
      src/main/java/com/uas/platform/b2c/logistics/service/impl/ReceiptServiceImpl.java
  15. 0 19
      src/main/java/com/uas/platform/b2c/trade/aftersale/Readme.md
  16. 0 321
      src/main/java/com/uas/platform/b2c/trade/aftersale/controller/ChangeController.java
  17. 0 285
      src/main/java/com/uas/platform/b2c/trade/aftersale/controller/ReturnController.java
  18. 0 41
      src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ChangeFB2cDao.java
  19. 0 42
      src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ChangeFCustDao.java
  20. 0 24
      src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ChangeFCustDetailDao.java
  21. 0 41
      src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ReturnFB2cDao.java
  22. 0 42
      src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ReturnFCustDao.java
  23. 0 22
      src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ReturnFCustDetailDao.java
  24. 0 77
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/AfterSaleStatus.java
  25. 0 29
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ApplyType.java
  26. 0 390
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFB2CSimpleInfo.java
  27. 0 802
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFB2c.java
  28. 0 580
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFB2cDetail.java
  29. 0 797
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFCust.java
  30. 0 622
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFCustDetail.java
  31. 0 881
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFB2c.java
  32. 0 619
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFB2cDetail.java
  33. 0 370
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFB2cSimpleInfo.java
  34. 0 829
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFCust.java
  35. 0 623
      src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFCustDetail.java
  36. 0 169
      src/main/java/com/uas/platform/b2c/trade/aftersale/service/ChangeService.java
  37. 0 26
      src/main/java/com/uas/platform/b2c/trade/aftersale/service/ReturnFCustDetailService.java
  38. 0 166
      src/main/java/com/uas/platform/b2c/trade/aftersale/service/ReturnService.java
  39. 0 616
      src/main/java/com/uas/platform/b2c/trade/aftersale/service/impl/ChangeServiceImpl.java
  40. 0 71
      src/main/java/com/uas/platform/b2c/trade/aftersale/service/impl/ReturnFCustDetailServiceImpl.java
  41. 0 679
      src/main/java/com/uas/platform/b2c/trade/aftersale/service/impl/ReturnServiceImpl.java
  42. 0 88
      src/main/java/com/uas/platform/b2c/trade/aftersale/util/ExceptionUtil.java
  43. 0 11
      src/main/java/com/uas/platform/b2c/trade/order/dao/PurchaseDao.java
  44. 0 63
      src/main/java/com/uas/platform/b2c/trade/order/model/Order.java
  45. 1 75
      src/main/java/com/uas/platform/b2c/trade/order/model/Purchase.java
  46. 0 30
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java
  47. 13 14
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseServiceImpl.java
  48. 2 42
      src/main/java/com/uas/platform/b2c/trade/util/StatusChangeUtil.java

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

@@ -18,9 +18,6 @@ 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;
-import com.uas.platform.b2c.trade.aftersale.dao.ReturnFCustDao;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
-import com.uas.platform.b2c.trade.aftersale.service.ReturnService;
 import com.uas.platform.b2c.trade.order.dao.OrderDao;
 import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
 import com.uas.platform.b2c.trade.order.model.Order;
@@ -80,12 +77,6 @@ public class BankTransferServiceImpl implements BankTransferService {
 	@Autowired
 	private OrderDao orderDao;
 
-	@Autowired
-	private ReturnFCustDao returnDao;
-
-	@Autowired
-	private ReturnService returnService;
-
 	@Autowired
 	private BankTransAssociateDao btaDao;
 	
@@ -192,75 +183,76 @@ public class BankTransferServiceImpl implements BankTransferService {
 
 	@Override
 	public BankTransfer saveForReturn(BankTransfer bankTransfer, String returnjson) {
-		String[] returnids = returnjson.split("-");
-		/*
-		 * 第一步 判断退货单是否有效操作
-		 */
-		ReturnFCust returnCust = null;
-		if (returnids == null || returnids.length == 0) {
-			throw new IllegalOperatorException("请选择退货单!");
-		}
-		for (String returnid : returnids) {
-			returnCust = returnDao.findOne(Long.parseLong(returnid));
-			if (returnCust == null || !returnCust.getStatus().equals(Status.TOBEREFUNDED.value())) {
-				throw new IllegalOperatorException("退货单不为待退款,不能做退款操作!");
-			}
-		}
-		/*
-		 * 第二步 保存银行转账信息
-		 */
-		// 平台支付方
-		BankInfo b2cAccount = FastjsonUtils.fromJson(bankTransfer.getJsonPament(), BankInfo.class);
-		// 客户收款方
-		BankInfo custAccount = FastjsonUtils.fromJson(bankTransfer.getJsonReceive(), BankInfo.class);
-
-		// 设置默认的账户
-		// 支付方的默认账户 1.企业账户
-		int num = 2;
-		List<BankInfo> listBankInfo = null;
-		if (b2cAccount.getUseruu() == null) {
-			listBankInfo = bankInfoService.getEnterpriseBankInfo(Type.MALL.value(), b2cAccount.getEnuu());
-			for (BankInfo bankInfo : listBankInfo) {
-				if (b2cAccount.getId().longValue() != bankInfo.getId().longValue()) {
-					bankInfo.setNum(num++);
-				}
-			}
-		}
-		b2cAccount.setNum(1);
-		listBankInfo.add(b2cAccount);
-		bankInfoService.save(listBankInfo);
-
-		// 收款方 默认企业账户
-		num = 2;
-		List<BankInfo> enterpriseBankInfo = bankInfoService.getEnterpriseBankInfo(Type.BUYER.value(), custAccount.getEnuu());
-		for (BankInfo bankInfo : enterpriseBankInfo) {
-			if (bankInfo.getNum() != custAccount.getNum()) {
-				bankInfo.setNum(num++);
-			}
-		}
-		custAccount.setNum(1);
-		enterpriseBankInfo.add(custAccount);
-		bankInfoService.save(enterpriseBankInfo);
-		bankTransfer.setPayUseruu(sysConf.getAdminUU());
-		bankTransfer.setPayenuu(sysConf.getEnUU());// 支付方设置为B2C的uu
-		bankTransfer.setCollectUseruu(returnCust.getBuyeruu()); // 收款方 退货单记录的UU
-		bankTransfer.setCollectenuu(returnCust.getBuyerenuu()); // 收款方
-																// 退货单记录的企业UU
-		bankTransfer.setBanktranssn(EncodingRulesConstant.BANKTRANSFER.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$bank_transfer", 8)));
-		bankTransfer.setTranferCreateTime(new Date());
-		BankTransfer saveBankTransfer = bankTransferDao.save(bankTransfer);
-
-		for (String returnid : returnids) {
-			returnCust = returnService.ensurePaid(Long.parseLong(returnid));
-			// 保存交易中间表
-			BankTransAssociate bankTransAssociate = new BankTransAssociate();
-			bankTransAssociate.setBtaTableserNum(returnCust.getReturnid());
-			bankTransAssociate.setBtaBanktranssn(saveBankTransfer.getBanktranssn());
-			btaDao.save(bankTransAssociate);
-			returnCust.setBanktfid(saveBankTransfer.getId());
-			returnDao.save(returnCust);
-		}
-		return saveBankTransfer;
+//		String[] returnids = returnjson.split("-");
+//		/*
+//		 * 第一步 判断退货单是否有效操作
+//		 */
+//		ReturnFCust returnCust = null;
+//		if (returnids == null || returnids.length == 0) {
+//			throw new IllegalOperatorException("请选择退货单!");
+//		}
+//		for (String returnid : returnids) {
+//			returnCust = returnDao.findOne(Long.parseLong(returnid));
+//			if (returnCust == null || !returnCust.getStatus().equals(Status.TOBEREFUNDED.value())) {
+//				throw new IllegalOperatorException("退货单不为待退款,不能做退款操作!");
+//			}
+//		}
+//		/*
+//		 * 第二步 保存银行转账信息
+//		 */
+//		// 平台支付方
+//		BankInfo b2cAccount = FastjsonUtils.fromJson(bankTransfer.getJsonPament(), BankInfo.class);
+//		// 客户收款方
+//		BankInfo custAccount = FastjsonUtils.fromJson(bankTransfer.getJsonReceive(), BankInfo.class);
+//
+//		// 设置默认的账户
+//		// 支付方的默认账户 1.企业账户
+//		int num = 2;
+//		List<BankInfo> listBankInfo = null;
+//		if (b2cAccount.getUseruu() == null) {
+//			listBankInfo = bankInfoService.getEnterpriseBankInfo(Type.MALL.value(), b2cAccount.getEnuu());
+//			for (BankInfo bankInfo : listBankInfo) {
+//				if (b2cAccount.getId().longValue() != bankInfo.getId().longValue()) {
+//					bankInfo.setNum(num++);
+//				}
+//			}
+//		}
+//		b2cAccount.setNum(1);
+//		listBankInfo.add(b2cAccount);
+//		bankInfoService.save(listBankInfo);
+//
+//		// 收款方 默认企业账户
+//		num = 2;
+//		List<BankInfo> enterpriseBankInfo = bankInfoService.getEnterpriseBankInfo(Type.BUYER.value(), custAccount.getEnuu());
+//		for (BankInfo bankInfo : enterpriseBankInfo) {
+//			if (bankInfo.getNum() != custAccount.getNum()) {
+//				bankInfo.setNum(num++);
+//			}
+//		}
+//		custAccount.setNum(1);
+//		enterpriseBankInfo.add(custAccount);
+//		bankInfoService.save(enterpriseBankInfo);
+//		bankTransfer.setPayUseruu(sysConf.getAdminUU());
+//		bankTransfer.setPayenuu(sysConf.getEnUU());// 支付方设置为B2C的uu
+//		bankTransfer.setCollectUseruu(returnCust.getBuyeruu()); // 收款方 退货单记录的UU
+//		bankTransfer.setCollectenuu(returnCust.getBuyerenuu()); // 收款方
+//																// 退货单记录的企业UU
+//		bankTransfer.setBanktranssn(EncodingRulesConstant.BANKTRANSFER.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$bank_transfer", 8)));
+//		bankTransfer.setTranferCreateTime(new Date());
+//		BankTransfer saveBankTransfer = bankTransferDao.save(bankTransfer);
+//
+//		for (String returnid : returnids) {
+//			returnCust = returnService.ensurePaid(Long.parseLong(returnid));
+//			// 保存交易中间表
+//			BankTransAssociate bankTransAssociate = new BankTransAssociate();
+//			bankTransAssociate.setBtaTableserNum(returnCust.getReturnid());
+//			bankTransAssociate.setBtaBanktranssn(saveBankTransfer.getBanktranssn());
+//			btaDao.save(bankTransAssociate);
+//			returnCust.setBanktfid(saveBankTransfer.getId());
+//			returnDao.save(returnCust);
+//		}
+//		return saveBankTransfer;
+		return null;
 	}
 
 	@Transactional

+ 1 - 29
src/main/java/com/uas/platform/b2c/fa/settlement/model/Refund.java

@@ -3,21 +3,10 @@ package com.uas.platform.b2c.fa.settlement.model;
 import com.alibaba.fastjson.JSON;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
 import com.uas.platform.b2c.trade.order.model.Order;
 import org.springframework.util.StringUtils;
 
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Date;
@@ -216,23 +205,6 @@ public class Refund implements Serializable{
 		this.payType = order.getPaytype();
 	}
 
-    /**
-     * Instantiates a new Refund.
-     *
-     * @param cust the cust
-     */
-    public Refund(ReturnFCust cust) {
-		this.createTime = new Date();
-		this.currency = cust.getCurrency();
-		this.orderid = cust.getOrid();
-		this.reUserName = cust.getBuyername();
-		this.reUseruu = cust.getBuyeruu();
-		this.enuu = cust.getBuyerenuu();
-		this.payType = cust.getPaytype();
-		this.userName = cust.getBuyername();
-		this.useruu = cust.getBuyeruu();
-	}
-
     /**
      * Gets enuu.
      *

+ 1 - 27
src/main/java/com/uas/platform/b2c/fa/settlement/model/RefundDetail.java

@@ -1,24 +1,13 @@
 package com.uas.platform.b2c.fa.settlement.model;
 
 import com.alibaba.fastjson.annotation.JSONField;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCustDetail;
 import com.uas.platform.b2c.trade.order.model.Document;
 import com.uas.platform.b2c.trade.order.model.OrderDetail;
 import org.codehaus.jackson.annotate.JsonIgnore;
 
+import javax.persistence.*;
 import java.io.Serializable;
 
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-
 
 /**
  * 退款单详情
@@ -128,21 +117,6 @@ public class RefundDetail extends Document implements Serializable{
 		this.total = orderDetail.getEnsurePrice();
 		this.status = Refund.RefundStatus.TOBEREFUND.toString();
 	}
-
-    /**
-     * Instantiates a new Refund detail.
-     *
-     * @param custDetail the cust detail
-     */
-    public RefundDetail(ReturnFCustDetail custDetail) {
-		this.number = custDetail.getNumber();
-		this.factRefundMoney = custDetail.getPrice();
-		this.price = custDetail.getTaxUnitprice();
-		this.taxes = custDetail.getTaxes();
-		this.total = custDetail.getPrice();
-		this.status = Refund.RefundStatus.TOBERETURN.toString();
-	}
-
     /**
      * Gets id.
      *

+ 0 - 13
src/main/java/com/uas/platform/b2c/fa/settlement/service/RefundService.java

@@ -2,7 +2,6 @@ package com.uas.platform.b2c.fa.settlement.service;
 
 import com.uas.platform.b2c.fa.payment.model.BankTransfer;
 import com.uas.platform.b2c.fa.settlement.model.Refund;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
 import com.uas.platform.b2c.trade.order.model.OrderDetail;
 import com.uas.platform.core.model.PageInfo;
 import org.springframework.data.domain.Page;
@@ -33,18 +32,6 @@ public interface RefundService {
     Refund createRefund(List<OrderDetail> list, Refund.RefundOrigin origin, String inId, Map<Long, Boolean> returnOrderId);
 
 
-    /**
-     * 创建时间 :2017年1月17日 上午10:34:33
-     *
-     * @param cust   客户退货单
-     * @param origin the origin 退款单来源
-     * @return Refund refund
-     * @throws
-     * @author yujia
-     * @Description: 根据客户的退货单生成客户的退款单
-     */
-    Refund createRefund(ReturnFCust cust, Refund.RefundOrigin origin);
-
     /**
      * 创建时间 :2016年11月21日 上午11:36:18
      *

+ 0 - 71
src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/RefundServiceImpl.java

@@ -2,34 +2,19 @@ package com.uas.platform.b2c.fa.settlement.service.impl;
 
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.trade.aftersale.dao.ReturnFCustDao;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCustDetail;
 import com.uas.platform.b2c.fa.payment.model.BankTransfer;
 import com.uas.platform.b2c.fa.payment.service.PaymentService;
 import com.uas.platform.b2c.fa.settlement.dao.RefundDao;
 import com.uas.platform.b2c.fa.settlement.model.Refund;
-import com.uas.platform.b2c.fa.settlement.model.Refund.RefundOrigin;
 import com.uas.platform.b2c.fa.settlement.model.Refund.RefundStatus;
 import com.uas.platform.b2c.fa.settlement.model.RefundDetail;
 import com.uas.platform.b2c.fa.settlement.service.RefundService;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.trade.aftersale.dao.ReturnFCustDao;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCustDetail;
 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.model.OrderDetail;
 import com.uas.platform.b2c.trade.order.service.OrderDetailService;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-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.model.OrderDetail;
-import com.uas.platform.b2c.trade.order.service.OrderDetailService;
-import com.uas.platform.b2c.trade.util.StatusChangeUtil;
 import com.uas.platform.core.exception.IllegalOperatorException;
-import com.uas.platform.core.exception.IllegalStatusException;
 import com.uas.platform.core.model.EncodingRulesConstant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Status;
@@ -79,10 +64,6 @@ public class RefundServiceImpl implements RefundService {
 	@Autowired
 	private OrderDetailService orderDetailService;
 
-	@Autowired
-	private ReturnFCustDao returnFCustDao;
-
-
 	@Override
 	public Refund getRefundById(Long id) {
 		return refundDao.findOne(id);
@@ -267,57 +248,5 @@ public class RefundServiceImpl implements RefundService {
 		}
 		// 同步订单和采购单的已失效状态
 		orderDetailService.synStatusOfPurchase(refund.getOrderid(), orderDetails, status.value());
-		// 如果退款单来源于退货单,则更新退货单状态
-		if (Refund.RefundOrigin.RETURN == refund.getOrigin()) {
-			ReturnFCust returnFCust = returnFCustDao.findByReturnid(refund.getInId());
-			if (returnFCust == null) {
-				throw new IllegalStatusException("客户退货单数据已失效");
-			}
-			returnFCust = StatusChangeUtil.updateReturnFCustStatus(returnFCust, Status.TOBEREFUNDED, Status.REFUNDED);
-			returnFCustDao.save(returnFCust);
-		}
 	}
-
-	@Override
-	public Refund createRefund(ReturnFCust cust, RefundOrigin origin) {
-		Long userUU = SystemSession.getUser().getUserUU();
-		// 生成退款单的基础信息
-		Refund refund = new Refund(cust);
-		// 生成退款单据号
-		String timeNumber = createNumberService.getTimeNumber("trade$refund", 8);
-		String refundId = EncodingRulesConstant.REFUND.replaceAll("_TIMESTAP_NUMBER", timeNumber);
-		refund.setReid(refundId);
-		// 设置退款单来源信息
-		refund.setOrigin(origin);
-		refund.setInId(cust.getReturnid());
-
-		Set<ReturnFCustDetail> returnDetails = cust.getReturnDetails();
-		Set<RefundDetail> set = new HashSet<>();
-		short detno = 1;
-		Double totalPrice = 0.0d;
-		Double taxes = 0.0d;
-		RefundDetail refundDetail;
-		for (ReturnFCustDetail detail : returnDetails) {
-			refundDetail = new RefundDetail(detail);
-			timeNumber = createNumberService.getTimeNumber("trade$refunddeail", 9);
-			String reid = EncodingRulesConstant.REFUND_DETAIL.replaceAll("_TIMESTAP_NUMBER", timeNumber);
-			refundDetail.setReid(reid);
-			refundDetail.setDetno(detno++);
-			String ord_id = detail.getOrd_id();
-			OrderDetail orderDetail = orderDetailDao.findByDetailid(ord_id);
-			refundDetail.setOrderDetail(orderDetail);
-			refundDetail.setOrderdetailid(orderDetail.getId());
-
-			totalPrice = NumberUtil.add(totalPrice, refundDetail.getFactRefundMoney());
-			taxes = NumberUtil.add(taxes, refundDetail.getTaxes());
-			set.add(refundDetail);
-			refundDetail.setRefund(refund);
-		}
-		refund.setTaxes(taxes);
-		refund.setReMoney(totalPrice);
-		refund.setStatus(RefundStatus.TOBERETURN.toString());
-		refund.setRefundDetails(set);
-		return refundDao.save(refund);
-	}
-
 }

+ 2 - 231
src/main/java/com/uas/platform/b2c/logistics/controller/InvoiceController.java

@@ -1,22 +1,11 @@
 package com.uas.platform.b2c.logistics.controller;
 
-import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
-import com.uas.platform.b2c.logistics.model.Invoice;
 import com.uas.platform.b2c.logistics.service.InvoiceService;
 import com.uas.platform.core.logging.BufferedLoggerManager;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.model.Status;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 出货单 TODO (换货上,以后可以考虑用共表)
@@ -35,222 +24,4 @@ public class InvoiceController {
 	private InvoiceService invoiceService;
 	
 	private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
-
-	/**
-	 * 订单转出货
-	 *
-	 * @param orid the orid 订单id
-	 * @return invoice 返回出货单
-	 */
-	@RequestMapping(value = "/create/{orid}", method = RequestMethod.PUT)
-	@ApiOperation(value = "订单转出货单", httpMethod = "PUT")
-	public Invoice send(@ApiParam(required = true, value = "订单id") @PathVariable Long orid) {
-		Invoice createInvoice = invoiceService.createInvoice(orid);
-		logger.log("出货单管理", "转出货单");
-		return createInvoice;
-	}
-
-	/**
-	 * 查看待出货状态的出货单
-	 *
-	 * @param params  the params 分页参数
-	 * @param keyword the keyword 搜索字符串
-	 * @return page 返回Invoice的page对象
-	 */
-	@RequestMapping(value = "/tobeshipped", method = RequestMethod.GET)
-	@ApiOperation(value = "查看待出货状态的出货单", httpMethod = "GET")
-	public Page<Invoice> findToBeShipped(@ApiParam(required = true, value = "分页参数") PageParams params, @ApiParam(required = true, value = "搜索字符串") String keyword) {
-		logger.log("出货单管理", "查看待出货");
-		PageInfo info = new PageInfo(params);
-		info.filter("status", Status.TOBESHIPPED.value());
-		return invoiceService.findPageByStatus(info, keyword);
-	}
-
-	/**
-	 * 查看待收货状态的出货单
-	 *
-	 * @param params  the params 分页参数
-	 * @param keyword the keyword 搜索字符串
-	 * @return page 返回Invoice的page对象
-	 */
-	@RequestMapping(value = "/inbound", method = RequestMethod.GET)
-	@ApiOperation(value = "查看待收货状态的出货单", httpMethod = "GET")
-	public Page<Invoice> findInbound(@ApiParam(required = true, value = "分页参数") PageParams params, @ApiParam(required = true, value = "搜索字符串") String keyword) {
-		logger.log("出货单管理", "查看待收货");
-		PageInfo info = new PageInfo(params);
-		info.filter("status", Status.INBOUND.value());
-		return invoiceService.findPageByStatus(info, keyword);
-	}
-
-	/**
-	 * 查看已收货状态的出货单
-	 *
-	 * @param params  the params 分页参数
-	 * @param keyword the keyword 搜索字符串
-	 * @return page 返回Invoice的page对象
-	 */
-	@RequestMapping(value = "/received", method = RequestMethod.GET)
-	@ApiOperation(value = "查看已收货状态的出货单", httpMethod = "GET")
-	public Page<Invoice> findReceived(@ApiParam(required = true, value = "分页参数") PageParams params, @ApiParam(required = true, value = "搜索字符串") String keyword) {
-		logger.log("出货单管理", "查看已收货");
-		PageInfo info = new PageInfo(params);
-		info.filter("status", Status.RECEIVED.value());
-		return invoiceService.findPageByStatus(info, keyword);
-	}
-
-	/**
-	 * 查看已付款状态的出货单
-	 *
-	 * @param params  the params 分页参数
-	 * @param keyword the keyword 搜索字符串
-	 * @return page 返回Invoice的page对象
-	 */
-	@RequestMapping(value = "/paid", method = RequestMethod.GET)
-	@ApiOperation(value = "查看已付款状态的出货单", httpMethod = "GET")
-	public Page<Invoice> findPaid(@ApiParam(required = true, value = "分页参数") PageParams params, @ApiParam(required = true, value = "搜索字符串") String keyword) {
-		logger.log("出货单管理", "查看已付款");
-		PageInfo info = new PageInfo(params);
-		info.filter("status", Status.PAID.value());
-		return invoiceService.findPageByStatus(info, keyword);
-	}
-
-	/**
-	 * 根据状态查看企业出货单
-	 *
-	 * @param params  the params 分页参数
-	 * @param keyword the keyword 搜索字符串
-	 * @param status  the status 状态
-	 * @return page 返回Invoice的page对象
-	 */
-	@RequestMapping(value = "/business", method = RequestMethod.GET)
-	@ApiOperation(value = "根据状态查看企业出货单", httpMethod = "GET")
-	public Page<Invoice> findBusiness(@ApiParam(required = true, value = "分页参数") PageParams params, @ApiParam(required = true, value = "搜索字符串") String keyword, @ApiParam(required = true, value = "出货单状态") String status) {
-		logger.log("出货单管理", "根据状态查看企业出货单");
-		PageInfo pageInfo = new PageInfo(params);
-		pageInfo.filter("sellerenuu", SystemSession.getUser().getEnterprise().getUu());
-		return invoiceService.findPageBusiness(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 供应商发货
-	 *
-	 * @param json the json Invoice集合的json字符串
-	 * @return string 返回发货结果
-	 */
-	@RequestMapping(value = "/inFch/send", method = RequestMethod.POST, params = "_role=vendor")
-	@ApiOperation(value = "供应商发货", httpMethod = "POST")
-	public String sendForVendor(@ApiParam(required = true, value = "Invoice集合的json字符串") @RequestBody String json) {
-		List<Invoice> invoices = FastjsonUtils.fromJsonArray(json, Invoice.class);
-		String inId = "";
-		for (Invoice invoice : invoices) {
-			inId += invoice.getInvoiceid();
-		}
-		logger.log("出货单管理", "供应商发货", "供应商发货:" + inId.substring(0, inId.length() -1) + ", 操作人:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
-		return invoiceService.sendForVendor(invoices);
-	}
-
-	/**
-	 * 平台确认收货
-	 *
-	 * @param inid the inid 发货单号id
-	 * @return string 返回确认结果
-	 */
-	@RequestMapping(value = "/{inid}/ensurereceipt", method = RequestMethod.PUT, params = "_role=vendor")
-	@ApiOperation(value = "平台确认收货", httpMethod = "PUT")
-	public String ensuerAcceptInvoise(@ApiParam(required = true, value = "发货单号") @PathVariable Long inid) {
-		logger.log("出货单管理", "平台确认收货", "平台确认收货 id=" + inid);
-		return invoiceService.ensuerAcceptInvoise(inid);
-	};
-
-	/**
-	 * 平台根据状态查看卖家出货单
-	 *
-	 * @param params  the params 分页参数
-	 * @param keyword the keyword 搜索字符串
-	 * @param status  the status 状态
-	 * @return page 返回Invoice的page对象
-	 */
-	@RequestMapping(value = "/inFch/admin", method = RequestMethod.GET, params = "_role=vendor")
-	@ApiOperation(value = "平台根据状态查看卖家出货单", httpMethod = "GET")
-	public Page<Invoice> findAdminInFpu(@ApiParam(required = true, value = "分页参数") PageParams params, @ApiParam(required = true, value = "搜索字符串") String keyword, @ApiParam(required = true, value = "出货单状态") String status) {
-		logger.log("出货单管理", "平台根据状态查看卖家出货单");
-		PageInfo pageInfo = new PageInfo(params);
-		pageInfo.filter("piclass", 1037);
-		return invoiceService.findAdminInFch(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 平台根据状态查看平台出货单
-	 *
-	 * @param params  the params 分页参数
-	 * @param keyword the keyword 搜索字符串
-	 * @param status  the status 状态
-	 * @return page 返回Invoice的page对象
-	 */
-	@RequestMapping(value = "/inFch/admin", method = RequestMethod.GET, params = "_role=b2c")
-	@ApiOperation(value = "平台根据状态查看平台出货单", httpMethod = "GET")
-	public Page<Invoice> findAdminInFpuToB2c(@ApiParam(required = true, value = "分页参数") PageParams params, @ApiParam(required = true, value = "搜索字符串") String keyword, @ApiParam(required = true, value = "发货单状态") String status) {
-		logger.log("出货单管理", "平台根据状态查看平台出货单");
-		PageInfo pageInfo = new PageInfo(params);
-		pageInfo.filter("piclass", 1038);
-		return invoiceService.findAdminInFpuToB2c(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 平台向客户发货
-	 *
-	 * @param json the json Invoice集合的json字符串
-	 * @return string 返回确认结果
-	 */
-	@RequestMapping(value = "/inFch/ensuresend", method = RequestMethod.POST, params = "_role=b2c")
-	@ApiOperation(value = "平台向客户发货", httpMethod = "POST")
-	public String ensureSend(@ApiParam(required = true, value = "分页参数") @RequestBody String json) {
-		List<Invoice> invoices = FastjsonUtils.fromJsonArray(json, Invoice.class);
-		String inId = "";
-		for (Invoice invoice : invoices) {
-			inId += invoice.getInvoiceid();
-		}
-		logger.log("出货单管理", "平台向客户发货", "平台向客户发货:" + inId.substring(0, inId.length() -1) + ", 操作人:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
-		return invoiceService.ensureSendToCust(invoices);
-	}
-
-	/**
-	 * 批量查询待出货 (findBy订单号)
-	 *
-	 * @param ids the ids 加密的订单id字符串
-	 * @return list 返回Invoice的集合
-	 */
-	@RequestMapping(value = "/inFch/tobeshipped/{ids}", method = RequestMethod.GET, params = "_role=vendor")
-	@ApiOperation(value = "批量查询待出货 (findBy订单号)", httpMethod = "GET")
-	public List<Invoice> findInvoiceByids(@ApiParam(required = true, value = "加密的订单id字符串") @PathVariable String ids) {
-		logger.log("出货单管理", "批量查询待出货");
-		return invoiceService.findInvoiceByids(ids);
-	}
-
-	/**
-	 * 管理平台查询换货出货单(含供应商换货出货单、平台换货出货单)
-	 *
-	 * @param invoiceid the invoiceid 加密的发货id字符串
-	 * @return Invoice 返回Invoice对象
-	 */
-	@RequestMapping(value = "/change/admin/{invoiceid}", method = RequestMethod.GET)
-	@ApiOperation(value = "管理平台查询换货出货单(含供应商换货出货单、平台换货出货单)", httpMethod = "GET")
-	public Invoice getVendorchangeByInvoiceid(@ApiParam(required = true, value = "加密的发货id字符串") @PathVariable String invoiceid) {
-		logger.log("出货单管理", "管理平台查询换货出货单");
-		invoiceid = StringUtilB2C.decodeValue(invoiceid);
-		return invoiceService.findChangeByInvoiceid(invoiceid);
-	}
-
-	/**
-	 * 买家根据换货单号获取商城针对买家换货单发货给买家的出货单
-	 *
-	 * @param changeId the changeId 发货单号
-	 * @return invoice 返回Invoice对象
-	 */
-	@RequestMapping(value = "getInvoiceBySourceid/{changeId}", method = RequestMethod.GET)
-	@ApiOperation(value = "买家根据换货单号获取商城针对买家换货单发货给买家的出货单", httpMethod = "GET")
-	public Invoice getInvoiceBySourceid(@ApiParam(required = true, value = "发货单号") @PathVariable String changeId) {
-		logger.log("出货单管理", "买家根据换货单号获取商城针对买家换货单发货给买家的出货单", "换货单号:" + changeId);
-		return invoiceService.getInvoiceBySourceid(changeId);
-	}
 }

+ 268 - 89
src/main/java/com/uas/platform/b2c/logistics/model/Invoice.java

@@ -1,26 +1,13 @@
 package com.uas.platform.b2c.logistics.model;
 
 
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2c;
 import com.uas.platform.b2c.trade.order.model.Document;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.core.model.EncodingRulesConstant;
+import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.core.model.Status;
-import com.uas.platform.core.model.Type;
 import com.uas.platform.core.persistence.StatusColumn;
 import org.hibernate.annotations.CacheConcurrencyStrategy;
 
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.HashSet;
@@ -71,6 +58,12 @@ public class Invoice extends Document implements Serializable {
 	@Column(name = "in_buyername")
 	private String buyername;
 
+	/**
+	 * 买家的企业名称
+	 */
+	@Column(name = "in_buyerentername")
+	private String buyerentername;
+
 	/**
 	 * 企业卖方uu
 	 * 
@@ -97,6 +90,25 @@ public class Invoice extends Document implements Serializable {
 	@Column(name = "in_sourceid")
 	private String sourceid;
 
+	/**
+	 * 来源采购单
+	 */
+	@Column(name = "pu_id")
+	private Long puid;
+
+
+	/**
+	 * 订单备注
+	 */
+	@Column(name = "in_remark", length = 4000)
+	private String remark;
+
+	/**
+	 * 是否是UAS的来源
+	 */
+	@Column(name = "or_uaspurcid")
+	private Long uasPurcid;
+
 	/**
 	 * 产出id(子级)
 	 */
@@ -131,7 +143,8 @@ public class Invoice extends Document implements Serializable {
 	/**
 	 * 订单状态(1->2)
 	 * 
-	 * @Tip 必须严格按照顺序流转 1、INBOUND(404, "待收货") 2、RECEIVED(405, "已收货"),
+	 * @Tip 必须严格按照顺序流转 1、TOBESHIPPED(406, "待出货")
+	 * 2、INBOUND(404, "待收货") 3、RECEIVED(405, "已收货"),
 	 */
 	@Column(name = "in_status")
 	@StatusColumn
@@ -140,11 +153,35 @@ public class Invoice extends Document implements Serializable {
 	/**
 	 * 币种名称
 	 */
-	@Column(name = "cr_name")
-	private String currencyName;
+	@Column(name = "in_currency")
+	private String currency;
+
+	/**
+	 * 税金
+	 */
+	@Column(name = "in_taxes")
+	private Double taxes;
 
 	/**
-	 * 金额合计
+	 * 运费
+	 */
+	@Column(name = "in_fare")
+	private Double fare;
+
+	/**
+	 * 适用的配送规则
+	 */
+	@Column(name = "in_rule")
+	private String jsonRule;
+
+	/**
+	 * 自提点信息
+	 */
+	@Column(name = "in_take_self")
+	private String jsonTakeSelf;
+
+	/**
+	 * 价税合计 (商品合计)
 	 */
 	@Column(name = "in_price")
 	private Double price;
@@ -162,28 +199,57 @@ public class Invoice extends Document implements Serializable {
 	private Double transationPrice;
 
 	/**
-	 * 客户退货数量
+	 * 状态变更记录 List<StatusHistory> -> Json
 	 */
-	@Column(name = "detail_returnqty")
-	private Double returnQty;
+	@Column(name = "in_statushistory", length = 4000)
+	private String statushistory;
+
 
 	/**
-	 * 客户换货数量
+	 * 数量
 	 */
-	@Column(name = "detail_changeqty")
-	private Double changeQty;
-	
-	/*
-	 * 税金
+	@Column(name = "in_qty")
+	private Double qty;
+
+	/**
+	 * 配送方式
 	 */
-	@Column(name = "detail_taxes")
-	private Double taxes;
+	@Column(name = "in_send_type")
+	private Integer sendType;
 
 	/**
-	 * 状态变更记录 List<StatusHistory> -> Json
+	 * 自己送货还是第三方物流送货
 	 */
-	@Column(name = "in_statushistory", length = 4000)
-	private String statushistory;
+	@Column(name = "in_delivery_type")
+	private String deliveryType;
+
+	/**
+	 * 自己送货的送货人
+	 */
+	@Column(name = "in_selfdeliveryname")
+	private String selfDeliveryName;
+
+
+	/**
+	 * 自己送货的联系电话
+	 */
+	@Column(name = "in_selfdeliveryphone")
+	private String selfDeliveryPhone;
+
+	/**
+	 * 店铺的id
+	 */
+	@Column(name = "in_storeid")
+	private String storeid;
+
+	/**
+	 * 买家订单的号
+	 */
+	@Column(name = "in_orid")
+	private String orid;
+
+	@Transient
+	private Boolean isSelfSeller;
 
 	/**
 	 * 发货单明细
@@ -349,14 +415,6 @@ public class Invoice extends Document implements Serializable {
 		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
 	}
 
-	public String getCurrencyName() {
-		return currencyName;
-	}
-
-	public void setCurrencyName(String currencyName) {
-		this.currencyName = currencyName;
-	}
-
 	public Double getPrice() {
 		return price;
 	}
@@ -385,22 +443,6 @@ public class Invoice extends Document implements Serializable {
 		this.transationPrice = transationPrice;
 	}
 
-	public Double getReturnQty() {
-		return returnQty;
-	}
-
-	public void setReturnQty(Double returnQty) {
-		this.returnQty = returnQty;
-	}
-
-	public Double getChangeQty() {
-		return changeQty;
-	}
-
-	public void setChangeQty(Double changeQty) {
-		this.changeQty = changeQty;
-	}
-
 	public Set<InvoiceDetail> getInvoiceDetails() {
 		return invoiceDetails;
 	}
@@ -425,6 +467,155 @@ public class Invoice extends Document implements Serializable {
 		this.sellername = sellername;
 	}
 
+	public String getBuyerentername() {
+		return buyerentername;
+	}
+
+	public Invoice setBuyerentername(String buyerentername) {
+		this.buyerentername = buyerentername;
+		return this;
+	}
+
+	public Long getPuid() {
+		return puid;
+	}
+
+	public Invoice setPuid(Long puid) {
+		this.puid = puid;
+		return this;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public Invoice setRemark(String remark) {
+		this.remark = remark;
+		return this;
+	}
+
+	public Long getUasPurcid() {
+		return uasPurcid;
+	}
+
+	public Invoice setUasPurcid(Long uasPurcid) {
+		this.uasPurcid = uasPurcid;
+		return this;
+	}
+
+	public String getCurrency() {
+		return currency;
+	}
+
+	public Invoice setCurrency(String currency) {
+		this.currency = currency;
+		return this;
+	}
+
+	public Double getFare() {
+		return fare;
+	}
+
+	public Invoice setFare(Double fare) {
+		this.fare = fare;
+		return this;
+	}
+
+	public String getJsonRule() {
+		return jsonRule;
+	}
+
+	public Invoice setJsonRule(String jsonRule) {
+		this.jsonRule = jsonRule;
+		return this;
+	}
+
+	public String getJsonTakeSelf() {
+		return jsonTakeSelf;
+	}
+
+	public Invoice setJsonTakeSelf(String jsonTakeSelf) {
+		this.jsonTakeSelf = jsonTakeSelf;
+		return this;
+	}
+
+	public Invoice setStatushistory(String statushistory) {
+		this.statushistory = statushistory;
+		return this;
+	}
+
+	public Double getQty() {
+		return qty;
+	}
+
+	public Invoice setQty(Double qty) {
+		this.qty = qty;
+		return this;
+	}
+
+	public Integer getSendType() {
+		return sendType;
+	}
+
+	public Invoice setSendType(Integer sendType) {
+		this.sendType = sendType;
+		return this;
+	}
+
+	public String getDeliveryType() {
+		return deliveryType;
+	}
+
+	public Invoice setDeliveryType(String deliveryType) {
+		this.deliveryType = deliveryType;
+		return this;
+	}
+
+	public String getSelfDeliveryName() {
+		return selfDeliveryName;
+	}
+
+	public Invoice setSelfDeliveryName(String selfDeliveryName) {
+		this.selfDeliveryName = selfDeliveryName;
+		return this;
+	}
+
+	public String getSelfDeliveryPhone() {
+		return selfDeliveryPhone;
+	}
+
+	public Invoice setSelfDeliveryPhone(String selfDeliveryPhone) {
+		this.selfDeliveryPhone = selfDeliveryPhone;
+		return this;
+	}
+
+	public String getStoreid() {
+		return storeid;
+	}
+
+	public Invoice setStoreid(String storeid) {
+		this.storeid = storeid;
+		return this;
+	}
+
+	public String getOrid() {
+		return orid;
+	}
+
+	public Invoice setOrid(String orid) {
+		this.orid = orid;
+		return this;
+	}
+
+	public Boolean getSelfSeller() {
+		return isSelfSeller;
+	}
+
+	public Invoice setSelfSeller(Boolean selfSeller) {
+		isSelfSeller = selfSeller;
+		return this;
+	}
+
 	/**
 	 * @Tip 对象初始化时必须给历史记录赋值
 	 */
@@ -433,37 +624,25 @@ public class Invoice extends Document implements Serializable {
 		this.invoiceDetails = new HashSet<InvoiceDetail>();
 	}
 
-	/**
-	 * 平台换货单 生成供应商换货出货单
-	 */
-	public Invoice(ChangeFB2c b2c, CreateNumberService createNumberService) {
-		String invoiceids = EncodingRulesConstant.INVOICE_FROMCHANGE.replace("_TIMESTAP_NUMBER",
-				createNumberService.getTimeNumber("trade$invoice", 8));
-		this.invoiceid = invoiceids;
-		// 给属性赋值
-		this.createtime = new Date();
-		this.buyerenuu = b2c.getBuyeruu();
-		this.buyername = b2c.getBuyername();
-		this.sellername = b2c.getSellername();
-		this.sellerenuu = b2c.getSellerenuu();
-		this.currencyName = b2c.getCurrencyName();
-		this.price = b2c.getPrice();
-		this.taxes = b2c.getTaxes();
-		// 平台的收货地址就是供应商的发货地址
-		this.jsonSdAddress = b2c.getJsonAddress();
-		// 平台的发货地址就是供应商的收货地址
-		this.jsonSpAddress = b2c.getJsonSdAddress();
-		this.changeQty = b2c.getQty();
-		// 记录来源单号
-		this.sourceid = b2c.getChangeid();
-		// 记录来源类型
-		this.piclass = Type.Invoice_Vender_Change_code.value();
-	}
-
-	@Override
-	public String toString() {
-		return "Invoice [invoiceid=" + invoiceid + ", piclass=" + piclass + ", sourceid=" + sourceid + ", createtime="
-				+ createtime + ", status=" + status + ", price=" + price + "]";
+	public Invoice(Purchase purchase) {
+		if (purchase == null) {
+			return ;
+		}
+		this.statushistory = "";
+		this.invoiceDetails = new HashSet<>();
+		this.sellerenuu = purchase.getSellerenuu();
+		this.currency = purchase.getCurrency();
+		this.uasPurcid = purchase.getUasPurcid();
+		this.buyerentername = purchase.getBuyentername();
+		this.buyerenuu = purchase.getBuyerenuu();
+		this.buyeruu = purchase.getBuyeruu();
+		this.buyername = purchase.getBuyername();
+		this.jsonSpAddress = purchase.getJsonAddress();
+		this.puid = purchase.getId();
+		this.sourceid = purchase.getPurchaseid();
+		this.storeid = purchase.getStoreid();
+		this.orid = purchase.getOrderid();
+		this.remark = purchase.getPurchaseRemark();
+		this.fare = purchase.getFare();
 	}
-
 }

+ 3 - 36
src/main/java/com/uas/platform/b2c/logistics/model/InvoiceDetail.java

@@ -1,21 +1,10 @@
 package com.uas.platform.b2c.logistics.model;
 
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2cDetail;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
 import com.alibaba.fastjson.annotation.JSONField;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.core.model.EncodingRulesConstant;
 import com.uas.platform.core.persistence.StatusColumn;
+import org.codehaus.jackson.annotate.JsonIgnore;
+
+import javax.persistence.*;
 
 /**
  * 发货单(来源于订单的)明细
@@ -381,28 +370,6 @@ public class InvoiceDetail {
 	public void setTaxunitprice(Double taxunitprice) {
 		this.taxunitprice = taxunitprice;
 	}
-
-	public InvoiceDetail(ChangeFB2cDetail b2cDetail, CreateNumberService createNumberService) {
-		String detailids = EncodingRulesConstant.INVOICE_DETAIL_FROMCHANGE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$invoice_detail", 9));
-		this.detailid = detailids;
-		this.batchCode = b2cDetail.getBatchCode();
-		this.uuid = b2cDetail.getUuid();
-		this.original = b2cDetail.getOriginal();
-		this.cmpCode = b2cDetail.getCmpCode();
-		this.brName = b2cDetail.getBrName();
-		this.kiName = b2cDetail.getKiName();
-		this.img = b2cDetail.getImg();
-		this.unitprice = b2cDetail.getUnitprice();
-		this.number = b2cDetail.getNumber();
-		this.currencyName = b2cDetail.getCurrencyName();
-		this.tax = b2cDetail.getTax();
-		this.taxes = b2cDetail.getTaxes();
-		this.taxunitprice = b2cDetail.getTaxunitprice();
-		this.price = b2cDetail.getPrice();
-		// 记录来源单号
-		this.sourceid = b2cDetail.getDetailid();
-	}
-
 	/**
 	 * 平台换货单明细 生成供应商换货出货单明细
 	 */

+ 2 - 96
src/main/java/com/uas/platform/b2c/logistics/model/Receipt.java

@@ -1,28 +1,13 @@
 package com.uas.platform.b2c.logistics.model;
 
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2c;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFCust;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2c;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
-import com.uas.platform.b2c.trade.order.model.Document;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.core.utils.StringUtilB2C;
-import com.uas.platform.core.model.EncodingRulesConstant;
+import com.uas.platform.b2c.trade.order.model.Document;
 import com.uas.platform.core.model.Status;
-import com.uas.platform.core.model.Type;
 import com.uas.platform.core.persistence.StatusColumn;
 import org.hibernate.annotations.Cache;
 import org.hibernate.annotations.CacheConcurrencyStrategy;
 
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.HashSet;
@@ -430,49 +415,6 @@ public class Receipt extends Document implements Serializable {
 		this.sourceType = sourceType;
 	}
 
-	/**
-	 * 平台换货单转供应商销售换货单
-	 */
-	public Receipt(ChangeFB2c b2c, CreateNumberService createNumberService) {
-		String receiptid = EncodingRulesConstant.RECEIPT_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt", 8));
-		this.receiptid = receiptid;
-		this.createtime = new Date();
-		this.jsonAddress = b2c.getJsonAddress();
-		this.price = b2c.getPrice();
-		// 记录来源换货单号
-		this.sourceid = b2c.getChangeid();
-		this.sellername = b2c.getSellername();
-		this.sellerenuu = b2c.getSellerenuu();
-		this.changeQty = b2c.getQty();
-		this.piclass = Type.Purc_Vender_Change_Code.value();
-		this.currency = b2c.getCurrencyName();
-		this.taxes = b2c.getTaxes();
-
-	}
-
-	/**
-	 * 客户换货单生成销售验退单 (平台销售换货单)
-	 */
-	public Receipt(ChangeFCust cust, CreateNumberService createNumberService) {
-		// 生成入库单号
-		String receiptids = EncodingRulesConstant.RECEIPT_FROMPURCHASE.replace("_TIMESTAP_NUMBER",
-				createNumberService.getTimeNumber("trade$receipt", 8));
-		this.receiptid = receiptids;
-		// 给属性赋值
-		this.createtime = new Date();
-		this.jsonAddress = cust.getJsonAddress();
-		this.price = cust.getPrice();
-		this.currency = cust.getCurrency();
-		this.taxes = cust.getTaxes();
-		// 记录来源换货单号
-		this.sourceid = cust.getChangeid();
-		this.sellername = cust.getSellername();
-		this.sellerenuu = cust.getSellerenuu();
-		this.changeQty = cust.getQty();
-		this.piclass = Type.Purc_B2c_Change_Code.value();
-
-	}
-
 	/**
 	 * @Tip 对象初始化时必须给历史记录赋值
 	 */
@@ -480,42 +422,6 @@ public class Receipt extends Document implements Serializable {
 		this.statushistory = "";
 		this.receiptDetails = new HashSet<ReceiptDetail>();
 	}
-	
-	public Receipt(ReturnFB2c b2c) {
-		this.statushistory = "";
-		this.receiptDetails = new HashSet<ReceiptDetail>();
-		this.purchaseid = b2c.getPuid();
-		this.createtime = new Date();
-		this.jsonAddress = b2c.getJsonAddress();
-		this.price = b2c.getPrice();
-		this.taxes = b2c.getTaxes();
-		this.sourceid = b2c.getReturnid();
-		this.currency = b2c.getCurrency();
-		this.sellerenuu = b2c.getSellerenuu();
-		this.sellername = b2c.getSellername();
-		this.returnQty = b2c.getQty();
-		this.settlement = Status.NOTSETTLED.value();
-		this.piclass = Type.Purc_Vender_Return_Code.value();
-	}
-	
-	public Receipt(ReturnFCust cust) {
-		this.statushistory = "";
-		this.receiptDetails = new HashSet<ReceiptDetail>();
-		// 给属性赋值
-		this.createtime = new Date();
-		this.jsonAddress = cust.getJsonAddress();
-		this.price = cust.getPrice();
-		this.taxes = cust.getTaxes();
-		this.currency = cust.getCurrency();
-		// 记录来源退货单号
-		this.invoiceid = cust.getReturnid();
-		this.sourceid = cust.getReturnid();
-		this.sellerenuu = cust.getSellerenuu();
-		this.sellername = cust.getSellername();
-		this.returnQty = cust.getQty();
-		// 为入库单生成类型
-		this.piclass = Type.Purc_B2c_Return_Code.value();
-	}
 
 	public Long getProofingid() {
 		return proofingid;

+ 3 - 90
src/main/java/com/uas/platform/b2c/logistics/model/ReceiptDetail.java

@@ -1,24 +1,10 @@
 package com.uas.platform.b2c.logistics.model;
 
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2cDetail;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFCustDetail;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2cDetail;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCustDetail;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
 import com.alibaba.fastjson.annotation.JSONField;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.core.model.EncodingRulesConstant;
 import com.uas.platform.core.persistence.StatusColumn;
+import org.codehaus.jackson.annotate.JsonIgnore;
+
+import javax.persistence.*;
 
 /**
  * 入库单明细
@@ -292,78 +278,5 @@ public class ReceiptDetail {
 	}
 
 	public ReceiptDetail() {
-
-	}
-
-	public ReceiptDetail(ReturnFB2cDetail b2cDetail) {
-		this.number = b2cDetail.getNumber();
-		this.unitprice = b2cDetail.getUnitprice();
-		this.price = b2cDetail.getPrice();
-		this.taxUnitprice = b2cDetail.getTaxUnitprice();
-		this.status = b2cDetail.getStatus();
-		this.original = b2cDetail.getOriginal();
-		this.tax = b2cDetail.getTax();
-		this.taxes = b2cDetail.getTaxes();
-		this.currencyName = b2cDetail.getCurrencyName();
-		this.pudetail_id = b2cDetail.getPuid();// 设置每一条明细关联的采购单明细
-		// 记录来源明细id
-		// reD.setSourceid(custDetail.getId());
-		this.sourceid = b2cDetail.getDetailid();
-	}
-
-	public ReceiptDetail(ReturnFCustDetail custDetail) {
-		this.number = custDetail.getNumber();
-		this.unitprice = custDetail.getUnitprice();
-		this.price = custDetail.getPrice();
-		this.taxUnitprice = custDetail.getTaxUnitprice();
-		this.status = custDetail.getStatus();
-		this.original = custDetail.getOriginal();
-		this.tax = custDetail.getTax();
-		this.taxes = custDetail.getTaxes();
-		this.currencyName = custDetail.getCurrencyName();
-		this.pudetail_id = custDetail.getPuid();// 设置每一条明细关联的采购单明细
-		// 记录来源明细id
-		// reD.setSourceid(custDetail.getId());
-		this.sourceid = custDetail.getDetailid();
-	}
-
-	/**
-	 * 平台换货单明细转供应商销售换货单明细(ChangeFB2c)
-	 */
-	public ReceiptDetail(ChangeFB2cDetail b2cDetail, CreateNumberService createNumberService) {
-		String detailid = EncodingRulesConstant.RECEIPT_DETAIL_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt_detail", 9));
-		this.detailid = detailid;
-		this.number = b2cDetail.getNumber();
-		this.currencyName = b2cDetail.getCurrencyName();
-		this.unitprice = b2cDetail.getUnitprice();
-		this.taxUnitprice = b2cDetail.getTaxunitprice();
-		this.tax = b2cDetail.getTax();
-		this.price = b2cDetail.getPrice();
-		this.status = b2cDetail.getStatus();
-		this.detno = b2cDetail.getDetno();
-		this.pudetail_id = b2cDetail.getPuid();
-		// this.sourceid = b2cDetail.getId();
-		this.sourceid = b2cDetail.getDetailid();
-	}
-
-	/**
-	 * 客户换货单明细转供应商销售换货单明细(ChangeFCust)
-	 */
-	public ReceiptDetail(ChangeFCustDetail custDetail, CreateNumberService createNumberService) {
-		String detailids = EncodingRulesConstant.RECEIPT_DETAIL_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt_detail", 9));
-		this.detailid = detailids;
-		// 设置属性
-		this.number = custDetail.getNumber();
-		this.currencyName = custDetail.getCurrencyName();
-		this.unitprice = custDetail.getUnitprice();
-		this.taxes = custDetail.getTaxes();
-		this.tax = custDetail.getTax();
-		this.price = custDetail.getPrice();
-		this.status = custDetail.getStatus();
-		this.pudetail_id = custDetail.getPuid();
-		this.detno = custDetail.getDetno();
-		this.taxUnitprice = custDetail.getTaxunitprice();
-		// this.sourceid = custDetail.getId();
-		this.sourceid = custDetail.getDetailid();
 	}
 }

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

@@ -1,115 +1,7 @@
 package com.uas.platform.b2c.logistics.service;
 
-import java.util.List;
-
-import org.springframework.data.domain.Page;
-
-import com.uas.platform.b2c.logistics.model.Invoice;
-import com.uas.platform.core.model.PageInfo;
-
 /**
  * The interface Invoice service.
  */
 public interface InvoiceService {
-
-	/**
-	 * 订单转出货
-	 *
-	 * @param orid the orid 订单id
-	 * @return invoice 返回invoice对象
-	 */
-	public Invoice createInvoice(Long orid);
-
-	/**
-	 * 分页查询出货单
-	 *
-	 * @param pageInfo the pageInfo 分页参数
-	 * @param keyword  the keyword 搜索的字符串
-	 * @return page Invoice的page对象
-	 */
-	public Page<Invoice> findPageByStatus(PageInfo pageInfo, String keyword);
-
-	/**
-	 * 平台出货
-	 * 
-	 */
-//	public Invoice sendInvoice(String inid);
-
-	/**
-	 * 分页查询企业来自采购出货单
-	 *
-	 * @param info    the info 分页参数
-	 * @param keyword the keyword 搜索的字符串
-	 * @param status  the status 状态
-	 * @return page Invoice的page对象
-	 */
-	public Page<Invoice> findPageBusiness(PageInfo info, String keyword, String status);
-
-	/**
-	 * 供应商发货
-	 *
-	 * @param invoices the invoices 批量发货
-	 * @return string 返回结果描述
-	 */
-	public String sendForVendor(List<Invoice> invoices);
-
-	/**
-	 * 平台确认收货
-	 *
-	 * @param inid the inid 发货单号
-	 * @return string 返回结果描述
-	 */
-	public String ensuerAcceptInvoise(Long inid);
-
-	/**
-	 * 平台查看卖家出货单
-	 *
-	 * @param info    the info 分页参数
-	 * @param keyword the keyword 搜索的字符串
-	 * @param status  the status 状态
-	 * @return page Invoice的page对象
-	 */
-	public Page<Invoice> findAdminInFch(PageInfo info, String keyword, String status);
-
-	/**
-	 * 平台查看平台出货单
-	 *
-	 * @param info    the info 分页参数
-	 * @param keyword the keyword 搜索的字符串
-	 * @param status  the status 状态
-	 * @return page Invoice的page对象
-	 */
-	public Page<Invoice> findAdminInFpuToB2c(PageInfo info, String keyword, String status);
-
-	/**
-	 * 平台确认想客户发货
-	 *
-	 * @param ensureSendToCust Invoice的list集合
-	 * @return string 返回结果描述
-	 */
-	public String ensureSendToCust(List<Invoice> ensureSendToCust);
-
-	/**
-	 * 批量查询待出货 (findBy订单号)
-	 *
-	 * @param inid the inid 出货单号
-	 * @return list 返回Invoice的list集合
-	 */
-	public List<Invoice> findInvoiceByids(String inid);
-
-	/**
-	 * 查询单张供应商换货出货单(平台)
-	 *
-	 * @param invoiceid the invoiceid 来源id
-	 * @return invoice 返回invoice对象
-	 */
-	public Invoice findChangeByInvoiceid(String invoiceid);
-
-	/**
-	 * 买家根据换货单号获取商城针对买家换货单发货给买家的出货单
-	 *
-	 * @param changeId the changeId 来源id
-	 * @return invoice 返回invoice对象
-	 */
-	Invoice getInvoiceBySourceid(String changeId);
 }

+ 0 - 6
src/main/java/com/uas/platform/b2c/logistics/service/impl/InvoiceFPurchaseServiceImpl.java

@@ -28,7 +28,6 @@ import com.uas.platform.b2c.prod.commodity.service.InOutboundDetailService;
 import com.uas.platform.b2c.prod.commodity.service.ProductService;
 import com.uas.platform.b2c.prod.commodity.type.InOutBoundType;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-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.PurchaseDao;
 import com.uas.platform.b2c.trade.order.model.Order;
@@ -411,11 +410,6 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
 			return new ResultMap(CodeType.NOT_PERMIT, "当前状态不是待出货状态,不能添加发货信息");
 		}
 		
-		if(purchase.getLaunchPuExApplyId() != null
-				&&purchase.getLaunchPuExApplyStatus().equals(AfterSaleStatus.CANCELED)
-				&&purchase.getLaunchPuExApplyStatus().equals(AfterSaleStatus.FINISHED)) {
-			return new ResultMap(CodeType.NOT_PERMIT, "您的异常申请流程还不是已完成或已取消状态,不能做发货的动作!");
-		}
 		JSONObject  logisticsJson = sendInfo.getJSONObject("logisticsInfo");
 		if (logisticsJson != null){
 			Logistics logistics = logisticsService.bornLogisticsByCompanyNameAndNum(logisticsJson.getString("companyName"), logisticsJson.getString("number"));

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

@@ -1,369 +1,9 @@
 package com.uas.platform.b2c.logistics.service.impl;
 
-import com.uas.platform.b2c.trade.aftersale.dao.ChangeFB2cDao;
-import com.uas.platform.b2c.trade.aftersale.dao.ChangeFCustDao;
-import com.uas.platform.b2c.trade.aftersale.dao.ChangeFCustDetailDao;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2c;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2cDetail;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFCust;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFCustDetail;
-import com.uas.platform.b2c.logistics.dao.InvoiceDao;
-import com.uas.platform.b2c.logistics.model.Invoice;
-import com.uas.platform.b2c.logistics.model.InvoiceDetail;
 import com.uas.platform.b2c.logistics.service.InvoiceService;
-import com.uas.platform.b2c.logistics.service.ReceiptService;
-import com.uas.platform.b2c.trade.order.dao.OrderDao;
-import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.b2c.trade.order.model.OrderDetail;
-import com.uas.platform.b2c.trade.order.model.Purchase;
-import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
-import com.uas.platform.core.exception.IllegalOperatorException;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.persistence.criteria.PredicateUtils;
-import com.uas.platform.core.persistence.criteria.SimpleExpression;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.criteria.CriteriaBuilder;
-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.HashSet;
-import java.util.List;
-import java.util.Set;
 
 @Service
 public class InvoiceServiceImpl implements InvoiceService {
 
-	@Autowired
-	private InvoiceDao invoiceDao;
-
-	@Autowired
-	private ChangeFB2cDao changeFB2cDao;
-
-	@Autowired
-	private ChangeFCustDao changeFCustDao;
-	
-	@Autowired
-	private ChangeFCustDetailDao changeFCustDetailDao;
-
-	@Autowired
-	private ReceiptService receiptService;
-	
-	@Autowired
-	private PurchaseDao purchaseDao;
-	
-	@Autowired
-	private OrderDao orderDao;
-	
-	@Override
-	public Invoice createInvoice(Long orid) {
-		return null;
-	}
-
-	@Transactional
-	@Override
-	public String ensuerAcceptInvoise(Long puid) {
-		Invoice invoice = invoiceDao.findOne(puid);
-		if (invoice.getStatus() != Status.INBOUND.value()) {
-			throw new IllegalAccessError("出货单"+invoice.getInvoiceid()+"的状态是"+Status.valueOf(invoice.getStatus()).getPhrase()+",不为待收货状态,不能确认收货");
-		}
-		Long uu = SystemSession.getUser().getUserUU();
-		// 1、生成入库单
-		receiptService.createPreceipts(invoice);
-		// 2、改写换货单状态
-		ChangeFB2c b2c = changeFB2cDao.findByChangeid(invoice.getSourceid());
-		Purchase purchase = purchaseDao.findByPurchaseid(b2c.getPuid());
-		Order order = orderDao.findByOrderid(purchase.getOrderid());
-		Set<ChangeFB2cDetail> changeDetails = b2c.getChangeDetails();
-		for (ChangeFB2cDetail changeFB2cDetail : changeDetails) {
-			changeFB2cDetail.setStatus(Status.RECEIVED.value());
-			String cfcid = changeFB2cDetail.getCfcid();
-			if(cfcid != null) {
-				ChangeFCustDetail custDetail = changeFCustDetailDao.findByDetailid(cfcid);
-				custDetail.setStatus(Status.SHIPPED.value());
-				changeFCustDetailDao.save(custDetail);
-			}else {
-				for (PurchaseDetail detail : purchase.getPurchaseDetails()) {
-					if(detail.getDetailid().equals(changeFB2cDetail.getPuid())) {
-						if(detail.getStatus().intValue() == Status.INBOUND.value()) {
-							detail.setStatusReceived(uu);
-						}else {
-							throw new IllegalOperatorException("平台换货单对应的采购单的明细状态有误,请刷新界面");
-						}
-					}
-				}
-				for (OrderDetail detail : order.getOrderDetails()) {
-					if(detail.getPurdetid().equals(changeFB2cDetail.getPuid())) {
-						if(detail.getStatus().intValue() == Status.SHIPPINGIN.value()) {
-							detail.setStatusShipped(uu);
-						}else {
-							throw new IllegalOperatorException("平台换货单对应的订单的明细状态有误,请刷新界面");
-						}
-					}
-				}
-			}
-		}
-		b2c.setStatusReceived(uu);
-		purchase.setExchangeStatusFromBuyer(Status.RECEIVED.value());
-		purchase.setSecondReceivedTime(new Date());
-		purchaseDao.save(purchase);
-		b2c = changeFB2cDao.save(b2c);
-		ChangeFCust cust = b2c.getCust();
-		if(cust != null) {
-			Set<ChangeFCustDetail> changeDetails2 = cust.getChangeDetails();
-			boolean isAllShip = true;
-			for (ChangeFCustDetail changeFCustDetail : changeDetails2) {
-				if(!changeFCustDetail.getStatus().equals(Status.SHIPPED.value())) {
-					isAllShip = false;
-				}
-			}
-			if(isAllShip) {
-				cust.setStatusShipped(uu);
-				String orid = cust.getOrid();
-				Order orderChange = orderDao.findByOrderid(orid);
-				orderChange.setChangeStatus(Status.SHIPPED.value());
-				orderDao.save(orderChange);
-				changeFCustDao.save(cust);
-			}
-		}else {
-			// 2、改写订单状态
-			boolean received = true;
-			Set<OrderDetail> orderDetails = order.getOrderDetails();
-			for (OrderDetail orderDetail : orderDetails) {
-				if((orderDetail.getStatus().intValue() != Status.SHIPPED.value())
-						&&(orderDetail.getStatus().intValue() != Status.UNAVAILABLE_DISAGREE.value())
-						&&(orderDetail.getStatus().intValue() != Status.UNAVAILABLE_PERSONAL.value())
-						&&(orderDetail.getStatus().intValue() != Status.TOBEREFUNDED.value())) {
-					received = false;
-				}
-			}
-			if(received) {//如果不存在待出货的状态,就设置主表的状态为已出货
-				order.setStatusShipped(uu);
-			}
-			orderDao.save(order);
-			received = true;
-			for (PurchaseDetail detail : purchase.getPurchaseDetails()) {
-				Integer status = detail.getStatus();
-				Set<Integer> statuses = new HashSet<Integer>();
-				statuses.add(Status.RECEIVED.value());
-				statuses.add(Status.UNAVAILABLE_DISAGREE.value());
-				statuses.add(Status.UNAVAILABLE_PERSONAL.value());
-				statuses.add(Status.TOBEREFUNDED.value());
-				if(!statuses.contains(status)) {
-					received = false;
-				}
-			}
-			if(received) {
-				purchase.setStatusReceived(uu);
-			}
-			purchaseDao.save(purchase);
-		}
-
-		// 3、改写供应商出货单状态
-		invoice.setStatusReceived(uu);
-		Set<InvoiceDetail> invoiceDetails = invoice.getInvoiceDetails();
-		for (InvoiceDetail invoiceDetail : invoiceDetails) {
-			invoiceDetail.setStatus(Status.RECEIVED.value());
-		}
-		invoice.setStatusToReceiveMoney(uu);
-		invoiceDao.save(invoice);
-		return "success";
-	}
-
-	@Override
-	public Page<Invoice> findPageByStatus(final PageInfo pageInfo, String keyword) {
-		return invoiceDao.findAll(new Specification<Invoice>() {
-			public Predicate toPredicate(Root<Invoice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	@Override
-	public Page<Invoice> findPageBusiness(final PageInfo info, String keyword, String status) {
-		if (status.indexOf("-") != -1) {
-			String[] statuses = status.split("-");
-			SimpleExpression[] expressions = new SimpleExpression[statuses.length];
-			for (int i = 0; i < statuses.length; i++) {
-				String s = statuses[i];
-				expressions[i] = PredicateUtils.eq("status", Short.parseShort(s), false);
-			}
-			info.expression(PredicateUtils.or(expressions));
-			info.getFilters().remove("status");
-		} else {
-			info.filter("status", Short.parseShort(status));
-		}
-		if (StringUtils.hasText(keyword)) {
-			info.filter("invoiceid", keyword);
-		}
-		return invoiceDao.findAll(new Specification<Invoice>() {
-			public Predicate toPredicate(Root<Invoice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				query.where(info.getPredicates(root, query, builder));
-				return null;
-			}
-		}, info);
-	}
-
-	@Override
-	public String sendForVendor(List<Invoice> invoices) {
-		for (Invoice invoice : invoices) {
-			if(invoice == null) {
-				throw new IllegalOperatorException("提交的数据有误,请刷新界面重新操作");
-			}
-			if (!invoice.getStatus().equals(Status.TOBESHIPPED.value())) {
-				throw new IllegalOperatorException("出货单"+invoice.getInvoiceid()+"状态是"+Status.valueOf(invoice.getStatus()).getPhrase()+",不为待出货,不能做出货操作!");
-			}
-			for (InvoiceDetail detail : invoice.getInvoiceDetails()) {
-				detail.setInvoice(invoice);
-				detail.setStatus(Status.INBOUND.value());
-			}
-			Long uu = SystemSession.getUser().getUserUU();
-			invoice.setStatusInBound(uu);
-			// 1 关联的来源单据状态 TODO 如果以后使用共表,这里需要判断来源表属于那张表
-			ChangeFB2c b2c = changeFB2cDao.findByChangeid(invoice.getSourceid());
-			Set<ChangeFB2cDetail> changeDetails = b2c.getChangeDetails();
-			for (ChangeFB2cDetail changeFB2cDetail : changeDetails) {
-				if(changeFB2cDetail.getStatus().intValue() == Status.TOBESHIPPED.value()) {
-					changeFB2cDetail.setStatus(Status.INBOUND.value());
-				}
-			}
-			b2c.setStatusInbound(uu);
-			Purchase purchase = purchaseDao.findByPurchaseid(b2c.getPuid());
-			if(purchase == null) {
-				throw new IllegalOperatorException("对应的采购单信息丢失");
-			};
-			purchase.setExchangeStatusFromBuyer(Status.INBOUND.value());
-			purchase.setSecondDeliveryTime(new Date());
-			purchaseDao.save(purchase);
-			b2c.setLogistics(invoice.getLogistics());
-			invoiceDao.save(invoice);
-			changeFB2cDao.save(b2c);
-		}
-		return "success";
-	}
-
-	@Override
-	public Page<Invoice> findAdminInFch(final PageInfo pageInfo, String keyword, String status) {
-		if (status.indexOf("-") != -1) {
-			String[] statuses = status.split("-");
-			SimpleExpression[] expressions = new SimpleExpression[statuses.length];
-			for (int i = 0; i < statuses.length; i++) {
-				String s = statuses[i];
-				expressions[i] = PredicateUtils.eq("status", Short.parseShort(s), false);
-			}
-			pageInfo.expression(PredicateUtils.or(expressions));
-		} else {
-			pageInfo.filter("status", Short.parseShort(status));
-		}
-		if (StringUtils.hasText(keyword)) {
-			pageInfo.filter("invoiceid", keyword);
-		}
-		return invoiceDao.findAll(new Specification<Invoice>() {
-			public Predicate toPredicate(Root<Invoice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	@Override
-	public Page<Invoice> findAdminInFpuToB2c(final PageInfo pageInfo, String keyword, String status) {
-		if (status.indexOf("-") != -1) {
-			String[] statuses = status.split("-");
-			SimpleExpression[] expressions = new SimpleExpression[statuses.length];
-			for (int i = 0; i < statuses.length; i++) {
-				String s = statuses[i];
-				expressions[i] = PredicateUtils.eq("status", Short.parseShort(s), false);
-			}
-			pageInfo.expression(PredicateUtils.or(expressions));
-		} else {
-			pageInfo.filter("status", Short.parseShort(status));
-		}
-		if (StringUtils.hasText(keyword)) {
-			pageInfo.filter("invoiceid", keyword);
-		}
-		return invoiceDao.findAll(new Specification<Invoice>() {
-			public Predicate toPredicate(Root<Invoice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	@Transactional
-	@Override
-	public String ensureSendToCust(List<Invoice> invoices) {
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd: HH:mm:ss");
-		for (Invoice invoice : invoices) {
-			if(invoice == null) {
-				throw new IllegalOperatorException("信息提交有误,请刷新界面,重新提交");
-			}
-			if (!invoice.getStatus().equals(Status.TOBESHIPPED.value())) {
-				throw new IllegalAccessError("出货单"+ invoice.getInvoiceid()+ "的状态是"+ Status.valueOf(invoice.getStatus()).getPhrase()+",不为待出货状态,不能出货!");
-			}
-			for (InvoiceDetail detail : invoice.getInvoiceDetails()) {
-				detail.setInvoice(invoice);
-				detail.setStatus(Status.INBOUND.value());
-			}
-			Long uu = SystemSession.getUser().getUserUU();
-			invoice.setStatusInBound(uu);
-			ChangeFCust cust = changeFCustDao.findByChangeid(invoice.getSourceid());
-			if (cust == null) {
-				throw new IllegalAccessError("出货单无来源订单,无法出货! ");
-			}
-			if(!cust.getStatus().equals(Status.SENDING.value())) {
-				throw new IllegalOperatorException("订单" + cust.getChangeid() +"的状态是"+ Status.valueOf(cust.getStatus()).getPhrase()+",不能确认发货");
-			}
-			Set<ChangeFCustDetail> changeDetails = cust.getChangeDetails();
-			for (ChangeFCustDetail changeFCustDetail : changeDetails) {
-				changeFCustDetail.setStatus(Status.INBOUND.value());
-			}
-			String orid = cust.getOrid();
-			Order order = orderDao.findByOrderid(orid);
-			order.setDeliverTime(order.getDeliverTime() + "," + sdf.format(new Date()));
-			order.setChangeStatus(Status.INBOUND.value());
-			orderDao.save(order);
-			cust.setStatusInbound(uu);
-			changeFCustDao.save(cust);
-			invoiceDao.save(invoice);
-		}
-		return "suceess";
-	}
-
-	@Override
-	public List<Invoice> findInvoiceByids(String inid) {
-		// 解密一次
-		String invoiceids = StringUtilB2C.decodeValue(inid);
-		String[] arrs = invoiceids.split("-");
-		List<Invoice> invoiceList = new ArrayList<Invoice>();
-		for (String invoiceid : arrs) {
-			Invoice invoice = invoiceDao.findByInvoiceid(invoiceid);
-			invoiceList.add(invoice);
-		}
-		return invoiceList;
-	}
-
-	@Override
-	public Invoice findChangeByInvoiceid(String invoiceid) {
-		return invoiceDao.findByInvoiceid(invoiceid);
-	}
-
-    @Override
-    public Invoice getInvoiceBySourceid(String changeId) {
-        return invoiceDao.getInvoiceBySourceid(changeId);
-    }
-
 }

+ 58 - 63
src/main/java/com/uas/platform/b2c/logistics/service/impl/ReceiptServiceImpl.java

@@ -2,22 +2,19 @@ package com.uas.platform.b2c.logistics.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.trade.aftersale.dao.ChangeFB2cDao;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2c;
+import com.uas.platform.b2c.core.constant.SplitChar;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.utils.NumberUtil;
+import com.uas.platform.b2c.core.utils.StringUtilB2C;
+import com.uas.platform.b2c.fa.settlement.util.SettlementUtil;
 import com.uas.platform.b2c.logistics.dao.ReceiptDao;
 import com.uas.platform.b2c.logistics.model.*;
 import com.uas.platform.b2c.logistics.service.ReceiptDetailService;
 import com.uas.platform.b2c.logistics.service.ReceiptService;
+import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
 import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
-import com.uas.platform.b2c.fa.settlement.util.SettlementUtil;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.constant.SplitChar;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
-import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.EncodingRulesConstant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Status;
@@ -66,9 +63,6 @@ public class ReceiptServiceImpl implements ReceiptService {
 	@Autowired
 	private EnterpriseDao enterpriseDao;
 
-	@Autowired
-	private ChangeFB2cDao changeFB2cDao;
-
 	@Override
 	public Receipt save(Receipt receipt) {
 		Set<ReceiptDetail> reDs = receipt.getReceiptDetails();
@@ -80,57 +74,58 @@ public class ReceiptServiceImpl implements ReceiptService {
 
 	@Override
 	public Receipt createPreceipts(Invoice invoice) {
-		Date date = new Date();
-		Receipt receipt = new Receipt();
-		// 生成入库单号
-		String receiptid = EncodingRulesConstant.RECEIPT_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt", 8));
-		receipt.setReceiptid(receiptid);
-		Set<ReceiptDetail> receiptdetais = new HashSet<>();
-		// 给明细赋值
-		for (InvoiceDetail puD : invoice.getInvoiceDetails()) {
-			ReceiptDetail reD = new ReceiptDetail();
-			String detailid = EncodingRulesConstant.RECEIPT_DETAIL_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt_detail", 9));
-			reD.setDetailid(detailid);
-			reD.setNumber(puD.getNumber());
-			reD.setUnitprice(puD.getUnitprice());
-			reD.setTax(puD.getTax());
-			reD.setTaxes(puD.getTaxes());
-			reD.setTaxUnitprice(puD.getTaxunitprice());
-			reD.setPrice(puD.getPrice());
-			reD.setDetno(puD.getDetno());
-			reD.setStatus(Status.AVAILABLE.value());
-			reD.setOriginal(puD.getOriginal());
-			// 设来源明细id
-			reD.setSourceid(puD.getDetailid());
-			reD.setReceipt(receipt);
-			receiptdetais.add(reD);
-		}
-		// 给属性赋值
-		ChangeFB2c b2c = changeFB2cDao.findByChangeid(invoice.getSourceid());
-		if (b2c == null) {
-			throw new IllegalOperatorException("此换货出货单对应的换货单不存在,请刷新界面");
-		}
-		Purchase purchase = puDao.findByPurchaseid(b2c.getPuid());
-		if (purchase == null) {
-			throw new IllegalOperatorException("此换货出货单对应的采购单不存在");
-		}
-		receipt.setPurchaseid(purchase.getPurchaseid());
-		receipt.setCreatetime(date);
-		receipt.setJsonAddress(invoice.getJsonSpAddress());
-		receipt.setPrice(invoice.getPrice());
-		// 设来源id
-		receipt.setSourceid(invoice.getInvoiceid());
-		// 记录来源出货单号
-		receipt.setInvoiceid(invoice.getInvoiceid());
-		receipt.setSellerenuu(invoice.getSellerenuu());
-		Long uu = SystemSession.getUser().getUserUU();
-		receipt.setStatusAvailable(uu);
-		receipt.setReceiptDetails(receiptdetais);
-		receipt.setSettlement(Status.NOTSETTLED.value());
-		// 为入库单生成类型
-		receipt.setPiclass(Type.Purc_B2c_Accept_Code.value());
-		receipt.setProofingid(invoice.getProduceid());
-		return receiptDao.save(receipt);
+//		Date date = new Date();
+//		Receipt receipt = new Receipt();
+//		// 生成入库单号
+//		String receiptid = EncodingRulesConstant.RECEIPT_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt", 8));
+//		receipt.setReceiptid(receiptid);
+//		Set<ReceiptDetail> receiptdetais = new HashSet<>();
+//		// 给明细赋值
+//		for (InvoiceDetail puD : invoice.getInvoiceDetails()) {
+//			ReceiptDetail reD = new ReceiptDetail();
+//			String detailid = EncodingRulesConstant.RECEIPT_DETAIL_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt_detail", 9));
+//			reD.setDetailid(detailid);
+//			reD.setNumber(puD.getNumber());
+//			reD.setUnitprice(puD.getUnitprice());
+//			reD.setTax(puD.getTax());
+//			reD.setTaxes(puD.getTaxes());
+//			reD.setTaxUnitprice(puD.getTaxunitprice());
+//			reD.setPrice(puD.getPrice());
+//			reD.setDetno(puD.getDetno());
+//			reD.setStatus(Status.AVAILABLE.value());
+//			reD.setOriginal(puD.getOriginal());
+//			// 设来源明细id
+//			reD.setSourceid(puD.getDetailid());
+//			reD.setReceipt(receipt);
+//			receiptdetais.add(reD);
+//		}
+//		// 给属性赋值
+//		ChangeFB2c b2c = changeFB2cDao.findByChangeid(invoice.getSourceid());
+//		if (b2c == null) {
+//			throw new IllegalOperatorException("此换货出货单对应的换货单不存在,请刷新界面");
+//		}
+//		Purchase purchase = puDao.findByPurchaseid(b2c.getPuid());
+//		if (purchase == null) {
+//			throw new IllegalOperatorException("此换货出货单对应的采购单不存在");
+//		}
+//		receipt.setPurchaseid(purchase.getPurchaseid());
+//		receipt.setCreatetime(date);
+//		receipt.setJsonAddress(invoice.getJsonSpAddress());
+//		receipt.setPrice(invoice.getPrice());
+//		// 设来源id
+//		receipt.setSourceid(invoice.getInvoiceid());
+//		// 记录来源出货单号
+//		receipt.setInvoiceid(invoice.getInvoiceid());
+//		receipt.setSellerenuu(invoice.getSellerenuu());
+//		Long uu = SystemSession.getUser().getUserUU();
+//		receipt.setStatusAvailable(uu);
+//		receipt.setReceiptDetails(receiptdetais);
+//		receipt.setSettlement(Status.NOTSETTLED.value());
+//		// 为入库单生成类型
+//		receipt.setPiclass(Type.Purc_B2c_Accept_Code.value());
+//		receipt.setProofingid(invoice.getProduceid());
+//		return receiptDao.save(receipt);
+		return null;
 	}
 
 	@Override

+ 0 - 19
src/main/java/com/uas/platform/b2c/trade/aftersale/Readme.md

@@ -1,19 +0,0 @@
-## name
-
-aftersale
-
-## 名称
-
-售后模块
-
-## 创建人
-
-huxz
-
-## 创建时间
-
-2017年7月31日19:25:25
-
-## 说明
-
-退货、换货

+ 0 - 321
src/main/java/com/uas/platform/b2c/trade/aftersale/controller/ChangeController.java

@@ -1,321 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.controller;
-
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2CSimpleInfo;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2c;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFCust;
-import com.uas.platform.b2c.trade.aftersale.service.ChangeService;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.core.logging.BufferedLoggerManager;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.model.Status;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * 换货单(包括客户和平台两种)
- *
- * @author aof
- * @version 2016-03-09 08:34:31 创建文件
- */
-@RestController
-@RequestMapping("/trade/change")
-public class ChangeController {
-	
-	private final ChangeService changeService;
-	
-	private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
-
-	@Autowired
-	public ChangeController(ChangeService changeService) {
-		this.changeService = changeService;
-	}
-
-
-	/**
-	 * 客户确认换货
-	 *
-	 * @param json the json
-	 * @return the string
-	 */
-	@RequestMapping(value = "/ensurechange", method = RequestMethod.POST)
-	public String ensureChange(@RequestBody String json) {
-		Order order = FastjsonUtils.fromJson(json, Order.class);
-		ChangeFCust ensureChange = changeService.ensureChange(order);
-		assert logger != null;
-		logger.log("换货信息管理", "客户确认换货", "客户确认换货,换货单号:" +ensureChange.getChangeid() + ",操作人:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
-		return "success";
-	}
-
-	/**
-	 * 审核客户换货单
-	 *
-	 * @param json the json
-	 * @return the string
-	 */
-	@RequestMapping(value = "/admin/audit", method = RequestMethod.POST)
-	public String auditReturn(@RequestBody String json) {
-		Long changeid = Long.valueOf(FastjsonUtils.parseObject(json).get("changeid").toString());
-		boolean boo = (boolean) FastjsonUtils.parseObject(json).get("boo");
-		assert logger != null;
-		logger.log("换货信息管理", "管理平台审核客户换货单", "管理平台审核 id为" +changeid + "的换货单,是否通过" + boo + ",操作人:"+ SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
-		return changeService.auditChange(changeid, boo);
-	}
-
-	/**
-	 * 查看申请中(客户查看)
-	 *
-	 * @return the ones unaudit
-	 */
-	@RequestMapping(value = "/ones/unaudit", method = RequestMethod.GET)
-	public List<ChangeFCust> getOnesUnaudit() {
-		assert logger != null;
-		logger.log("换货信息管理", "查看申请的换货单信息");
-		return changeService.findByStatus(Status.UNAUDIT.value());
-	}
-
-	/**
-	 * 查看待回寄(客户查看)
-	 *
-	 * @return the ones tobeshippedback
-	 */
-	@RequestMapping(value = "/ones/tobeshippedback", method = RequestMethod.GET)
-	public List<ChangeFCust> getOnesTobeshippedback() {
-		assert logger != null;
-		logger.log("换货信息管理", "查看待回寄的换货单");
-		return changeService.findByStatus(Status.TOBESHIPPEDBACK.value());
-	}
-
-	/**
-	 * 客户发换货单
-	 *
-	 * @param json the json
-	 * @return the string
-	 */
-	@RequestMapping(value = "/ones/sendchange", method = RequestMethod.POST)
-	public String sendChange(@RequestBody String json) {
-		ChangeFCust cust = FastjsonUtils.fromJson(json, ChangeFCust.class);
-		assert logger != null;
-		logger.log("换货信息管理", "客户回寄发货单", "用户回寄" + cust.getChangeid() + "的发货单, 操作人:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
-		return changeService.sendChange(cust);
-	}
-
-	/**
-	 * 平台向供应商发货(批量)
-	 *
-	 * @param json the json
-	 * @return the string
-	 */
-	@RequestMapping(value = "/batchSendForVender", method = RequestMethod.POST)
-	public String batchSendForVender(@RequestBody String json) {	
-		List<ChangeFB2c> b2cs = FastjsonUtils.fromJsonArray(json, ChangeFB2c.class);
-		String changeIds = "";
-		for (ChangeFB2c changeFB2c : b2cs) {
-			changeIds += changeFB2c.getChangeid();
-		}
-		assert logger != null;
-		logger.log("换货信息管理", "平台向供应商发货" , "平台向供应商批量发换货单:" + changeIds.substring(0, changeIds.length()-1) + ",操作人:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
-		return changeService.batchSendForVender(b2cs);
-	}
-
-	/**
-	 * 供应商确认收货
-	 *
-	 * @param changeid the changeid
-	 * @return the string
-	 */
-	@RequestMapping(value = "/venderaccept/{changeid}", method = RequestMethod.PUT)
-	public String venderAccept(@PathVariable Long changeid) {
-		assert logger != null;
-		logger.log("换货信息管理", "供应商确认收货", "供应商确认收货id=" + changeid + ", 操作人:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
-		return changeService.venderAccept(changeid);
-	}
-
-	/**
-	 * 供应商根据采购单确认收退换货
-	 *
-	 * @param purchaseId the purchase id
-	 * @return the string
-	 */
-	@RequestMapping(value = "/venderAcceptByPurchase/{purchaseId}", method = RequestMethod.GET)
-	public String venderAcceptByPurchase(@PathVariable String purchaseId) {
-		assert logger != null;
-		logger.log("换货信息管理", "供应商确认收货", "供应商确认收货的采购单编号purchaseId=" + purchaseId + ", 操作人:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
-		return changeService.venderAccept(purchaseId);
-	}
-
-	/**
-	 * 判断是否有换货单
-	 *
-	 * @return the model map
-	 */
-	@RequestMapping(value = "/haschanges", method = RequestMethod.GET)
-	public ModelMap hasChanges() {
-		return changeService.hasChanges();
-	}
-
-	/**
-	 * 客户换货单转出货
-	 *
-	 * @param changeid 客户换货单ID
-	 * @return the string
-	 */
-	@RequestMapping(value = "/create/{changeid}", method = RequestMethod.PUT)
-	public String send(@PathVariable Long changeid) {
-		assert logger != null;
-		logger.log("换货信息管理", "客户换货单转出货", "客户换货单转出货id=" + changeid + ",操作人:" + SystemSession.getUser().getUserUU() + "-"+SystemSession.getUser().getUserName());
-		return changeService.createInvoiceB2cChange(changeid);
-	}
-
-	/**
-	 * 客户确认收货(收到平台出货单)
-	 *
-	 * @param changeid the changeid
-	 * @return the string
-	 */
-	@RequestMapping(value = "/ones/ensureaccept/{changeid}", method = RequestMethod.PUT)
-	public String onesEnsureAccept(@PathVariable Long changeid) {
-		assert logger != null;
-		logger.log("换货信息管理", "客户确认收货(收到平台出货单)", "客户确认收货(收到平台出货单) id=" + changeid + ",操作人:" + SystemSession.getUser().getUserUU() + "-"+ SystemSession.getUser().getUserName());
-		return changeService.onesEnsureAccept(changeid);
-	}
-
-	/**
-	 * 根据状态买家查看订单
-	 *
-	 * @param params  the params
-	 * @param keyword the keyword
-	 * @param status  the status
-	 * @return the page
-	 */
-	@RequestMapping(value = "/individual", method = RequestMethod.GET)
-	public Page<ChangeFCust> findIndividualChanges(PageParams params, String keyword, String status) {
-		assert logger != null;
-		logger.log("换货信息管理", "用户查看客户换货单");
-		PageInfo pageInfo = new PageInfo(params);
-		pageInfo.filter("buyeruu", SystemSession.getUser().getUserUU());
-		pageInfo.filter("buyerenuu", SystemSession.getUser().getEnterprise().getUu());
-		return changeService.findIndividualChanges(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 平台根据状态查看订单
-	 *
-	 * @param params  the params
-	 * @param keyword the keyword
-	 * @param status  the status
-	 * @return the page
-	 */
-	@RequestMapping(value = "b2c/individualfcust", method = RequestMethod.GET)
-	public Page<ChangeFCust> findIndividualFcust(PageParams params, String keyword, String status) {
-		assert logger != null;
-		logger.log("换货信息管理", "平台查看客户换货单");
-		PageInfo pageInfo = new PageInfo(params);
-		return changeService.findIndividualChanges(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 平台根据状态查看订单
-	 *
-	 * @param params  the params
-	 * @param keyword the keyword
-	 * @param status  the status
-	 * @return the page
-	 */
-	@RequestMapping(value = "b2c/individualfb2c", method = RequestMethod.GET)
-	public Page<ChangeFB2c> findIndividualFb2c(PageParams params, String keyword, String status) {
-		assert logger != null;
-		logger.log("换货信息管理", "平台查看平台换货单");
-		PageInfo pageInfo = new PageInfo(params);
-		return changeService.findIndividualVender(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 供应商根据状态查看订单
-	 *
-	 * @param params   the params
-	 * @param keyword  the keyword
-	 * @param status   the status
-	 * @param isVender the is vender
-	 * @return the page
-	 */
-	@RequestMapping(value = "enterprise/individual", method = RequestMethod.GET)
-	public Page<ChangeFB2c> findIndividualVender(PageParams params, String keyword, String status, boolean isVender) {
-		assert logger != null;
-		logger.log("换货信息管理", "供应商查看不同状态的换货单");
-		PageInfo pageInfo = new PageInfo(params);
-		if (isVender) {
-			pageInfo.filter("sellerenuu", SystemSession.getUser().getEnterprise().getUu());
-		} else {
-			pageInfo.filter("buyeruu", SystemSession.getUser().getUserUU());
-		}
-		return changeService.findIndividualVender(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 根据订单号查询某个换货单
-	 *
-	 * @param changeid 客户换货单单据号
-	 * @return the change f cust
-	 */
-	@RequestMapping(value = "/findOne/{changeid}", method = RequestMethod.GET)
-	public ChangeFCust findByChangeId(@PathVariable String changeid) {
-		assert logger != null;
-		logger.log("换货信息管理", "查询流水号=" + changeid +"的客户换货单");
-		return changeService.findFCByChangeId(StringUtilB2C.decodeValue(changeid));
-	}
-
-	/**
-	 * 根据订单号获取 验货中 换货单(供应商)
-	 *
-	 * @param changeid 客户换货单单据号
-	 * @return the inspecting by change id with enterprise
-	 */
-	@RequestMapping(value = "/enterprise/{changeid}", method = RequestMethod.GET)
-	public ChangeFB2CSimpleInfo getInspectingByChangeIdWithEnterprise(@PathVariable String changeid) {
-		changeid = StringUtilB2C.decodeValue(changeid);
-		assert logger != null;
-		logger.log("换货信息管理", "根据订单号获取 验货中 换货单(供应商)流水号:" + changeid);
-		return changeService.findByChangeidAndSellenuu(changeid);
-	}
-
-	/**
-	 * 根据换货单号获取单张客户换货单(平台)
-	 *
-	 * @param changeid 客户换货单单据号
-	 * @return the fc by change id admin
-	 */
-	@RequestMapping(value = "/cust/admin/{changeid}", method = RequestMethod.GET)
-	public ChangeFCust getFCByChangeIdAdmin(@PathVariable String changeid) {	
-		changeid = StringUtilB2C.decodeValue(changeid);
-		assert logger != null;
-		logger.log("换货信息管理", "平台查看流水单号:" + changeid);
-		return changeService.findFCByChangeId(changeid);
-	}
-
-	/**
-	 * 根据换货单号获取单张平台换货单(平台)
-	 *
-	 * @param changeid 平台换货单单据号
-	 * @return the fb 2 c by change id admin
-	 */
-	@RequestMapping(value = "/b2c/admin/{changeid}", method = RequestMethod.GET)
-	public ChangeFB2c getFB2CByChangeIdAdmin(@PathVariable String changeid) {	
-		changeid = StringUtilB2C.decodeValue(changeid);
-		assert logger != null;
-		logger.log("换货信息管理", "根据换货单号获取单张平台换货单  流水号:" + changeid);
-		return changeService.findB2CByChangeId(changeid);
-	}
-}

+ 0 - 285
src/main/java/com/uas/platform/b2c/trade/aftersale/controller/ReturnController.java

@@ -1,285 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2c;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2cSimpleInfo;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
-import com.uas.platform.b2c.trade.aftersale.service.ReturnService;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.model.Status;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 退货单(包括客户和平台两种)
- *
- * @author aof
- * @version 2016-03-07 07:00:16 创建文件
- */
-@RestController
-@RequestMapping("/trade/return")
-public class ReturnController {
-
-	@Autowired
-	private ReturnService returnService;
-
-	/**
-	 * 审核客户退货单
-	 *
-	 * @param json   the json
-	 * @param result the result
-	 * @return the return f cust
-	 */
-	@RequestMapping(value = "/admin/audit/{result}", method = RequestMethod.POST)
-	public ReturnFCust auditReturn(@RequestBody String json, @PathVariable Long result) {
-		JSONObject object = FastjsonUtils.parseObject(json);
-		Long id = null;
-		if(object.get("id") != null) {
-			id = Long.valueOf(object.get("id").toString());
-		}
-		return returnService.auditReturn(id, result);
-	}
-
-	/**
-	 * 客户确认退货
-	 *
-	 * @param json the json
-	 * @return the return f cust
-	 */
-	@RequestMapping(value = "/ensurereturn", method = RequestMethod.POST)
-	public ReturnFCust ensureReturn(@RequestBody String json) {
-		return returnService.ensureReturn(FastjsonUtils.fromJson(json, Order.class));
-	}
-
-	/**
-	 * b2c管理者统一查询接口(ReturnFCust)
-	 *
-	 * @param params  the params
-	 * @param keyword the keyword
-	 * @param status  the status
-	 * @return the individual cust
-	 */
-	@RequestMapping(value = "/b2c/individualCust", method = RequestMethod.GET)
-	public Page<ReturnFCust> getIndividualCust(PageParams params, String keyword, String status) {
-		PageInfo pageInfo = new PageInfo(params);
-		return returnService.findIndividualReturns(pageInfo, keyword, status);
-	}
-
-	/**
-	 * b2c管理者统一查询接口(ReturnFB2c)
-	 *
-	 * @param params  the params
-	 * @param keyword the keyword
-	 * @param status  the status
-	 * @return the individual
-	 */
-	@RequestMapping(value = "/b2c/individual", method = RequestMethod.GET)
-	public Page<ReturnFB2c> getIndividual(PageParams params, String keyword, String status) {
-		PageInfo pageInfo = new PageInfo(params);
-		return returnService.findIndividualVender(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 管理平台查看单平台退货单
-	 *
-	 * @param returnid the returnid
-	 * @return fb 2 c admin
-	 */
-	@RequestMapping(value = "/b2c/admin/{returnid}", method = RequestMethod.GET)
-	public ReturnFB2c getFB2CAdmin(@PathVariable("returnid") String returnid) {
-		returnid = StringUtilB2C.decodeValue(returnid);
-		return returnService.findB2CByReturnid(returnid);
-	}
-
-	/**
-	 * 查看申请中(客户查看)
-	 *
-	 * @return the ones unaudit
-	 */
-	@RequestMapping(value = "/ones/unaudit", method = RequestMethod.GET)
-	public List<ReturnFCust> getOnesUnaudit() {
-		return returnService.findByStatus(Status.UNAUDIT.value());
-	}
-
-	/**
-	 * 查看待回寄(客户查看)
-	 *
-	 * @return the ones tobeshippedback
-	 */
-	@RequestMapping(value = "/ones/tobeshippedback", method = RequestMethod.GET)
-	public List<ReturnFCust> getOnesTobeshippedback() {
-		return returnService.findByStatus(Status.TOBESHIPPEDBACK.value());
-	}
-
-	/**
-	 * 查看待退款(客户查看)
-	 *
-	 * @return the ones toreceivemoney
-	 */
-	@RequestMapping(value = "/ones/toreceivemoney", method = RequestMethod.GET)
-	public List<ReturnFCust> getOnesToreceivemoney() {
-		// 这里待退款包括 验货中 已验货 待退款三个状态
-		List<Integer> statues = new ArrayList<Integer>();
-		statues.add(Status.INSPECTING.value());
-		statues.add(Status.INSPECTED.value());
-		statues.add(Status.TORECEIVEMONEY.value());
-		return returnService.findOnesByStatuses(statues);
-	}
-
-	/**
-	 * 查看已退款(客户查看)
-	 *
-	 * @return the ones moneyreceived
-	 */
-	@RequestMapping(value = "/ones/moneyreceived", method = RequestMethod.GET)
-	public List<ReturnFCust> getOnesMoneyreceived() {
-		return returnService.findByStatus(Status.MONEYRECEIVED.value());
-	}
-
-	/**
-	 * 客户发退货单
-	 *
-	 * @param json the json
-	 * @return the return f cust
-	 */
-	@RequestMapping(value = "/ones/sendreturn", method = RequestMethod.POST)
-	public ReturnFCust sendReturn(@RequestBody String json) {
-		return returnService.sendReturn(FastjsonUtils.fromJson(json, ReturnFCust.class));
-	}
-
-	/**
-	 * 平台向供应商发货
-	 *
-	 * @param json the json
-	 * @return the string
-	 */
-	@RequestMapping(value = "/batchSendForVender", method = RequestMethod.POST)
-	public String batchSendForVender(@RequestBody String json) {
-		List<ReturnFB2c> b2cs = FastjsonUtils.fromJsonArray(json, ReturnFB2c.class);
-		return returnService.batchSendForVender(b2cs);
-	}
-
-	/**
-	 * 根据采购单号获取采购单号与退货单的关联映射
-	 *
-	 * @param puids the puids
-	 * @return return by purchase ids
-	 */
-	@RequestMapping(value = "/getReturnByPurchaseIds", method = RequestMethod.GET)
-	public Map<String, ReturnFB2c> getReturnByPurchaseIds(String[] puids) {
-		//logger.log("退货", "获取采购单关联的退货单信息", purchaseIds);
-		return returnService.getReturnByPurchaseIds(puids);
-	}
-
-	/**
-	 * 供应商确认收货
-	 *
-	 * @param returnid the returnid
-	 * @return the return fb 2 c
-	 */
-	@RequestMapping(value = "/venderaccept/{returnid}", method = RequestMethod.PUT)
-	public ReturnFB2c venderAccept(@PathVariable Long returnid) {
-		return returnService.venderAccept(returnid);
-	}
-
-	/**
-	 * 确认退款
-	 *
-	 * @param returnid the returnid
-	 * @return the return f cust
-	 */
-	@RequestMapping(value = "/ensurepaid/{returnid}", method = RequestMethod.PUT)
-	public ReturnFCust ensurePaid(@PathVariable Long returnid) {
-		return returnService.ensurePaid(returnid);
-	}
-
-	/**
-	 * 判断是否有退货单
-	 *
-	 * @return the model map
-	 */
-	@RequestMapping(value = "/hasreturns", method = RequestMethod.GET)
-	public ModelMap hasReturns() {
-		return returnService.hasReturns();
-	}
-
-	/**
-	 * 根据状态买家查看订单
-	 *
-	 * @param params   the params
-	 * @param keyword  the keyword
-	 * @param status   the status
-	 * @param isVender the is vender
-	 * @return page
-	 */
-	@RequestMapping(value = "/individual", method = RequestMethod.GET)
-	public Page<ReturnFCust> findIndividualReturns(PageParams params, String keyword, String status, boolean isVender) {
-		PageInfo pageInfo = new PageInfo(params);
-		if (isVender == true) {
-			pageInfo.filter("sellerenuu", SystemSession.getUser().getEnterprise().getUu());
-		} else {
-			pageInfo.filter("buyeruu", SystemSession.getUser().getUserUU());
-			pageInfo.filter("buyerenuu", SystemSession.getUser().getEnterprise().getUu());
-		}
-		return returnService.findIndividualReturns(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 供应商根据状态查看订单
-	 *
-	 * @param params   the params
-	 * @param keyword  the keyword
-	 * @param status   the status
-	 * @param isVender the is vender
-	 * @return page
-	 */
-	@RequestMapping(value = "vender/individual", method = RequestMethod.GET)
-	public Page<ReturnFB2c> findIndividualVender(PageParams params, String keyword, String status, boolean isVender) {
-		PageInfo pageInfo = new PageInfo(params);
-		if (isVender == true) {
-			pageInfo.filter("sellerenuu", SystemSession.getUser().getEnterprise().getUu());
-		} else {
-			pageInfo.filter("buyeruu", SystemSession.getUser().getUserUU());
-		}
-		return returnService.findIndividualVender(pageInfo, keyword, status);
-	}
-
-	/**
-	 * 根据订单号查询某个退货单
-	 *
-	 * @param returnid the returnid
-	 * @return return f cust
-	 */
-	@RequestMapping(value = "/findOne/{returnid}", method = RequestMethod.GET)
-	public ReturnFCust findByReturnId(@PathVariable String returnid) {
-		return returnService.findByReturnId(StringUtilB2C.decodeValue(returnid));
-	}
-
-	/**
-	 * 根据订单号查询某个退货单(供应商)
-	 *
-	 * @param returnid the returnid
-	 * @return by returnid and sellerenuu
-	 */
-	@RequestMapping(value = "/enterprise/{returnid}", method = RequestMethod.GET)
-	public ReturnFB2cSimpleInfo getByReturnidAndSellerenuu(@PathVariable String returnid) {
-		returnid = StringUtilB2C.decodeValue(returnid);
-		return returnService.findByReturnidAndSellerenuu(returnid);
-	}
-
-}

+ 0 - 41
src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ChangeFB2cDao.java

@@ -1,41 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.dao;
-
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2c;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * The interface Change fb 2 c dao.
- *
- * @author aof
- * @version 2017-08-02 16:52:14 创建文件
- */
-@Repository
-public interface ChangeFB2cDao extends JpaSpecificationExecutor<ChangeFB2c>, JpaRepository<ChangeFB2c, Long>{
-
-	/**
-	 * 根据订单号查找换货单
-	 *
-	 * @param changeid the changeid
-	 * @return the change fb 2 c
-	 */
-	ChangeFB2c findByChangeid(String changeid);
-
-	/**
-	 * 根据采购单ID查询换货单
-	 *
-	 * @param puid 采购单ID
-	 * @return the change fb 2 c
-	 */
-	ChangeFB2c findByPuid(String puid);
-
-	/**
-	 * 根据换货单号和供应商uu查找换货单
-	 *
-	 * @param changeid   the changeid
-	 * @param sellerenuu the sellerenuu
-	 * @return the change fb 2 c
-	 */
-	ChangeFB2c findByChangeidAndSellerenuu(String changeid, Long sellerenuu);
-}

+ 0 - 42
src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ChangeFCustDao.java

@@ -1,42 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.dao;
-
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFCust;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * The interface Change f cust dao.
- *
- * @author aof
- * @version 2017-08-02 16:52:41 创建文件
- */
-@Repository
-public interface ChangeFCustDao extends JpaSpecificationExecutor<ChangeFCust>, JpaRepository<ChangeFCust, Long>{
-
-	/**
-	 * Find by status list.
-	 *
-	 * @param status the status
-	 * @return the list
-	 */
-	List<ChangeFCust> findByStatus(Integer status);
-
-	/**
-	 * Find by buyeruu list.
-	 *
-	 * @param buyeruu the buyeruu
-	 * @return the list
-	 */
-	List<ChangeFCust> findByBuyeruu(Long buyeruu);
-
-	/**
-	 * 通过订单号查询
-	 *
-	 * @param changeid the changeid
-	 * @return change f cust
-	 */
-	ChangeFCust findByChangeid(String changeid);
-}

+ 0 - 24
src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ChangeFCustDetailDao.java

@@ -1,24 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.dao;
-
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFCustDetail;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * The interface Change f cust detail dao.
- *
- * @author yujia
- * @version 2016-09-02 14:58:53 创建文件
- */
-@Repository
-public interface ChangeFCustDetailDao extends JpaSpecificationExecutor<ChangeFCustDetail>, JpaRepository<ChangeFCustDetail, Long> {
-
-	/**
-	 * Find by detailid change f cust detail.
-	 *
-	 * @param detailid the detailid
-	 * @return the change f cust detail
-	 */
-	ChangeFCustDetail findByDetailid(String detailid);
-}

+ 0 - 41
src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ReturnFB2cDao.java

@@ -1,41 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.dao;
-
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2c;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * The interface Return fb 2 c dao.
- *
- * @author aof
- * @version 2017-08-02 16:54:17 创建文件
- */
-@Repository
-public interface ReturnFB2cDao extends JpaSpecificationExecutor<ReturnFB2c>, JpaRepository<ReturnFB2c, Long> {
-
-	/**
-	 * 根据退货单号和供应商uu获取退货单
-	 *
-	 * @param returnid   the returnid
-	 * @param sellerenuu the sellerenuu
-	 * @return return fb 2 c
-	 */
-	ReturnFB2c findByReturnidAndSellerenuu(String returnid, Long sellerenuu);
-
-	/**
-	 * 根据退货单号获取平台退货单
-	 *
-	 * @param returnid the returnid
-	 * @return return fb 2 c
-	 */
-	ReturnFB2c findByReturnid(String returnid);
-
-	/**
-	 * 根据采购单号获取退货单
-	 *
-	 * @param puid the puid
-	 * @return return fb 2 c
-	 */
-	ReturnFB2c findByPuid(String puid);
-}

+ 0 - 42
src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ReturnFCustDao.java

@@ -1,42 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.dao;
-
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * The interface Return f cust dao.
- *
- * @author aof
- * @version 2017-08-02 16:54:37 创建文件
- */
-@Repository
-public interface ReturnFCustDao extends JpaSpecificationExecutor<ReturnFCust>, JpaRepository<ReturnFCust, Long>{
-
-	/**
-	 * Find by status list.
-	 *
-	 * @param status the status
-	 * @return the list
-	 */
-	List<ReturnFCust> findByStatus(Integer status);
-
-	/**
-	 * Find by buyeruu list.
-	 *
-	 * @param buyeruu the buyeruu
-	 * @return the list
-	 */
-	List<ReturnFCust> findByBuyeruu(Long buyeruu);
-
-	/**
-	 * Find by returnid return f cust.
-	 *
-	 * @param returnid the returnid
-	 * @return the return f cust
-	 */
-	ReturnFCust findByReturnid(String returnid);
-}

+ 0 - 22
src/main/java/com/uas/platform/b2c/trade/aftersale/dao/ReturnFCustDetailDao.java

@@ -1,22 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.dao;
-
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCustDetail;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-
-/**
- * The interface Return f cust detail dao.
- *
- * @author yujia
- * @version 2016-08-31 21:36:22  创建文件
- */
-public interface ReturnFCustDetailDao extends JpaSpecificationExecutor<ReturnFCustDetail>, JpaRepository<ReturnFCustDetail, Long>{
-
-	/**
-	 * Find by detailid return f cust detail.
-	 *
-	 * @param detailid the detailid
-	 * @return the return f cust detail
-	 */
-	ReturnFCustDetail findByDetailid(String detailid);
-}

+ 0 - 77
src/main/java/com/uas/platform/b2c/trade/aftersale/model/AfterSaleStatus.java

@@ -1,77 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-/**
- * 售后申请状态:
- * 买家到商城
- * 商城到供应商
- * 供应商到商城
- * 商城到买家
- * 取消
- * 完成
- *
- * @author aof
- * @version 2017-08-02 16:55:42 创建文件
- */
-public enum AfterSaleStatus {
-	/**
-	 * The Buyer to mall.
-	 */
-	BUYER_TO_MALL {
-        @Override
-        public AfterSaleStatus nextStatus() {
-            return MALL_TO_SUP;
-        }
-    },
-	/**
-	 * The Mall to sup.
-	 */
-	MALL_TO_SUP {
-        @Override
-        public AfterSaleStatus nextStatus() {
-            return SUP_TO_MALL;
-        }
-    },
-	/**
-	 * The Sup to mall.
-	 */
-	SUP_TO_MALL {
-        @Override
-        public AfterSaleStatus nextStatus() {
-            return MALL_TO_BUYER;
-        }
-    },
-	/**
-	 * The Mall to buyer.
-	 */
-	MALL_TO_BUYER {
-        @Override
-        public AfterSaleStatus nextStatus() {
-            return BUYER_TO_MALL;
-        }
-    },
-	/**
-	 * The Canceled.
-	 */
-	CANCELED {
-        @Override
-        public AfterSaleStatus nextStatus() {
-            return null;
-        }
-    },
-	/**
-	 * The Finished.
-	 */
-	FINISHED {
-        @Override
-        public AfterSaleStatus nextStatus() {
-            return null;
-        }
-    };
-
-	/**
-	 * 获取当前状态的下一个状态
-	 *
-	 * @return after sale status
-	 */
-	public abstract AfterSaleStatus nextStatus();
-}

+ 0 - 29
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ApplyType.java

@@ -1,29 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-/**
- * 申请类型:取消购买、退货、换货、退款、拒绝、缺货取消
- *
- * @author aof
- * @version 2017-08-02 16:56:44 创建文件
- */
-public enum ApplyType {
-	/**
-	 * Cancel buy apply type.
-	 */
-	CANCEL_BUY, /**
-	 * Return apply type.
-	 */
-	RETURN, /**
-	 * Exchange apply type.
-	 */
-	EXCHANGE, /**
-	 * Refund apply type.
-	 */
-	REFUND, /**
-	 * Refuse apply type.
-	 */
-	REFUSE, /**
-	 * Stock out apply type.
-	 */
-	STOCK_OUT
-}

+ 0 - 390
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFB2CSimpleInfo.java

@@ -1,390 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.uas.platform.b2c.logistics.model.Logistics;
-import com.uas.platform.b2c.trade.order.model.Document;
-
-import javax.persistence.Column;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * 简要平台换货单(供应商)
- *
- * @author wangyc
- * @version 2017-08-02 16:59:21 创建文件
- */
-public class ChangeFB2CSimpleInfo extends Document implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	private Long id;
-
-	/**
-	 * 换货单号
-	 */
-	private String changeid;
-
-	/**
-	 * 企业卖方uu
-	 */
-	private Long sellerenuu;
-
-	/**
-	 * 发货地址 这里使用json字符串的形式将发货地址整个存起来
-	 */
-	private String jsonSdAddress;
-
-	/**
-	 * 换货单单生成时间
-	 */
-	private Date createtime;
-
-	/**
-	 * 换单状态(1->2->3->4->5->6->7->8->9)
-	 * 
-	 * @Tip 必须严格按照顺序流转 1、TOBECONFIRMED(701, "申请中"), 2、TOBEPAID(702, "未通过"),
-	 *      3、PAID(504, "待回寄"), 4、TOBESHIPPED(406, "验货中"), 5、SHIPPINGIN(403,
-	 *      "已验货"), 6、SHIPPED(407, "待退款"), 7、SENDING(408, "已退款"),
-	 */
-	private Integer status;
-
-	/**
-	 * 数量
-	 */
-	private Double qty;
-
-	/**
-	 * 币种名称
-	 */
-	@Column(name = "cr_name")
-	private String currencyName;
-
-	/**
-	 * 价格,存储的为元
-	 */
-	private Double price;
-
-	/**
-	 * 状态变更记录 List<StatusHistory> -> Json
-	 */
-	private String statushistory;
-
-	/**
-	 * 转换货出货单号
-	 */
-	private String invoiceid;
-
-	/**
-	 * 来源采购单的id
-	 */
-	private String purchaseid;
-
-	/**
-	 * 来源采购单号
-	 */
-	private String puid;
-
-	/**
-	 * 物流信息
-	 */
-	private Logistics logistics;
-
-	/**
-	 * 换货单明细
-	 */
-	private Set<ChangeFB2cDetail> changeDetails;
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets changeid.
-	 *
-	 * @return the changeid
-	 */
-	public String getChangeid() {
-		return changeid;
-	}
-
-	/**
-	 * Sets changeid.
-	 *
-	 * @param changeid the changeid
-	 */
-	public void setChangeid(String changeid) {
-		this.changeid = changeid;
-	}
-
-	/**
-	 * Gets sellerenuu.
-	 *
-	 * @return the sellerenuu
-	 */
-	public Long getSellerenuu() {
-		return sellerenuu;
-	}
-
-	/**
-	 * Sets sellerenuu.
-	 *
-	 * @param sellerenuu the sellerenuu
-	 */
-	public void setSellerenuu(Long sellerenuu) {
-		this.sellerenuu = sellerenuu;
-	}
-
-	/**
-	 * Gets json sd address.
-	 *
-	 * @return the json sd address
-	 */
-	public String getJsonSdAddress() {
-		return jsonSdAddress;
-	}
-
-	/**
-	 * Sets json sd address.
-	 *
-	 * @param jsonSdAddress the json sd address
-	 */
-	public void setJsonSdAddress(String jsonSdAddress) {
-		this.jsonSdAddress = jsonSdAddress;
-	}
-
-	/**
-	 * Gets createtime.
-	 *
-	 * @return the createtime
-	 */
-	public Date getCreatetime() {
-		return createtime;
-	}
-
-	/**
-	 * Sets createtime.
-	 *
-	 * @param createtime the createtime
-	 */
-	public void setCreatetime(Date createtime) {
-		this.createtime = createtime;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Gets qty.
-	 *
-	 * @return the qty
-	 */
-	public Double getQty() {
-		return qty;
-	}
-
-	/**
-	 * Sets qty.
-	 *
-	 * @param qty the qty
-	 */
-	public void setQty(Double qty) {
-		this.qty = qty;
-	}
-
-	/**
-	 * Gets currency name.
-	 *
-	 * @return the currency name
-	 */
-	public String getCurrencyName() {
-		return currencyName;
-	}
-
-	/**
-	 * Sets currency name.
-	 *
-	 * @param currencyName the currency name
-	 */
-	public void setCurrencyName(String currencyName) {
-		this.currencyName = currencyName;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets statushistory.
-	 *
-	 * @return the statushistory
-	 */
-	public String getStatushistory() {
-		return statushistory;
-	}
-
-	/**
-	 * Sets statushistory.
-	 *
-	 * @param statushistory the statushistory
-	 */
-	public void setStatushistory(String statushistory) {
-		this.statushistory = statushistory;
-	}
-
-	/**
-	 * Gets invoiceid.
-	 *
-	 * @return the invoiceid
-	 */
-	public String getInvoiceid() {
-		return invoiceid;
-	}
-
-	/**
-	 * Sets invoiceid.
-	 *
-	 * @param invoiceid the invoiceid
-	 */
-	public void setInvoiceid(String invoiceid) {
-		this.invoiceid = invoiceid;
-	}
-
-	/**
-	 * Gets puid.
-	 *
-	 * @return the puid
-	 */
-	public String getPuid() {
-		return puid;
-	}
-
-	/**
-	 * Sets puid.
-	 *
-	 * @param puid the puid
-	 */
-	public void setPuid(String puid) {
-		this.puid = puid;
-	}
-
-	/**
-	 * Gets purchaseid.
-	 *
-	 * @return the purchaseid
-	 */
-	public String getPurchaseid() {
-		return purchaseid;
-	}
-
-	/**
-	 * Sets purchaseid.
-	 *
-	 * @param purchaseid the purchaseid
-	 */
-	public void setPurchaseid(String purchaseid) {
-		this.purchaseid = purchaseid;
-	}
-
-	/**
-	 * Gets logistics.
-	 *
-	 * @return the logistics
-	 */
-	public Logistics getLogistics() {
-		return logistics;
-	}
-
-	/**
-	 * Sets logistics.
-	 *
-	 * @param logistics the logistics
-	 */
-	public void setLogistics(Logistics logistics) {
-		this.logistics = logistics;
-	}
-
-	/**
-	 * Gets change details.
-	 *
-	 * @return the change details
-	 */
-	public Set<ChangeFB2cDetail> getChangeDetails() {
-		return changeDetails;
-	}
-
-	/**
-	 * Sets change details.
-	 *
-	 * @param changeDetails the change details
-	 */
-	public void setChangeDetails(Set<ChangeFB2cDetail> changeDetails) {
-		this.changeDetails = changeDetails;
-	}
-
-	public ChangeFB2CSimpleInfo() {
-
-	}
-
-	public ChangeFB2CSimpleInfo(ChangeFB2c changeFB2C) {
-		this.changeid = changeFB2C.getChangeid();
-		this.sellerenuu = changeFB2C.getSellerenuu();
-		this.jsonSdAddress = changeFB2C.getJsonSdAddress();
-		this.createtime = changeFB2C.getCreatetime();
-		this.status = changeFB2C.getStatus();
-		this.qty = changeFB2C.getQty();
-		this.currencyName = changeFB2C.getCurrencyName();
-		this.price = changeFB2C.getPrice();
-		this.statushistory = changeFB2C.getStatushistory();
-		this.purchaseid = changeFB2C.getPuid();
-		this.logistics = changeFB2C.getLogistics();
-		this.changeDetails = changeFB2C.getChangeDetails();
-	}
-
-}

+ 0 - 802
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFB2c.java

@@ -1,802 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.uas.platform.b2c.logistics.model.Logistics;
-import com.uas.platform.b2c.trade.order.model.Document;
-import com.uas.platform.b2c.trade.order.model.Purchase;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.persistence.StatusColumn;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * 平台换货单
- *
- * @author aof
- * @version 2017-08-02 16:56:57 创建文件
- */
-@Entity
-@Table(name = "trade$change_fmb2c")
-public class ChangeFB2c extends Document implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue
-	@Column(name = "id")
-	private Long id;
-
-	/**
-	 * 换货单号
-	 */
-	@Column(name = "cf_id", unique = true)
-	private String changeid;
-
-	/**
-	 * 买方uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "cf_buyeruu")
-	private Long buyeruu;
-
-	/**
-	 * 买方姓名
-	 */
-	@Column(name = "cf_buyername")
-	private String buyername;
-
-	/**
-	 * 买方企业uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "cf_buyerenuu")
-	private Long buyerenuu;
-	
-	/**
-	 * 客户的换货单
-	 */
-	@Column(name = "cf_cfcid")
-	private String cfcid;
-
-	/**
-	 * 企业卖方uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "cf_sellerenuu")
-	private Long sellerenuu;
-
-	/**
-	 * 卖方企业名称
-	 */
-	@Column(name = "cf_sellername")
-	private String sellername;
-
-	/**
-	 * 配送方式
-	 */
-	@Column(name = "cf_deliverytype")
-	private Integer deliverytype;
-
-	/**
-	 * 收货地址 这里使用json字符串的形式将收货地址整个存起来
-	 */
-	@Column(name = "cf_addr", length = 2000)
-	private String jsonAddress;
-
-	/**
-	 * 发货地址 这里使用json字符串的形式将发货地址整个存起来
-	 */
-	@Column(name = "cf_sd_addr", length = 2000)
-	private String jsonSdAddress;
-
-	/**
-	 * 发票类型
-	 */
-	@Column(name = "cf_invoicetype")
-	private Integer invoicetype;
-
-	/**
-	 * 发票抬头
-	 */
-	@Column(name = "cf_invoicetitle")
-	private String invoicetitle;
-
-	/**
-	 * 订单生成时间
-	 */
-	@Column(name = "cf_createtime")
-	private Date createtime;
-
-	/**
-	 * 订单状态(1->2->3)
-	 *
-	 * 后续状态等需要完成退换货功能时,在加上
-	 * @Tip 必须严格按照顺序流转 1、TOBESHIPPEDBACK(409, "待回寄"), 2、INSPECTING(410, "验货中"),
-	 *      3、TOBESHIPPED(406, "待出货")
-	 */
-	@Column(name = "cf_status")
-	@StatusColumn
-	private Integer status;
-
-	/**
-	 * 数量
-	 */
-	@Column(name = "cf_qty")
-	private Double qty;
-
-	/**
-	 * 币种名称
-	 */
-	@Column(name = "cr_name")
-	private String currencyName;
-
-	/**
-	 * 价格,存储的为元
-	 */
-	@Column(name = "cf_price")
-	private Double price;
-
-
-	/**
-	 * 状态变更记录 List<StatusHistory> -> Json
-	 */
-	@Column(name = "cf_statushistory", length = 4000)
-	private String statushistory;
-
-	/**
-	 * 转的采购单id
-	 */
-	@Column(name = "pu_id")
-	private String puid;
-
-	/**
-	 * 转的发货单流水号
-	 */
-	@Column(name = "in_id")
-	private String inid;
-
-	/**
-	 * 关联的订单id
-	 */
-	@Column(name = "or_id")
-	private String orid;
-
-	/**
-	 * 物流信息
-	 */
-	@OneToOne(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
-	@JoinColumn(name = "cf_lgt_id")
-	private Logistics logistics;
-
-	/**
-	 * 客户换货单
-	 */
-	@OneToOne(cascade = { CascadeType.REFRESH }, fetch = FetchType.LAZY)
-	@JoinColumn(name = "in_custid", insertable = false, updatable = false)
-	private ChangeFCust cust;
-
-	/**
-	 * 客户换货单id
-	 */
-	@Column(name = "in_custid")
-	private Long custid;
-	
-	/**
-	 * 税金
-	 */
-	@Column(name = "cf_taxes")
-	private Double taxes;
-
-	/**
-	 * 换货单明细
-	 */
-	@OneToMany(mappedBy = "change", cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
-	@OrderBy("detno")
-	private Set<ChangeFB2cDetail> changeDetails;
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets changeid.
-	 *
-	 * @return the changeid
-	 */
-	public String getChangeid() {
-		return changeid;
-	}
-
-	/**
-	 * Sets changeid.
-	 *
-	 * @param changeid the changeid
-	 */
-	public void setChangeid(String changeid) {
-		this.changeid = changeid;
-	}
-
-	/**
-	 * Gets cfcid.
-	 *
-	 * @return the cfcid
-	 */
-	public String getCfcid() {
-		return cfcid;
-	}
-
-	/**
-	 * Sets cfcid.
-	 *
-	 * @param cfcid the cfcid
-	 */
-	public void setCfcid(String cfcid) {
-		this.cfcid = cfcid;
-	}
-
-	/**
-	 * Gets buyeruu.
-	 *
-	 * @return the buyeruu
-	 */
-	public Long getBuyeruu() {
-		return buyeruu;
-	}
-
-	/**
-	 * Sets buyeruu.
-	 *
-	 * @param buyeruu the buyeruu
-	 */
-	public void setBuyeruu(Long buyeruu) {
-		this.buyeruu = buyeruu;
-	}
-
-	/**
-	 * Gets buyerenuu.
-	 *
-	 * @return the buyerenuu
-	 */
-	public Long getBuyerenuu() {
-		return buyerenuu;
-	}
-
-	/**
-	 * Sets buyerenuu.
-	 *
-	 * @param buyerenuu the buyerenuu
-	 */
-	public void setBuyerenuu(Long buyerenuu) {
-		this.buyerenuu = buyerenuu;
-	}
-
-	/**
-	 * Gets buyername.
-	 *
-	 * @return the buyername
-	 */
-	public String getBuyername() {
-		return buyername;
-	}
-
-	/**
-	 * Sets buyername.
-	 *
-	 * @param buyername the buyername
-	 */
-	public void setBuyername(String buyername) {
-		this.buyername = buyername;
-	}
-
-	/**
-	 * Gets sellername.
-	 *
-	 * @return the sellername
-	 */
-	public String getSellername() {
-		return sellername;
-	}
-
-	/**
-	 * Sets sellername.
-	 *
-	 * @param sellername the sellername
-	 */
-	public void setSellername(String sellername) {
-		this.sellername = sellername;
-	}
-
-	/**
-	 * Gets sellerenuu.
-	 *
-	 * @return the sellerenuu
-	 */
-	public Long getSellerenuu() {
-		return sellerenuu;
-	}
-
-	/**
-	 * Sets sellerenuu.
-	 *
-	 * @param sellerenuu the sellerenuu
-	 */
-	public void setSellerenuu(Long sellerenuu) {
-		this.sellerenuu = sellerenuu;
-	}
-
-	/**
-	 * Gets deliverytype.
-	 *
-	 * @return the deliverytype
-	 */
-	public Integer getDeliverytype() {
-		return deliverytype;
-	}
-
-	/**
-	 * Sets deliverytype.
-	 *
-	 * @param deliverytype the deliverytype
-	 */
-	public void setDeliverytype(Integer deliverytype) {
-		this.deliverytype = deliverytype;
-	}
-
-	/**
-	 * Gets json address.
-	 *
-	 * @return the json address
-	 */
-	public String getJsonAddress() {
-		return jsonAddress;
-	}
-
-	/**
-	 * Sets json address.
-	 *
-	 * @param jsonAddress the json address
-	 */
-	public void setJsonAddress(String jsonAddress) {
-		this.jsonAddress = jsonAddress;
-	}
-
-	/**
-	 * Gets invoicetype.
-	 *
-	 * @return the invoicetype
-	 */
-	public Integer getInvoicetype() {
-		return invoicetype;
-	}
-
-	/**
-	 * Sets invoicetype.
-	 *
-	 * @param invoicetype the invoicetype
-	 */
-	public void setInvoicetype(Integer invoicetype) {
-		this.invoicetype = invoicetype;
-	}
-
-	/**
-	 * Gets invoicetitle.
-	 *
-	 * @return the invoicetitle
-	 */
-	public String getInvoicetitle() {
-		return invoicetitle;
-	}
-
-	/**
-	 * Sets invoicetitle.
-	 *
-	 * @param invoicetitle the invoicetitle
-	 */
-	public void setInvoicetitle(String invoicetitle) {
-		this.invoicetitle = invoicetitle;
-	}
-
-	/**
-	 * Gets createtime.
-	 *
-	 * @return the createtime
-	 */
-	public Date getCreatetime() {
-		return createtime;
-	}
-
-	/**
-	 * Sets createtime.
-	 *
-	 * @param createtime the createtime
-	 */
-	public void setCreatetime(Date createtime) {
-		this.createtime = createtime;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Gets currency name.
-	 *
-	 * @return the currency name
-	 */
-	public String getCurrencyName() {
-		return currencyName;
-	}
-
-	/**
-	 * Sets currency name.
-	 *
-	 * @param currencyName the currency name
-	 */
-	public void setCurrencyName(String currencyName) {
-		this.currencyName = currencyName;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets statushistory.
-	 *
-	 * @return the statushistory
-	 */
-	public String getStatushistory() {
-		return statushistory;
-	}
-
-	/**
-	 * Sets statushistory.
-	 *
-	 * @param statushistory the statushistory
-	 */
-	public void setStatushistory(String statushistory) {
-		this.statushistory = statushistory;
-	}
-
-	/**
-	 * Gets puid.
-	 *
-	 * @return the puid
-	 */
-	public String getPuid() {
-		return puid;
-	}
-
-	/**
-	 * Sets puid.
-	 *
-	 * @param puid the puid
-	 */
-	public void setPuid(String puid) {
-		this.puid = puid;
-	}
-
-	/**
-	 * Gets inid.
-	 *
-	 * @return the inid
-	 */
-	public String getInid() {
-		return inid;
-	}
-
-	/**
-	 * Sets inid.
-	 *
-	 * @param inid the inid
-	 */
-	public void setInid(String inid) {
-		this.inid = inid;
-	}
-
-	/**
-	 * Gets logistics.
-	 *
-	 * @return the logistics
-	 */
-	public Logistics getLogistics() {
-		return logistics;
-	}
-
-	/**
-	 * Sets logistics.
-	 *
-	 * @param logistics the logistics
-	 */
-	public void setLogistics(Logistics logistics) {
-		this.logistics = logistics;
-	}
-
-	/**
-	 * Gets orid.
-	 *
-	 * @return the orid
-	 */
-	public String getOrid() {
-		return orid;
-	}
-
-	/**
-	 * Sets orid.
-	 *
-	 * @param orid the orid
-	 */
-	public void setOrid(String orid) {
-		this.orid = orid;
-	}
-
-	/**
-	 * Gets custid.
-	 *
-	 * @return the custid
-	 */
-	public Long getCustid() {
-		return custid;
-	}
-
-	/**
-	 * Sets custid.
-	 *
-	 * @param custid the custid
-	 */
-	public void setCustid(Long custid) {
-		this.custid = custid;
-	}
-
-	/**
-	 * Gets cust.
-	 *
-	 * @return the cust
-	 */
-	public ChangeFCust getCust() {
-		return cust;
-	}
-
-	/**
-	 * Sets cust.
-	 *
-	 * @param cust the cust
-	 */
-	public void setCust(ChangeFCust cust) {
-		this.cust = cust;
-	}
-
-	/**
-	 * Gets json sd address.
-	 *
-	 * @return the json sd address
-	 */
-	public String getJsonSdAddress() {
-		return jsonSdAddress;
-	}
-
-	/**
-	 * Sets json sd address.
-	 *
-	 * @param jsonSdAddress the json sd address
-	 */
-	public void setJsonSdAddress(String jsonSdAddress) {
-		this.jsonSdAddress = jsonSdAddress;
-	}
-
-	/**
-	 * Gets change details.
-	 *
-	 * @return the change details
-	 */
-	public Set<ChangeFB2cDetail> getChangeDetails() {
-		return changeDetails;
-	}
-
-	/**
-	 * Sets change details.
-	 *
-	 * @param changeDetails the change details
-	 */
-	public void setChangeDetails(Set<ChangeFB2cDetail> changeDetails) {
-		this.changeDetails = changeDetails;
-	}
-
-	/**
-	 * 待回寄
-	 *
-	 * @param uu the uu
-	 */
-	public void setStatusTobeshippedback(Long uu) {
-		this.status = Status.TOBESHIPPEDBACK.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 验货中
-	 *
-	 * @param uu the uu
-	 */
-	public void setStatusInspecting(Long uu) {
-		this.status = Status.INSPECTING.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 待出货
-	 *
-	 * @param uu the uu
-	 */
-	public void setStatusTobeshipped(Long uu) {
-		this.status = Status.TOBESHIPPED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 待收货
-	 *
-	 * @param uu the uu
-	 */
-	public void setStatusInbound(Long uu) {
-		this.status = Status.INBOUND.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 已收货
-	 *
-	 * @param uu the uu
-	 */
-	public void setStatusReceived(Long uu) {
-		this.status = Status.RECEIVED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 客户换货转平台换货
-	 *
-	 * @param cust the cust
-	 */
-	public ChangeFB2c(ChangeFCust cust) {
-		this.buyeruu = cust.getBuyeruu();
-		this.buyerenuu = cust.getBuyerenuu();
-		this.buyername = cust.getBuyername();
-		this.sellername = cust.getSellername();
-		this.sellerenuu = cust.getSellerenuu();
-		this.deliverytype = cust.getDeliverytype();
-		// 客户的发货地址就是平台的收货地址
-		this.jsonAddress = cust.getJsonSdAddress();
-		this.invoicetype = cust.getInvoicetype();
-		this.invoicetitle = cust.getInvoicetitle();
-		this.createtime = new Date();
-		this.currencyName = cust.getCurrency();
-		this.inid = cust.getInid();
-		this.orid = cust.getOrid();
-	}
-
-	/**
-	 * Gets qty.
-	 *
-	 * @return the qty
-	 */
-	public Double getQty() {
-		if (qty == null || qty == 0) {
-			setQtys();
-		}
-		return qty;
-	}
-
-	/**
-	 * Sets qty.
-	 *
-	 * @param qty the qty
-	 */
-	public void setQty(Double qty) {
-		this.qty = qty;
-	}
-
-	/**
-	 * Gets taxes.
-	 *
-	 * @return the taxes
-	 */
-	public Double getTaxes() {
-		return taxes;
-	}
-
-	/**
-	 * Sets taxes.
-	 *
-	 * @param taxes the taxes
-	 */
-	public void setTaxes(Double taxes) {
-		this.taxes = taxes;
-	}
-
-	/**
-	 * Sets qtys.
-	 */
-	public void setQtys() {
-		double thisqty = 0D;
-		for (ChangeFB2cDetail detail : this.changeDetails) {
-			thisqty += detail.getNumber();
-		}
-		this.qty = thisqty;
-	}
-
-	/**
-	 * @Tip 对象初始化时必须给历史记录赋值
-	 */
-	public ChangeFB2c() {
-		this.statushistory = "";
-	}
-
-	public ChangeFB2c(Purchase purchase) {
-		super();
-		this.sellerenuu = purchase.getSellerenuu();
-		this.sellername = purchase.getSellername();
-		this.createtime = new Date();
-		this.currencyName = purchase.getCurrency();
-		this.puid = purchase.getPurchaseid();
-	}
-}

+ 0 - 580
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFB2cDetail.java

@@ -1,580 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.alibaba.fastjson.annotation.JSONField;
-import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
-import com.uas.platform.core.persistence.StatusColumn;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-/**
- * 平台换货单明细
- *
- * @author aof
- * @version 2017-08-02 16:57:55 创建文件
- */
-@Entity
-@Table(name = "trade$change_fmb2c_dt")
-public class ChangeFB2cDetail {
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue
-	@Column(name = "id")
-	private Long id;
-
-	/**
-	 * 主表
-	 * 
-	 * @JsonIgnore
-	 */
-	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = true)
-	@JoinColumn(name = "change_id", nullable = false)
-	private ChangeFB2c change;
-
-	/**
-	 * 明细序号 detailNO
-	 */
-	@Column(name = "detno", unique = true)
-	private Short detno;
-
-	/**
-	 * 订单明细编号
-	 */
-	@Column(name = "detail_id")
-	private String detailid;
-
-	/**
-	 * 批次号
-	 */
-	@Column(name = "go_batch")
-	private String batchCode;
-
-	/**
-	 * 对应的器件uuid
-	 */
-	@Column(name = "cmp_uuid")
-	private String uuid;
-
-	/**
-	 * 库存 库存1311, 呆滞库存 1312,(暂时不用)废料 1313
-	 */
-	@Column(name = "go_original")
-	private Integer original;
-
-	/**
-	 * 原厂型号
-	 */
-	@Column(name = "cmp_code")
-	private String cmpCode;
-
-	/**
-	 * 器件所属类目
-	 */
-	@Column(name = "ki_name")
-	private String kiName;
-
-	/**
-	 * 器件所属品牌
-	 */
-	@Column(name = "br_name")
-	private String brName;
-
-	/**
-	 * 图片path
-	 */
-	@Column(name = "cmp_img")
-	private String img;
-
-	/**
-	 * 币种名称
-	 */
-	@Column(name = "cr_name")
-	private String currencyName;
-
-	/**
-	 * 单价,单位为元
-	 */
-	@Column(name = "go_unitprice")
-	private Double unitprice;
-
-	/**
-	 * 换货数量
-	 */
-	@Column(name = "detail_number")
-	private Double number;
-
-	/**
-	 * 价格,存储的为元
-	 */
-	@Column(name = "detail_price")
-	private Double price;
-
-	/**
-	 * 存放采购明细流水号
-	 */
-	@Column(name = "detail_puid")
-	private String puid;
-
-	/**
-	 * 订单明细状态
-	 */
-	@Column(name = "detail_status")
-	@StatusColumn
-	private Integer status;
-
-	/**
-	 * 税率
-	 */
-	@Column(name = "detail_tax")
-	private Short tax;
-
-	/**
-	 * 税金
-	 */
-	@Column(name = "detail_taxes")
-	private Double taxes;
-
-	/**
-	 * 含税单价
-	 */
-	@Column(name = "detail_taxunitprice")
-	private Double taxunitprice;
-
-	/**
-	 * 客户换货单明细id
-	 */
-	@Column(name = "detail_cfcid")
-	private String cfcid;
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets change.
-	 *
-	 * @return the change
-	 */
-	@JsonIgnore
-	@JSONField(serialize = false)
-	public ChangeFB2c getChange() {
-		return change;
-	}
-
-	/**
-	 * Sets change.
-	 *
-	 * @param change the change
-	 */
-	public void setChange(ChangeFB2c change) {
-		this.change = change;
-	}
-
-	/**
-	 * Gets detno.
-	 *
-	 * @return the detno
-	 */
-	public Short getDetno() {
-		return detno;
-	}
-
-	/**
-	 * Sets detno.
-	 *
-	 * @param detno the detno
-	 */
-	public void setDetno(Short detno) {
-		this.detno = detno;
-	}
-
-	/**
-	 * Gets detailid.
-	 *
-	 * @return the detailid
-	 */
-	public String getDetailid() {
-		return detailid;
-	}
-
-	/**
-	 * Sets detailid.
-	 *
-	 * @param detailid the detailid
-	 */
-	public void setDetailid(String detailid) {
-		this.detailid = detailid;
-	}
-
-	/**
-	 * Gets batch code.
-	 *
-	 * @return the batch code
-	 */
-	public String getBatchCode() {
-		return batchCode;
-	}
-
-	/**
-	 * Sets batch code.
-	 *
-	 * @param batchCode the batch code
-	 */
-	public void setBatchCode(String batchCode) {
-		this.batchCode = batchCode;
-	}
-
-	/**
-	 * Gets uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-
-	/**
-	 * Sets uuid.
-	 *
-	 * @param uuid the uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-
-	/**
-	 * Gets original.
-	 *
-	 * @return the original
-	 */
-	public Integer getOriginal() {
-		return original;
-	}
-
-	/**
-	 * Sets original.
-	 *
-	 * @param original the original
-	 */
-	public void setOriginal(Integer original) {
-		this.original = original;
-	}
-
-	/**
-	 * Gets cmp code.
-	 *
-	 * @return the cmp code
-	 */
-	public String getCmpCode() {
-		return cmpCode;
-	}
-
-	/**
-	 * Sets cmp code.
-	 *
-	 * @param cmpCode the cmp code
-	 */
-	public void setCmpCode(String cmpCode) {
-		this.cmpCode = cmpCode;
-	}
-
-	/**
-	 * Gets ki name.
-	 *
-	 * @return the ki name
-	 */
-	public String getKiName() {
-		return kiName;
-	}
-
-	/**
-	 * Sets ki name.
-	 *
-	 * @param kiName the ki name
-	 */
-	public void setKiName(String kiName) {
-		this.kiName = kiName;
-	}
-
-	/**
-	 * Gets br name.
-	 *
-	 * @return the br name
-	 */
-	public String getBrName() {
-		return brName;
-	}
-
-	/**
-	 * Sets br name.
-	 *
-	 * @param brName the br name
-	 */
-	public void setBrName(String brName) {
-		this.brName = brName;
-	}
-
-	/**
-	 * Gets img.
-	 *
-	 * @return the img
-	 */
-	public String getImg() {
-		return img;
-	}
-
-	/**
-	 * Sets img.
-	 *
-	 * @param img the img
-	 */
-	public void setImg(String img) {
-		this.img = img;
-	}
-
-	/**
-	 * Gets currency name.
-	 *
-	 * @return the currency name
-	 */
-	public String getCurrencyName() {
-		return currencyName;
-	}
-
-	/**
-	 * Sets currency name.
-	 *
-	 * @param currencyName the currency name
-	 */
-	public void setCurrencyName(String currencyName) {
-		this.currencyName = currencyName;
-	}
-
-	/**
-	 * Gets unitprice.
-	 *
-	 * @return the unitprice
-	 */
-	public Double getUnitprice() {
-		return unitprice;
-	}
-
-	/**
-	 * Sets unitprice.
-	 *
-	 * @param unitprice the unitprice
-	 */
-	public void setUnitprice(Double unitprice) {
-		this.unitprice = unitprice;
-	}
-
-	/**
-	 * Gets number.
-	 *
-	 * @return the number
-	 */
-	public Double getNumber() {
-		return number;
-	}
-
-	/**
-	 * Sets number.
-	 *
-	 * @param number the number
-	 */
-	public void setNumber(Double number) {
-		this.number = number;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets puid.
-	 *
-	 * @return the puid
-	 */
-	public String getPuid() {
-		return puid;
-	}
-
-	/**
-	 * Sets puid.
-	 *
-	 * @param puid the puid
-	 */
-	public void setPuid(String puid) {
-		this.puid = puid;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Gets tax.
-	 *
-	 * @return the tax
-	 */
-	public Short getTax() {
-		return tax;
-	}
-
-	/**
-	 * Sets tax.
-	 *
-	 * @param tax the tax
-	 */
-	public void setTax(Short tax) {
-		this.tax = tax;
-	}
-
-	/**
-	 * Gets taxes.
-	 *
-	 * @return the taxes
-	 */
-	public Double getTaxes() {
-		return taxes;
-	}
-
-	/**
-	 * Sets taxes.
-	 *
-	 * @param taxes the taxes
-	 */
-	public void setTaxes(Double taxes) {
-		this.taxes = taxes;
-	}
-
-	/**
-	 * Gets taxunitprice.
-	 *
-	 * @return the taxunitprice
-	 */
-	public Double getTaxunitprice() {
-		return taxunitprice;
-	}
-
-	/**
-	 * Sets taxunitprice.
-	 *
-	 * @param taxunitprice the taxunitprice
-	 */
-	public void setTaxunitprice(Double taxunitprice) {
-		this.taxunitprice = taxunitprice;
-	}
-
-	/**
-	 * Gets cfcid.
-	 *
-	 * @return the cfcid
-	 */
-	public String getCfcid() {
-		return cfcid;
-	}
-
-	/**
-	 * Sets cfcid.
-	 *
-	 * @param cfcid the cfcid
-	 */
-	public void setCfcid(String cfcid) {
-		this.cfcid = cfcid;
-	}
-
-	public ChangeFB2cDetail(ChangeFCustDetail custDetail) {
-		this.detno = custDetail.getDetno();
-		this.batchCode = custDetail.getBatchCode();
-		this.uuid = custDetail.getUuid();
-		this.original = custDetail.getOriginal();
-		this.cmpCode = custDetail.getCmpCode();
-		this.brName = custDetail.getBrName();
-		this.kiName = custDetail.getKiName();
-		this.img = custDetail.getImg();
-		this.unitprice = custDetail.getUnitprice();
-		this.currencyName = custDetail.getCurrencyName();
-		this.number = custDetail.getNumber();
-		this.price = custDetail.getPrice();
-		this.taxunitprice = custDetail.getTaxunitprice();
-		this.puid = custDetail.getPuid();
-		this.tax = custDetail.getTax();
-		this.cfcid = custDetail.getDetailid();
-	}
-
-	public ChangeFB2cDetail() {
-		super();
-	}
-
-	public ChangeFB2cDetail(PurchaseDetail detail) {
-		super();
-		this.number = detail.getNumber();
-		this.batchCode = detail.getBatchCode();
-		this.brName = detail.getBrName();
-		this.uuid = detail.getUuid();
-		this.original = detail.getOriginal();
-		this.cmpCode = detail.getCmpCode();
-		this.kiName = detail.getKiName();
-		this.img = detail.getImg();
-		this.currencyName = detail.getCurrencyName();
-		this.unitprice = detail.getUnitprice();
-		this.taxunitprice = detail.getTaxUnitPrice();
-		this.tax = detail.getTax();
-		this.price = detail.getPrice();
-		this.taxes = detail.getTaxes();
-		this.puid = detail.getDetailid();
-	}
-}

+ 0 - 797
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFCust.java

@@ -1,797 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.uas.platform.b2c.logistics.model.Invoice;
-import com.uas.platform.b2c.logistics.model.Logistics;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.trade.order.model.Document;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.core.model.EncodingRulesConstant;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.model.Type;
-import com.uas.platform.core.persistence.StatusColumn;
-
-import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * 客户换货单
- *
- * @author aof
- * @version 2017-08-02 17:00:05 创建文件
- */
-@Entity
-@Table(name = "trade$change_fmcust")
-public class ChangeFCust extends Document implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue
-	@Column(name = "id")
-	private Long id;
-
-	/**
-	 * 换货单号
-	 */
-	@Column(name = "cf_id", unique = true)
-	private String changeid;
-
-	/**
-	 * 关联的订单id
-	 */
-	@Column(name = "or_id")
-	private String orid;
-
-	/**
-	 * 买方uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "cf_buyeruu")
-	private Long buyeruu;
-
-	/**
-	 * 买方姓名
-	 */
-	@Column(name = "cf_buyername")
-	private String buyername;
-
-	/**
-	 * 买方企业uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "cf_buyerenuu")
-	private Long buyerenuu;
-
-	/**
-	 * 企业卖方uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "cf_sellerenuu")
-	private Long sellerenuu;
-
-	/**
-	 * 卖方企业名称
-	 */
-	@Column(name = "cf_sellername")
-	private String sellername;
-	/**
-	 * 配送方式
-	 */
-	@Column(name = "cf_deliverytype")
-	private Integer deliverytype;
-
-	/**
-	 * 收货地址 这里使用json字符串的形式将收货地址整个存起来
-	 */
-	@Column(name = "cf_addr", length = 2000)
-	private String jsonAddress;
-
-	/**
-	 * 发货地址 这里使用json字符串的形式将收货地址整个存起来
-	 */
-	@Column(name = "cf_sd_addr", length = 2000)
-	private String jsonSdAddress;
-
-	/**
-	 * 发票类型
-	 */
-	@Column(name = "cf_invoicetype")
-	private Integer invoicetype;
-
-	/**
-	 * 发票抬头
-	 */
-	@Column(name = "cf_invoicetitle")
-	private String invoicetitle;
-
-	/**
-	 * 订单生成时间
-	 */
-	@Column(name = "cf_createtime")
-	private Date createtime;
-
-	/**
-	 * 订单状态(1->2->3)
-	 *
-	 * 后续状态等需要完成退换货功能时,在加上
-	 * @Tip 必须严格按照顺序流转 1、TOBESHIPPEDBACK(409, "待回寄"), 2、INSPECTING(410, "验货中"),
-	 *      3、TOBESHIPPED(406, "待出货")
-	 */
-	@Column(name = "cf_status")
-	@StatusColumn
-	private Integer status;
-	
-	/**
-	 * 合计的税金
-	 */
-	@Column(name = "cf_taxes")
-	private Double taxes;
-	
-	/**
-	 * 币别
-	 */
-	@Column(name = "cf_currency")
-	private String currency;
-
-	/**
-	 * 价税合计
-	 */
-	@Column(name = "cf_price")
-	private Double price;
-
-	/**
-	 * 数量
-	 */
-	@Column(name = "cf_qty")
-	private Double qty;
-
-	/**
-	 * 状态变更记录 List<StatusHistory> -> Json
-	 */
-	@Column(name = "cf_statushistory", length = 4000)
-	private String statushistory;
-
-	/**
-	 * 转的发货单流水号
-	 */
-	@Column(name = "in_id")
-	private String inid;
-
-	/**
-	 * 物流信息
-	 */
-	@OneToOne(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
-	@JoinColumn(name = "cf_lgt_id")
-	private Logistics logistics;
-
-	/**
-	 * 退货单明细
-	 */
-	@OneToMany(mappedBy = "change", cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
-	@OrderBy("detno")
-	private Set<ChangeFCustDetail> changeDetails;
-
-	public ChangeFCust(Order order) {
-		this.buyeruu = order.getBuyeruu();
-		this.buyerenuu = order.getBuyerenuu();
-		this.buyername = order.getBuyername();
-		this.sellername = order.getSellername();
-		this.sellerenuu = order.getSellerenuu();
-		this.deliverytype = order.getDeliverytype();
-		this.jsonSdAddress = order.getJsonAddress();
-		// this.jsonAddress = order.getJsonAddress();
-		this.invoicetype = order.getInvoicetype();
-		this.invoicetitle = order.getInvoicetitle();
-		this.createtime = new Date();
-		this.orid = order.getOrderid();
-		this.currency = order.getCurrency();
-	}
-
-	/**
-	 * Convert invoice f change invoice.
-	 *
-	 * @param createNumberService the create number service
-	 * @return the invoice
-	 */
-	public Invoice convertInvoiceFChange(CreateNumberService createNumberService) {
-		String invoiceid = EncodingRulesConstant.INVOICE_FROMCHANGE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$invoice", 8));
-		Date date = new Date();
-		Invoice invoice = new Invoice();
-		invoice.setInvoiceid(invoiceid);
-		// 给属性赋值
-		invoice.setCreatetime(date);
-		invoice.setBuyeruu(this.getBuyeruu());
-		invoice.setBuyername(this.getBuyername());
-		invoice.setSellername(this.getSellername());
-		invoice.setSellerenuu(this.getSellerenuu());
-		invoice.setBuyerenuu(this.getBuyerenuu());
-		invoice.setPrice(this.getPrice());
-		invoice.setChangeQty(this.getQty());
-		invoice.setTaxes(this.getTaxes());
-		invoice.setCurrencyName(this.getCurrency());
-		// TODO 这里需要考虑确认总价的(默认和总价相等 打折等其他逻辑待考虑)
-		// invoice.setEnsurePrice(this.ensurePrice);
-		invoice.setJsonSpAddress(this.getJsonSdAddress());
-		// 记录来源id 记录出货类型
-		invoice.setSourceid(this.changeid);
-		invoice.setPiclass(Type.Invoice_B2c_Change_code.value());
-		return invoice;
-	}
-
-	/**
-	 * 申请中
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusUnaudit(Long uu) {
-		this.status = Status.UNAUDIT.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 审核通过
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusTobeshippedback(Long uu) {
-		this.status = Status.TOBESHIPPEDBACK.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 审核不通过
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusNotallow(Long uu) {
-		this.status = Status.NOTALLOW.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 验货中
-	 *
-	 * @param uu the uu
-	 */
-	public void setStatusInspecting(Long uu) {
-		this.status = Status.INSPECTING.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 出货中
-	 *
-	 * @param uu the uu
-	 */
-	public void setStatusShippingin(Long uu) {
-		this.status = Status.SHIPPINGIN.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 待出货
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusTobeshipped(Long uu) {
-		this.status = Status.TOBESHIPPED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 待收货
-	 *
-	 * @param uu the uu
-	 */
-	public void setStatusInbound(Long uu) {
-		this.status = Status.INBOUND.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 已出货
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusShipped(Long uu) {
-		this.status = Status.SHIPPED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 发货中
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusSending(Long uu) {
-		this.status = Status.SENDING.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 待收款
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusToreceivemoney(Long uu) {
-		this.status = Status.TORECEIVEMONEY.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 已收款
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusMoneyreceived(Long uu) {
-		this.status = Status.MONEYRECEIVED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 已收货
-	 *
-	 * @param uu the uu
-	 * @return
-	 */
-	public void setStatusReceived(Long uu) {
-		this.status = Status.RECEIVED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets changeid.
-	 *
-	 * @return the changeid
-	 */
-	public String getChangeid() {
-		return changeid;
-	}
-
-	/**
-	 * Sets changeid.
-	 *
-	 * @param changeid the changeid
-	 */
-	public void setChangeid(String changeid) {
-		this.changeid = changeid;
-	}
-
-	/**
-	 * Gets buyeruu.
-	 *
-	 * @return the buyeruu
-	 */
-	public Long getBuyeruu() {
-		return buyeruu;
-	}
-
-	/**
-	 * Sets buyeruu.
-	 *
-	 * @param buyeruu the buyeruu
-	 */
-	public void setBuyeruu(Long buyeruu) {
-		this.buyeruu = buyeruu;
-	}
-
-	/**
-	 * Gets buyerenuu.
-	 *
-	 * @return the buyerenuu
-	 */
-	public Long getBuyerenuu() {
-		return buyerenuu;
-	}
-
-	/**
-	 * Sets buyerenuu.
-	 *
-	 * @param buyerenuu the buyerenuu
-	 */
-	public void setBuyerenuu(Long buyerenuu) {
-		this.buyerenuu = buyerenuu;
-	}
-
-	/**
-	 * Gets buyername.
-	 *
-	 * @return the buyername
-	 */
-	public String getBuyername() {
-		return buyername;
-	}
-
-	/**
-	 * Sets buyername.
-	 *
-	 * @param buyername the buyername
-	 */
-	public void setBuyername(String buyername) {
-		this.buyername = buyername;
-	}
-
-	/**
-	 * Gets sellername.
-	 *
-	 * @return the sellername
-	 */
-	public String getSellername() {
-		return sellername;
-	}
-
-	/**
-	 * Sets sellername.
-	 *
-	 * @param sellername the sellername
-	 */
-	public void setSellername(String sellername) {
-		this.sellername = sellername;
-	}
-
-	/**
-	 * Gets sellerenuu.
-	 *
-	 * @return the sellerenuu
-	 */
-	public Long getSellerenuu() {
-		return sellerenuu;
-	}
-
-	/**
-	 * Sets sellerenuu.
-	 *
-	 * @param sellerenuu the sellerenuu
-	 */
-	public void setSellerenuu(Long sellerenuu) {
-		this.sellerenuu = sellerenuu;
-	}
-
-	/**
-	 * Gets taxes.
-	 *
-	 * @return the taxes
-	 */
-	public Double getTaxes() {
-		return taxes;
-	}
-
-	/**
-	 * Sets taxes.
-	 *
-	 * @param taxes the taxes
-	 */
-	public void setTaxes(Double taxes) {
-		this.taxes = taxes;
-	}
-
-	/**
-	 * Gets currency.
-	 *
-	 * @return the currency
-	 */
-	public String getCurrency() {
-		return currency;
-	}
-
-	/**
-	 * Sets currency.
-	 *
-	 * @param currency the currency
-	 */
-	public void setCurrency(String currency) {
-		this.currency = currency;
-	}
-
-	/**
-	 * Gets deliverytype.
-	 *
-	 * @return the deliverytype
-	 */
-	public Integer getDeliverytype() {
-		return deliverytype;
-	}
-
-	/**
-	 * Sets deliverytype.
-	 *
-	 * @param deliverytype the deliverytype
-	 */
-	public void setDeliverytype(Integer deliverytype) {
-		this.deliverytype = deliverytype;
-	}
-
-	/**
-	 * Gets json address.
-	 *
-	 * @return the json address
-	 */
-	public String getJsonAddress() {
-		return jsonAddress;
-	}
-
-	/**
-	 * Sets json address.
-	 *
-	 * @param jsonAddress the json address
-	 */
-	public void setJsonAddress(String jsonAddress) {
-		this.jsonAddress = jsonAddress;
-	}
-
-	/**
-	 * Gets invoicetype.
-	 *
-	 * @return the invoicetype
-	 */
-	public Integer getInvoicetype() {
-		return invoicetype;
-	}
-
-	/**
-	 * Sets invoicetype.
-	 *
-	 * @param invoicetype the invoicetype
-	 */
-	public void setInvoicetype(Integer invoicetype) {
-		this.invoicetype = invoicetype;
-	}
-
-	/**
-	 * Gets invoicetitle.
-	 *
-	 * @return the invoicetitle
-	 */
-	public String getInvoicetitle() {
-		return invoicetitle;
-	}
-
-	/**
-	 * Sets invoicetitle.
-	 *
-	 * @param invoicetitle the invoicetitle
-	 */
-	public void setInvoicetitle(String invoicetitle) {
-		this.invoicetitle = invoicetitle;
-	}
-
-	/**
-	 * Gets createtime.
-	 *
-	 * @return the createtime
-	 */
-	public Date getCreatetime() {
-		return createtime;
-	}
-
-	/**
-	 * Sets createtime.
-	 *
-	 * @param createtime the createtime
-	 */
-	public void setCreatetime(Date createtime) {
-		this.createtime = createtime;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets statushistory.
-	 *
-	 * @return the statushistory
-	 */
-	public String getStatushistory() {
-		return statushistory;
-	}
-
-	/**
-	 * Sets statushistory.
-	 *
-	 * @param statushistory the statushistory
-	 */
-	public void setStatushistory(String statushistory) {
-		this.statushistory = statushistory;
-	}
-
-	/**
-	 * Gets inid.
-	 *
-	 * @return the inid
-	 */
-	public String getInid() {
-		return inid;
-	}
-
-	/**
-	 * Sets inid.
-	 *
-	 * @param inid the inid
-	 */
-	public void setInid(String inid) {
-		this.inid = inid;
-	}
-
-	/**
-	 * Gets logistics.
-	 *
-	 * @return the logistics
-	 */
-	public Logistics getLogistics() {
-		return logistics;
-	}
-
-	/**
-	 * Sets logistics.
-	 *
-	 * @param logistics the logistics
-	 */
-	public void setLogistics(Logistics logistics) {
-		this.logistics = logistics;
-	}
-
-	/**
-	 * Gets change details.
-	 *
-	 * @return the change details
-	 */
-	public Set<ChangeFCustDetail> getChangeDetails() {
-		return changeDetails;
-	}
-
-	/**
-	 * Sets change details.
-	 *
-	 * @param changeDetails the change details
-	 */
-	public void setChangeDetails(Set<ChangeFCustDetail> changeDetails) {
-		this.changeDetails = changeDetails;
-	}
-
-	public ChangeFCust() {
-		this.statushistory = "";
-	}
-
-	/**
-	 * Gets orid.
-	 *
-	 * @return the orid
-	 */
-	public String getOrid() {
-		return orid;
-	}
-
-	/**
-	 * Sets orid.
-	 *
-	 * @param orid the orid
-	 */
-	public void setOrid(String orid) {
-		this.orid = orid;
-	}
-
-	/**
-	 * Gets json sd address.
-	 *
-	 * @return the json sd address
-	 */
-	public String getJsonSdAddress() {
-		return jsonSdAddress;
-	}
-
-	/**
-	 * Sets json sd address.
-	 *
-	 * @param jsonSdAddress the json sd address
-	 */
-	public void setJsonSdAddress(String jsonSdAddress) {
-		this.jsonSdAddress = jsonSdAddress;
-	}
-
-	/**
-	 * Gets qty.
-	 *
-	 * @return the qty
-	 */
-	public Double getQty() {
-		if (qty == null || qty == 0) {
-			setQtys();
-		}
-		return qty;
-	}
-
-	/**
-	 * Sets qty.
-	 *
-	 * @param qty the qty
-	 */
-	public void setQty(Double qty) {
-		this.qty = qty;
-	}
-
-	/**
-	 * Sets qtys.
-	 */
-	public void setQtys() {
-		double thisqty = 0D;
-		for (ChangeFCustDetail detail : this.changeDetails) {
-			thisqty += detail.getNumber();
-		}
-		this.qty = thisqty;
-	}
-
-	@Override
-	public String toString() {
-		return "ChangeFCust [id=" + id + ", changeid=" + changeid + ", orid=" + orid + ", buyeruu=" + buyeruu + ", buyerenuu=" + buyerenuu + ", sellerenuu=" + sellerenuu + ", jsonAddress="
-				+ jsonAddress + ", invoicetype=" + invoicetype + ", createtime=" + createtime + ", status=" + status  + ", price=" + price
-				+ ", statushistory=" + statushistory + ", inid=" + inid + "]";
-	}
-
-}

+ 0 - 622
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ChangeFCustDetail.java

@@ -1,622 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.alibaba.fastjson.annotation.JSONField;
-import com.uas.platform.b2c.core.utils.DoubleArith;
-import com.uas.platform.b2c.logistics.model.InvoiceDetail;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.trade.order.model.OrderDetail;
-import com.uas.platform.core.model.EncodingRulesConstant;
-import com.uas.platform.core.persistence.StatusColumn;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-/**
- * 客户换货单明细
- *
- * @author aof
- * @version 2017-08-02 17:00:58 创建文件
- */
-@Entity
-@Table(name = "trade$change_fmcust_dt")
-public class ChangeFCustDetail {
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue
-	@Column(name = "id")
-	private Long id;
-
-	/**
-	 * 主表
-	 * 
-	 * @JsonIgnore
-	 */
-	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE, CascadeType.REMOVE }, optional = true)
-	@JoinColumn(name = "change_id", nullable = false)
-	private ChangeFCust change;
-
-	/**
-	 * 关联的订单明细id
-	 */
-	@Column(name = "ord_id")
-	private String ordid;
-
-	/**
-	 * 明细序号 detailNO
-	 */
-	@Column(name = "detno")
-	private Short detno;
-
-	/**
-	 * 换货单明细编号
-	 */
-	@Column(name = "detail_id", unique = true)
-	private String detailid;
-
-	/**
-	 * 批次号
-	 */
-	@Column(name = "go_batch")
-	private String batchCode;
-
-	/**
-	 * 对应的器件uuid
-	 */
-	@Column(name = "cmp_uuid")
-	private String uuid;
-
-	/**
-	 * 库存 1311 现货 , 1312 呆滞库存 ,(暂时不用) 1313 废料
-	 */
-	@Column(name = "go_original")
-	private Integer original;
-
-	/**
-	 * 原厂型号
-	 */
-	@Column(name = "cmp_code")
-	private String cmpCode;
-
-	/**
-	 * 器件所属类目
-	 */
-	@Column(name = "ki_name")
-	private String kiName;
-
-	/**
-	 * 器件所属品牌
-	 */
-	@Column(name = "br_name")
-	private String brName;
-
-	/**
-	 * 图片path
-	 */
-	@Column(name = "cmp_img")
-	private String img;
-
-	/**
-	 * 币种名称
-	 */
-	@Column(name = "cr_name")
-	private String currencyName;
-
-	/**
-	 * 单价,单位为元
-	 */
-	@Column(name = "go_unitprice")
-	private Double unitprice;
-
-	/**
-	 * 换货数量
-	 */
-	@Column(name = "detail_number")
-	private Double number;
-
-	/**
-	 * 价格,存储的为元
-	 */
-	@Column(name = "detail_price")
-	private Double price;
-
-	/**
-	 * 存放采购明细流水号
-	 */
-	@Column(name = "detail_puid")
-	private String puid;
-
-	/**
-	 * 订单明细状态
-	 */
-	@Column(name = "detail_status")
-	@StatusColumn
-	private Integer status;
-
-	/**
-	 * 含税单价
-	 */
-	@Column(name = "detail_taxunitprice")
-	private Double taxunitprice;
-
-	/**
-	 * 税率
-	 */
-	@Column(name = "detail_tax")
-	private Short tax;
-
-	/**
-	 * 税率
-	 */
-	@Column(name = "detail_taxRate")
-	private Double taxRate;
-
-	/**
-	 * 税金
-	 */
-	@Column(name = "detail_taxes")
-	private Double taxes;
-
-	public ChangeFCustDetail(OrderDetail detail) {
-		this.detno = detail.getDetno();
-		this.batchCode = detail.getBatchCode();
-		this.uuid = detail.getUuid();
-		this.original = detail.getOriginal();
-		this.cmpCode = detail.getCmpCode();
-		this.brName = detail.getBrName();
-		this.kiName = detail.getKiName();
-		this.img = detail.getImg();
-		this.currencyName = detail.getCurrencyName();
-		this.unitprice = detail.getUnitprice();
-		this.taxunitprice = detail.getTaxUnitprice();
-		this.taxRate = detail.getTaxRate() == null ? 0 : detail.getTaxRate();
-		this.number = detail.getNumber();
-		this.price = DoubleArith.mul(this.number, detail.getTaxUnitprice());
-		this.taxes = DoubleArith.mul(this.price, this.taxRate);
-		this.ordid = detail.getDetailid();
-		this.puid = detail.getPurdetid();
-		this.status = detail.getStatus();
-	}
-
-	public ChangeFCustDetail() {
-
-	}
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets change.
-	 *
-	 * @return the change
-	 */
-	@JsonIgnore
-	@JSONField(serialize = false)
-	public ChangeFCust getChange() {
-		return change;
-	}
-
-	/**
-	 * Sets change.
-	 *
-	 * @param change the change
-	 */
-	public void setChange(ChangeFCust change) {
-		this.change = change;
-	}
-
-	/**
-	 * Gets detno.
-	 *
-	 * @return the detno
-	 */
-	public Short getDetno() {
-		return detno;
-	}
-
-	/**
-	 * Sets detno.
-	 *
-	 * @param detno the detno
-	 */
-	public void setDetno(Short detno) {
-		this.detno = detno;
-	}
-
-	/**
-	 * Gets detailid.
-	 *
-	 * @return the detailid
-	 */
-	public String getDetailid() {
-		return detailid;
-	}
-
-	/**
-	 * Sets detailid.
-	 *
-	 * @param detailid the detailid
-	 */
-	public void setDetailid(String detailid) {
-		this.detailid = detailid;
-	}
-
-	/**
-	 * Gets batch code.
-	 *
-	 * @return the batch code
-	 */
-	public String getBatchCode() {
-		return batchCode;
-	}
-
-	/**
-	 * Sets batch code.
-	 *
-	 * @param batchCode the batch code
-	 */
-	public void setBatchCode(String batchCode) {
-		this.batchCode = batchCode;
-	}
-
-	/**
-	 * Gets uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-
-	/**
-	 * Sets uuid.
-	 *
-	 * @param uuid the uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-
-	/**
-	 * Gets ordid.
-	 *
-	 * @return the ordid
-	 */
-	public String getOrdid() {
-		return ordid;
-	}
-
-	/**
-	 * Sets ordid.
-	 *
-	 * @param ordid the ordid
-	 */
-	public void setOrdid(String ordid) {
-		this.ordid = ordid;
-	}
-
-	/**
-	 * Gets taxunitprice.
-	 *
-	 * @return the taxunitprice
-	 */
-	public Double getTaxunitprice() {
-		return taxunitprice;
-	}
-
-	/**
-	 * Sets taxunitprice.
-	 *
-	 * @param taxunitprice the taxunitprice
-	 */
-	public void setTaxunitprice(Double taxunitprice) {
-		this.taxunitprice = taxunitprice;
-	}
-
-	/**
-	 * Gets tax.
-	 *
-	 * @return the tax
-	 */
-	public Short getTax() {
-		return tax;
-	}
-
-	/**
-	 * Sets tax.
-	 *
-	 * @param tax the tax
-	 */
-	public void setTax(Short tax) {
-		this.tax = tax;
-	}
-
-	/**
-	 * Gets taxes.
-	 *
-	 * @return the taxes
-	 */
-	public Double getTaxes() {
-		return taxes;
-	}
-
-	/**
-	 * Sets taxes.
-	 *
-	 * @param taxes the taxes
-	 */
-	public void setTaxes(Double taxes) {
-		this.taxes = taxes;
-	}
-
-	/**
-	 * Gets original.
-	 *
-	 * @return the original
-	 */
-	public Integer getOriginal() {
-		return original;
-	}
-
-	/**
-	 * Sets original.
-	 *
-	 * @param original the original
-	 */
-	public void setOriginal(Integer original) {
-		this.original = original;
-	}
-
-	/**
-	 * Gets cmp code.
-	 *
-	 * @return the cmp code
-	 */
-	public String getCmpCode() {
-		return cmpCode;
-	}
-
-	/**
-	 * Sets cmp code.
-	 *
-	 * @param cmpCode the cmp code
-	 */
-	public void setCmpCode(String cmpCode) {
-		this.cmpCode = cmpCode;
-	}
-
-	/**
-	 * Gets ki name.
-	 *
-	 * @return the ki name
-	 */
-	public String getKiName() {
-		return kiName;
-	}
-
-	/**
-	 * Sets ki name.
-	 *
-	 * @param kiName the ki name
-	 */
-	public void setKiName(String kiName) {
-		this.kiName = kiName;
-	}
-
-	/**
-	 * Gets br name.
-	 *
-	 * @return the br name
-	 */
-	public String getBrName() {
-		return brName;
-	}
-
-	/**
-	 * Sets br name.
-	 *
-	 * @param brName the br name
-	 */
-	public void setBrName(String brName) {
-		this.brName = brName;
-	}
-
-	/**
-	 * Gets img.
-	 *
-	 * @return the img
-	 */
-	public String getImg() {
-		return img;
-	}
-
-	/**
-	 * Sets img.
-	 *
-	 * @param img the img
-	 */
-	public void setImg(String img) {
-		this.img = img;
-	}
-
-	/**
-	 * Gets currency name.
-	 *
-	 * @return the currency name
-	 */
-	public String getCurrencyName() {
-		return currencyName;
-	}
-
-	/**
-	 * Sets currency name.
-	 *
-	 * @param currencyName the currency name
-	 */
-	public void setCurrencyName(String currencyName) {
-		this.currencyName = currencyName;
-	}
-
-	/**
-	 * Gets unitprice.
-	 *
-	 * @return the unitprice
-	 */
-	public Double getUnitprice() {
-		return unitprice;
-	}
-
-	/**
-	 * Sets unitprice.
-	 *
-	 * @param unitprice the unitprice
-	 */
-	public void setUnitprice(Double unitprice) {
-		this.unitprice = unitprice;
-	}
-
-	/**
-	 * Gets number.
-	 *
-	 * @return the number
-	 */
-	public Double getNumber() {
-		return number;
-	}
-
-	/**
-	 * Sets number.
-	 *
-	 * @param number the number
-	 */
-	public void setNumber(Double number) {
-		this.number = number;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets puid.
-	 *
-	 * @return the puid
-	 */
-	public String getPuid() {
-		return puid;
-	}
-
-	/**
-	 * Sets puid.
-	 *
-	 * @param puid the puid
-	 */
-	public void setPuid(String puid) {
-		this.puid = puid;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Convert invoice f ch detail invoice detail.
-	 *
-	 * @param createNumberService the create number service
-	 * @return the invoice detail
-	 */
-	public InvoiceDetail convertInvoiceFChDetail(CreateNumberService createNumberService) {
-		InvoiceDetail invoiceD = new InvoiceDetail();
-		String detailid = EncodingRulesConstant.INVOICE_DETAIL_FROMCHANGE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$invoice_detail", 9));
-		invoiceD.setDetailid(detailid);
-		invoiceD.setBatchCode(this.getBatchCode());
-		invoiceD.setUuid(this.getUuid());
-		invoiceD.setOriginal(this.original);
-		invoiceD.setCmpCode(this.getCmpCode());
-		invoiceD.setImg(this.getImg());
-		invoiceD.setUnitprice(this.getUnitprice());
-		invoiceD.setTaxunitprice(this.getTaxunitprice());
-		invoiceD.setTax(this.getTax());
-		invoiceD.setTaxes(this.getTaxes());
-		invoiceD.setNumber(this.getNumber());
-		invoiceD.setCurrencyName(this.getCurrencyName());
-		invoiceD.setPrice(this.getPrice());
-		// TODO 这里需要考虑确认总价的(默认和总价相等 打折等其他逻辑待考虑)
-		// invoiceD.setEnsurePrice(this.ensurePrice);
-		invoiceD.setStatus(this.getStatus());
-		// 记录来源明细 id
-		invoiceD.setSourceid(this.getDetailid());
-		return invoiceD;
-	}
-
-	/**
-	 * Gets tax rate.
-	 *
-	 * @return the tax rate
-	 */
-	public Double getTaxRate() {
-		return taxRate;
-	}
-
-	/**
-	 * Sets tax rate.
-	 *
-	 * @param taxRate the tax rate
-	 */
-	public void setTaxRate(Double taxRate) {
-		this.taxRate = taxRate;
-	}
-}

+ 0 - 881
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFB2c.java

@@ -1,881 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.uas.platform.b2c.logistics.model.Logistics;
-import com.uas.platform.b2c.trade.order.model.Document;
-import com.uas.platform.b2c.trade.order.model.Purchase;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.persistence.StatusColumn;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * 平台退货单
- *
- * @author aof
- * @version 2017-08-02 17:02:01 创建文件
- */
-@Entity
-@Table(name = "trade$return_fmb2c")
-public class ReturnFB2c extends Document implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue
-	@Column(name = "id")
-	private Long id;
-
-	/**
-	 * 退货单号
-	 */
-	@Column(name = "rf_id", unique = true)
-	private String returnid;
-
-	/**
-	 * 买方uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "rf_buyeruu")
-	private Long buyeruu;
-	
-	/**
-	 * 采购单号
-	 */
-	@Column(name = "rf_puid")
-	private String puid;
-	
-	/**
-	 * 客户的退货单
-	 */
-	@Column(name = "rfc_id")
-	private String rfcid;
-	
-	/**
-	 * 买方姓名
-	 */
-	@Column(name = "rf_buyername")
-	private String buyername;
-
-	/**
-	 * 买方企业uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "rf_buyerenuu")
-	private Long buyerenuu;
-
-	/**
-	 * 企业卖方uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "rf_sellerenuu")
-	private Long sellerenuu;
-
-	/**
-	 * 卖方企业名称
-	 */
-	@Column(name = "rf_sellername")
-	private String sellername;
-
-	/**
-	 * 付款方式
-	 */
-	@Column(name = "rf_paytype")
-	private Integer paytype;
-
-	/**
-	 * 配送方式
-	 */
-	@Column(name = "rf_deliverytype")
-	private Integer deliverytype;
-
-	/**
-	 * 收货地址 这里使用json字符串的形式将收货地址整个存起来
-	 */
-	@Column(name = "rf_addr", length = 2000)
-	private String jsonAddress;
-
-	/**
-	 * 发票类型
-	 */
-	@Column(name = "rf_invoicetype")
-	private Integer invoicetype;
-
-	/**
-	 * 发票抬头
-	 */
-	@Column(name = "rf_invoicetitle")
-	private String invoicetitle;
-
-	/**
-	 * 订单生成时间
-	 */
-	@Column(name = "rf_createtime")
-	private Date createtime;
-
-	/**
-	 * 退货有效时间
-	 */
-	@Column(name = "rf_availabletime")
-	private Date availabletime;
-
-	/**
-	 * 订单状态(1->2->3->4->5->6->7->8->9)
-	 * 
-	 * @Tip 必须严格按照顺序流转
-	 *      1、PAID(504, "待回寄"), 2、TOBESHIPPED(406, "验货中"), 3、SHIPPINGIN(403,
-	 *      "已验货"), 4、SHIPPED(407, "待退款"), 5、SENDING(408, "已退款"),
-	 */
-	@Column(name = "rf_status")
-	@StatusColumn
-	private Integer status;
-
-	/**
-	 * 退款时间
-	 */
-	@Column(name = "rf_paytime")
-	private Date paytime;
-
-	/**
-	 * 银行转账信息id
-	 * 
-	 * @Tip 目前只有银行转账信息,
-	 */
-	@Column(name = "rf_banktf")
-	private Long banktfid;
-
-	/**
-	 * 数量
-	 */
-	@Column(name = "rf_qty")
-	private Double qty;
-
-	/**
-	 * 价格,存储的为元
-	 */
-	@Column(name = "rf_price")
-	private Double price;
-
-	/**
-	 * 状态变更记录 List<StatusHistory> -> Json
-	 */
-	@Column(name = "rf_statushistory", length = 4000)
-	private String statushistory;
-
-	/**
-	 * 转的发货单id
-	 */
-	@Column(name = "in_id")
-	private String inid;
-	/**
-	 * 币别
-	 */
-	@Column(name = "rf_currency")
-	private String currency;
-	
-	/**
-	 * 税金
-	 */
-	@Column(name = "rf_taxes")
-	private Double taxes;
-
-	/**
-	 * 关联的订单id
-	 */
-	@Column(name = "or_id")
-	private String orid;
-
-	/**
-	 * 物流信息
-	 */
-	@OneToOne(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
-	@JoinColumn(name = "rf_lgt_id")
-	private Logistics logistics;
-
-	/**
-	 * 客户退货单
-	 */
-	@OneToOne(cascade = { CascadeType.REFRESH })
-	@JoinColumn(name = "in_custid", insertable = false, updatable = false)
-	private ReturnFCust cust;
-
-	/**
-	 * 客户退货单id
-	 */
-	@Column(name = "in_custid")
-	private Long custid;
-
-	/**
-	 * 退货单明细
-	 */
-	@OneToMany(mappedBy = "b2creturn", cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
-	@OrderBy("detno")
-	private Set<ReturnFB2cDetail> returnDetails;
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets returnid.
-	 *
-	 * @return the returnid
-	 */
-	public String getReturnid() {
-		return returnid;
-	}
-
-	/**
-	 * Sets returnid.
-	 *
-	 * @param returnid the returnid
-	 */
-	public void setReturnid(String returnid) {
-		this.returnid = returnid;
-	}
-
-	/**
-	 * Gets rfcid.
-	 *
-	 * @return the rfcid
-	 */
-	public String getRfcid() {
-		return rfcid;
-	}
-
-	/**
-	 * Sets rfcid.
-	 *
-	 * @param rfcid the rfcid
-	 */
-	public void setRfcid(String rfcid) {
-		this.rfcid = rfcid;
-	}
-
-	/**
-	 * Gets buyeruu.
-	 *
-	 * @return the buyeruu
-	 */
-	public Long getBuyeruu() {
-		return buyeruu;
-	}
-
-	/**
-	 * Sets buyeruu.
-	 *
-	 * @param buyeruu the buyeruu
-	 */
-	public void setBuyeruu(Long buyeruu) {
-		this.buyeruu = buyeruu;
-	}
-
-	/**
-	 * Gets currency.
-	 *
-	 * @return the currency
-	 */
-	public String getCurrency() {
-		return currency;
-	}
-
-	/**
-	 * Sets currency.
-	 *
-	 * @param currency the currency
-	 */
-	public void setCurrency(String currency) {
-		this.currency = currency;
-	}
-
-	/**
-	 * Gets taxes.
-	 *
-	 * @return the taxes
-	 */
-	public Double getTaxes() {
-		return taxes;
-	}
-
-	/**
-	 * Sets taxes.
-	 *
-	 * @param taxes the taxes
-	 */
-	public void setTaxes(Double taxes) {
-		this.taxes = taxes;
-	}
-
-	/**
-	 * Gets buyername.
-	 *
-	 * @return the buyername
-	 */
-	public String getBuyername() {
-		return buyername;
-	}
-
-	/**
-	 * Sets buyername.
-	 *
-	 * @param buyername the buyername
-	 */
-	public void setBuyername(String buyername) {
-		this.buyername = buyername;
-	}
-
-	/**
-	 * Gets buyerenuu.
-	 *
-	 * @return the buyerenuu
-	 */
-	public Long getBuyerenuu() {
-		return buyerenuu;
-	}
-
-	/**
-	 * Sets buyerenuu.
-	 *
-	 * @param buyerenuu the buyerenuu
-	 */
-	public void setBuyerenuu(Long buyerenuu) {
-		this.buyerenuu = buyerenuu;
-	}
-
-	/**
-	 * Gets sellerenuu.
-	 *
-	 * @return the sellerenuu
-	 */
-	public Long getSellerenuu() {
-		return sellerenuu;
-	}
-
-	/**
-	 * Sets sellerenuu.
-	 *
-	 * @param sellerenuu the sellerenuu
-	 */
-	public void setSellerenuu(Long sellerenuu) {
-		this.sellerenuu = sellerenuu;
-	}
-
-	/**
-	 * Gets sellername.
-	 *
-	 * @return the sellername
-	 */
-	public String getSellername() {
-		return sellername;
-	}
-
-	/**
-	 * Sets sellername.
-	 *
-	 * @param sellername the sellername
-	 */
-	public void setSellername(String sellername) {
-		this.sellername = sellername;
-	}
-
-	/**
-	 * Gets paytype.
-	 *
-	 * @return the paytype
-	 */
-	public Integer getPaytype() {
-		return paytype;
-	}
-
-	/**
-	 * Sets paytype.
-	 *
-	 * @param paytype the paytype
-	 */
-	public void setPaytype(Integer paytype) {
-		this.paytype = paytype;
-	}
-
-	/**
-	 * Gets puid.
-	 *
-	 * @return the puid
-	 */
-	public String getPuid() {
-		return puid;
-	}
-
-	/**
-	 * Sets puid.
-	 *
-	 * @param puid the puid
-	 */
-	public void setPuid(String puid) {
-		this.puid = puid;
-	}
-
-	/**
-	 * Gets deliverytype.
-	 *
-	 * @return the deliverytype
-	 */
-	public Integer getDeliverytype() {
-		return deliverytype;
-	}
-
-	/**
-	 * Sets deliverytype.
-	 *
-	 * @param deliverytype the deliverytype
-	 */
-	public void setDeliverytype(Integer deliverytype) {
-		this.deliverytype = deliverytype;
-	}
-
-	/**
-	 * Gets json address.
-	 *
-	 * @return the json address
-	 */
-	public String getJsonAddress() {
-		return jsonAddress;
-	}
-
-	/**
-	 * Sets json address.
-	 *
-	 * @param jsonAddress the json address
-	 */
-	public void setJsonAddress(String jsonAddress) {
-		this.jsonAddress = jsonAddress;
-	}
-
-	/**
-	 * Gets invoicetype.
-	 *
-	 * @return the invoicetype
-	 */
-	public Integer getInvoicetype() {
-		return invoicetype;
-	}
-
-	/**
-	 * Sets invoicetype.
-	 *
-	 * @param invoicetype the invoicetype
-	 */
-	public void setInvoicetype(Integer invoicetype) {
-		this.invoicetype = invoicetype;
-	}
-
-	/**
-	 * Gets invoicetitle.
-	 *
-	 * @return the invoicetitle
-	 */
-	public String getInvoicetitle() {
-		return invoicetitle;
-	}
-
-	/**
-	 * Sets invoicetitle.
-	 *
-	 * @param invoicetitle the invoicetitle
-	 */
-	public void setInvoicetitle(String invoicetitle) {
-		this.invoicetitle = invoicetitle;
-	}
-
-	/**
-	 * Gets createtime.
-	 *
-	 * @return the createtime
-	 */
-	public Date getCreatetime() {
-		return createtime;
-	}
-
-	/**
-	 * Sets createtime.
-	 *
-	 * @param createtime the createtime
-	 */
-	public void setCreatetime(Date createtime) {
-		this.createtime = createtime;
-	}
-
-	/**
-	 * Gets availabletime.
-	 *
-	 * @return the availabletime
-	 */
-	public Date getAvailabletime() {
-		return availabletime;
-	}
-
-	/**
-	 * Sets availabletime.
-	 *
-	 * @param availabletime the availabletime
-	 */
-	public void setAvailabletime(Date availabletime) {
-		this.availabletime = availabletime;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Gets paytime.
-	 *
-	 * @return the paytime
-	 */
-	public Date getPaytime() {
-		return paytime;
-	}
-
-	/**
-	 * Sets paytime.
-	 *
-	 * @param paytime the paytime
-	 */
-	public void setPaytime(Date paytime) {
-		this.paytime = paytime;
-	}
-
-	/**
-	 * Gets banktfid.
-	 *
-	 * @return the banktfid
-	 */
-	public Long getBanktfid() {
-		return banktfid;
-	}
-
-	/**
-	 * Sets banktfid.
-	 *
-	 * @param banktfid the banktfid
-	 */
-	public void setBanktfid(Long banktfid) {
-		this.banktfid = banktfid;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets statushistory.
-	 *
-	 * @return the statushistory
-	 */
-	public String getStatushistory() {
-		return statushistory;
-	}
-
-	/**
-	 * Sets statushistory.
-	 *
-	 * @param statushistory the statushistory
-	 */
-	public void setStatushistory(String statushistory) {
-		this.statushistory = statushistory;
-	}
-
-	/**
-	 * Gets inid.
-	 *
-	 * @return the inid
-	 */
-	public String getInid() {
-		return inid;
-	}
-
-	/**
-	 * Sets inid.
-	 *
-	 * @param inid the inid
-	 */
-	public void setInid(String inid) {
-		this.inid = inid;
-	}
-
-	/**
-	 * Gets logistics.
-	 *
-	 * @return the logistics
-	 */
-	public Logistics getLogistics() {
-		return logistics;
-	}
-
-	/**
-	 * Sets logistics.
-	 *
-	 * @param logistics the logistics
-	 */
-	public void setLogistics(Logistics logistics) {
-		this.logistics = logistics;
-	}
-
-	/**
-	 * Gets custid.
-	 *
-	 * @return the custid
-	 */
-	public Long getCustid() {
-		return custid;
-	}
-
-	/**
-	 * Sets custid.
-	 *
-	 * @param custid the custid
-	 */
-	public void setCustid(Long custid) {
-		this.custid = custid;
-	}
-
-	/**
-	 * Gets return details.
-	 *
-	 * @return the return details
-	 */
-	public Set<ReturnFB2cDetail> getReturnDetails() {
-		return returnDetails;
-	}
-
-	/**
-	 * Sets return details.
-	 *
-	 * @param returnDetails the return details
-	 */
-	public void setReturnDetails(Set<ReturnFB2cDetail> returnDetails) {
-		this.returnDetails = returnDetails;
-	}
-
-	/**
-	 * Gets cust.
-	 *
-	 * @return the cust
-	 */
-	public ReturnFCust getCust() {
-		return cust;
-	}
-
-	/**
-	 * Sets cust.
-	 *
-	 * @param cust the cust
-	 */
-	public void setCust(ReturnFCust cust) {
-		this.cust = cust;
-	}
-
-	/**
-	 * Gets orid.
-	 *
-	 * @return the orid
-	 */
-	public String getOrid() {
-		return orid;
-	}
-
-	/**
-	 * Sets orid.
-	 *
-	 * @param orid the orid
-	 */
-	public void setOrid(String orid) {
-		this.orid = orid;
-	}
-
-	/**
-	 * Sets status tobeshippedback.
-	 *
-	 * @param uu the uu
-	 */
-// 待回寄
-	public void setStatusTobeshippedback(Long uu) {
-		this.status = Status.TOBESHIPPEDBACK.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status inspecting.
-	 *
-	 * @param uu the uu
-	 */
-// 验货中
-	public void setStatusInspecting(Long uu) {
-		this.status = Status.INSPECTING.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status received.
-	 *
-	 * @param uu the uu
-	 */
-	// 已收货
-	public void setStatusReceived(Long uu) {
-		if (Status.INSPECTING.value() != this.status) {
-			return;
-		}
-		this.status = Status.RECEIVED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status refunded.
-	 *
-	 * @param uu the uu
-	 */
-	// 已退款
-	public void setStatusRefunded(Long uu) {
-		this.status = Status.REFUNDED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 客户退货转平台退货
-	 *
-	 * @param cust the cust
-	 */
-	public ReturnFB2c(ReturnFCust cust) {
-		this.buyeruu = cust.getBuyeruu();
-		this.buyerenuu = cust.getBuyerenuu();
-		this.buyername = cust.getBuyername();
-		this.paytype = cust.getPaytype();
-		this.deliverytype = cust.getDeliverytype();
-		// 收货地址需要去对应供应商的收货地址
-		this.invoicetype = cust.getInvoicetype();
-		this.invoicetitle = cust.getInvoicetitle();
-		this.availabletime = cust.getAvailabletime();
-		this.paytime = cust.getPaytime();
-		this.banktfid = cust.getBanktfid();
-		this.inid = cust.getInid();
-		this.orid = cust.getOrid();
-	}
-
-	/**
-	 * 客户退货转平台退货
-	 *
-	 * @param purchase the purchase
-	 */
-	public ReturnFB2c(Purchase purchase) {
-		this.createtime = new Date();
-		this.puid = purchase.getPurchaseid();
-		this.sellerenuu = purchase.getSellerenuu();
-		this.sellername = purchase.getSellername();
-		this.paytime = purchase.getPayTime();
-		this.jsonAddress = purchase.getJsonAddress();
-		this.currency = purchase.getCurrency();
-	}
-
-	/**
-	 * Gets qty.
-	 *
-	 * @return the qty
-	 */
-	public Double getQty() {
-		if (qty == null || qty == 0) {
-			setQtys();
-		}
-		return qty;
-	}
-
-	/**
-	 * Sets qty.
-	 *
-	 * @param qty the qty
-	 */
-	public void setQty(Double qty) {
-		this.qty = qty;
-	}
-
-	/**
-	 * Sets qtys.
-	 */
-	public void setQtys() {
-		double thisqty = 0D;
-		if(this.returnDetails != null) {
-			for (ReturnFB2cDetail detail : this.returnDetails) {
-				if(detail.getNumber() != null) {
-					thisqty += detail.getNumber();
-				}
-			}
-		}
-		this.qty = thisqty;
-	}
-
-	/**
-	 * @Tip 对象初始化时必须给历史记录赋值
-	 */
-	public ReturnFB2c() {
-		this.statushistory = "";
-	}
-}

+ 0 - 619
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFB2cDetail.java

@@ -1,619 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.alibaba.fastjson.annotation.JSONField;
-import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
-import com.uas.platform.core.persistence.StatusColumn;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-/**
- * 平台退货单明细
- *
- * @author aof
- * @version 2017-08-02 17:03:40 创建文件
- */
-@Entity
-@Table(name = "trade$return_fmb2c_dt")
-public class ReturnFB2cDetail {
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue
-	@Column(name = "id")
-	private Long id;
-
-	/**
-	 * 主表
-	 * 
-	 * @JsonIgnore
-	 */
-	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE })
-	@JoinColumn(name = "return_id", nullable = false)
-	private ReturnFB2c b2creturn;
-
-	/**
-	 * 明细序号 detailNO
-	 */
-	@Column(name = "detno")
-	private Short detno;
-
-	/**
-	 * 退货单明细编号
-	 */
-	@Column(name = "detail_id", unique = true)
-	private String detailid;
-
-	/**
-	 * 批次号
-	 */
-	@Column(name = "go_batch")
-	private String batchCode;
-
-	/**
-	 * 对应的器件uuid
-	 */
-	@Column(name = "cmp_uuid")
-	private String uuid;
-
-	/**
-	 * 订单明细流水号
-	 */
-	@Column(name = "detailor_id")
-	private String ordetailid;
-
-	/**
-	 * 库存 1311 现货, 呆滞库存 1312 ,(暂时不用) 1313 废料
-	 */
-	@Column(name = "go_original")
-	private Integer original;
-
-	/**
-	 * 原厂型号
-	 */
-	@Column(name = "cmp_code")
-	private String cmpCode;
-
-	/**
-	 * 器件所属类目
-	 */
-	@Column(name = "ki_name")
-	private String kiName;
-
-	/**
-	 * 器件所属品牌
-	 */
-	@Column(name = "br_name")
-	private String brName;
-
-	/**
-	 * 图片path
-	 */
-	@Column(name = "cmp_img")
-	private String img;
-
-	/**
-	 * 单价,单位为元
-	 */
-	@Column(name = "go_unitprice")
-	private Double unitprice;
-
-	/**
-	 * 含税单价,单位为元
-	 */
-	@Column(name = "go_taxunitprice")
-	private Double taxUnitprice;
-
-	/**
-	 * 币别,币种名称
-	 */
-	@Column(name = "detail_currency")
-	private String currencyName;
-
-	/**
-	 * 税率
-	 */
-	@Column(name = "go_tax")
-	private Short tax;
-
-	/**
-	 * 税金
-	 */
-	@Column(name = "detail_taxes")
-	private Double taxes;
-
-	/**
-	 * 退货数量
-	 */
-	@Column(name = "detail_number")
-	private Double number;
-
-	/**
-	 * 价格,存储的为元
-	 */
-	@Column(name = "detail_price")
-	private Double price;
-
-	/**
-	 * 存放采购明细流水号
-	 */
-	@Column(name = "detail_puid")
-	private String puid;
-
-	/**
-	 * 订单明细状态
-	 */
-	@Column(name = "detail_status")
-	@StatusColumn
-	private Integer status;
-
-	/**
-	 * 存放客户退货单明细的流水号
-	 */
-	@Column(name = "detail_rcustid")
-	private String rfcdid;
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets b 2 creturn.
-	 *
-	 * @return the b 2 creturn
-	 */
-	@JsonIgnore
-	@JSONField(serialize = false)
-	public ReturnFB2c getB2creturn() {
-		return b2creturn;
-	}
-
-	/**
-	 * Sets b 2 creturn.
-	 *
-	 * @param b2creturn the b 2 creturn
-	 */
-	public void setB2creturn(ReturnFB2c b2creturn) {
-		this.b2creturn = b2creturn;
-	}
-
-	/**
-	 * Gets ordetailid.
-	 *
-	 * @return the ordetailid
-	 */
-	public String getOrdetailid() {
-		return ordetailid;
-	}
-
-	/**
-	 * Sets ordetailid.
-	 *
-	 * @param ordetailid the ordetailid
-	 */
-	public void setOrdetailid(String ordetailid) {
-		this.ordetailid = ordetailid;
-	}
-
-	/**
-	 * Gets detno.
-	 *
-	 * @return the detno
-	 */
-	public Short getDetno() {
-		return detno;
-	}
-
-	/**
-	 * Sets detno.
-	 *
-	 * @param detno the detno
-	 */
-	public void setDetno(Short detno) {
-		this.detno = detno;
-	}
-
-	/**
-	 * Gets rfcdid.
-	 *
-	 * @return the rfcdid
-	 */
-	public String getRfcdid() {
-		return rfcdid;
-	}
-
-	/**
-	 * Sets rfcdid.
-	 *
-	 * @param rfcdid the rfcdid
-	 */
-	public void setRfcdid(String rfcdid) {
-		this.rfcdid = rfcdid;
-	}
-
-	/**
-	 * Gets tax unitprice.
-	 *
-	 * @return the tax unitprice
-	 */
-	public Double getTaxUnitprice() {
-		return taxUnitprice;
-	}
-
-	/**
-	 * Sets tax unitprice.
-	 *
-	 * @param taxUnitprice the tax unitprice
-	 */
-	public void setTaxUnitprice(Double taxUnitprice) {
-		this.taxUnitprice = taxUnitprice;
-	}
-
-	/**
-	 * Gets currency name.
-	 *
-	 * @return the currency name
-	 */
-	public String getCurrencyName() {
-		return currencyName;
-	}
-
-	/**
-	 * Sets currency name.
-	 *
-	 * @param currencyName the currency name
-	 */
-	public void setCurrencyName(String currencyName) {
-		this.currencyName = currencyName;
-	}
-
-	/**
-	 * Gets tax.
-	 *
-	 * @return the tax
-	 */
-	public Short getTax() {
-		return tax;
-	}
-
-	/**
-	 * Sets tax.
-	 *
-	 * @param tax the tax
-	 */
-	public void setTax(Short tax) {
-		this.tax = tax;
-	}
-
-	/**
-	 * Gets taxes.
-	 *
-	 * @return the taxes
-	 */
-	public Double getTaxes() {
-		return taxes;
-	}
-
-	/**
-	 * Sets taxes.
-	 *
-	 * @param taxes the taxes
-	 */
-	public void setTaxes(Double taxes) {
-		this.taxes = taxes;
-	}
-
-	/**
-	 * Gets detailid.
-	 *
-	 * @return the detailid
-	 */
-	public String getDetailid() {
-		return detailid;
-	}
-
-	/**
-	 * Sets detailid.
-	 *
-	 * @param detailid the detailid
-	 */
-	public void setDetailid(String detailid) {
-		this.detailid = detailid;
-	}
-
-	/**
-	 * Gets batch code.
-	 *
-	 * @return the batch code
-	 */
-	public String getBatchCode() {
-		return batchCode;
-	}
-
-	/**
-	 * Sets batch code.
-	 *
-	 * @param batchCode the batch code
-	 */
-	public void setBatchCode(String batchCode) {
-		this.batchCode = batchCode;
-	}
-
-	/**
-	 * Gets uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-
-	/**
-	 * Sets uuid.
-	 *
-	 * @param uuid the uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-
-	/**
-	 * Gets original.
-	 *
-	 * @return the original
-	 */
-	public Integer getOriginal() {
-		return original;
-	}
-
-	/**
-	 * Sets original.
-	 *
-	 * @param original the original
-	 */
-	public void setOriginal(Integer original) {
-		this.original = original;
-	}
-
-	/**
-	 * Gets cmp code.
-	 *
-	 * @return the cmp code
-	 */
-	public String getCmpCode() {
-		return cmpCode;
-	}
-
-	/**
-	 * Sets cmp code.
-	 *
-	 * @param cmpCode the cmp code
-	 */
-	public void setCmpCode(String cmpCode) {
-		this.cmpCode = cmpCode;
-	}
-
-	/**
-	 * Gets ki name.
-	 *
-	 * @return the ki name
-	 */
-	public String getKiName() {
-		return kiName;
-	}
-
-	/**
-	 * Sets ki name.
-	 *
-	 * @param kiName the ki name
-	 */
-	public void setKiName(String kiName) {
-		this.kiName = kiName;
-	}
-
-	/**
-	 * Gets br name.
-	 *
-	 * @return the br name
-	 */
-	public String getBrName() {
-		return brName;
-	}
-
-	/**
-	 * Sets br name.
-	 *
-	 * @param brName the br name
-	 */
-	public void setBrName(String brName) {
-		this.brName = brName;
-	}
-
-	/**
-	 * Gets img.
-	 *
-	 * @return the img
-	 */
-	public String getImg() {
-		return img;
-	}
-
-	/**
-	 * Sets img.
-	 *
-	 * @param img the img
-	 */
-	public void setImg(String img) {
-		this.img = img;
-	}
-
-	/**
-	 * Gets unitprice.
-	 *
-	 * @return the unitprice
-	 */
-	public Double getUnitprice() {
-		return unitprice;
-	}
-
-	/**
-	 * Sets unitprice.
-	 *
-	 * @param unitprice the unitprice
-	 */
-	public void setUnitprice(Double unitprice) {
-		this.unitprice = unitprice;
-	}
-
-	/**
-	 * Gets number.
-	 *
-	 * @return the number
-	 */
-	public Double getNumber() {
-		return number;
-	}
-
-	/**
-	 * Sets number.
-	 *
-	 * @param number the number
-	 */
-	public void setNumber(Double number) {
-		this.number = number;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets puid.
-	 *
-	 * @return the puid
-	 */
-	public String getPuid() {
-		return puid;
-	}
-
-	/**
-	 * Sets puid.
-	 *
-	 * @param puid the puid
-	 */
-	public void setPuid(String puid) {
-		this.puid = puid;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Instantiates a new Return fb 2 c detail.
-	 *
-	 * @param custDetail the cust detail
-	 */
-	public ReturnFB2cDetail(ReturnFCustDetail custDetail) {
-		// this.b2creturn = b2creturn;
-		this.detno = custDetail.getDetno();
-		this.ordetailid = custDetail.getOrd_id();
-		this.batchCode = custDetail.getBatchCode();
-		this.uuid = custDetail.getUuid();
-		this.original = custDetail.getOriginal();
-		this.cmpCode = custDetail.getCmpCode();
-		this.brName = custDetail.getBrName();
-		this.kiName = custDetail.getKiName();
-		this.img = custDetail.getImg();
-		this.unitprice = custDetail.getUnitprice();
-		this.number = custDetail.getNumber();
-		this.price = custDetail.getPrice();
-		this.puid = custDetail.getPuid();
-		this.tax = custDetail.getTax();
-		this.taxes = custDetail.getTaxes();
-		this.currencyName = custDetail.getCurrencyName();
-		this.taxUnitprice = custDetail.getTaxUnitprice();
-		this.rfcdid = custDetail.getDetailid();
-	}
-
-	/**
-	 * Instantiates a new Return fb 2 c detail.
-	 *
-	 * @param detail the detail
-	 */
-	public ReturnFB2cDetail(PurchaseDetail detail) {
-		this.ordetailid = detail.getOrderdetailid();
-		this.batchCode = detail.getBatchCode();
-		this.uuid = detail.getUuid();
-		this.original = detail.getOriginal();
-		this.cmpCode = detail.getCmpCode();
-		this.brName = detail.getBrName();
-		this.kiName = detail.getKiName();
-		this.img = detail.getImg();
-		this.unitprice = detail.getUnitprice();
-		this.number = detail.getNumber();
-		this.price = detail.getPrice();
-		this.puid = detail.getDetailid();
-		this.tax = detail.getTax();
-		this.taxes = detail.getTaxes();
-		this.currencyName = detail.getCurrencyName();
-		this.taxUnitprice = detail.getTaxUnitPrice();
-		this.rfcdid = null;
-	}
-
-	public ReturnFB2cDetail() {
-
-	}
-
-}

+ 0 - 370
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFB2cSimpleInfo.java

@@ -1,370 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.uas.platform.b2c.logistics.model.Logistics;
-import com.uas.platform.b2c.trade.order.model.Document;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * 简要的平台退货单信息
- *
- * @author wangyc
- * @version 2017-08-02 17:04:31 创建文件
- */
-public class ReturnFB2cSimpleInfo extends Document implements Serializable {
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	private Long id;
-
-	/**
-	 * 退货单号
-	 */
-	private String returnid;
-
-	/**
-	 * 企业卖方uu
-	 */
-	private Long sellerenuu;
-
-	/**
-	 * 订单生成时间
-	 */
-	private Date createtime;
-
-	/**
-	 * 退货有效时间
-	 */
-	private Date availabletime;
-
-	/**
-	 * 订单状态(1->2->3->4->5->6->7->8->9)
-	 * 
-	 * @Tip 必须严格按照顺序流转 1、TOBECONFIRMED(701, "申请中"), 2、TOBEPAID(702, "未通过"),
-	 *      3、PAID(504, "待回寄"), 4、TOBESHIPPED(406, "验货中"), 5、SHIPPINGIN(403,
-	 *      "已验货"), 6、SHIPPED(407, "待退款"), 7、SENDING(408, "已退款"),
-	 */
-	private Integer status;
-
-	/**
-	 * 退款时间
-	 */
-	private Date paytime;
-
-	/**
-	 * 数量
-	 */
-	private Double qty;
-
-	/**
-	 * 价格,存储的为元
-	 */
-	private Double price;
-
-	/**
-	 * 状态变更记录 List<StatusHistory> -> Json
-	 */
-	private String statushistory;
-
-	/**
-	 * 来源采购单的id
-	 */
-	private String purchaseid;
-
-	/**
-	 * 物流信息
-	 */
-	private Logistics logistics;
-
-	/**
-	 * 币别
-	 */
-	private String currency;
-
-	/**
-	 * 退货单明细
-	 */
-	private Set<ReturnFB2cDetail> returnDetails;
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets returnid.
-	 *
-	 * @return the returnid
-	 */
-	public String getReturnid() {
-		return returnid;
-	}
-
-	/**
-	 * Sets returnid.
-	 *
-	 * @param returnid the returnid
-	 */
-	public void setReturnid(String returnid) {
-		this.returnid = returnid;
-	}
-
-	/**
-	 * Gets sellerenuu.
-	 *
-	 * @return the sellerenuu
-	 */
-	public Long getSellerenuu() {
-		return sellerenuu;
-	}
-
-	/**
-	 * Sets sellerenuu.
-	 *
-	 * @param sellerenuu the sellerenuu
-	 */
-	public void setSellerenuu(Long sellerenuu) {
-		this.sellerenuu = sellerenuu;
-	}
-
-	/**
-	 * Gets currency.
-	 *
-	 * @return the currency
-	 */
-	public String getCurrency() {
-		return currency;
-	}
-
-	/**
-	 * Sets currency.
-	 *
-	 * @param currency the currency
-	 */
-	public void setCurrency(String currency) {
-		this.currency = currency;
-	}
-
-	/**
-	 * Gets createtime.
-	 *
-	 * @return the createtime
-	 */
-	public Date getCreatetime() {
-		return createtime;
-	}
-
-	/**
-	 * Sets createtime.
-	 *
-	 * @param createtime the createtime
-	 */
-	public void setCreatetime(Date createtime) {
-		this.createtime = createtime;
-	}
-
-	/**
-	 * Gets availabletime.
-	 *
-	 * @return the availabletime
-	 */
-	public Date getAvailabletime() {
-		return availabletime;
-	}
-
-	/**
-	 * Sets availabletime.
-	 *
-	 * @param availabletime the availabletime
-	 */
-	public void setAvailabletime(Date availabletime) {
-		this.availabletime = availabletime;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Gets paytime.
-	 *
-	 * @return the paytime
-	 */
-	public Date getPaytime() {
-		return paytime;
-	}
-
-	/**
-	 * Sets paytime.
-	 *
-	 * @param paytime the paytime
-	 */
-	public void setPaytime(Date paytime) {
-		this.paytime = paytime;
-	}
-
-	/**
-	 * Gets qty.
-	 *
-	 * @return the qty
-	 */
-	public Double getQty() {
-		return qty;
-	}
-
-	/**
-	 * Sets qty.
-	 *
-	 * @param qty the qty
-	 */
-	public void setQty(Double qty) {
-		this.qty = qty;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets statushistory.
-	 *
-	 * @return the statushistory
-	 */
-	public String getStatushistory() {
-		return statushistory;
-	}
-
-	/**
-	 * Sets statushistory.
-	 *
-	 * @param statushistory the statushistory
-	 */
-	public void setStatushistory(String statushistory) {
-		this.statushistory = statushistory;
-	}
-
-	/**
-	 * Gets purchaseid.
-	 *
-	 * @return the purchaseid
-	 */
-	public String getPurchaseid() {
-		return purchaseid;
-	}
-
-	/**
-	 * Sets purchaseid.
-	 *
-	 * @param purchaseid the purchaseid
-	 */
-	public void setPurchaseid(String purchaseid) {
-		this.purchaseid = purchaseid;
-	}
-
-	/**
-	 * Gets logistics.
-	 *
-	 * @return the logistics
-	 */
-	public Logistics getLogistics() {
-		return logistics;
-	}
-
-	/**
-	 * Sets logistics.
-	 *
-	 * @param logistics the logistics
-	 */
-	public void setLogistics(Logistics logistics) {
-		this.logistics = logistics;
-	}
-
-	/**
-	 * Gets return details.
-	 *
-	 * @return the return details
-	 */
-	public Set<ReturnFB2cDetail> getReturnDetails() {
-		return returnDetails;
-	}
-
-	/**
-	 * Sets return details.
-	 *
-	 * @param returnDetails the return details
-	 */
-	public void setReturnDetails(Set<ReturnFB2cDetail> returnDetails) {
-		this.returnDetails = returnDetails;
-	}
-
-	public ReturnFB2cSimpleInfo() {
-
-	}
-
-	/**
-	 * Instantiates a new Return fb 2 c simple info.
-	 *
-	 * @param returnFB2c the return fb 2 c
-	 */
-	public ReturnFB2cSimpleInfo(ReturnFB2c returnFB2c) {
-		this.returnid = returnFB2c.getReturnid();
-		this.sellerenuu = returnFB2c.getSellerenuu();
-		this.createtime = returnFB2c.getCreatetime();
-		this.availabletime = returnFB2c.getAvailabletime();
-		this.status = returnFB2c.getStatus();
-		this.paytime = returnFB2c.getPaytime();
-		this.qty = returnFB2c.getQty();
-		this.price = returnFB2c.getPrice();
-		this.statushistory = returnFB2c.getStatushistory();
-		this.logistics = returnFB2c.getLogistics();
-		this.returnDetails = returnFB2c.getReturnDetails();
-		this.purchaseid = returnFB2c.getPuid();
-		this.currency = returnFB2c.getCurrency();
-	}
-
-}

+ 0 - 829
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFCust.java

@@ -1,829 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.uas.platform.b2c.logistics.model.Logistics;
-import com.uas.platform.b2c.trade.order.model.Document;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.persistence.StatusColumn;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * 客户退货单
- *
- * @author aof
- * @version 2017-08-02 17:05:17 创建文件
- */
-@Entity
-@Table(name = "trade$return_fmcust")
-public class ReturnFCust extends Document implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue
-	@Column(name = "id")
-	private Long id;
-
-	/**
-	 * 退货单号
-	 */
-	@Column(name = "rf_id", unique = true)
-	private String returnid;
-
-	/**
-	 * 买方uu
-	 * 
-	 */
-	@Column(name = "rf_buyeruu")
-	private Long buyeruu;
-
-	/**
-	 * 买方姓名
-	 */
-	@Column(name = "rf_buyername")
-	private String buyername;
-
-	/**
-	 * 买方企业uu
-	 * 
-	 * @Tip 买家所在的企业
-	 */
-	@Column(name = "rf_buyerenuu")
-	private Long buyerenuu;
-
-	/**
-	 * 企业卖方uu
-	 * 
-	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
-	 */
-	@Column(name = "rf_sellerenuu")
-	private Long sellerenuu;
-
-	/**
-	 * 卖方企业名称
-	 */
-	@Column(name = "rf_sellername")
-	private String sellername;
-
-	/**
-	 * 付款方式
-	 */
-	@Column(name = "rf_paytype")
-	private Integer paytype;
-
-	/**
-	 * 配送方式
-	 */
-	@Column(name = "rf_deliverytype")
-	private Integer deliverytype;
-
-	/**
-	 * 收货地址 这里使用json字符串的形式将收货地址整个存起来
-	 */
-	@Column(name = "rf_addr", length = 2000)
-	private String jsonAddress;
-
-	/**
-	 * 发票类型
-	 */
-	@Column(name = "rf_invoicetype")
-	private Integer invoicetype;
-
-	/**
-	 * 发票抬头
-	 */
-	@Column(name = "rf_invoicetitle")
-	private String invoicetitle;
-
-	/**
-	 * 订单生成时间
-	 */
-	@Column(name = "rf_createtime")
-	private Date createtime;
-
-	/**
-	 * 退货有效时间
-	 */
-	@Column(name = "rf_availabletime")
-	private Date availabletime;
-
-	/**
-	 * 订单状态(1->2->3->4->5)
-	 * 
-	 * @Tip 必须严格按照顺序流转 1、TOBESHIPPEDBACK(409, "待回寄"), 2、INSPECTING(410, "验货中"),
-	 *      3、INSPECTED(411, "已验货"), 4、TOBEREFUNDED(507, "待退款"), 5、REFUNDED(508,
-	 *      "已退款")
-	 */
-	@Column(name = "rf_status")
-	@StatusColumn
-	private Integer status;
-
-	/**
-	 * 退款时间
-	 */
-	@Column(name = "rf_paytime")
-	private Date paytime;
-
-	/**
-	 * 银行转账信息id
-	 * 
-	 * @Tip 目前只有银行转账信息,
-	 */
-	@Column(name = "rf_banktf")
-	private Long banktfid;
-
-	/**
-	 * 数量
-	 */
-	@Column(name = "rf_qty")
-	private Double qty;
-
-	/**
-	 * 价格,存储的为元
-	 */
-	@Column(name = "rf_price")
-	private Double price;
-	
-	/**
-	 * 总金额
-	 */
-	@Column(name = "rf_total")
-	private Double total;
-
-	/**
-	 * 状态变更记录 List<StatusHistory> -> Json
-	 */
-	@Column(name = "rf_statushistory", length = 4000)
-	private String statushistory;
-
-	/**
-	 * 转的发货单id
-	 */
-	@Column(name = "in_id")
-	private String inid;
-
-	/**
-	 * 关联的订单id
-	 */
-	@Column(name = "or_id")
-	private String orid;
-	
-	/**
-	 * 币别
-	 */
-	@Column(name = "rf_currency")
-	private String currency;
-	
-	/**
-	 * 税金
-	 */
-	@Column(name = "or_taxes")
-	private Double taxes;
-	
-	
-	/**
-	 * 物流信息
-	 */
-	@OneToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, fetch = FetchType.EAGER)
-	@JoinColumn(name = "rf_lgt_id")
-	private Logistics logistics;
-
-	/**
-	 * 退货单明细
-	 */
-	@OneToMany(mappedBy = "custreturn", cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
-	@OrderBy("detno")
-	private Set<ReturnFCustDetail> returnDetails;
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets total.
-	 *
-	 * @return the total
-	 */
-	public Double getTotal() {
-		return total;
-	}
-
-	/**
-	 * Sets total.
-	 *
-	 * @param total the total
-	 */
-	public void setTotal(Double total) {
-		this.total = total;
-	}
-
-	/**
-	 * Gets returnid.
-	 *
-	 * @return the returnid
-	 */
-	public String getReturnid() {
-		return returnid;
-	}
-
-	/**
-	 * Sets returnid.
-	 *
-	 * @param returnid the returnid
-	 */
-	public void setReturnid(String returnid) {
-		this.returnid = returnid;
-	}
-
-	/**
-	 * Gets buyeruu.
-	 *
-	 * @return the buyeruu
-	 */
-	public Long getBuyeruu() {
-		return buyeruu;
-	}
-
-	/**
-	 * Sets buyeruu.
-	 *
-	 * @param buyeruu the buyeruu
-	 */
-	public void setBuyeruu(Long buyeruu) {
-		this.buyeruu = buyeruu;
-	}
-
-	/**
-	 * Gets buyername.
-	 *
-	 * @return the buyername
-	 */
-	public String getBuyername() {
-		return buyername;
-	}
-
-	/**
-	 * Sets buyername.
-	 *
-	 * @param buyername the buyername
-	 */
-	public void setBuyername(String buyername) {
-		this.buyername = buyername;
-	}
-
-	/**
-	 * Gets buyerenuu.
-	 *
-	 * @return the buyerenuu
-	 */
-	public Long getBuyerenuu() {
-		return buyerenuu;
-	}
-
-	/**
-	 * Sets buyerenuu.
-	 *
-	 * @param buyerenuu the buyerenuu
-	 */
-	public void setBuyerenuu(Long buyerenuu) {
-		this.buyerenuu = buyerenuu;
-	}
-
-	/**
-	 * Gets sellerenuu.
-	 *
-	 * @return the sellerenuu
-	 */
-	public Long getSellerenuu() {
-		return sellerenuu;
-	}
-
-	/**
-	 * Sets sellerenuu.
-	 *
-	 * @param sellerenuu the sellerenuu
-	 */
-	public void setSellerenuu(Long sellerenuu) {
-		this.sellerenuu = sellerenuu;
-	}
-
-	/**
-	 * Gets sellername.
-	 *
-	 * @return the sellername
-	 */
-	public String getSellername() {
-		return sellername;
-	}
-
-	/**
-	 * Sets sellername.
-	 *
-	 * @param sellername the sellername
-	 */
-	public void setSellername(String sellername) {
-		this.sellername = sellername;
-	}
-
-	/**
-	 * Gets currency.
-	 *
-	 * @return the currency
-	 */
-	public String getCurrency() {
-		return currency;
-	}
-
-	/**
-	 * Sets currency.
-	 *
-	 * @param currency the currency
-	 */
-	public void setCurrency(String currency) {
-		this.currency = currency;
-	}
-
-	/**
-	 * Gets taxes.
-	 *
-	 * @return the taxes
-	 */
-	public Double getTaxes() {
-		return taxes;
-	}
-
-	/**
-	 * Sets taxes.
-	 *
-	 * @param taxes the taxes
-	 */
-	public void setTaxes(Double taxes) {
-		this.taxes = taxes;
-	}
-
-	/**
-	 * Gets paytype.
-	 *
-	 * @return the paytype
-	 */
-	public Integer getPaytype() {
-		return paytype;
-	}
-
-	/**
-	 * Sets paytype.
-	 *
-	 * @param paytype the paytype
-	 */
-	public void setPaytype(Integer paytype) {
-		this.paytype = paytype;
-	}
-
-	/**
-	 * Gets deliverytype.
-	 *
-	 * @return the deliverytype
-	 */
-	public Integer getDeliverytype() {
-		return deliverytype;
-	}
-
-	/**
-	 * Sets deliverytype.
-	 *
-	 * @param deliverytype the deliverytype
-	 */
-	public void setDeliverytype(Integer deliverytype) {
-		this.deliverytype = deliverytype;
-	}
-
-	/**
-	 * Gets json address.
-	 *
-	 * @return the json address
-	 */
-	public String getJsonAddress() {
-		return jsonAddress;
-	}
-
-	/**
-	 * Sets json address.
-	 *
-	 * @param jsonAddress the json address
-	 */
-	public void setJsonAddress(String jsonAddress) {
-		this.jsonAddress = jsonAddress;
-	}
-
-	/**
-	 * Gets invoicetype.
-	 *
-	 * @return the invoicetype
-	 */
-	public Integer getInvoicetype() {
-		return invoicetype;
-	}
-
-	/**
-	 * Sets invoicetype.
-	 *
-	 * @param invoicetype the invoicetype
-	 */
-	public void setInvoicetype(Integer invoicetype) {
-		this.invoicetype = invoicetype;
-	}
-
-	/**
-	 * Gets invoicetitle.
-	 *
-	 * @return the invoicetitle
-	 */
-	public String getInvoicetitle() {
-		return invoicetitle;
-	}
-
-	/**
-	 * Sets invoicetitle.
-	 *
-	 * @param invoicetitle the invoicetitle
-	 */
-	public void setInvoicetitle(String invoicetitle) {
-		this.invoicetitle = invoicetitle;
-	}
-
-	/**
-	 * Gets createtime.
-	 *
-	 * @return the createtime
-	 */
-	public Date getCreatetime() {
-		return createtime;
-	}
-
-	/**
-	 * Sets createtime.
-	 *
-	 * @param createtime the createtime
-	 */
-	public void setCreatetime(Date createtime) {
-		this.createtime = createtime;
-	}
-
-	/**
-	 * Gets availabletime.
-	 *
-	 * @return the availabletime
-	 */
-	public Date getAvailabletime() {
-		return availabletime;
-	}
-
-	/**
-	 * Sets availabletime.
-	 *
-	 * @param availabletime the availabletime
-	 */
-	public void setAvailabletime(Date availabletime) {
-		this.availabletime = availabletime;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Gets paytime.
-	 *
-	 * @return the paytime
-	 */
-	public Date getPaytime() {
-		return paytime;
-	}
-
-	/**
-	 * Sets paytime.
-	 *
-	 * @param paytime the paytime
-	 */
-	public void setPaytime(Date paytime) {
-		this.paytime = paytime;
-	}
-
-	/**
-	 * Gets banktfid.
-	 *
-	 * @return the banktfid
-	 */
-	public Long getBanktfid() {
-		return banktfid;
-	}
-
-	/**
-	 * Sets banktfid.
-	 *
-	 * @param banktfid the banktfid
-	 */
-	public void setBanktfid(Long banktfid) {
-		this.banktfid = banktfid;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets statushistory.
-	 *
-	 * @return the statushistory
-	 */
-	public String getStatushistory() {
-		return statushistory;
-	}
-
-	/**
-	 * Sets statushistory.
-	 *
-	 * @param statushistory the statushistory
-	 */
-	public void setStatushistory(String statushistory) {
-		this.statushistory = statushistory;
-	}
-
-	/**
-	 * Gets inid.
-	 *
-	 * @return the inid
-	 */
-	public String getInid() {
-		return inid;
-	}
-
-	/**
-	 * Sets inid.
-	 *
-	 * @param inid the inid
-	 */
-	public void setInid(String inid) {
-		this.inid = inid;
-	}
-
-	/**
-	 * Gets logistics.
-	 *
-	 * @return the logistics
-	 */
-	public Logistics getLogistics() {
-		return logistics;
-	}
-
-	/**
-	 * Sets logistics.
-	 *
-	 * @param logistics the logistics
-	 */
-	public void setLogistics(Logistics logistics) {
-		this.logistics = logistics;
-	}
-
-	/**
-	 * Gets return details.
-	 *
-	 * @return the return details
-	 */
-	public Set<ReturnFCustDetail> getReturnDetails() {
-		return returnDetails;
-	}
-
-	/**
-	 * Gets orid.
-	 *
-	 * @return the orid
-	 */
-	public String getOrid() {
-		return orid;
-	}
-
-	/**
-	 * Sets orid.
-	 *
-	 * @param orid the orid
-	 */
-	public void setOrid(String orid) {
-		this.orid = orid;
-	}
-
-	/**
-	 * Sets return details.
-	 *
-	 * @param returnDetails the return details
-	 */
-	public void setReturnDetails(Set<ReturnFCustDetail> returnDetails) {
-		this.returnDetails = returnDetails;
-	}
-
-	/**
-	 * Sets status unaudit.
-	 *
-	 * @param uu the uu
-	 */
-// 申请中
-	public void setStatusUnaudit(Long uu) {
-		this.status = Status.UNAUDIT.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status notallow.
-	 *
-	 * @param uu the uu
-	 */
-// 未通过
-	public void setStatusNotallow(Long uu) {
-		this.status = Status.NOTALLOW.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status tobeshippedback.
-	 *
-	 * @param uu the uu
-	 */
-// 待回寄
-	public void setStatusTobeshippedback(Long uu) {
-		this.status = Status.TOBESHIPPEDBACK.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status inspecting.
-	 *
-	 * @param uu the uu
-	 */
-// 验货中
-	public void setStatusInspecting(Long uu) {
-		this.status = Status.INSPECTING.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status inspected.
-	 *
-	 * @param uu the uu
-	 */
-// 已验货
-	public void setStatusInspected(Long uu) {
-		this.status = Status.INSPECTED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status toberefunded.
-	 *
-	 * @param uu the uu
-	 */
-// 待退款
-	public void setStatusToberefunded(Long uu) {
-		this.status = Status.TOBEREFUNDED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * Sets status refunded.
-	 *
-	 * @param uu the uu
-	 */
-// 已退款
-	public void setStatusRefunded(Long uu) {
-		this.status = Status.REFUNDED.value();
-		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
-	}
-
-	/**
-	 * 将订单数据转化成相应退货单数据
-	 *
-	 * @param order the order
-	 */
-	public ReturnFCust(Order order) {
-		this.buyeruu = order.getBuyeruu();
-		this.buyername = order.getBuyername();
-		this.buyerenuu = order.getBuyerenuu();
-		this.sellerenuu = order.getSellerenuu();
-		this.sellername = order.getSellername();
-		this.paytype = order.getPaytype();
-		this.deliverytype = order.getDeliverytype();
-		this.jsonAddress = order.getJsonAddress();
-		this.invoicetype = order.getInvoicetype();
-		this.invoicetitle = order.getInvoicetitle();
-		this.currency = order.getCurrency();
-		this.createtime = new Date();
-		this.banktfid = order.getBanktfid();
-		this.orid = order.getOrderid();
-	}
-
-	/**
-	 * 对象初始化时必须给历史记录赋值
-	 */
-	public ReturnFCust() {
-		this.statushistory = "";
-	}
-
-	/**
-	 * Gets qty.
-	 *
-	 * @return the qty
-	 */
-	public Double getQty() {
-		if (qty == null || qty == 0) {
-			setQtys();
-		}
-		return qty;
-	}
-
-	/**
-	 * Sets qty.
-	 *
-	 * @param qty the qty
-	 */
-	public void setQty(Double qty) {
-		this.qty = qty;
-	}
-
-	/**
-	 * Sets qtys.
-	 */
-	public void setQtys() {
-		double thisqty = 0D;
-		for (ReturnFCustDetail detail : this.returnDetails) {
-			thisqty += detail.getNumber();
-		}
-		this.qty = thisqty;
-	}
-
-	@Override
-	public String toString() {
-		return "ReturnFCust [returnid=" + returnid + ", buyeruu=" + buyeruu + ", buyerenuu=" + buyerenuu + ", sellerenuu=" + sellerenuu + ", paytype=" + paytype + ", deliverytype=" + deliverytype
-				+ ", jsonAddress=" + jsonAddress + ", invoicetype=" + invoicetype + ", invoicetitle=" + invoicetitle + ", createtime=" + createtime + ", availabletime=" + availabletime + ", status="
-				+ status + ", paytime=" + paytime + ", banktfid=" + banktfid + ", price=" + price + ", statushistory=" + statushistory + ", inid=" + inid
-				+ ", returnDetails=" + returnDetails + "]";
-	}
-
-}

+ 0 - 623
src/main/java/com/uas/platform/b2c/trade/aftersale/model/ReturnFCustDetail.java

@@ -1,623 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.model;
-
-import com.alibaba.fastjson.annotation.JSONField;
-import com.uas.platform.b2c.core.utils.DoubleArith;
-import com.uas.platform.b2c.trade.order.model.OrderDetail;
-import com.uas.platform.core.persistence.StatusColumn;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-/**
- * 客户退货单明细
- *
- * @author aof
- * @version 2017-08-02 17:06:38 创建文件
- */
-@Entity
-@Table(name = "trade$return_fmcust_dt")
-public class ReturnFCustDetail {
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue
-	@Column(name = "id")
-	private Long id;
-
-	/**
-	 * 主表
-	 * 
-	 * @JsonIgnore
-	 */
-	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = true)
-	@JoinColumn(name = "return_id", nullable = false)
-	private ReturnFCust custreturn;
-
-	/**
-	 * 明细序号 detailNO
-	 */
-	@Column(name = "detno")
-	private Short detno;
-
-	/**
-	 * 关联的订单明细id
-	 */
-	@Column(name = "ord_id")
-	private String ord_id;
-
-	/**
-	 * 订单明细编号
-	 */
-	@Column(name = "detail_id")
-	private String detailid;
-
-	/**
-	 * 批次号
-	 */
-	@Column(name = "go_batch")
-	private String batchCode;
-
-	/**
-	 * 对应的器件uuid
-	 */
-	@Column(name = "cmp_uuid")
-	private String uuid;
-
-	/**
-	 * 库存 1311 现货, 1312 呆滞库存,(暂时不用) 1313 废料
-	 */
-	@Column(name = "go_original")
-	private Integer original;
-
-	/**
-	 * 原厂型号
-	 */
-	@Column(name = "cmp_code")
-	private String cmpCode;
-
-	/**
-	 * 器件所属类目
-	 */
-	@Column(name = "ki_name")
-	private String kiName;
-
-	/**
-	 * 器件所属品牌
-	 */
-	@Column(name = "br_name")
-	private String brName;
-
-	/**
-	 * 图片path
-	 */
-	@Column(name = "cmp_img")
-	private String img;
-
-	/**
-	 * 单价,单位为元
-	 */
-	@Column(name = "go_unitprice")
-	private Double unitprice;
-
-	/**
-	 * 退货数量
-	 */
-	@Column(name = "detail_number")
-	private Double number;
-
-	/**
-	 * 总金额
-	 */
-	@Column(name = "detail_price")
-	private Double price;
-
-	/**
-	 * 存放采购明细流水号
-	 */
-	@Column(name = "detail_puid")
-	private String puid;
-
-	/**
-	 * 含税单价,单位为元
-	 */
-	@Column(name = "go_taxunitprice")
-	private Double taxUnitprice;
-
-	/**
-	 * 币别,币种名称
-	 */
-	@Column(name = "detail_currency")
-	private String currencyName;
-
-	/**
-	 * 税率
-	 */
-	@Column(name = "go_tax")
-	private Short tax;
-
-	/**
-	 * 税金
-	 */
-	@Column(name = "detail_taxes")
-	private Double taxes;
-
-	/**
-	 * 是否支持7天无理由退货,1:支持,0:不支持
-	 */
-	@Column(name = "go_returninweek")
-	private Short returnInWeek;
-
-	/**
-	 * 订单明细状态
-	 */
-	@Column(name = "detail_status")
-	@StatusColumn
-	private Integer status;
-
-	/**
-	 * Gets id.
-	 *
-	 * @return the id
-	 */
-	public Long getId() {
-		return id;
-	}
-
-	/**
-	 * Sets id.
-	 *
-	 * @param id the id
-	 */
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	/**
-	 * Gets custreturn.
-	 *
-	 * @return the custreturn
-	 */
-	@JsonIgnore
-	@JSONField(serialize = false)
-	public ReturnFCust getCustreturn() {
-		return custreturn;
-	}
-
-	/**
-	 * Sets custreturn.
-	 *
-	 * @param custreturn the custreturn
-	 */
-	public void setCustreturn(ReturnFCust custreturn) {
-		this.custreturn = custreturn;
-	}
-
-	/**
-	 * Gets detno.
-	 *
-	 * @return the detno
-	 */
-	public Short getDetno() {
-		return detno;
-	}
-
-	/**
-	 * Sets detno.
-	 *
-	 * @param detno the detno
-	 */
-	public void setDetno(Short detno) {
-		this.detno = detno;
-	}
-
-	/**
-	 * Gets detailid.
-	 *
-	 * @return the detailid
-	 */
-	public String getDetailid() {
-		return detailid;
-	}
-
-	/**
-	 * Sets detailid.
-	 *
-	 * @param detailid the detailid
-	 */
-	public void setDetailid(String detailid) {
-		this.detailid = detailid;
-	}
-
-	/**
-	 * Gets batch code.
-	 *
-	 * @return the batch code
-	 */
-	public String getBatchCode() {
-		return batchCode;
-	}
-
-	/**
-	 * Sets batch code.
-	 *
-	 * @param batchCode the batch code
-	 */
-	public void setBatchCode(String batchCode) {
-		this.batchCode = batchCode;
-	}
-
-	/**
-	 * Gets uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-
-	/**
-	 * Sets uuid.
-	 *
-	 * @param uuid the uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-
-	/**
-	 * Gets original.
-	 *
-	 * @return the original
-	 */
-	public Integer getOriginal() {
-		return original;
-	}
-
-	/**
-	 * Sets original.
-	 *
-	 * @param original the original
-	 */
-	public void setOriginal(Integer original) {
-		this.original = original;
-	}
-
-	/**
-	 * Gets cmp code.
-	 *
-	 * @return the cmp code
-	 */
-	public String getCmpCode() {
-		return cmpCode;
-	}
-
-	/**
-	 * Sets cmp code.
-	 *
-	 * @param cmpCode the cmp code
-	 */
-	public void setCmpCode(String cmpCode) {
-		this.cmpCode = cmpCode;
-	}
-
-	/**
-	 * Gets ki name.
-	 *
-	 * @return the ki name
-	 */
-	public String getKiName() {
-		return kiName;
-	}
-
-	/**
-	 * Sets ki name.
-	 *
-	 * @param kiName the ki name
-	 */
-	public void setKiName(String kiName) {
-		this.kiName = kiName;
-	}
-
-	/**
-	 * Gets br name.
-	 *
-	 * @return the br name
-	 */
-	public String getBrName() {
-		return brName;
-	}
-
-	/**
-	 * Sets br name.
-	 *
-	 * @param brName the br name
-	 */
-	public void setBrName(String brName) {
-		this.brName = brName;
-	}
-
-	/**
-	 * Gets img.
-	 *
-	 * @return the img
-	 */
-	public String getImg() {
-		return img;
-	}
-
-	/**
-	 * Sets img.
-	 *
-	 * @param img the img
-	 */
-	public void setImg(String img) {
-		this.img = img;
-	}
-
-	/**
-	 * Gets unitprice.
-	 *
-	 * @return the unitprice
-	 */
-	public Double getUnitprice() {
-		return unitprice;
-	}
-
-	/**
-	 * Sets unitprice.
-	 *
-	 * @param unitprice the unitprice
-	 */
-	public void setUnitprice(Double unitprice) {
-		this.unitprice = unitprice;
-	}
-
-	/**
-	 * Gets currency name.
-	 *
-	 * @return the currency name
-	 */
-	public String getCurrencyName() {
-		return currencyName;
-	}
-
-	/**
-	 * Sets currency name.
-	 *
-	 * @param currencyName the currency name
-	 */
-	public void setCurrencyName(String currencyName) {
-		this.currencyName = currencyName;
-	}
-
-	/**
-	 * Gets tax.
-	 *
-	 * @return the tax
-	 */
-	public Short getTax() {
-		return tax;
-	}
-
-	/**
-	 * Sets tax.
-	 *
-	 * @param tax the tax
-	 */
-	public void setTax(Short tax) {
-		this.tax = tax;
-	}
-
-	/**
-	 * Gets taxes.
-	 *
-	 * @return the taxes
-	 */
-	public Double getTaxes() {
-		if (taxes == null) {
-			taxes = DoubleArith.sub(DoubleArith.mul(number, taxUnitprice), DoubleArith.mul(number, unitprice));
-		}
-		return taxes;
-	}
-
-	/**
-	 * Sets taxes.
-	 *
-	 * @param taxes the taxes
-	 */
-	public void setTaxes(Double taxes) {
-		this.taxes = taxes;
-	}
-
-	/**
-	 * Gets return in week.
-	 *
-	 * @return the return in week
-	 */
-	public Short getReturnInWeek() {
-		return returnInWeek;
-	}
-
-	/**
-	 * Sets return in week.
-	 *
-	 * @param returnInWeek the return in week
-	 */
-	public void setReturnInWeek(Short returnInWeek) {
-		this.returnInWeek = returnInWeek;
-	}
-
-	/**
-	 * Gets number.
-	 *
-	 * @return the number
-	 */
-	public Double getNumber() {
-		return number;
-	}
-
-	/**
-	 * Sets number.
-	 *
-	 * @param number the number
-	 */
-	public void setNumber(Double number) {
-		this.number = number;
-	}
-
-	/**
-	 * Gets price.
-	 *
-	 * @return the price
-	 */
-	public Double getPrice() {
-		return price;
-	}
-
-	/**
-	 * Sets price.
-	 *
-	 * @param price the price
-	 */
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	/**
-	 * Gets puid.
-	 *
-	 * @return the puid
-	 */
-	public String getPuid() {
-		return puid;
-	}
-
-	/**
-	 * Sets puid.
-	 *
-	 * @param puid the puid
-	 */
-	public void setPuid(String puid) {
-		this.puid = puid;
-	}
-
-	/**
-	 * Gets status.
-	 *
-	 * @return the status
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * Sets status.
-	 *
-	 * @param status the status
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * Gets tax unitprice.
-	 *
-	 * @return the tax unitprice
-	 */
-	public Double getTaxUnitprice() {
-		return taxUnitprice;
-	}
-
-	/**
-	 * Sets tax unitprice.
-	 *
-	 * @param taxUnitprice the tax unitprice
-	 */
-	public void setTaxUnitprice(Double taxUnitprice) {
-		this.taxUnitprice = taxUnitprice;
-	}
-
-	/**
-	 * Gets ord id.
-	 *
-	 * @return the ord id
-	 */
-	public String getOrd_id() {
-		return ord_id;
-	}
-
-	/**
-	 * Sets ord id.
-	 *
-	 * @param ord_id the ord id
-	 */
-	public void setOrd_id(String ord_id) {
-		this.ord_id = ord_id;
-	}
-
-	/**
-	 * Convert return f cust detail.
-	 *
-	 * @param detail the detail
-	 * @return the return f cust detail
-	 */
-	public ReturnFCustDetail convert(OrderDetail detail) {
-		ReturnFCustDetail thisdetail = new ReturnFCustDetail();
-		thisdetail.detno = detail.getDetno();
-		thisdetail.batchCode = detail.getBatchCode();
-		thisdetail.original = detail.getOriginal();
-		thisdetail.uuid = detail.getUuid();
-		thisdetail.cmpCode = detail.getCmpCode();
-		thisdetail.brName = detail.getBrName();
-		thisdetail.kiName = detail.getKiName();
-		thisdetail.img = detail.getImg();
-		thisdetail.unitprice = detail.getUnitprice();
-		thisdetail.tax = detail.getTax();
-		thisdetail.currencyName = detail.getCurrencyName();
-		thisdetail.returnInWeek = detail.getReturnInWeek();
-		thisdetail.taxUnitprice = detail.getTaxUnitprice();
-		thisdetail.puid = detail.getPurdetid();
-		thisdetail.status = detail.getStatus();
-		return thisdetail;
-	}
-
-	/**
-	 * Instantiates a new Return f cust detail.
-	 *
-	 * @param detail the detail
-	 */
-	public ReturnFCustDetail(OrderDetail detail) {
-		this.detno = detail.getDetno();
-		this.batchCode = detail.getBatchCode();
-		this.uuid = detail.getUuid();
-		this.original = detail.getOriginal();
-		this.cmpCode = detail.getCmpCode();
-		this.brName = detail.getBrName();
-		this.kiName = detail.getKiName();
-		this.img = detail.getImg();
-		this.unitprice = detail.getUnitprice();
-		this.taxUnitprice = detail.getTaxUnitprice();
-		this.currencyName = detail.getCurrencyName();
-		this.tax = detail.getTax();
-		this.number = detail.getNumber();
-		this.price = detail.getPrice();
-		this.returnInWeek = detail.getReturnInWeek();
-		this.puid = detail.getPurdetid();
-		this.ord_id = detail.getDetailid();
-		this.status = detail.getStatus();
-	}
-
-	public ReturnFCustDetail() {
-
-	}
-
-}

+ 0 - 169
src/main/java/com/uas/platform/b2c/trade/aftersale/service/ChangeService.java

@@ -1,169 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.service;
-
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2CSimpleInfo;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFB2c;
-import com.uas.platform.b2c.trade.aftersale.model.ChangeFCust;
-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.PurchaseDetail;
-import com.uas.platform.core.model.PageInfo;
-import org.springframework.data.domain.Page;
-import org.springframework.ui.ModelMap;
-
-import java.util.List;
-
-/**
- * The interface Change service.
- *
- * @author aof
- * @version 2017-08-02 17:07:25 创建文件
- */
-public interface ChangeService {
-
-	/**
-	 * 客户确认换货
-	 *
-	 * @param order the order
-	 * @return change f cust
-	 */
-	ChangeFCust ensureChange(Order order);
-
-	/**
-	 * 审核换货单
-	 *
-	 * @param changeid the changeid
-	 * @param boo      the boo
-	 * @return the string
-	 */
-	String auditChange(Long changeid, boolean boo);
-
-	/**
-	 * 客户根据状态查询换货单
-	 *
-	 * @param status the status
-	 * @return the list
-	 */
-	List<ChangeFCust> findByStatus(Integer status);
-
-	/**
-	 * 客户发换货单
-	 *
-	 * @param changeid the changeid
-	 * @return string
-	 */
-	String sendChange(ChangeFCust changeid);
-
-	/**
-	 * 平台向供应商发换货单
-	 *
-	 * @param b2cs the b 2 cs
-	 * @return the string
-	 */
-	String batchSendForVender(List<ChangeFB2c> b2cs);
-
-	/**
-	 * 供应商确认收货
-	 *
-	 * @param changeid the changeid
-	 * @return the string
-	 */
-	String venderAccept(Long changeid);
-
-	/**
-	 * 供应商根据采购单ID确认收换货
-	 *
-	 * @param purchaseId 采购单ID
-	 * @return the string
-	 */
-	String venderAccept(String purchaseId);
-
-	/**
-	 * 判断是否有换货单
-	 *
-	 * @return the model map
-	 */
-	ModelMap hasChanges();
-
-	/**
-	 * 换货单转出货
-	 *
-	 * @param changeid the changeid
-	 * @return the string
-	 */
-	String createInvoiceB2cChange(Long changeid);
-
-	/**
-	 * 客户确认收货
-	 *
-	 * @param changeid the changeid
-	 * @return the string
-	 */
-	String onesEnsureAccept(Long changeid);
-
-	/**
-	 * 买家根据订单状态查看订单
-	 *
-	 * @param pageInfo the page info
-	 * @param keyword  the keyword
-	 * @param status   the status
-	 * @return the page
-	 */
-	Page<ChangeFCust> findIndividualChanges(PageInfo pageInfo, String keyword, String status);
-
-	/**
-	 * 买家根据订单状态查看订单
-	 *
-	 * @param pageInfo the page info
-	 * @param keyword  the keyword
-	 * @param status   the status
-	 * @return the page
-	 */
-	Page<ChangeFB2c> findIndividualVender(PageInfo pageInfo, String keyword, String status);
-
-	/**
-	 * 根据订单号查询某个客户换货单
-	 *
-	 * @param changeid the changeid
-	 * @return change f cust
-	 */
-	ChangeFCust findFCByChangeId(String changeid);
-
-	/**
-	 * 根据订单号查询某个平台换货单
-	 *
-	 * @param changeid the changeid
-	 * @return change fb 2 c
-	 */
-	ChangeFB2c findB2CByChangeId(String changeid);
-
-	/**
-	 * 根据订单号查询换货单(供应商)
-	 *
-	 * @param changeid the changeid
-	 * @return change fb 2 c simple info
-	 */
-	ChangeFB2CSimpleInfo findByChangeidAndSellenuu(String changeid);
-
-	/**
-	 * 创建时间 :2016年11月18日 下午8:12:31
-	 *
-	 * @param list the list
-	 * @return ChangeFCust change f cust
-	 * @throws
-	 * @author yujia
-	 * @Description: TODO
-	 */
-	ChangeFCust createChangeFCust(List<OrderDetail> list);
-
-	/**
-	 * 创建时间 :2016年11月18日 下午8:16:47
-	 *
-	 * @param list       the list
-	 * @param changeFB2c the change fb 2 c
-	 * @return change fb 2 c
-	 * @throws
-	 * @author yujia
-	 * @Description: TODO
-	 */
-	ChangeFB2c createChangeFB2C(List<PurchaseDetail> list, ChangeFB2c changeFB2c);
-}

+ 0 - 26
src/main/java/com/uas/platform/b2c/trade/aftersale/service/ReturnFCustDetailService.java

@@ -1,26 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.service;
-
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCustDetail;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.b2c.trade.order.model.OrderDetail;
-
-import java.util.List;
-
-/**
- * The interface Return f cust detail service.
- *
- * @author yujia
- * @version 2016-11-10 13:51:22 客户退货单的明细服务层
- */
-public interface ReturnFCustDetailService {
-
-	/**
-	 * 创建时间 :2016年11月22日 下午5:29:33
-	 *
-	 * @param orderDetails the order details
-	 * @param order        the order
-	 * @return List<ReturnFCustDetail>  根据订单明细生成退款单
-	 * @author yujia
-	 */
-	List<ReturnFCustDetail> createReturnFCustDetail(List<OrderDetail> orderDetails, Order order);
-}

+ 0 - 166
src/main/java/com/uas/platform/b2c/trade/aftersale/service/ReturnService.java

@@ -1,166 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.service;
-
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2c;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2cSimpleInfo;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
-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.PurchaseDetail;
-import com.uas.platform.core.model.PageInfo;
-import org.springframework.data.domain.Page;
-import org.springframework.ui.ModelMap;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * The interface Return service.
- *
- * @author aof
- * @version 2017-08-02 17:14:09 创建文件
- */
-public interface ReturnService {
-
-	/**
-	 * 确认退货
-	 *
-	 * @param order the order
-	 * @return the return f cust
-	 */
-	ReturnFCust ensureReturn(Order order);
-
-	/**
-	 * 查询单个平台退货单(平台)
-	 *
-	 * @param returnid the returnid
-	 * @return return fb 2 c
-	 */
-	ReturnFB2c findB2CByReturnid(String returnid);
-
-	/**
-	 * 审核客户退货单
-	 *
-	 * @param id  the id
-	 * @param boo the boo
-	 * @return the return f cust
-	 */
-	ReturnFCust auditReturn(Long id, Long boo);
-
-	/**
-	 * 客户根据状态查询退货单
-	 *
-	 * @param status the status
-	 * @return the list
-	 */
-	List<ReturnFCust> findByStatus(Integer status);
-
-	/**
-	 * 客户根据状态查询退货单(多状态一起查)
-	 *
-	 * @param statuses the statuses
-	 * @return the list
-	 */
-	List<ReturnFCust> findOnesByStatuses(List<Integer> statuses);
-
-	/**
-	 * 客户发退货单
-	 *
-	 * @param returnfcust the returnfcust
-	 * @return the return f cust
-	 */
-	ReturnFCust sendReturn(ReturnFCust returnfcust);
-
-	/**
-	 * 客户发退货单
-	 *
-	 * @param b2cs the b 2 cs
-	 * @return the string
-	 */
-	String batchSendForVender(List<ReturnFB2c> b2cs);
-
-	/**
-	 * 供应商确认收退货单
-	 *
-	 * @param returnid the returnid
-	 * @return the return fb 2 c
-	 */
-	ReturnFB2c venderAccept(Long returnid);
-
-	/**
-	 * 确认退款
-	 *
-	 * @param returnid the returnid
-	 * @return return f cust
-	 */
-	ReturnFCust ensurePaid(Long returnid);
-
-	/**
-	 * 判断是否有退货单
-	 *
-	 * @return the model map
-	 */
-	ModelMap hasReturns();
-
-	/**
-	 * 买家根据订单状态查看订单
-	 *
-	 * @param pageInfo the page info
-	 * @param keyword  the keyword
-	 * @param status   the status
-	 * @return the page
-	 */
-	Page<ReturnFCust> findIndividualReturns(PageInfo pageInfo, String keyword, String status);
-
-	/**
-	 * 供应商根据状态查看订单
-	 *
-	 * @param pageInfo the page info
-	 * @param keyword  the keyword
-	 * @param status   the status
-	 * @return page
-	 */
-	Page<ReturnFB2c> findIndividualVender(PageInfo pageInfo, String keyword, String status);
-
-	/**
-	 * 根据订单号查询某个退货单
-	 *
-	 * @param returnid the returnid
-	 * @return return f cust
-	 */
-	ReturnFCust findByReturnId(String returnid);
-
-	/**
-	 * 根据退换单号查找退货单(供应商)
-	 *
-	 * @param returnid the returnid
-	 * @return return fb 2 c simple info
-	 */
-	ReturnFB2cSimpleInfo findByReturnidAndSellerenuu(String returnid);
-
-	/**
-	 * 根据订单明细生成退货单
-	 *
-	 * @param orderDetails the order details
-	 * @param order        the order
-	 * @return the return f cust
-	 */
-	ReturnFCust createReturnFCust(List<OrderDetail> orderDetails, Order order);
-
-	/**
-	 * 2016年11月11日 下午2:11:00
-	 * 根据采购单的明细生成平台的退货单
-	 *
-	 * @param list the list
-	 * @param id   the id
-	 * @return the return fb 2 c
-	 */
-	ReturnFB2c createReturnFB2c(List<PurchaseDetail> list, Long id);
-
-	/**
-	 * 根据采购单号获取采购单号与退货单的关联映射
-	 *
-	 * @param purchaseIds the purchase ids
-	 * @return return by purchase ids
-	 */
-	Map<String,ReturnFB2c> getReturnByPurchaseIds(String[] purchaseIds);
-}

+ 0 - 616
src/main/java/com/uas/platform/b2c/trade/aftersale/service/impl/ChangeServiceImpl.java

@@ -1,616 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.service.impl;
-
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.DoubleArith;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.logistics.dao.InvoiceDao;
-import com.uas.platform.b2c.logistics.dao.InvoiceFPurchaseDao;
-import com.uas.platform.b2c.logistics.dao.ReceiptDao;
-import com.uas.platform.b2c.logistics.model.Invoice;
-import com.uas.platform.b2c.logistics.model.InvoiceDetail;
-import com.uas.platform.b2c.logistics.model.Receipt;
-import com.uas.platform.b2c.logistics.model.ReceiptDetail;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.trade.aftersale.dao.ChangeFB2cDao;
-import com.uas.platform.b2c.trade.aftersale.dao.ChangeFCustDao;
-import com.uas.platform.b2c.trade.aftersale.dao.ChangeFCustDetailDao;
-import com.uas.platform.b2c.trade.aftersale.model.*;
-import com.uas.platform.b2c.trade.aftersale.service.ChangeService;
-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.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.core.exception.IllegalOperatorException;
-import com.uas.platform.core.model.EncodingRulesConstant;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.model.Type;
-import com.uas.platform.core.persistence.criteria.PredicateUtils;
-import com.uas.platform.core.persistence.criteria.SimpleExpression;
-import org.apache.commons.collections.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * The type Change service implementation.
- *
- * @author aof
- * @version 2017-08-02 17:15:25 创建文件
- */
-@Service
-public class ChangeServiceImpl implements ChangeService {
-
-	@Autowired
-	private CreateNumberService createNumberService;
-
-	@Autowired
-	private ChangeFB2cDao changeFB2cDao;
-
-	@Autowired
-	private OrderDao orderDao;
-
-	@Autowired
-	private ChangeFCustDao changeFCustDao;
-	
-	@Autowired
-	private ChangeFCustDetailDao changeFCustDetailDao;
-
-	@Autowired
-	private ReceiptDao receiptDao;
-
-	@Autowired
-	private InvoiceDao invoiceDao;
-
-	@Autowired
-	private PurchaseDao purchaseDao;
-
-	@Autowired
-	private InvoiceFPurchaseDao invoiceFPurchaseDao;
-	
-	@Autowired
-	private OrderDetailDao orderDetailDao;
-	
-	@Autowired
-	private PurchaseDetailDao purchaseDetailDao;
-
-
-	@Override
-	@Transactional
-	public ChangeFCust ensureChange(Order order) {
-		if (!orderDao.findOne(order.getId()).getStatus().equals(Status.RECEIVED.value())) {
-			throw new IllegalOperatorException("订单状态不为已收货,不可做换货操作!");
-		}
-		long uu = SystemSession.getUser().getUserUU();
-		Set<ChangeFCustDetail> changeDetails = new HashSet<>();
-		ChangeFCust cust = new ChangeFCust(order);
-		Double totalPrice = (double) 0;
-		Double taxes = 0D;
-		// 生成换 货单号
-		String changeid = EncodingRulesConstant.CHANGE_FROMCUST.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$change_fmcust", 8));
-		// 这里由于前台传过来的order对象被切断了双向关联,这里需要重新set进去
-		Set<OrderDetail> orDetails = new HashSet<OrderDetail>();
-		for (OrderDetail detail : order.getOrderDetails()) {
-			if (detail.getReturnQty() > 0) {
-				if (detail.getReturnQty() > detail.getNumber() - detail.getCustreturnQty()) {
-					throw new IllegalOperatorException("换货数量超过订单现有数量");
-				}
-				detail.setStatusInaftersales(uu);
-				detail.setCustchangeQty(DoubleArith.add(detail.getReturnQty(), detail.getCustchangeQty()));
-				order.setCustchangeQty(DoubleArith.add(detail.getReturnQty(), order.getCustchangeQty()));
-				ChangeFCustDetail changeDetail = new ChangeFCustDetail(detail);
-				String detailid = EncodingRulesConstant.CHANGE_DETAIL_FROMCUST.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$change_fmcust_dt", 9));
-				changeDetail.setDetailid(detailid);
-				changeDetail.setStatus(Status.UNAUDIT.value());
-				// 计算明细总价
-				totalPrice = DoubleArith.add(changeDetail.getPrice(), totalPrice);
-				taxes =DoubleArith.add(changeDetail.getTaxes(), taxes);
-				changeDetail.setChange(cust);
-				changeDetails.add(changeDetail);
-			}
-			detail.setOrder(order);
-			orDetails.add(detail);
-		}
-		cust.setChangeDetails(changeDetails);
-		cust.setChangeid(changeid);
-		cust.setPrice(totalPrice);
-		cust.setTaxes(taxes);
-		// 锁订单状态
-		order.setOrderDetails(orDetails);
-		orderDao.save(order);
-		cust.setQtys();
-		// 设置状态为申请中
-		cust.setStatusUnaudit(uu);
-		ChangeFCust change = changeFCustDao.save(cust);
-		return change;
-	}
-
-	@Override
-	@Transactional
-	public String auditChange(Long changeid, boolean boo) {
-		ChangeFCust thiscust = changeFCustDao.findOne(changeid);
-		if(thiscust == null) {
-			throw new IllegalOperatorException("请刷新界面,您操作的信息已经过时。");
-		}
-		if ((!thiscust.getStatus().equals(Status.UNAUDIT.value()))) {
-			throw new IllegalOperatorException("退货单" + thiscust.getChangeid() + "的状态" + Status.valueOf(thiscust.getStatus()).getPhrase() + "不在申请中,不能审核。");
-		}
-		Long uu = SystemSession.getUser().getUserUU();
-		if (boo) {
-			// 审核通过
-			thiscust.setStatusTobeshippedback(uu);
-			Set<ChangeFCustDetail> changeDetails = thiscust.getChangeDetails();
-			for (ChangeFCustDetail changeFCustDetail : changeDetails) {
-				changeFCustDetail.setStatus(Status.TOBESHIPPEDBACK.value());
-			}
-		} else {
-			// 审核不通过
-			thiscust.setStatusNotallow(uu);
-			Set<ChangeFCustDetail> changeDetails = thiscust.getChangeDetails();
-			for (ChangeFCustDetail changeFCustDetail : changeDetails) {
-				changeFCustDetail.setStatus(Status.NOTALLOW.value());
-				String ordid = changeFCustDetail.getOrdid();
-				OrderDetail orderDetail = orderDetailDao.findByDetailid(ordid);
-				if(orderDetail.getStatus().equals(Status.INAFTERSALES.value())) {
-					orderDetail.setCustchangeQty(DoubleArith.sub(orderDetail.getCustchangeQty(), changeFCustDetail.getNumber()));
-					Order order = orderDetail.getOrder();
-					order.setCustchangeQty(DoubleArith.sub(order.getCustchangeQty(),changeFCustDetail.getNumber()));
-					orderDetail.setStatusReceived(uu);
-				}else {
-					throw new IllegalOperatorException("当前状态不在售后的状态,不需要修改。");
-				}
-				orderDetailDao.save(orderDetail);
-			}
-		}
-		changeFCustDao.save(thiscust);
-		return "sucess";
-	}
-
-	@Override
-	public List<ChangeFCust> findByStatus(Integer status) {
-		return changeFCustDao.findByStatus(status);
-	}
-
-	@Override
-	public String sendChange(ChangeFCust cust) {
-		if (cust == null || !cust.getStatus().equals(Status.TOBESHIPPEDBACK.value())) {
-			throw new IllegalOperatorException("换货单状态不为待回寄,不可做发货操作!");
-		}
-		cust.setStatusInspecting(SystemSession.getUser().getUserUU());
-		for (ChangeFCustDetail detail : cust.getChangeDetails()) {
-			detail.setStatus(Status.INSPECTING.value());
-			detail.setChange(cust);
-		}
-		
-		String orid = cust.getOrid();
-		Order order = orderDao.findByOrderid(orid);
-		order.setChangeStatus(Status.INSPECTING.value());
-		orderDao.save(order);
-		// 更新来源订单的changeQty值
-		// Order order = orderDao.findOne(cust.getOr_id());
-		// Set<OrderDetail> orDetails = new HashSet<>();
-		// double changeQty = 0;
-		// for(OrderDetail ordetail : order.getOrderDetails()) {
-		// for(ChangeFCustDetail detail : cust.getChangeDetails()) {
-		// if(ordetail.getId() .equals(detail.getOrd_id())) {
-		// ordetail.setCustchangeQty(detail.getNumber());
-		// changeQty += detail.getNumber();
-		// }
-		// }
-		// ordetail.setOrder(order);
-		// orDetails.add(ordetail);
-		// }
-		// order.setCustchangeQty(changeQty);
-		// order.setOrderDetails(orDetails);
-		changeFCustDao.save(cust);
-		// orderDao.save(order);
-		return "success";
-	}
-
-	@Override
-	@Transactional
-	public String batchSendForVender(List<ChangeFB2c> b2cs) {
-		for (ChangeFB2c b2c : b2cs) {
-			if(b2c == null) {
-				throw new IllegalOperatorException("换货单信息有无,请重新刷新界面操作");
-			}
-			if(!b2c.getStatus().equals(Status.TOBESHIPPEDBACK.value())) {
-				throw new IllegalOperatorException("换货单"+ b2c.getChangeid() + "的状态是"+ Status.valueOf(b2c.getStatus()).getPhrase() + ",不能做发货操作");
-			}
-			for (ChangeFB2cDetail detail : b2c.getChangeDetails()) {
-				detail.setChange(b2c);
-				detail.setStatus(Status.INSPECTING.value());
-			}
-			Purchase purchase = purchaseDao.findByPurchaseid(b2c.getPuid());
-			if(purchase != null) {
-				purchase.setExchangeStatusFromBuyer(Status.INSPECTING.value());
-			}else {
-				throw new IllegalOperatorException("换货单对应的采购单信息丢失");
-			}
-			// 设置采购单的换货状态为确认收货状态
-			purchase.setExchangeStatus(Purchase.ExchangeStatus.VENDOR_RECEIVE);
-			purchaseDao.save(purchase);
-			b2c.setStatusInspecting(SystemSession.getUser().getUserUU());
-			changeFB2cDao.save(b2c);
-		}
-		return "success";
-	}
-
-	@Override
-	public ModelMap hasChanges() {
-		ModelMap map = new ModelMap();
-		List<ChangeFCust> list = changeFCustDao.findByBuyeruu(SystemSession.getUser().getUserUU());
-		if (CollectionUtils.isEmpty(list)) {
-			map.put("data", "error");
-		} else {
-			map.put("data", "success");
-		}
-		return map;
-	}
-
-	@Override
-	@Transactional
-	public String venderAccept(Long changeid) {
-		ChangeFB2c b2c = changeFB2cDao.findOne(changeid);
-		if(b2c == null) {
-			throw new IllegalOperatorException("提交的信息有误,请刷新界面重新提交");
-		}
-		if (!b2c.getStatus().equals(Status.INSPECTING.value())) {
-			throw new IllegalOperatorException("换货单" + b2c.getChangeid() + "的状态是" + Status.valueOf(b2c.getStatus()).getPhrase() + ",不能进行相应操作");
-		}
-		// TODO 第1步 生成销售验退单 (供应商销售换货单)
-		Receipt receipt = new Receipt(b2c, createNumberService);
-		Set<ReceiptDetail> receiptdetais = new HashSet<>();
-		for (ChangeFB2cDetail b2cDetail : b2c.getChangeDetails()) {
-			ReceiptDetail reD = new ReceiptDetail(b2cDetail, createNumberService);
-			reD.setReceipt(receipt);
-			reD.setStatus(Status.AVAILABLE.value());
-			b2cDetail.setStatus(Status.TOBESHIPPED.value());
-			receiptdetais.add(reD);
-		}
-		// 给属性赋值
-		Purchase purchase = purchaseDao.findByPurchaseid(b2c.getPuid());
-		if (purchase == null) {
-			throw new IllegalOperatorException("此换货单对应的采购单不存在");
-		}
-		receipt.setPurchaseid(purchase.getPurchaseid());
-		Long uu = SystemSession.getUser().getUserUU();
-		receipt.setStatusAvailable(uu);
-		receipt.setReceiptDetails(receiptdetais);
-		receipt.setSettlement(Status.NOTSETTLED.value());
-		receiptDao.save(receipt);
-		// 第二步 生成供应商换货出货单
-		Invoice invoice = new Invoice(b2c, createNumberService);
-		Set<InvoiceDetail> inDetails = new HashSet<>();
-		// 给明细赋值
-		for (ChangeFB2cDetail b2cDetail : b2c.getChangeDetails()) {
-			InvoiceDetail inDetail = new InvoiceDetail(b2cDetail, createNumberService);
-			inDetail.setInvoice(invoice);
-			inDetail.setStatus(Status.TOBESHIPPED.value());
-			inDetails.add(inDetail);
-			String cfcid = b2cDetail.getCfcid();
-			if(cfcid != null) {//有可能这张换货单是由平台申请的
-				ChangeFCustDetail custDetail = changeFCustDetailDao.findByDetailid(cfcid);
-				custDetail.setStatus(Status.SHIPPINGIN.value());
-				changeFCustDetailDao.save(custDetail);
-			}
-		}
-		// 给属性赋值
-		invoice.setStatusToBeShipped(uu);
-		invoice.setInvoiceDetails(inDetails);
-		invoiceDao.save(invoice);
-		// 第三步 更新平台换货单 客户换货单状态
-		ChangeFCust cust = b2c.getCust();
-		if(cust != null) {
-			if (!cust.getStatus().equals(Status.TOBESHIPPED.value())) {
-				throw new IllegalOperatorException("没有传入有效的订单信息");
-			}
-			boolean isAllShippingin = true;
-			Set<ChangeFCustDetail> changeDetails = cust.getChangeDetails();
-			for (ChangeFCustDetail changeFCustDetail : changeDetails) {
-				if(changeFCustDetail.getStatus().equals(Status.SHIPPINGIN.value())) {
-					isAllShippingin = false;
-					break;
-				}
-			}
-			if(isAllShippingin) {
-				cust.setStatusShippingin(uu);
-				changeFCustDao.save(cust);
-			}
-		}
-		purchase.setExchangeStatusFromBuyer(Status.TOBESHIPPED.value());
-		// 设置采购单的退换货单的状态为已收货状态
-		purchase.setExchangeStatus(Purchase.ExchangeStatus.VENDOR_RECEIVED);
-		purchaseDao.save(purchase);
-		b2c.setStatusTobeshipped(uu);
-		changeFB2cDao.save(b2c);
-		return "success";
-	}
-
-	@Override
-	public String venderAccept(String purchaseId) {
-		ChangeFB2c changeFB2c = changeFB2cDao.findByPuid(purchaseId);
-		if (changeFB2c == null) {
-			throw new IllegalOperatorException("采购单编号[" + purchaseId + "]对应的平台退换货单不存在");
-		}
-		return venderAccept(changeFB2c.getId());
-	}
-
-	@Override
-	@Transactional
-	public String createInvoiceB2cChange(Long changeid) {
-		ChangeFCust cust = changeFCustDao.findOne(changeid);
-		if(cust == null) {
-			throw new IllegalOperatorException("信息提交有误,请刷新界面重新提交");
-		}
-		if (cust.getStatus() != Status.SHIPPED.value()) {
-			throw new IllegalAccessError("换货单"+cust.getChangeid()+"的状态是"+Status.valueOf(cust.getStatus()).getPhrase()+",不为已出货状态,不能为此换货单转出货单");
-		}
-		// 1 生成一张平台换货出货单
-		Invoice invoice = cust.convertInvoiceFChange(createNumberService);
-		Set<InvoiceDetail> iDetails = new HashSet<>();
-		// 给明细赋值
-		for (ChangeFCustDetail chD : cust.getChangeDetails()) {
-			InvoiceDetail invoiceD = chD.convertInvoiceFChDetail(createNumberService);
-			invoiceD.setInvoice(invoice);
-			invoiceD.setStatus(Status.TOBESHIPPED.value());
-			iDetails.add(invoiceD);
-		}
-		Long uu = SystemSession.getUser().getUserUU();
-		// 如果是现货,则需要平台手动发货(需要录用快递信息)
-		invoice.setStatusToBeShipped(uu);
-		invoice.setInvoiceDetails(iDetails);
-		invoice = invoiceDao.save(invoice);
-		// 2 改写订单单关联属性及状态
-		cust.setStatusSending(uu);
-		Set<ChangeFCustDetail> changeDetails = cust.getChangeDetails();
-		for (ChangeFCustDetail changeFCustDetail : changeDetails) {
-			changeFCustDetail.setStatus(Status.SENDING.value());
-		}
-		// 换货单的发货地址就是本次出货单的收货地址
-		invoice.setJsonSpAddress(cust.getJsonSdAddress());
-		changeFCustDao.save(cust);
-		return "success";
-	}
-
-	@Override
-	@Transactional
-	public String onesEnsureAccept(Long changeid) {
-		ChangeFCust cust = changeFCustDao.findOne(changeid);
-		if(cust == null) {
-			throw new IllegalOperatorException("信息提交有误,请刷新界面重新提交");
-		}
-		if (cust.getStatus() != Status.INBOUND.value()) {
-			throw new IllegalAccessError("订单"+cust.getChangeid()+"的状态是"+Status.valueOf(cust.getStatus()).getPhrase()+",不为待收货状态,不能为确认收货!");
-		}
-		Long uu = SystemSession.getUser().getUserUU();
-		cust.setStatusReceived(uu);
-		Set<ChangeFCustDetail> changeDetails = cust.getChangeDetails();
-		for (ChangeFCustDetail changeFCustDetail : changeDetails) {
-			changeFCustDetail.setStatus(Status.RECEIVED.value());
-			String ordid = changeFCustDetail.getOrdid();
-			OrderDetail orderDetail = orderDetailDao.findByDetailid(ordid);
-			orderDetail.setStatus(Status.RECEIVED.value());
-			orderDetailDao.save(orderDetail);
-			
-		}
-		cust = changeFCustDao.save(cust);
-		// 1 更新管理订单及明细数据
-		Order order = orderDao.findByOrderid(cust.getOrid());
-		if (order == null) {
-			throw new IllegalAccessError("来源订单不存在,请重试!");
-		}
-		order.setSecondReTime(new Date());
-		order.setChangeStatus(Status.RECEIVED.value());
-		order = orderDao.save(order);
-		Set<OrderDetail> orderDetails = order.getOrderDetails();
-		// 2 更新关联采购订单及明细数据
-		List<Purchase> purchases = purchaseDao.findByOrderid(order.getOrderid());
-		if (purchases.size() == 0) {
-			throw new IllegalAccessError("来源采购单不存在,请重试!");
-		}
-		for (Purchase purchase : purchases) {
-			Set<PurchaseDetail> puDetails = new HashSet<>();
-			for (PurchaseDetail purcDetail : purchase.getPurchaseDetails()) {
-				for (OrderDetail orderdetail : orderDetails) {
-					if (purcDetail.getDetailid().equals(orderdetail.getPurdetid())) {
-						purcDetail.setChangeQty(orderdetail.getCustchangeQty());
-						purcDetail.setEnsurePrice(purcDetail.ensurePrice());
-					}
-				}
-				purcDetail.setPurchase(purchase);
-				puDetails.add(purcDetail);
-			}
-			purchase.setEnsurePrice(purchase.ensurePrice(puDetails));
-			purchase.setChangeQty(purchase.totalChangeQty(puDetails));
-			purchase.setPurchaseDetails(puDetails);
-			purchaseDao.save(purchase);
-		}
-
-		// 更新平台换货出货单状态
-		Invoice invoice = invoiceDao.findBySourceidAndPiclass(cust.getChangeid(), Type.Invoice_B2c_Change_code.value());
-		Set<InvoiceDetail> invoiceDetails = invoice.getInvoiceDetails();
-		for (InvoiceDetail invoiceDetail : invoiceDetails) {
-			invoiceDetail.setStatus(Status.RECEIVED.value());
-		}
-		invoice.setStatusReceived(uu);
-		invoiceDao.save(invoice);
-		return "success";
-	}
-
-	@Override
-	public Page<ChangeFCust> findIndividualChanges(final PageInfo pageInfo, String keyword, String status) {
-		if (status.indexOf("-") != -1) {
-			String[] statuses = status.split("-");
-			SimpleExpression[] expressions = new SimpleExpression[statuses.length];
-			for (int i = 0; i < statuses.length; i++) {
-				String s = statuses[i];
-				expressions[i] = PredicateUtils.eq("status", Short.parseShort(s), false);
-			}
-			pageInfo.expression(PredicateUtils.or(expressions));
-		} else {
-			pageInfo.filter("status", Short.parseShort(status));
-		}
-		if (StringUtils.hasText(keyword)) {
-			// 输订单号,按订单号查询
-			pageInfo.filter("changeid", keyword);
-		}
-		return changeFCustDao.findAll(new Specification<ChangeFCust>() {
-			public Predicate toPredicate(Root<ChangeFCust> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	@Override
-	public ChangeFCust findFCByChangeId(String changeid) {
-		return changeFCustDao.findByChangeid(changeid);
-	}
-
-	@Override
-	public ChangeFB2CSimpleInfo findByChangeidAndSellenuu(String changeid) {
-		Long sellerenuu = SystemSession.getUser().getEnterprise().getUu();
-		ChangeFB2c changeFB2C = changeFB2cDao.findByChangeidAndSellerenuu(changeid, sellerenuu);
-		if (changeFB2C == null) {
-			throw new IllegalOperatorException("非法操作");
-		}
-		String invoiceid = null;
-		String puid = null;
-		Purchase purchase = purchaseDao.findByPurchaseid(changeFB2C.getPuid());
-		if (purchase != null) {
-			puid = purchase.getPurchaseid();
-		}
-		Invoice invoice = invoiceDao.findBySourceid(changeid);
-		if (invoice != null) {
-			invoiceid = invoice.getInvoiceid();
-		}
-		ChangeFB2CSimpleInfo changeFB2CSimpleInfo = new ChangeFB2CSimpleInfo(changeFB2C);
-		changeFB2CSimpleInfo.setPuid(puid);
-		changeFB2CSimpleInfo.setInvoiceid(invoiceid);
-		return changeFB2CSimpleInfo;
-	}
-
-	@Override
-	public Page<ChangeFB2c> findIndividualVender(final PageInfo pageInfo, String keyword, String status) {
-		if (status.indexOf("-") != -1) {
-			String[] statuses = status.split("-");
-			SimpleExpression[] expressions = new SimpleExpression[statuses.length];
-			for (int i = 0; i < statuses.length; i++) {
-				String s = statuses[i];
-				expressions[i] = PredicateUtils.eq("status", Short.parseShort(s), false);
-			}
-			pageInfo.expression(PredicateUtils.or(expressions));
-		} else {
-			pageInfo.filter("status", Short.parseShort(status));
-		}
-		if (StringUtils.hasText(keyword)) {
-			// 输订单号,按订单号查询
-			pageInfo.filter("changeid", keyword);
-		}
-		return changeFB2cDao.findAll(new Specification<ChangeFB2c>() {
-			public Predicate toPredicate(Root<ChangeFB2c> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	@Override
-	public ChangeFB2c findB2CByChangeId(String changeid) {
-		return changeFB2cDao.findByChangeid(changeid);
-	}
-
-	@Override
-	public ChangeFCust createChangeFCust(List<OrderDetail> list) {
-		if(CollectionUtils.isEmpty(list)) {
-			return null;
-		}
-		Long userUU = SystemSession.getUser().getUserUU();
-		Order order = list.get(0).getOrder();
-		ChangeFCust changeFCust = new ChangeFCust(order);
-		Set<ChangeFCustDetail> setDetail = new HashSet<>();
-		Short detno = 1;
-		Double totalPrice = 0.0d;
-		Double qty = 0.0d;
-		Double taxes = 0.0d;
-		ChangeFCustDetail changeFCustDetail;
-		for (OrderDetail orderDetail : list) {
-			changeFCustDetail = new ChangeFCustDetail(orderDetail);
-			String timeNumber = createNumberService.getTimeNumber("trade$change_fmcust_dt", 9);
-			String detailid = EncodingRulesConstant.CHANGE_DETAIL_FROMCUST.replaceAll("_TIMESTAP_NUMBER", timeNumber);
-			changeFCustDetail.setDetailid(detailid);
-			
-			changeFCustDetail.setDetno(detno++);
-			changeFCustDetail.setStatus(Status.TOBESHIPPEDBACK.value());
-			changeFCustDetail.setChange(changeFCust);
-			changeFCustDetail.setOrdid(orderDetail.getDetailid());
-			totalPrice = NumberUtil.add(totalPrice, changeFCustDetail.getPrice());
-			qty = NumberUtil.add(qty, changeFCustDetail.getNumber());
-			taxes = NumberUtil.add(taxes, changeFCustDetail.getTaxes());
-			setDetail.add(changeFCustDetail);
-		}
-		changeFCust.setPrice(totalPrice);
-		changeFCust.setQty(qty);
-		changeFCust.setTaxes(taxes);
-		changeFCust.setChangeDetails(setDetail);
-		String timeNumber = createNumberService.getTimeNumber("trade$change_fmcust", 8);
-		String changeid = EncodingRulesConstant.CHANGE_FROMCUST.replaceAll("_TIMESTAP_NUMBER", timeNumber);
-		changeFCust.setChangeid(changeid);
-		changeFCust.setStatusTobeshippedback(userUU);
-		ChangeFCust change = changeFCustDao.save(changeFCust);
- 		return change;
-	}
-
-	@Override
-	public ChangeFB2c createChangeFB2C(List<PurchaseDetail> list, ChangeFB2c changeFB2c) {
-		if(CollectionUtils.isEmpty(list)) {
-			return null;
-		}
-		Set<ChangeFB2cDetail> details = new HashSet<ChangeFB2cDetail>();
-		Short detno = 1;
-		Double prices = 0.0d;
-		Double taxes = 0.0d;
-		Double qty = 0.0d;
-		ChangeFB2cDetail detail = null;
-		for (PurchaseDetail purchaseDetail : list) {
-			detail = new ChangeFB2cDetail(purchaseDetail);
-			String timeNumber = createNumberService.getTimeNumber("trade$change_fmb2c_dt", 9);
-			String detailid = EncodingRulesConstant.CHANGE_DETAIL_FROMB2C.replace("_TIMESTAP_NUMBER", timeNumber);
-			detail.setDetailid(detailid);
-			detail.setDetno(detno++);
-			qty += detail.getNumber();
-			taxes += detail.getTaxes();
-			prices += detail.getPrice();
-			detail.setStatus(Status.TOBESHIPPEDBACK.value());
-			detail.setChange(changeFB2c);
-			details.add(detail);
-			purchaseDetail.setChangeId(detailid);
-		}
-		changeFB2c.setQty(qty);
-		changeFB2c.setPrice(prices);
-		changeFB2c.setTaxes(taxes);
-		changeFB2c.setChangeDetails(details);
-		String timeNumber = createNumberService.getTimeNumber("trade$change_fmb2c", 8);
-		String changeId = EncodingRulesConstant.CHANGE_FROMB2C.replace("_TIMESTAP_NUMBER", timeNumber);
-		changeFB2c.setChangeid(changeId);
-		return changeFB2c;
-	}
-}

+ 0 - 71
src/main/java/com/uas/platform/b2c/trade/aftersale/service/impl/ReturnFCustDetailServiceImpl.java

@@ -1,71 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.service.impl;
-
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCustDetail;
-import com.uas.platform.b2c.trade.aftersale.service.ReturnFCustDetailService;
-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.OrderDetail;
-import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
-import com.uas.platform.core.exception.IllegalStatusException;
-import com.uas.platform.core.model.EncodingRulesConstant;
-import com.uas.platform.core.model.Status;
-import org.apache.commons.collections.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * The type Return f cust detail service.
- *
- * @author yujia
- * @version 2016-11-10 13:52:25  客户退货单明细的实现层
- */
-@Service
-public class ReturnFCustDetailServiceImpl implements ReturnFCustDetailService {
-	
-	private final CreateNumberService createNumberService;
-
-	private final PurchaseDetailDao purchaseDetailDao;
-
-	@Autowired
-	public ReturnFCustDetailServiceImpl(CreateNumberService createNumberService, PurchaseDetailDao purchaseDetailDao) {
-		this.createNumberService = createNumberService;
-		this.purchaseDetailDao = purchaseDetailDao;
-	}
-
-	@Override
-	public List<ReturnFCustDetail> createReturnFCustDetail(List<OrderDetail> orderDetails, Order order) {
-		if(CollectionUtils.isEmpty(orderDetails)) {
-			return null;
-		}
-		List<ReturnFCustDetail> list = new ArrayList<>();
-		ReturnFCustDetail rDetail;
-		short detno = 1;
-		String  detailid;
-		String timeNumber;
-		for (OrderDetail oDetail : orderDetails) {
-			rDetail = new ReturnFCustDetail(oDetail);
-			rDetail.setDetno(detno++);	
-			timeNumber = createNumberService.getTimeNumber("trade$return_fmcust_dt", 8);
-			detailid = EncodingRulesConstant.RETURN_DETAIL_FROMCUST.replaceAll("_TIMESTAP_NUMBER", timeNumber);
-			rDetail.setDetailid(detailid);
-			rDetail.setStatus(Status.TOBESHIPPEDBACK.value());
-			rDetail.setOrd_id(oDetail.getDetailid());
-			oDetail.setStatus(Status.RETURN.value(), SystemSession.getUser().getUserUU());
-			// 保存采购单的退货数量信息
-			PurchaseDetail puDetail = purchaseDetailDao.findByOrderdetailid(oDetail.getDetailid());
-			if (puDetail == null) {
-				throw new IllegalStatusException("订单明细" + oDetail.getDetailid() + "对应的采购单明细不存在");
-			}
-			puDetail.setReturnQty(oDetail.getNumber());
-			purchaseDetailDao.save(puDetail);
-			list.add(rDetail);
-		}
-		return list;
-	}
-
-}

+ 0 - 679
src/main/java/com/uas/platform/b2c/trade/aftersale/service/impl/ReturnServiceImpl.java

@@ -1,679 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.service.impl;
-
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.DoubleArith;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.fa.settlement.dao.RefundDao;
-import com.uas.platform.b2c.fa.settlement.model.Refund;
-import com.uas.platform.b2c.fa.settlement.model.RefundDetail;
-import com.uas.platform.b2c.fa.settlement.service.RefundService;
-import com.uas.platform.b2c.logistics.dao.InvoiceFPurchaseDao;
-import com.uas.platform.b2c.logistics.dao.ReceiptDao;
-import com.uas.platform.b2c.logistics.model.Receipt;
-import com.uas.platform.b2c.logistics.model.ReceiptDetail;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.trade.aftersale.dao.ReturnFB2cDao;
-import com.uas.platform.b2c.trade.aftersale.dao.ReturnFCustDao;
-import com.uas.platform.b2c.trade.aftersale.dao.ReturnFCustDetailDao;
-import com.uas.platform.b2c.trade.aftersale.model.*;
-import com.uas.platform.b2c.trade.aftersale.service.ReturnFCustDetailService;
-import com.uas.platform.b2c.trade.aftersale.service.ReturnService;
-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.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.core.exception.IllegalOperatorException;
-import com.uas.platform.core.exception.IllegalStatusException;
-import com.uas.platform.core.model.EncodingRulesConstant;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.persistence.criteria.PredicateUtils;
-import com.uas.platform.core.persistence.criteria.SimpleExpression;
-import org.apache.commons.collections.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import java.util.*;
-
-/**
- * The type Return service implementation.
- *
- * @author aof
- * @version 2017-08-02 17:16:56 创建文件
- */
-@Service
-@Transactional
-public class ReturnServiceImpl implements ReturnService {
-
-	private final CreateNumberService createNumberService;
-	
-	private final PurchaseDetailDao purchaseDetailDao;
-
-	private final ReturnFCustDao returnFCustDao;
-	
-	private final ReturnFCustDetailDao returnFCustDetailDao;
-
-	private final ReturnFB2cDao returnFB2cDao;
-
-	private final ReceiptDao receiptDao;
-
-	private final OrderDao orderDao;
-	
-	private final OrderDetailDao orderDetailDao;
-
-	private final PurchaseDao purchaseDao;
-
-	private final InvoiceFPurchaseDao invoiceFPurchaseDao;
-	
-	private final ReturnFCustDetailService returnFCustDetailService;
-
-	@Autowired
-	private RefundService refundService;
-
-	private final RefundDao refundDao;
-
-	@Autowired
-	public ReturnServiceImpl(CreateNumberService createNumberService, PurchaseDetailDao purchaseDetailDao, ReturnFCustDao returnFCustDao, ReturnFCustDetailDao returnFCustDetailDao, ReturnFB2cDao returnFB2cDao, ReceiptDao receiptDao, OrderDao orderDao, OrderDetailDao orderDetailDao, PurchaseDao purchaseDao, InvoiceFPurchaseDao invoiceFPurchaseDao, ReturnFCustDetailService returnFCustDetailService, RefundDao refundDao) {
-		this.createNumberService = createNumberService;
-		this.purchaseDetailDao = purchaseDetailDao;
-		this.returnFCustDao = returnFCustDao;
-		this.returnFCustDetailDao = returnFCustDetailDao;
-		this.returnFB2cDao = returnFB2cDao;
-		this.receiptDao = receiptDao;
-		this.orderDao = orderDao;
-		this.orderDetailDao = orderDetailDao;
-		this.purchaseDao = purchaseDao;
-		this.invoiceFPurchaseDao = invoiceFPurchaseDao;
-		this.returnFCustDetailService = returnFCustDetailService;
-		this.refundDao = refundDao;
-	}
-
-	@Override
-	@Transactional
-	public ReturnFCust ensureReturn(Order order) {
-		if (!orderDao.findOne(order.getId()).getStatus().equals(Status.RECEIVED.value())) {
-			throw new IllegalOperatorException("订单"+ order.getOrderid() +"的状态是"+ Status.valueOf(order.getStatus()).getPhrase() +",已收货,不可做退货操作!");
-		}
-		Long uu = SystemSession.getUser().getUserUU();
-		Set<ReturnFCustDetail> returnDetails = new HashSet<>();
-		ReturnFCust cust = new ReturnFCust(order);
-		Double totalPrice = (double) 0;
-		Double taxes = (double) 0;
-		// 生成退货单号
-		String returnid = EncodingRulesConstant.RETURN_FROMCUST.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$return_fmcust", 8));
-		// 这里由于前台传过来的order对象被切断了双向关联,这里需要重新set进去
-		Set<OrderDetail> orDetails = new HashSet<>();
-		for (OrderDetail detail : order.getOrderDetails()) {
-			if (detail.getReturnQty() > 0) {
-				if(detail.getStatus() != Status.RECEIVED.value()) {
-					throw new IllegalOperatorException("当前订单" + detail.getDetailid() + "的状态是" + Status.valueOf(detail.getStatus()).getPhrase() + ", 不能进行退货");
-				}
-				if (detail.getReturnQty() > detail.getNumber() - detail.getCustreturnQty()) {
-					throw new IllegalOperatorException("退货数量超过订单现有数量");
-				}
-				ReturnFCustDetail returnDetail = new ReturnFCustDetail(detail);
-				String detailid = EncodingRulesConstant.RETURN_DETAIL_FROMCUST.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$return_fmcust_dt", 9));
-				returnDetail.setDetailid(detailid);
-				// 退货数量
-				returnDetail.setNumber(detail.getReturnQty());
-				taxes = DoubleArith.add(taxes, returnDetail.getTaxes());
-				// 计算明细总价
-				returnDetail.setPrice(returnDetail.getNumber() * returnDetail.getTaxUnitprice());
-				totalPrice = DoubleArith.add(totalPrice, returnDetail.getPrice());
-				returnDetail.setOrd_id(detail.getDetailid());
-				returnDetail.setCustreturn(cust);
-				returnDetail.setStatus(Status.UNAUDIT.value());
-				returnDetails.add(returnDetail);
-				detail.setStatusInaftersales(uu);
-				detail.setCustreturnQty(DoubleArith.add(detail.getCustreturnQty(), detail.getReturnQty()));
-				order.setCustreturnQty(DoubleArith.add(detail.getReturnQty(), order.getCustreturnQty()));
-			}
-			detail.setOrder(order);
-			orDetails.add(detail);
-		}
-		cust.setReturnDetails(returnDetails);
-		cust.setReturnid(returnid);
-		cust.setPrice(totalPrice);
-		cust.setTaxes(taxes);
-		cust.setOrid(order.getOrderid());
-		order.setOrderDetails(orDetails);
-		orderDao.save(order);
-		// 设置状态为申请中
-		cust.setQtys();
-		cust.setStatusUnaudit(uu);
-		return returnFCustDao.save(cust);
-	}
-
-	@Override
-	public ReturnFCust auditReturn(Long id, Long boo) {
-		Long uu = SystemSession.getUser().getUserUU();
-		ReturnFCust thiscust = returnFCustDao.findOne(id);
-		if (thiscust == null) {
-			throw new IllegalOperatorException("退货单[ID:" + id + "]不存在");
-		} else if (Status.UNAUDIT.value() != thiscust.getStatus()) {
-			throw new IllegalOperatorException("退货单" + thiscust.getReturnid() + "的状态是" + Status.valueOf(thiscust.getStatus()).getPhrase() + ",不能操作");
-		}
-		if (boo == 1) {
-			// 审核通过
-			thiscust.setStatusTobeshippedback(uu);
-			Set<ReturnFCustDetail> returnDetails = thiscust.getReturnDetails();
-			for (ReturnFCustDetail returnFCustDetail : returnDetails) {
-				returnFCustDetail.setStatus(Status.TOBESHIPPEDBACK.value());
-			}
-		} else {
-			// 审核不通过
-			thiscust.setStatusNotallow(uu);
-			Set<ReturnFCustDetail> returnDetails = thiscust.getReturnDetails();
-			// 将关联的订单解绑
-			Order order = orderDao.findByOrderid(thiscust.getOrid());
-			order.setStatusReceived(uu);
-			for (ReturnFCustDetail returnFCustDetail : returnDetails) {
-				returnFCustDetail.setStatus(Status.NOTALLOW.value());
-				String ord_id = returnFCustDetail.getOrd_id();
-				OrderDetail orderDetail = orderDetailDao.findByDetailid(ord_id);
-				orderDetail.setStatusReceived(uu);
-				//修改
-				orderDetail.setCustreturnQty(DoubleArith.sub(orderDetail.getCustreturnQty(), returnFCustDetail.getNumber()));
-				order.setCustreturnQty(DoubleArith.sub(order.getCustreturnQty(), returnFCustDetail.getNumber()));
-				orderDetailDao.save(orderDetail);
-			}
-			orderDao.save(order);
-		}
-		return returnFCustDao.save(thiscust);
-	}
-
-	@Override
-	public List<ReturnFCust> findByStatus(Integer status) {
-		return returnFCustDao.findByStatus(status);
-	}
-
-	@Override
-	public List<ReturnFCust> findOnesByStatuses(List<Integer> statuses) {
-		List<ReturnFCust> custs = new ArrayList<>();
-		for (Integer statue : statuses) {
-			custs.addAll(findByStatus(statue));
-		}
-		return custs;
-	}
-
-	@Override
-	@Transactional
-	public ReturnFCust sendReturn(ReturnFCust cust) {
-		if (cust == null) {
-			throw new IllegalOperatorException("退货单不存在");
-		} else if (Status.TOBESHIPPEDBACK.value() != cust.getStatus()) {
-			throw new IllegalOperatorException("退货单"+ cust.getReturnid() +"的状态是" + Status.valueOf(cust.getStatus()).getPhrase() + ",不可进行当前操作");
-		}
-		for (ReturnFCustDetail detail : cust.getReturnDetails()) {
-			detail.setCustreturn(cust);
-			detail.setStatus(Status.INSPECTING.value());
-		}
-		cust.setStatusInspecting(SystemSession.getUser().getUserUU());
-		String orid = cust.getOrid();
-		Order order = orderDao.findByOrderid(orid);
-		order.setReturnStatus(Status.INSPECTING.value());
-		orderDao.save(order);
-		return returnFCustDao.save(cust);
-	}
-
-	@Override
-	public String batchSendForVender(List<ReturnFB2c> b2cs) {
-		for (ReturnFB2c b2c : b2cs) {
-			if (b2c == null) {
-				throw new IllegalOperatorException("平台退货单不存在");
-			} else if (Status.TOBESHIPPEDBACK.value() != b2c.getStatus()) {
-				throw new IllegalOperatorException("退货单" + b2c.getReturnid() +",状态为"+ Status.valueOf(b2c.getStatus()).getPhrase() +",不可做发货操作!");
-			}
-			for (ReturnFB2cDetail detail : b2c.getReturnDetails()) {
-				detail.setB2creturn(b2c);
-				detail.setStatus(Status.INSPECTING.value());
-			}
-			b2c.setStatusInspecting(SystemSession.getUser().getUserUU());
-			
-			Purchase purchase = purchaseDao.findByPurchaseid(b2c.getPuid());
-			if(purchase != null) {
-				purchase.setReturnPuStatus(Status.INSPECTING.value());
-				purchaseDao.save(purchase);
-			}else {
-				throw new IllegalOperatorException("换货单对应的采购单信息丢失。");
-			}
-			returnFB2cDao.save(b2c);
-		}
-		return "success";
-	}
-
-	@Override
-	@Transactional
-	public ReturnFB2c venderAccept(Long returnid) {
-		Long uu = SystemSession.getUser().getUserUU();
-		ReturnFB2c b2c = returnFB2cDao.findOne(returnid);
-		if(b2c == null) {
-			throw new IllegalOperatorException("单据信息缺失,请重新刷新界面操作");
-		} else if (Status.INSPECTING.value() != b2c.getStatus()) {
-			throw new IllegalOperatorException("退货单" + b2c.getReturnid() + "的状态是" + Status.valueOf(b2c.getStatus()).getPhrase()+ ",不能进行相应的操作");
-		}
-		// 记录需要更新状态的客户退款单、采购单以及退款单对应的订单明细单据ID
-		Set<String> reCustDetailIds = new HashSet<>();
-		Set<String> puIds = new HashSet<>();
-		Set<String> orderDetailIds = new HashSet<>();
-		// 记录平台退货单是否在取消购买时产生
-		boolean isCancelOrder = b2c.getCustid() == null;
-
-		// 创建供应商的入库单以及明细,并持久化
-		Receipt receipt = createReceiptForVendor(b2c);
-		if (receipt != null) {
-			receiptDao.save(receipt);
-		}
-
-		// 更新平台退货单以及明细的状态
-		Set<ReturnFB2cDetail> returnFB2cDetails = b2c.getReturnDetails();
-		for (ReturnFB2cDetail fb2cDetail : returnFB2cDetails) {
-			if (Status.RECEIVED.value() == fb2cDetail.getStatus()) {
-				continue;
-			}
-			fb2cDetail.setStatus(Status.RECEIVED.value());
-			if (!isCancelOrder) {
-				// 记录需要修改状态的明细单据ID
-				reCustDetailIds.add(fb2cDetail.getRfcdid());
-			}
-			puIds.add(fb2cDetail.getPuid());
-			orderDetailIds.add(fb2cDetail.getOrdetailid());
-		}
-		b2c.setReturnDetails(returnFB2cDetails);
-		b2c.setStatusReceived(uu);
-		b2c = returnFB2cDao.save(b2c);
-
-		// 更新客户退货单以及明细的状态
-		if (!isCancelOrder) {
-			ReturnFCust returnFCust = returnFCustDao.findOne(b2c.getCustid());
-			returnFCust = updateReturnFCustByB2c(reCustDetailIds, returnFCust);
-			returnFCustDao.save(returnFCust);
-		}
-
-		// 更新采购单退货的数量和状态信息(更新主单据状态必须更新明细状态)
-		Purchase purchase = purchaseDao.findByPurchaseid(b2c.getPuid());
-		purchase = updatePurchaseByReturn(puIds, isCancelOrder, purchase);
-		purchaseDao.save(purchase);
-
-		// 更新退款单明细的状态以及退款单的状态
-		Refund refund = refundDao.findByOrderid(purchase.getOrderid());
-		refund = updateRefundByReturn(orderDetailIds, refund);
-		refundDao.save(refund);
-		return b2c;
-	}
-
-	/**
-	 * 根据待更新状态的退款单明细单据ID更新明细状态,以及退款单的状态信息
-	 *
-	 * history:
-	 * Created by huxz 2017-1-20 09:50:10
-	 *
-	 * @param orderDetailIds	待更新状态的退款单明细的单据ID
-	 * @param refund			待更新状态的退款单实例
-	 * @return	待持久化的退款单
-	 */
-	private Refund updateRefundByReturn(Set<String> orderDetailIds, Refund refund) {
-		if (refund == null) {
-			throw new IllegalStatusException("没有生成退货单对应的退款单");
-		}
-		Set<RefundDetail> refundDetails = refund.getRefundDetails();
-		if (CollectionUtils.isNotEmpty(refundDetails)) {
-			int count = 0;
-			for (RefundDetail refundDetail : refundDetails) {
-				if (orderDetailIds.contains(refundDetail.getOrderDetail().getDetailid())) {
-					refundDetail.setStatus(Refund.RefundStatus.TOBEREFUND.toString());
-				}
-				if (Refund.RefundStatus.TOBEREFUND.toString().equals(refundDetail.getStatus())) {
-					count ++;
-				}
-			}
-			refund.setRefundDetails(refundDetails);
-			if (count == refundDetails.size()) {
-				refund.setStatus(Refund.RefundStatus.TOBEREFUND.toString());
-			}
-		}
-		return refund;
-	}
-
-	/**
-	 * 根据待更新状态的采购单明细单据ID更新明细状态,以及更新采购单的状态信息
-	 *
-	 * history:
-	 * Created by huxz 2017-1-20 09:44:43
-	 *
-	 * @param puIds				待更新状态的采购单明细单据ID
-	 * @param isCancelOrder		是否为取消购买产生的退货单
-	 * @param purchase			待更新状态的采购单
-	 * @return 	待持久化的采购单
-	 */
-	private Purchase updatePurchaseByReturn(Set<String> puIds, boolean isCancelOrder, Purchase purchase) {
-		Long uu = SystemSession.getUser().getUserUU();
-		if (purchase == null) {
-			throw new IllegalStatusException("采购单信息丢失");
-		}
-		purchase.totalReturnQty(purchase.getPurchaseDetails());
-		Status newStatus;
-		if (isCancelOrder) {
-			newStatus = Status.UNAVAILABLE_PERSONAL;
-		} else {
-			newStatus = Status.UNAVAILABLE_RETURN;
-		}
-		// 根据采购单明细设置采购单的失效状态
-		Set<PurchaseDetail> purchaseDetails = purchase.getPurchaseDetails();
-		if (CollectionUtils.isNotEmpty(purchaseDetails)) {
-			int count = 0;
-			for (PurchaseDetail purchaseDetail : purchaseDetails) {
-				if (puIds.contains(purchaseDetail.getDetailid())) {
-					purchaseDetail.setStatus(newStatus.value(), uu);
-				}
-				if (Status.isUnavailable(purchaseDetail.getStatus())) {
-					count ++;
-				}
-			}
-			purchase.setPurchaseDetails(purchaseDetails);
-			if (count == purchaseDetails.size()) {
-				purchase.setStatus(newStatus.value(), SystemSession.getUser().getUserUU());
-			}
-		}
-		return purchase;
-	}
-
-	/**
-	 * 根据待更新状态的客户退货单明细单据ID更新明细状态,以及更新客户退货单的状态信息
-	 *
-	 * history:
-	 * Created by huxz 2017-1-20 09:43:29
-	 *
-	 * @param reCustDetailIds	待更新状态的客户退货单明细单据ID
-	 * @param returnFCust		待更新状态的客户退货单
-	 * @return	待持久化的客户退货单
-	 */
-	private ReturnFCust updateReturnFCustByB2c(Set<String> reCustDetailIds, ReturnFCust returnFCust) {
-		Long uu = SystemSession.getUser().getUserUU();
-		if (returnFCust == null || Status.INSPECTED.value() != returnFCust.getStatus()) {
-			throw new IllegalOperatorException("没有传入有效的客户退货单信息");
-		}
-		Set<ReturnFCustDetail> returnDetails = returnFCust.getReturnDetails();
-		if (CollectionUtils.isNotEmpty(returnDetails)) {
-			int count = 0;
-			for (ReturnFCustDetail returnFCustDetail : returnDetails) {
-				if (reCustDetailIds.contains(returnFCustDetail.getDetailid())) {
-					returnFCustDetail.setStatus(Status.TOBEREFUNDED.value());
-				}
-				if (Status.TOBEREFUNDED.value() == returnFCustDetail.getStatus()) {
-					count ++;
-				}
-			}
-			returnFCust.setReturnDetails(returnDetails);
-			if(count == returnDetails.size()) {
-				returnFCust.setStatusToberefunded(uu);
-			}
-		}
-		return returnFCust;
-	}
-
-	/**
-	 * 根据平台退货单生成相应的供应商入库单及其明细信息
-	 *
-	 * history:
-	 * Created by huxz 2017-1-19 17:27:37
-	 *
-	 * @param returnFB2c	查询到的平台退货单实例
-	 * @return	待持久化的入库单
-	 */
-	private Receipt createReceiptForVendor(ReturnFB2c returnFB2c) {
-		Long uu = SystemSession.getUser().getUserUU();
-		if (returnFB2c == null) {
-			return null;
-		}
-		// 生成销售验退单 (供应商销售退货单)
-		Receipt receipt = new Receipt(returnFB2c);
-		// 生成入库单号
-		String receiptid = EncodingRulesConstant.RECEIPT_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt", 8));
-		receipt.setReceiptid(receiptid);
-		Set<ReceiptDetail> receiptdetais = new HashSet<>();
-		Set<ReturnFB2cDetail> returnFB2cDetails = returnFB2c.getReturnDetails();
-		if (CollectionUtils.isEmpty(returnFB2cDetails)) {
-			return null;
-		}
-		// 根据退货单明细信息生成对应的销售验退单明细信息
-		for (ReturnFB2cDetail b2cDetail : returnFB2cDetails) {
-			ReceiptDetail reD = new ReceiptDetail(b2cDetail);
-			String detailid = EncodingRulesConstant.RECEIPT_DETAIL_FROMPURCHASE.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$receipt_detail", 9));
-			reD.setDetailid(detailid);
-			reD.setReceipt(receipt);
-			reD.setStatus(Status.AVAILABLE.value());
-			receiptdetais.add(reD);
-		}
-		receipt.setStatusAvailable(uu);
-		receipt.setReceiptDetails(receiptdetais);
-		return receipt;
-	}
-
-	@Override
-	public ReturnFCust ensurePaid(Long returnid) {
-		ReturnFCust cust = returnFCustDao.findOne(returnid);
-		if(cust == null) {
-			throw new IllegalOperatorException("对应的数据不存在,操作有误");
-		}
-		if (!cust.getStatus().equals(Status.TOBEREFUNDED.value())) {
-			throw new IllegalOperatorException("退货单"+cust.getReturnid()+"的状态是"+Status.valueOf(cust.getStatus()).getPhrase() +",不为待退款,不能做退款操作!");
-		}
-		Long uu = SystemSession.getUser().getUserUU();
-		// 将客户退货单更改状态为已退款
-		cust.setStatusRefunded(uu);
-		Set<ReturnFCustDetail> returnDetails = cust.getReturnDetails();
-		// 变更退款明细表的状态为已退款
-		for (ReturnFCustDetail returnFCustDetail : returnDetails) {
-			returnFCustDetail.setStatus(Status.REFUNDED.value());
-		}
-		cust = returnFCustDao.save(cust);
-		return cust;
-	}
-
-	@Override
-	public ModelMap hasReturns() {
-		ModelMap map = new ModelMap();
-		List<ReturnFCust> list = returnFCustDao.findByBuyeruu(SystemSession.getUser().getUserUU());
-		if (CollectionUtils.isEmpty(list)) {
-			map.put("data", "error");
-		} else {
-			map.put("data", "success");
-		}
-		return map;
-	}
-
-	@Override
-	public Page<ReturnFCust> findIndividualReturns(final PageInfo pageInfo, String keyword, String status) {
-		handlerStatus(pageInfo, status);
-		if (StringUtils.hasText(keyword)) {
-			// 输订单号,按订单号查询
-			pageInfo.filter("returnid", keyword);
-		}
-		return returnFCustDao.findAll(new Specification<ReturnFCust>() {
-			public Predicate toPredicate(Root<ReturnFCust> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	@Override
-	public ReturnFCust findByReturnId(String returnid) {
-		return returnFCustDao.findByReturnid(returnid);
-	}
-
-	@Override
-	public Page<ReturnFB2c> findIndividualVender(final PageInfo pageInfo, String keyword, String status) {
-		handlerStatus(pageInfo, status);
-		if (StringUtils.hasText(keyword)) {
-			// 输订单号,按订单号查询
-			pageInfo.filter("returnid", keyword);
-		}
-		return returnFB2cDao.findAll(new Specification<ReturnFB2c>() {
-			public Predicate toPredicate(Root<ReturnFB2c> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	private void handlerStatus(PageInfo pageInfo, String status) {
-		if (status.contains("-")) {
-			String[] statuses = status.split("-");
-			SimpleExpression[] expressions = new SimpleExpression[statuses.length];
-			for (int i = 0; i < statuses.length; i++) {
-				String s = statuses[i];
-				expressions[i] = PredicateUtils.eq("status", Short.parseShort(s), false);
-			}
-			pageInfo.expression(PredicateUtils.or(expressions));
-		} else {
-			pageInfo.filter("status", Short.parseShort(status));
-		}
-	}
-
-	@Override
-	public ReturnFB2cSimpleInfo findByReturnidAndSellerenuu(String returnid) {
-		Long sellerenuu = SystemSession.getUser().getEnterprise().getUu();
-		ReturnFB2c returnFB2c = returnFB2cDao.findByReturnidAndSellerenuu(returnid, sellerenuu);
-		if (returnFB2c == null) {
-			throw new IllegalOperatorException("非法操作");
-		}
-		String puid = returnFB2c.getPuid();
-		Purchase purchase = purchaseDao.findByPurchaseid(puid);
-		if (purchase == null) {
-			throw new IllegalOperatorException("对应的采购单信息为空,操作有误");
-		}
-		return new ReturnFB2cSimpleInfo(returnFB2c);
-	}
-
-	@Override
-	public ReturnFB2c findB2CByReturnid(String returnid) {
-		return returnFB2cDao.findByReturnid(returnid);
-	}
-
-	@Transactional
-	@Override
-	public ReturnFCust createReturnFCust(List<OrderDetail> orderDetails, Order order) {
-		if(CollectionUtils.isEmpty(orderDetails)) {
-			return null;
-		}
-		Long userUU = SystemSession.getUser().getUserUU();
-		ReturnFCust  returnFCust = new ReturnFCust(order);
-		List<ReturnFCustDetail> returnFCustDetails = returnFCustDetailService.createReturnFCustDetail(orderDetails, order);
-		Double total = 0.0d;
-		Double qty = 0.0d;
-		Double taxes = 0.0d;
-		// 计算退货订单的退货数量、总金额和税金,并关联主表信息
-		for (ReturnFCustDetail returnFCustDetail : returnFCustDetails) {
-			qty = NumberUtil.add(qty, returnFCustDetail.getNumber());
-			total = NumberUtil.add(total, returnFCustDetail.getPrice());
-			taxes = NumberUtil.add(taxes, returnFCustDetail.getTaxes());
-			returnFCustDetail.setCustreturn(returnFCust);
-		}
-		String timeNumber = createNumberService.getTimeNumber("trade$return_fmcust", 8);
-		String reid = EncodingRulesConstant.RETURN_FROMCUST.replaceAll("_TIMESTAP_NUMBER", timeNumber);
-		returnFCust.setReturnid(reid);
-		returnFCust.setOrid(order.getOrderid());
-		returnFCust.setStatusTobeshippedback(userUU);
-		returnFCust.setTotal(total);
-		returnFCust.setQty(qty);
-		returnFCust.setTaxes(taxes);
-		HashSet<ReturnFCustDetail> set = new HashSet<>();
-		set.addAll(returnFCustDetails);
-		returnFCust.setReturnDetails(set);
-		ReturnFCust reFCust = returnFCustDao.save(returnFCust);
-		
-		//创建退款单
-		Refund refund = refundService.createRefund(reFCust, Refund.RefundOrigin.RETURN);
-		order.setRefundId(refund.getReid());
-		return reFCust;
-		
-	}
-
-	@Override
-	public ReturnFB2c createReturnFB2c(List<PurchaseDetail> list, Long id) {
-		Purchase purchase = purchaseDao.getOne(id);
-		String orderid = purchase.getOrderid();
-		Order order = orderDao.findByOrderid(orderid);
-		ReturnFB2c returnFB2c = new ReturnFB2c(purchase);
-		String timeNumber = createNumberService.getTimeNumber("trade$return_fmb2c", 8);
-		String returnId = EncodingRulesConstant.RETURN_FROMB2C.replace("_TIMESTAP_NUMBER", timeNumber);
-		returnFB2c.setReturnid(returnId);
-		returnFB2c.setBuyeruu(order.getBuyeruu());
-		returnFB2c.setBuyername(order.getBuyername());
-		returnFB2c.setBuyerenuu(order.getBuyerenuu());
-		returnFB2c.setDeliverytype(order.getDeliverytype());
-		returnFB2c.setInvoicetitle(order.getInvoicetitle());
-		returnFB2c.setOrid(order.getOrderid());
-		returnFB2c.setInvoicetype(order.getInvoicetype());
-		returnFB2c.setPaytype(order.getPaytype());
-		Set<ReturnFB2cDetail> set = new HashSet<>();
-		short detno = 1;
-		Double price = 0.0d;
-		Double taxes = 0.0d;
-		Double qty = 0.0d;
-		for (PurchaseDetail purchaseDetail : list) {
-			ReturnFB2cDetail rBDetail = new ReturnFB2cDetail(purchaseDetail);
-			rBDetail.setDetno(detno++);
-			timeNumber = createNumberService.getTimeNumber("trade$return_fmb2c_dt", 8);
-			String detailid = EncodingRulesConstant.RETURN_DETAIL_FROMB2C.replace("_TIMESTAP_NUMBER", timeNumber);
-			rBDetail.setDetailid(detailid);
-			rBDetail.setStatus(Status.TOBESHIPPEDBACK.value());
-			qty += rBDetail.getNumber();
-			taxes += rBDetail.getTaxes();
-			price += rBDetail.getPrice();
-			rBDetail.setB2creturn(returnFB2c);
-			set.add(rBDetail);
-		}
-		returnFB2c.setQty(qty);
-		returnFB2c.setTaxes(taxes);
-		returnFB2c.setPrice(price);
-		returnFB2c.setReturnDetails(set);
-		returnFB2c.setStatusTobeshippedback(SystemSession.getUser().getUserUU());
-		returnFB2cDao.save(returnFB2c);
-		return returnFB2c;
-	}
-
-    @Override
-    public Map<String, ReturnFB2c> getReturnByPurchaseIds(String[] purchaseIds) {
-        Map<String, ReturnFB2c> puReturnMap = new HashMap<>();
-		ReturnFB2c returnFB2c;
-		if(purchaseIds != null) {
-			for(String purchaseId : purchaseIds) {
-				returnFB2c = returnFB2cDao.findByPuid(purchaseId);
-				ReturnFB2c puReturn = null;
-				if(returnFB2c != null) {
-					puReturn = new ReturnFB2c();
-					puReturn.setId(returnFB2c.getId());
-					puReturn.setReturnid(returnFB2c.getReturnid());
-					puReturn.setStatus(returnFB2c.getStatus());
-
-					Set<ReturnFB2cDetail> detailSet = new HashSet<>();
-					ReturnFB2cDetail returnFB2cDetail;
-					for(ReturnFB2cDetail detail : returnFB2c.getReturnDetails()) {
-						returnFB2cDetail = new ReturnFB2cDetail();
-						returnFB2cDetail.setDetailid(detail.getPuid());
-						detailSet.add(returnFB2cDetail);
-					}
-					puReturn.setReturnDetails(detailSet);
-				}
-				puReturnMap.put(purchaseId, puReturn);
-			}
-		}
-		return puReturnMap;
-    }
-}

+ 0 - 88
src/main/java/com/uas/platform/b2c/trade/aftersale/util/ExceptionUtil.java

@@ -1,88 +0,0 @@
-package com.uas.platform.b2c.trade.aftersale.util;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.BUYER_TO_MALL;
-import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.MALL_TO_BUYER;
-import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.MALL_TO_SUP;
-import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.SUP_TO_MALL;
-
-/**
- * 交易异常处理Util
- *
- * @author yangck
- * @version 2016-11-14 16:45:00 创建文件
- */
-public class ExceptionUtil {
-
-	/**
-	 * 根据异常申请当前状态得到下一个状态
-	 *
-	 * @param currentStatus the current status
-	 * @return 已弃用  ,请直接使用AfterSaleStatus的nextStatus方法
-	 */
-	@Deprecated
-    public static AfterSaleStatus getNextApplyStatus(AfterSaleStatus currentStatus) {
-        switch (currentStatus) {
-            case BUYER_TO_MALL : return MALL_TO_SUP;
-            case MALL_TO_SUP : return SUP_TO_MALL;
-            case SUP_TO_MALL : return  MALL_TO_BUYER;
-            case MALL_TO_BUYER : return BUYER_TO_MALL;
-            default : throw new RuntimeException("传入方法" + "getNextApplyStatus" + "的参数错误:" + currentStatus);
-        }
-    }
-
-	/**
-	 * 将采购异常信息map转为json保存在数据库
-	 *
-	 * @param puExInfoMap map内容示例:{"PAP2016111100000003" : "SUP_TO_MALL", "PAP2016111100000003" : "FINISHED"}
-	 * @return string
-	 */
-	public static String puExInfoMapToJson(Map<String, AfterSaleStatus> puExInfoMap) {
-        if(!CollectionUtils.isEmpty(puExInfoMap)) {
-            StringBuilder sb = new StringBuilder();
-            sb.append("[");
-            for(String puExApplyId : puExInfoMap.keySet()) {
-                sb.append("{");
-                sb.append("puExApplyId");
-                sb.append(" : \"");
-                sb.append(puExApplyId);
-                sb.append("\", status : \"");
-                sb.append(puExInfoMap.get(puExApplyId));
-                sb.append("\"}");
-            }
-            sb.append("]");
-            return sb.toString();
-        }else {
-            return null;
-        }
-    }
-
-	/**
-	 * 将采购异常信息json字符串转换为Map形式,以利用map高效的检索进行数据处理
-	 *
-	 * @param jsonStr 格式:[{puExApplyId : "PAP2016111100000002", status : "SUP_TO_MALL"},..]
-	 * @return map
-	 */
-	public static Map<String, AfterSaleStatus> puExInfoJsonToMap(String jsonStr) {
-        Map<String, AfterSaleStatus> puExInfoMap = new HashMap<>();
-        if(StringUtils.hasText(jsonStr)) {
-            JSONArray jsonArray = JSON.parseArray(jsonStr);
-            JSONObject jsonObject;
-            for(Object obj : jsonArray) {
-                jsonObject = (JSONObject) obj;
-                puExInfoMap.put(jsonObject.getString("puExApplyId"), AfterSaleStatus.valueOf(jsonObject.getString("status")));
-            }
-        }
-        return puExInfoMap;
-    }
-
-}

+ 0 - 11
src/main/java/com/uas/platform/b2c/trade/order/dao/PurchaseDao.java

@@ -1,6 +1,5 @@
 package com.uas.platform.b2c.trade.order.dao;
 
-import com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus;
 import com.uas.platform.b2c.trade.order.model.Purchase;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
@@ -134,16 +133,6 @@ public interface PurchaseDao extends JpaSpecificationExecutor<Purchase>, JpaRepo
 	@Query(value="select count(*) from trade.Purchase a where a.sellerenuu=:sellerenuu and a.storeid=:storeid and a.proofingid is null and a.used = 1")
 	int getCountBySellerenuuAndStoreid(@Param("sellerenuu") Long sellerenuu, @Param("storeid") String storeid);
 
-	/**
-	 * 根据企业UU、采购单状态、采购单异常通知状态获取采购单数量
-	 *
-	 * @param sellerenuu             the sellerenuu
-	 * @param status                 the status
-	 * @param exApplyStatusFromBuyer the ex apply status from buyer
-	 * @return rec exception count by apply status
-	 */
-	@Query(value = "select count(*) from trade.Purchase p where p.sellerenuu=:sellerenuu and p.status=:status and ((p.exApplyStatusFromBuyer<>:exApplyStatusFromBuyer and p.exApplyStatusFromBuyer is not null) or p.exApplyStatusFromMall is not null)")
-	int getRecExceptionCountByApplyStatus(@Param("sellerenuu") Long sellerenuu, @Param("status") Integer status, @Param("exApplyStatusFromBuyer") AfterSaleStatus exApplyStatusFromBuyer);
 
 	/**
 	 * 根据企业UU、采购单状态、采购单异常申请状态获取采购单数量

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

@@ -1,7 +1,5 @@
 package com.uas.platform.b2c.trade.order.model;
 
-import com.alibaba.fastjson.annotation.JSONField;
-import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.uas.api.b2c_erp.buyer.model.B2cOrder;
 import com.uas.api.b2c_erp.buyer.model.B2cOrderDetail;
 import com.uas.platform.b2c.common.account.model.User;
@@ -11,12 +9,9 @@ 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;
-import com.uas.platform.b2c.trade.aftersale.util.ExceptionUtil;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.EncodingRulesConstant;
 import com.uas.platform.core.persistence.StatusColumn;
-import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import javax.persistence.*;
@@ -476,12 +471,6 @@ public class Order extends Document implements Serializable {
 	private String serviceStatus = "1111";
 
 	/**********************异常处理 start**********************/
-	/**
-	 * 发起的售后申请状态
-	 */
-	@Enumerated(EnumType.STRING)
-	@Column(name = "launch_or_ex_apply_status")
-	private AfterSaleStatus launchOrExApplyStatus;
 
 	/**
 	 * 发起的申请单申请号
@@ -496,14 +485,6 @@ public class Order extends Document implements Serializable {
 	@Column(name = "or_json_pu_ex_info")
 	private String puExInfoJson;
 
-	/**
-	 * jsonPuExInfo的map形式,便于在程序中操作
-	 * key:采购异常申请单号
-	 * value:异常申请状态
-	 */
-	@Transient
-	private Map<String, AfterSaleStatus> puExInfoMap;
-
 	public Integer getSendstatus() {
 		return sendstatus;
 	}
@@ -2522,24 +2503,6 @@ public class Order extends Document implements Serializable {
 		return this;
 	}
 
-	/**
-	 * Gets launch or ex apply status.
-	 *
-	 * @return the launch or ex apply status
-	 */
-	public AfterSaleStatus getLaunchOrExApplyStatus() {
-		return launchOrExApplyStatus;
-	}
-
-	/**
-	 * Sets launch or ex apply status.
-	 *
-	 * @param launchOrExApplyStatus the launch or ex apply status
-	 */
-	public void setLaunchOrExApplyStatus(AfterSaleStatus launchOrExApplyStatus) {
-		this.launchOrExApplyStatus = launchOrExApplyStatus;
-	}
-
 	/**
 	 * Gets orderids.
 	 *
@@ -2640,7 +2603,6 @@ public class Order extends Document implements Serializable {
 				", uasPurcid=" + uasPurcid +
 				", orderDetails=" + orderDetails +
 				", serviceStatus='" + serviceStatus + '\'' +
-				", launchOrExApplyStatus=" + launchOrExApplyStatus +
 				", launchOrExApplyId='" + launchOrExApplyId + '\'' +
 				", jsonPuExInfo='" +  puExInfoJson + '\'' +
 				", exception='" + exception + '\'' +
@@ -2702,31 +2664,6 @@ public class Order extends Document implements Serializable {
 		this.used = used;
 	}
 
-	/**
-	 * 获取puExInfoJson的map形式
-	 *
-	 * @return pu ex info map
-	 */
-	@JSONField(serialize = false)
-	@JsonIgnore
-	public Map<String, AfterSaleStatus> getPuExInfoMap() {
-		if(CollectionUtils.isEmpty(puExInfoMap) && StringUtils.hasText( puExInfoJson)) {
-			puExInfoMap = ExceptionUtil.puExInfoJsonToMap(puExInfoJson);
-		}
-		return puExInfoMap;
-	}
-
-	/**
-	 * 将puExInfo的信息同步到puExInfoJson
-	 *
-	 * @param puExInfoMap the pu ex info map
-	 */
-	public void setPuExInfoMapToJson(Map<String, AfterSaleStatus> puExInfoMap) {
-		this.puExInfoMap = puExInfoMap;
-		puExInfoJson = ExceptionUtil.puExInfoMapToJson(puExInfoMap);
-	}
-
-
 	/**
 	 * Gets buyer tel.
 	 *

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

@@ -3,7 +3,6 @@ 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;
 import com.uas.platform.core.persistence.StatusColumn;
@@ -193,7 +192,7 @@ public class Purchase extends Document implements Serializable {
 	private String statushistory;
 
 	/**
-	 * 转的发货单id
+	 * 转的发货单号
 	 */
 	@Column(name = "pu_inids", length = 1000)
 	private String inids = "";
@@ -351,12 +350,6 @@ public class Purchase extends Document implements Serializable {
     /*******************************************************************************
      * 异常相关字段
      *******************************************************************************/
-	/**
-	 * 发起的售后申请状态
-	 */
-	@Enumerated(EnumType.STRING)
-	@Column(name = "launch_pu_ex_apply_status")
-	private AfterSaleStatus launchPuExApplyStatus;
 
     /**
      * 发起的申请单申请号
@@ -370,12 +363,6 @@ public class Purchase extends Document implements Serializable {
     @Column(name = "ex_apply_id_from_buyer")
     private String exApplyIdFromBuyer;
 
-    /**
-     * 接收买家发起的售后申请状态
-     */
-    @Enumerated(EnumType.STRING)
-    @Column(name = "ex_apply_status_from_buyer")
-    private AfterSaleStatus exApplyStatusFromBuyer;
 
     /**
      * 接收商城发起的申请单的申请号
@@ -383,13 +370,6 @@ public class Purchase extends Document implements Serializable {
     @Column(name = "ex_apply_id_from_mall")
     private String exApplyIdFromMall;
 
-    /**
-     * 接收商城发起的申请单的申请状态
-     */
-    @Enumerated(EnumType.STRING)
-    @Column(name = "ex_apply_status_from_mall")
-    private AfterSaleStatus exApplyStatusFromMall;
-
     /**
 	 * 退货单状态
      */
@@ -1741,24 +1721,6 @@ public class Purchase extends Document implements Serializable {
 		this.sendstatus = sendstatus;
 	}
 
-	/**
-	 * Gets launch pu ex apply status.
-	 *
-	 * @return the launch pu ex apply status
-	 */
-	public AfterSaleStatus getLaunchPuExApplyStatus() {
-		return launchPuExApplyStatus;
-	}
-
-	/**
-	 * Sets launch pu ex apply status.
-	 *
-	 * @param launchPuExApplyStatus the launch pu ex apply status
-	 */
-	public void setLaunchPuExApplyStatus(AfterSaleStatus launchPuExApplyStatus) {
-		this.launchPuExApplyStatus = launchPuExApplyStatus;
-	}
-
 	/**
 	 * Gets self sell.
 	 *
@@ -2014,24 +1976,6 @@ public class Purchase extends Document implements Serializable {
         this.exchangeStatusFromBuyer = exchangeStatusFromBuyer;
     }
 
-	/**
-	 * Gets ex apply status from buyer.
-	 *
-	 * @return the ex apply status from buyer
-	 */
-	public AfterSaleStatus getExApplyStatusFromBuyer() {
-        return exApplyStatusFromBuyer;
-    }
-
-	/**
-	 * Sets ex apply status from buyer.
-	 *
-	 * @param exApplyStatusFromBuyer the ex apply status from buyer
-	 */
-	public void setExApplyStatusFromBuyer(AfterSaleStatus exApplyStatusFromBuyer) {
-        this.exApplyStatusFromBuyer = exApplyStatusFromBuyer;
-    }
-
 	/**
 	 * Gets ex apply id from buyer.
 	 *
@@ -2094,24 +2038,6 @@ public class Purchase extends Document implements Serializable {
         this.exApplyIdFromMall = exApplyIdFromMall;
     }
 
-	/**
-	 * Gets ex apply status from mall.
-	 *
-	 * @return the ex apply status from mall
-	 */
-	public AfterSaleStatus getExApplyStatusFromMall() {
-        return exApplyStatusFromMall;
-    }
-
-	/**
-	 * Sets ex apply status from mall.
-	 *
-	 * @param exApplyStatusFromMall the ex apply status from mall
-	 */
-	public void setExApplyStatusFromMall(AfterSaleStatus exApplyStatusFromMall) {
-        this.exApplyStatusFromMall = exApplyStatusFromMall;
-    }
-
 	/**
 	 * Gets exchange status.
 	 *

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

@@ -51,10 +51,8 @@ import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
 import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
-import com.uas.platform.b2c.prod.commodity.service.CommodityInOutboundService;
 import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.prod.commodity.service.InOutboundDetailService;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
 import com.uas.platform.b2c.prod.product.component.modal.Component;
@@ -62,7 +60,6 @@ import com.uas.platform.b2c.prod.product.component.service.ComponentService;
 import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 import com.uas.platform.b2c.prod.store.model.StoreIn;
 import com.uas.platform.b2c.prod.store.model.StoreStatus;
-import com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus;
 import com.uas.platform.b2c.trade.deprecated.model.OrderRelationInfo;
 import com.uas.platform.b2c.trade.deprecated.model.UserInfoForOrder;
 import com.uas.platform.b2c.trade.inquiry.dao.TradeChargeDao;
@@ -126,7 +123,6 @@ import java.util.*;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.*;
 import static com.uas.platform.b2c.trade.util.Preconditions.checkNotNull;
 
 /**
@@ -225,12 +221,6 @@ public class OrderServiceImpl implements OrderService {
     @Autowired
     private MessageNotifyPersonalManagementService messageNotifyPersonalManagementService;
 
-    @Autowired
-    private InOutboundDetailService inOutboundDetailService;
-
-    @Autowired
-    private CommodityInOutboundService commodityInOutboundService;
-
     private final BoundedExecutor executor;
 
     @Autowired
@@ -2067,20 +2057,6 @@ public class OrderServiceImpl implements OrderService {
             }
         }, pageInfo);
 
-        // 移除状态为供应商到商城的异常通知,该状态的通知不允许买家看到
-        for (Order order : pageOrders) {
-            Map<String, AfterSaleStatus> puExInfoMap = order.getPuExInfoMap();
-            if (!CollectionUtils.isEmpty(puExInfoMap)) {
-                Iterator<Map.Entry<String, AfterSaleStatus>> iterator = puExInfoMap.entrySet().iterator();
-                while (iterator.hasNext()) {
-                    if (iterator.next().getValue().equals(SUP_TO_MALL)) {
-                        iterator.remove();
-                    }
-                }
-            }
-            order.setPuExInfoMapToJson(puExInfoMap);
-        }
-
         //买家中心--订单中心 增加分期付款信息
         for (Order order : pageOrders) {
             Long installmentId = order.getInstallmentId();
@@ -2183,12 +2159,6 @@ public class OrderServiceImpl implements OrderService {
                 expressions[2] = PredicateUtils.like("puExInfoJson", "MALL_TO_SUP", true);
                 expressions[3] = PredicateUtils.like("puExInfoJson", "FINISHED", true);
                 break;
-            case "apply":
-                expressions = new SimpleExpression[3];
-                expressions[0] = PredicateUtils.eq("launchOrExApplyStatus", BUYER_TO_MALL, true);
-                expressions[1] = PredicateUtils.eq("launchOrExApplyStatus", MALL_TO_SUP, true);
-                expressions[2] = PredicateUtils.eq("launchOrExApplyStatus", SUP_TO_MALL, true);
-                break;
             case "return":
                 expressions = new SimpleExpression[1];
                 expressions[0] = PredicateUtils.isNotNull("returnId");

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

@@ -39,7 +39,6 @@ import com.uas.platform.b2c.prod.store.dao.StoreApplyDao;
 import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 import com.uas.platform.b2c.prod.store.model.StoreApply;
 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.*;
 import com.uas.platform.b2c.trade.order.model.*;
 import com.uas.platform.b2c.trade.order.service.OrderService;
@@ -1108,7 +1107,7 @@ public class PurchaseServiceImpl implements PurchaseService {
 	@Override
 	public ModelMap getCountByAllStatus(Long uu, String storeid) {
 		if (!StringUtils.hasText(storeid) || uu == null) {
-			return null;
+			return new ModelMap();
 		}
 		ModelMap map = new ModelMap();
 		int totalCount = purchaseDao.getCountBySellerenuuAndStoreid(uu, storeid);
@@ -1129,7 +1128,7 @@ public class PurchaseServiceImpl implements PurchaseService {
 				totalCount += count;
 
                 launchPuExCount += purchaseDao.getLunchExceptionCountByApplyStatus(uu, Integer.parseInt(statusStr));
-                receivedPuExCount += purchaseDao.getRecExceptionCountByApplyStatus(uu, Integer.parseInt(statusStr), AfterSaleStatus.BUYER_TO_MALL);
+                receivedPuExCount += 0;
                 returnPuCount += purchaseDao.getReturnCountByApplyStatus(uu, Integer.parseInt(statusStr));
                 exchangePuCount += purchaseDao.getExchangeCountByApplyStatus(uu, Integer.parseInt(statusStr));
 			}
@@ -1254,17 +1253,17 @@ public class PurchaseServiceImpl implements PurchaseService {
 		/*SimpleExpression criteria = PredicateUtils.isNotNull(exceptionType);
 		pageInfo.expression(criteria);*/
 
-		String[] exceptionTypes = exceptionType.split("-");
-		SimpleExpression[] expressions = new SimpleExpression[exceptionTypes.length];
-		for (int i = 0; i < exceptionTypes.length; i++) {
-			if (exceptionTypes[i].equals("exApplyStatusFromBuyer")) {
-				expressions[i] = PredicateUtils.ne(exceptionTypes[i], AfterSaleStatus.BUYER_TO_MALL, true);
-			} else {
-				expressions[i] = PredicateUtils.isNotNull(exceptionTypes[i]);
-			}
-		}
-		LogicalExpression logicalExpression = new LogicalExpression(expressions, CriterionExpression.Operator.OR);
-		pageInfo.expression(logicalExpression);
+//		String[] exceptionTypes = exceptionType.split("-");
+//		SimpleExpression[] expressions = new SimpleExpression[exceptionTypes.length];
+//		for (int i = 0; i < exceptionTypes.length; i++) {
+//			if (exceptionTypes[i].equals("exApplyStatusFromBuyer")) {
+//				expressions[i] = PredicateUtils.ne(exceptionTypes[i], AfterSaleStatus.BUYER_TO_MALL, true);
+//			} else {
+//				expressions[i] = PredicateUtils.isNotNull(exceptionTypes[i]);
+//			}
+//		}
+//		LogicalExpression logicalExpression = new LogicalExpression(expressions, CriterionExpression.Operator.OR);
+//		pageInfo.expression(logicalExpression);
 
 	}
 

+ 2 - 42
src/main/java/com/uas/platform/b2c/trade/util/StatusChangeUtil.java

@@ -1,13 +1,11 @@
 package com.uas.platform.b2c.trade.util;
 
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.utils.StringUtilB2C;
 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.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCust;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFCustDetail;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.exception.IllegalStatusException;
 import com.uas.platform.core.model.Status;
@@ -101,44 +99,6 @@ public class StatusChangeUtil {
 		return voucher;
 	}
 
-	/**
-	 * 更新客户退货单的状态为新的状态
-	 *
-	 * @param voucher			客户退货单实例
-	 * @param currentStatus		当前状态信息
-	 * @param newStatus			新的状态信息
-	 * @return	修改后的客户退货单信息
-	 */
-	public static ReturnFCust updateReturnFCustStatus(ReturnFCust voucher, Status currentStatus, Status newStatus) {
-		if (voucher == null) {
-			throw new IllegalStatusException("客户退货单不存在");
-		} else if (currentStatus == null || newStatus == null) {
-			throw new IllegalOperatorException("当前状态或新状态不能为NULL");
-		}
-		if (currentStatus.value() != voucher.getStatus()) {
-			throw new IllegalOperatorException("客户退货单不为" + currentStatus.getPhrase() + "状态,不能为更新此客户退货单状态为"
-					+ newStatus.getPhrase());
-		}
-		// 更新订单状态及历史信息
-		Long userUU = SystemSession.getUser().getUserUU();
-		voucher.setStatus(newStatus.value());
-		String statusHistory = addStatusHistory(voucher.getStatushistory(), userUU, newStatus.value());
-		voucher.setStatushistory(statusHistory);
-		// 更新明细的状态
-		Set<ReturnFCustDetail> details = voucher.getReturnDetails();
-		if (CollectionUtils.isEmpty(details)) {
-			throw new IllegalStatusException("当前采购单的明细信息不存在");
-		}
-		for (ReturnFCustDetail detail : details) {
-			if (currentStatus.value() != detail.getStatus()) {
-				continue;
-			}
-			detail.setStatus(newStatus.value());
-		}
-		voucher.setReturnDetails(details);
-		return voucher;
-	}
-
 	/**
 	 * 根据状态历史字符串生成新的状态历史记录字符串
 	 *