|
@@ -11,7 +11,9 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import com.iamberry.wechat.core.entity.coupon.*;
|
|
|
+import com.iamberry.wechat.core.entity.product.ProductColor;
|
|
|
import com.iamberry.wechat.face.coupon.ExchangeService;
|
|
|
+import com.iamberry.wechat.face.porduct.ProductColorService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -95,6 +97,8 @@ public class OrderHandler {
|
|
|
private ProductInfoService productInfoService;
|
|
|
@Autowired
|
|
|
private TemporaryQrcodeService temporaryQrcodeService;
|
|
|
+ @Autowired
|
|
|
+ private ProductColorService productColorService;
|
|
|
/**
|
|
|
* 支付前,调用方法
|
|
|
* @param request
|
|
@@ -337,7 +341,24 @@ public class OrderHandler {
|
|
|
msg.setMessage(ResultInfo.cartEmptyError);
|
|
|
return msg;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ if(Integer.valueOf(temp.getExchangeColorId()) != null && Integer.valueOf(temp.getExchangeColorId())!=0){
|
|
|
+ ProductColor productColor = productColorService.selectProductColorById(temp.getExchangeColorId());
|
|
|
+ CartDto cartDto = new CartDto();
|
|
|
+ cartDto.setCartProductId(productColor.getColorProductId());
|
|
|
+ cartDto.setCartColorId(productColor.getColorId());
|
|
|
+ cartDto.setCartNum(1);
|
|
|
+ cartDto.setProductName(productColor.getColorProductName());
|
|
|
+ cartDto.setProductType(productColor.getColorProductType()); //colorProductType
|
|
|
+ cartDto.setProductPrice(productColor.getColorDiscount());
|
|
|
+ cartDto.setProductDiscount(productColor.getColorPrice());
|
|
|
+ cartDto.setProductStatus(1);
|
|
|
+ cartDto.setTotal(productColor.getColorDiscount());
|
|
|
+ cartDto.setProductColor(productColor.getColorName());
|
|
|
+ cartDto.setColorImg(productColor.getColorProductPic());
|
|
|
+ cartDtos.add(cartDto);
|
|
|
+ }
|
|
|
+
|
|
|
//根据openid查询该用户是否购买过订单
|
|
|
ShopSalesOrderDto shopSalesOrderDto = new ShopSalesOrderDto();
|
|
|
shopSalesOrderDto.setSalesOpenid(member.getUserOpenid());
|