Skip to content

Commit

Permalink
修改bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiran2018 committed Mar 12, 2020
1 parent dc86269 commit 9260890
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 62 deletions.
24 changes: 12 additions & 12 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified WebRoot/WEB-INF/classes/ru/own/www/entity/Order.class
Binary file not shown.
Binary file modified WebRoot/WEB-INF/classes/ru/own/www/logic/OrderOperate.class
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</update>

<insert id="insertOrder" useGeneratedKeys="true" keyProperty="id" parameterType="ru.own.www.entity.Order" flushCache="true">
insert into own.order(ordernumber,userid,ordercreatetime,orderstate,countprice,realpay,reducefee,mailfee,currencyId,currencyrate,usejifen,givejifen,userip,useraddressid) values (#{ordernumber},#{userid},now(),#{orderstate},#{countprice},#{realpay},#{reducefee},#{mailfee},#{currencyId},#{currencyrate},#{usejifen},#{givejifen},#{userip},#{useraddressid})
insert into own.order(ordernumber,userid,ordercreatetime,orderstate,countprice,realpay,reducefee,mailfee,currencyId,productCurrencyRate,usejifen,givejifen,userip,useraddressid) values (#{ordernumber},#{userid},now(),#{orderstate},#{countprice},#{realpay},#{reducefee},#{mailfee},#{currencyId},#{productCurrencyRate},#{usejifen},#{givejifen},#{userip},#{useraddressid})

<!-- order是数据库的关键字,所以必须加上own,数据库的名字 -->
</insert>
Expand Down Expand Up @@ -142,6 +142,7 @@
<result property="mailfee" column="mailfee"/>
<result property="currencyId" column="currencyId"/>
<result property="currencyrate" column="currencyrate"/>
<result property="productCurrencyRate" column="productCurrencyRate"/>
<result property="usejifen" column="usejifen"/>
<result property="givejifen" column="givejifen"/>
<result property="userip" column="userip"/>
Expand Down
2 changes: 1 addition & 1 deletion WebRoot/WEB-INF/classes/struts_client_manger.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@


<!-- 确认订单页面中,生成订单-->
<action name="place-order" class="ru.own.www.logic.OrderOperate" method="placeOrder">
<action name="placeOrder" class="ru.own.www.logic.OrderOperate" method="placeOrder">
<result name="success" type="json">
<param name = "includeProperties">orderId</param >
</result>
Expand Down
2 changes: 1 addition & 1 deletion WebRoot/common/js/product.ship.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function calculateShipFeeInpage(selectShipFee,products,selectNumber)
{
realFee=calculateShippingFeeByExchangeRate(realFee);
}
return realFee;
return parseFloat(realFee).toFixed(2);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion WebRoot/jqladmin/admin-index/js/confirmorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function placeOrder()
*/
function generateOrder(params)
{
var actionUrl = "shopcart/place-order.action";
var actionUrl = "shopcart/placeOrder.action";
$.ajax( {
url : actionUrl,
type : "post",
Expand Down
39 changes: 28 additions & 11 deletions WebRoot/jqladmin/order/js/order-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,22 @@ function totalAmountInPage(orderShowvo)
var orderCurrencyShowSybol = currencyele.currencyname + " "+currencyele.currencysymbol;
// var orderCurrencyRate = orderShowvo.order.currencyrate;
var orderCurrencyRate = 1;

var productAmountToShow=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(productAmount,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
productAmount = (parseFloat(orderShowvo.order.countprice)-parseFloat(orderShowvo.order.mailfee)).toFixed(2)
// var productAmountToShow=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(productAmount,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
var productAmountToShow=orderCurrencyShowSybol+" "+productAmount
$(".ProductAmount").html(productAmountToShow);
var shippingCostToShow=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(shippingCost,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
// var shippingCostToShow=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(shippingCost,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
shippingCost = parseFloat(orderShowvo.order.mailfee).toFixed(2)
var shippingCostToShow=orderCurrencyShowSybol+" "+shippingCost
$(".ShippingCost").html(shippingCostToShow);
var allTempTotal=productAmount+shippingCost; //商品费用+运费
var allTotalToShow=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(allTempTotal,orderCurrencyRate);
var allTotal=parseFloat(productAmount)+parseFloat(shippingCost); //商品费用+运费
// var allTotalToShow=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(allTotal,orderCurrencyRate);
var allTotalToShow=orderCurrencyShowSybol+" "+parseFloat(allTotal).toFixed(2)
$(".TotalAmount").html(allTotalToShow);
}



/**
* 该函数的作用是构建具体需要显示的信息
* @param entireTransInfoArgs
Expand All @@ -194,7 +200,8 @@ function generateXiangXiInfo(order,odsvoList,uinfo,currencyArgs)
var len=odsvoList.length;
var orderCurrencyShowSybol = currencyArgs.currencyname + " "+currencyArgs.currencysymbol;
// var orderCurrencyRate = order.currencyrate;
var orderCurrencyRate = 1;
// var orderCurrencyRate = 1;
var orderCurrencyRate = order.productCurrencyRate;
for(var i=0;i<len;i++)
{
odsvo=odsvoList[i];//商品详情
Expand Down Expand Up @@ -234,16 +241,23 @@ function generateXiangXiInfo(order,odsvoList,uinfo,currencyArgs)
html+="</td>";
//price

var tempprice=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(od.price,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
// var tempprice=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(od.price,orderCurrencyRate);//calculateFeeByExchangeRate in math.js

var productPrice = parseFloat(calculateFeeByExchangeRate(od.price,orderCurrencyRate)).toFixed(2)
var tempprice=orderCurrencyShowSybol+" "+productPrice;//calculateFeeByExchangeRate in math.js

html+="<td class='price'>"+tempprice+"</td>";
//数量
html+="<td class='quantity'>"+od.ordercount+"</td>";

//支付总金额
//price
var tempAmount=od.price*od.ordercount;
// var tempAmount=od.price*od.ordercount;
var tempAmount=productPrice*od.ordercount;
productAmount=productAmount+tempAmount//商品总价格
var tempAmountPrice=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(tempAmount,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
var tempAmountEx= parseFloat(calculateFeeByExchangeRate(tempAmount,orderCurrencyRate)).toFixed(2)
var tempAmountPrice=orderCurrencyShowSybol+" "+tempAmountEx;//calculateFeeByExchangeRate in math.js
// var tempAmountPrice=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(tempAmount,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
html+="<td class='amount'>";
html+="<span>"+tempAmountPrice+"</span>";
html+="</td>";
Expand Down Expand Up @@ -275,7 +289,9 @@ function generateXiangXiInfo(order,odsvoList,uinfo,currencyArgs)
if(shipfee!=""&&shipfee!=null)
{
shippingCost=shippingCost+shipfee;//货运总价格
tempShipFeePrice=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(shipfee,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
// tempShipFeePrice=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(shipfee,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
var tempShipEx=parseFloat(calculateFeeByExchangeRate(shipfee,orderCurrencyRate)).toFixed(2);
tempShipFeePrice=orderCurrencyShowSybol+" "+tempShipEx
}
html+="<p class='ship-price'>";
html+="<span class='ship-free'>"+tempShipFeePrice+"</span>";
Expand Down Expand Up @@ -355,7 +371,8 @@ function getProductProperties(attrList)
*/
function paymentDetail(olistInfo)
{
allTotal=productAmount+shippingCost; //商品费用+运费
// allTotal=productAmount+shippingCost; //商品费用+运费
var allTotal=parseFloat(productAmount)+parseFloat(shippingCost); //商品费用+运费

//汇率等信息
currencyele = olistInfo.currency;
Expand Down
6 changes: 4 additions & 2 deletions WebRoot/jqladmin/order/js/order-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,10 @@ function generateXiangXiInfo(order,odsvoList,uinfo,currencyArgs)
//price
var orderCurrencyShowSybol = currencyArgs.currencyname + " "+currencyArgs.currencysymbol;
// var orderCurrencyRate = order.currencyrate;
var orderCurrencyRate = 1;
var tempprice=orderCurrencyShowSybol+" "+calculateFeeByExchangeRate(od.price,orderCurrencyRate);//calculateFeeByExchangeRate in math.js
// var orderCurrencyRate = 1;
var orderCurrencyRate = order.productCurrencyRate;
var productPrice = parseFloat(calculateFeeByExchangeRate(od.price,orderCurrencyRate)).toFixed(2)
var tempprice=orderCurrencyShowSybol+" "+productPrice;//calculateFeeByExchangeRate in math.js
html+="<td class='price'>"+tempprice+"</td>";
//数量
html+="<td class='quantity'>"+od.ordercount+"</td>";
Expand Down
2 changes: 1 addition & 1 deletion WebRoot/order/confirmorder.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

<!-- all select product items -->

<form name="orderForm" id="place-order-form" method="post" action='/shopcart/place-order.action?availableProductShopcartIds=<s:property value="availableProductShopcartIds" escape="false" />'>
<form name="orderForm" id="place-order-form" method="post" action='/shopcart/placeOrder.action?availableProductShopcartIds=<s:property value="availableProductShopcartIds" escape="false" />'>

<!-- 邮寄地址相关 -->
<input id="place-order-change-address" type="hidden" name="changeAddressPage" value="false">
Expand Down
14 changes: 8 additions & 6 deletions WebRoot/order/js/confirmorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function placeOrder()
}

var params={
"mailAddressId":defaultMailAddressId,//邮寄地址
"mailAddressId":parseInt(defaultMailAddressId),//邮寄地址
"subtotalPrice":subtotalPriceInExchange,
"shippingPrice":shippingPrice,
"availableProductShopcartIds":availableProductShopcartIds,
Expand All @@ -156,7 +156,7 @@ function placeOrder()
*/
function generateOrder(params)
{
var actionUrl = "shopcart/place-order.action";
var actionUrl = "shopcart/placeOrder.action";
$.ajax( {
url : actionUrl,
type : "post",
Expand Down Expand Up @@ -705,16 +705,17 @@ function insertCouponInfo()
function insertPriceInfo()
{
// var tempprice=currencyShowSymbol+" "+calculateFeeByExchangeRate(subtotalPrice,currencyRate);//calculateFeeByExchangeRate in math.js
var tempprice=currencyShowSymbol+" "+subtotalPriceInExchange
var tempprice=currencyShowSymbol+" "+subtotalPriceInExchange.toFixed(2)
$(".subtotal-price").html(tempprice);

// var tempShippPrice = calculateFeeByExchangeRate(shippingPrice,currencyRate)

tempprice=currencyShowSymbol+" "+shippingPrice;
tempprice=currencyShowSymbol+" "+shippingPrice.toFixed(2);
$(".shipping-price").html(tempprice);

var totalprice=calculateFeeByExchangeRate(subtotalPriceInExchange+shippingPrice,1);
// tempprice=currencyShowSymbol+" "+calculateFeeByExchangeRate(totalprice,currencyRate);
totalprice= parseFloat(totalprice).toFixed(2)
$("#totalprice").html(totalprice);
$("#all-totalfee-show").html(totalprice);
}
Expand Down Expand Up @@ -956,7 +957,7 @@ function insertShopCartItemsInPage(shopCartList)
var tempItemPriceNo=quantity*(parseFloat(originPrice)); //没有汇率转变之前的费用
// subtotalPrice+=tempItemPriceNo;

subtotalPriceInExchange=quantity*nowPrice //用汇率改了之后总的费用,商品数量*商品单价(这个单价用汇率改了)
subtotalPriceInExchange+=quantity*parseFloat(nowPrice) //用汇率改了之后总的费用,商品数量*商品单价(这个单价用汇率改了)


//购物车id
Expand Down Expand Up @@ -1012,12 +1013,13 @@ function insertShopCartItemsInPage(shopCartList)

// shippingPrice+=parseFloat(tempRealFee); //没有汇率转变之前的费用
tempRealFee=calculateShippingFeeByExchangeRate(tempRealFee);
tempRealFee = parseFloat(tempRealFee)
shippingPrice+=tempRealFee;

//计算总邮费

//具体的费用
insertHtml+="<p><span class='order-target notranslate'>"+currencyShowSymbol+" "+tempRealFee+"</span></P>";//currencyShowSymbol in product.price.js
insertHtml+="<p><span class='order-target notranslate'>"+currencyShowSymbol+" "+tempRealFee.toFixed(2)+"</span></P>";//currencyShowSymbol in product.price.js
}


Expand Down
Loading

0 comments on commit 9260890

Please sign in to comment.