|
@@ -178,17 +178,17 @@ public class OrderHandler {
|
|
|
|
|
|
/*上朵分销,查看是否为分销*/
|
|
/*上朵分销,查看是否为分销*/
|
|
for (CartDto cd : cartDtos) {
|
|
for (CartDto cd : cartDtos) {
|
|
- Integer price = 0,discount=0;
|
|
|
|
|
|
+ cd.setIsSelfLifting(2); //不能自提
|
|
|
|
+
|
|
if(channelType > 0 && channelId > 0){
|
|
if(channelType > 0 && channelId > 0){
|
|
ChannelPrice channelPrice = channelPriceService.getChannelPriceByChannel(channelId,channelType,cd.getCartColorId());
|
|
ChannelPrice channelPrice = channelPriceService.getChannelPriceByChannel(channelId,channelType,cd.getCartColorId());
|
|
if(channelPrice != null){
|
|
if(channelPrice != null){
|
|
cd.setProductPrice( channelPrice.getChannelPriceOffer()); //因结算页面都是去price,所以都赋值优惠价
|
|
cd.setProductPrice( channelPrice.getChannelPriceOffer()); //因结算页面都是去price,所以都赋值优惠价
|
|
cd.setProductDiscount( channelPrice.getChannelPriceOffer());
|
|
cd.setProductDiscount( channelPrice.getChannelPriceOffer());
|
|
|
|
+ cd.setIsSelfLifting(1);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}else if("2".equals(isCustomize)){
|
|
}else if("2".equals(isCustomize)){
|
|
Integer id = Integer.valueOf(cartIds);
|
|
Integer id = Integer.valueOf(cartIds);
|
|
CustomizedTooth customizedTooth = customizedToothService.getCustomizedToothById(id);
|
|
CustomizedTooth customizedTooth = customizedToothService.getCustomizedToothById(id);
|
|
@@ -244,7 +244,6 @@ public class OrderHandler {
|
|
toothbrushTotal += cartDto.getCartNum() * cartDto.getProductPrice();
|
|
toothbrushTotal += cartDto.getCartNum() * cartDto.getProductPrice();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
String[] brushelEls = brushelEment.split("-");
|
|
String[] brushelEls = brushelEment.split("-");
|
|
for(String brushelEl : brushelEls){
|
|
for(String brushelEl : brushelEls){
|
|
if(cartDto.getProductType() == Integer.valueOf(brushelEl)){ //判断订单中是否有刷头,有刷头 brushFlag 为true;
|
|
if(cartDto.getProductType() == Integer.valueOf(brushelEl)){ //判断订单中是否有刷头,有刷头 brushFlag 为true;
|
|
@@ -351,8 +350,6 @@ public class OrderHandler {
|
|
@RequestMapping(value = "/pay", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/pay", method = RequestMethod.POST)
|
|
public ResultMsg requestPay(
|
|
public ResultMsg requestPay(
|
|
TempOrderDto temp,
|
|
TempOrderDto temp,
|
|
- @RequestParam(value = "channelType",defaultValue = "0") Integer channelType,
|
|
|
|
- @RequestParam(value = "channelId",defaultValue = "0") Integer channelId,
|
|
|
|
HttpServletRequest request
|
|
HttpServletRequest request
|
|
) throws Exception {
|
|
) throws Exception {
|
|
|
|
|
|
@@ -378,7 +375,6 @@ public class OrderHandler {
|
|
msg.setMessage(ResultInfo.paramFormatError);
|
|
msg.setMessage(ResultInfo.paramFormatError);
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
-
|
|
|
|
/*校验订单信息*/
|
|
/*校验订单信息*/
|
|
if(temp.getOrderAddressMoblie() == null || "".equals(temp.getOrderAddressMoblie())){
|
|
if(temp.getOrderAddressMoblie() == null || "".equals(temp.getOrderAddressMoblie())){
|
|
msg.setMessage("电话号码为空,请重新添加收货地址信息!");
|
|
msg.setMessage("电话号码为空,请重新添加收货地址信息!");
|
|
@@ -392,17 +388,10 @@ public class OrderHandler {
|
|
msg.setMessage("电话号码错误,请重新添加收货地址信息!");
|
|
msg.setMessage("电话号码错误,请重新添加收货地址信息!");
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
-
|
|
|
|
- if(temp.getOrderAddressInfo() == null || "".equals(temp.getOrderAddressInfo())){
|
|
|
|
- msg.setMessage("收货人地址为空,请重新添加收货地址信息!");
|
|
|
|
- return msg;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if(temp.getOrderAddressName() == null || "".equals(temp.getOrderAddressName())){
|
|
if(temp.getOrderAddressName() == null || "".equals(temp.getOrderAddressName())){
|
|
msg.setMessage("收货人姓名为空,请重新添加收货地址信息!");
|
|
msg.setMessage("收货人姓名为空,请重新添加收货地址信息!");
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
-
|
|
|
|
if(temp.getCartIdStr() == null || "".equals(temp.getCartIdStr())){
|
|
if(temp.getCartIdStr() == null || "".equals(temp.getCartIdStr())){
|
|
msg.setMessage("未选择商品,请重新选择商品并结算!");
|
|
msg.setMessage("未选择商品,请重新选择商品并结算!");
|
|
return msg;
|
|
return msg;
|
|
@@ -413,6 +402,13 @@ public class OrderHandler {
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //salesTransportationType
|
|
|
|
+ if(temp.getSalesTransportationType() == 1){
|
|
|
|
+ if(temp.getOrderAddressInfo() == null || "".equals(temp.getOrderAddressInfo())){
|
|
|
|
+ msg.setMessage("收货人地址为空,请重新添加收货地址信息!");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
if(temp.getIsCustomize() == null || "".equals(temp.getIsCustomize())){ //默认为1
|
|
if(temp.getIsCustomize() == null || "".equals(temp.getIsCustomize())){ //默认为1
|
|
temp.setIsCustomize("1");
|
|
temp.setIsCustomize("1");
|
|
@@ -487,8 +483,8 @@ public class OrderHandler {
|
|
total += subTotal;
|
|
total += subTotal;
|
|
|
|
|
|
/*上朵分销,*/
|
|
/*上朵分销,*/
|
|
- if(channelType > 0 && channelId > 0){
|
|
|
|
- ChannelPrice channelPrice = channelPriceService.getChannelPriceByChannel(channelId,channelType,cartDto.getCartColorId());
|
|
|
|
|
|
+ if(temp.getChannelType() > 0 && temp.getChannelId() > 0){
|
|
|
|
+ ChannelPrice channelPrice = channelPriceService.getChannelPriceByChannel(temp.getChannelId(),temp.getChannelType(),cartDto.getCartColorId());
|
|
if(channelPrice != null){
|
|
if(channelPrice != null){
|
|
subTotal = cartDto.getCartNum() * channelPrice.getChannelPriceOffer();
|
|
subTotal = cartDto.getCartNum() * channelPrice.getChannelPriceOffer();
|
|
}
|
|
}
|
|
@@ -535,7 +531,7 @@ public class OrderHandler {
|
|
order.setSalesOpenid(member.getUserOpenid()); // openid
|
|
order.setSalesOpenid(member.getUserOpenid()); // openid
|
|
order.setSalesAmount(total); // 订单金额
|
|
order.setSalesAmount(total); // 订单金额
|
|
|
|
|
|
- if(total > channelTotal && channelType > 0 && channelId > 0){ //如果有分销优惠,将直接使用分销优惠价
|
|
|
|
|
|
+ if(total > channelTotal && temp.getChannelType() > 0 && temp.getChannelId() > 0){ //如果有分销优惠,将直接使用分销优惠价
|
|
total = channelTotal;
|
|
total = channelTotal;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -641,6 +637,11 @@ public class OrderHandler {
|
|
order.setSalesAddressTel(temp.getOrderAddressMoblie()); // 收入联系方式
|
|
order.setSalesAddressTel(temp.getOrderAddressMoblie()); // 收入联系方式
|
|
order.setSalesAddressPostnum(temp.getOrderAddressPostNum()); // 物流编号
|
|
order.setSalesAddressPostnum(temp.getOrderAddressPostNum()); // 物流编号
|
|
order.setSalesUserRemark(temp.getOrderUserRemark()); // 用户备注
|
|
order.setSalesUserRemark(temp.getOrderUserRemark()); // 用户备注
|
|
|
|
+
|
|
|
|
+ order.setSalesChannelId(temp.getChannelId());
|
|
|
|
+ order.setSalesChannelType(temp.getChannelType());
|
|
|
|
+ order.setSalesTransportationType(temp.getSalesTransportationType()); //salesTransportationType 订单运输类型 1:邮寄 2:自提
|
|
|
|
+
|
|
// 保存
|
|
// 保存
|
|
boolean flag = false;
|
|
boolean flag = false;
|
|
try {
|
|
try {
|
|
@@ -656,8 +657,8 @@ public class OrderHandler {
|
|
List<OrderItem> orderItemList = adminOrderService.getShopOrderItemByOrderId(order.getSalesOrderid());
|
|
List<OrderItem> orderItemList = adminOrderService.getShopOrderItemByOrderId(order.getSalesOrderid());
|
|
try{
|
|
try{
|
|
for (OrderItem oi:orderItemList) {
|
|
for (OrderItem oi:orderItemList) {
|
|
- if(channelType > 0 && channelId > 0){
|
|
|
|
- ChannelPrice channelPrice = channelPriceService.getChannelPriceByChannel(channelId,channelType,oi.getItemColorId());
|
|
|
|
|
|
+ if(temp.getChannelType() > 0 && temp.getChannelId() > 0){
|
|
|
|
+ ChannelPrice channelPrice = channelPriceService.getChannelPriceByChannel(temp.getChannelId(),temp.getChannelType(),oi.getItemColorId());
|
|
if(channelPrice != null){
|
|
if(channelPrice != null){
|
|
Integer rebateAmount = channelPrice.getChannelRebateAmount(); //channelRebateAmount 返利金额
|
|
Integer rebateAmount = channelPrice.getChannelRebateAmount(); //channelRebateAmount 返利金额
|
|
rebateAmount = rebateAmount * oi.getItemNum();
|
|
rebateAmount = rebateAmount * oi.getItemNum();
|
|
@@ -666,8 +667,8 @@ public class OrderHandler {
|
|
channelRebate.setRebateSalesOrderId(order.getSalesOrderid());
|
|
channelRebate.setRebateSalesOrderId(order.getSalesOrderid());
|
|
channelRebate.setRebackFromOpenId(member.getUserOpenid());
|
|
channelRebate.setRebackFromOpenId(member.getUserOpenid());
|
|
channelRebate.setRebateItemId(oi.getItemId());
|
|
channelRebate.setRebateItemId(oi.getItemId());
|
|
- channelRebate.setRebackChannelType(channelType);
|
|
|
|
- channelRebate.setRebackChannelId(channelId);
|
|
|
|
|
|
+ channelRebate.setRebackChannelType(temp.getChannelType());
|
|
|
|
+ channelRebate.setRebackChannelId(temp.getChannelId());
|
|
channelRebate.setRebackAmount(rebateAmount);
|
|
channelRebate.setRebackAmount(rebateAmount);
|
|
channelRebate.setRebackStatus(1); //1:待返利
|
|
channelRebate.setRebackStatus(1); //1:待返利
|
|
Integer fl = channelRebateService.save(channelRebate);
|
|
Integer fl = channelRebateService.save(channelRebate);
|