From 756e16e090b15c7fd8648f55f5451367face6abc Mon Sep 17 00:00:00 2001
From: jyy <jyy>
Date: Sat, 19 Jun 2021 14:44:58 +0800
Subject: [PATCH] 修复业绩bug
---
zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java | 2 +-
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml | 2 +-
zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html | 2 +-
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html | 2 +-
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html | 23 ++++++++++++-----------
zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java | 4 ++--
6 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java
index 5e47996..6e0b818 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java
@@ -115,7 +115,7 @@
total = total.add(new BigDecimal(item.getPrice() * item.getCount()));
}
SysOrder sysOrderResult = new SysOrder();
- sysOrderResult.setZkTotal(zkTotal.doubleValue());
+ sysOrderResult.setZkTotal(zkTotal.setScale(2,BigDecimal.ROUND_DOWN).doubleValue());
sysOrderResult.setTotal(total.doubleValue());
return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrderResult));
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java b/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java
index 3b5af52..7c9f166 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java
@@ -62,7 +62,7 @@
v2=v2==null ? 0:v2;
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
- return b1.multiply(b2).doubleValue();
+ return b1.multiply(b2).setScale(2,BigDecimal.ROUND_DOWN).doubleValue();
}
@@ -104,7 +104,7 @@
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
- return b1.divide(b2, scale, BigDecimal.ROUND_HALF_DOWN).doubleValue();
+ return b1.divide(b2, scale, BigDecimal.ROUND_DOWN).doubleValue();
}
/**
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
index b66d44a..8d89990 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
@@ -1047,7 +1047,7 @@
b.code goodsNo,
b.name goodsName,
c.su_name meiliao,
- d.count*d.zk_price zk_total
+ TRUNCATE(d.count*d.zk_price,2) zk_total
from achieve_new a
left join shopping_goods b on a.shopping_goods_id=b.id
left join sys_users c on a.beault_id=c.su_id
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html
index 0f3eb7d..f066a6d 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html
@@ -765,7 +765,7 @@
_this.dialogSettleVisible = true;
},
calOrderTotalFormatter(row, column) {
- return row.count * row.zkPrice;
+ return (row.count * row.zkPrice).toFixed(2);
},
getVipMoneyCards() {
let _this = this;
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html
index f195403..6334706 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html
@@ -767,7 +767,7 @@
commission : 0,
achieveType : _this.achieveTypeList[0].value,
isShare: false,
- payMethod:item.payMethod,
+ payMethod:"现金",
});
});
_this.order.payMoney = orderPayMoney;
@@ -1044,28 +1044,29 @@
return false;
}
}
+ console.log("isCardPay",isCardPay);
//匹配业绩
+ _this.order.items.forEach(item=>{
+ item.achieveList = [];
+ })
_this.achieveList.forEach(achieve => {
for (let i = 0; i < _this.order.items.length; i++) {
let item = _this.order.items[i];
- if (!item.achieveList){
- item.achieveList = [];
- }
if (item.uuid == achieve.orderItem.uuid) {
+ let payMethod=achieve.payMethod;
if(isCardPay){
//如果是储值卡支付,则业绩自动切换到划扣金额
- achieve.payMethod="划扣";
- }
-
+ payMethod="划扣";
+ }
let achieveNew = {
uuid:item.uuid,
beaultId: achieve.saleId,
projPercentage: achieve.commission,
achieveType: achieve.achieveType,
goodsCash: achieve.goodsCash,
- payMethod: achieve.payMethod,
+ payMethod: payMethod,
};
item.achieveList.push(achieveNew);
break;
@@ -1171,9 +1172,9 @@
*/
chouseGoods() {
let _this = this;
- // this.multipleSelection.forEach(item => {
- // _this.pushToSelectGoods(item, BUY_TYPE_NOT_FREE);
- // });
+ _this.multipleSelection.forEach(item => {
+ _this.pushToSelectGoods(item, BUY_TYPE_NOT_FREE);
+ });
this.closeXm();
this.calculationTotal();
},
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html
index 58db52c..e5069f4 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html
@@ -785,7 +785,7 @@
_this.dialogSettleVisible = true;
},
calOrderTotalFormatter(row, column) {
- return row.count * row.zkPrice;
+ return (row.count * row.zkPrice).toFixed(2);
},
getVipMoneyCards() {
let _this = this;
--
Gitblit v1.9.1