From a578777e1191abb5507848047f0ee03a67790ecc Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Fri, 05 Feb 2021 14:09:44 +0800
Subject: [PATCH] 取消订单,删除交易流水
---
zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java | 30 ++++++++++++------------------
1 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java
index 520998d..2bd0261 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java
@@ -154,7 +154,7 @@
@Override
- public void addAchieveByServiceOrder(SysProjServices projServices) {
+ public void addAchieveByServiceOrder(SysProjServices projServices) {
List<AchieveNew> achieveNewList = new ArrayList<>();
List<SysBeauticianState> beauticianStateList = sysBeauticianStateDao.selectBySerIds(projServices.getId());
int size = beauticianStateList.size();
@@ -177,15 +177,12 @@
achieveNew.setHisConsume(projUse.getPrice());
}
achieveNew.setT2(projUse.getSource());
- if (projServices.getCreateTime() != null) {
- achieveNew.setDatatime(projServices.getCreateTime());
- } else {
- achieveNew.setDatatime(new Date());
- }
+ achieveNew.setDatatime(new Date());
achieveNew.setOrderType(Dictionary.ORDER_TYPE_SERVICE);
achieveNew.setServiceOrderId(projServices.getId());
achieveNew.setOrderItemId(beauticianState.getId());
achieveNew.setShopId(projServices.getShopId());
+ achieveNew.setCompanyId(projServices.getCompanyId());
achieveNew.setShoppingGoodsId(projUse.getProjId());
achieveNew.setNumberOfPeople(1D / size);
achieveNew.setProjNum(1);
@@ -225,14 +222,6 @@
achieveNewList.add(achieveNew);
}
}
- } else {
- // 如果该订单明细没有设置美疗师则单独设置顾问业绩
- AchieveNew achieveNew = new AchieveNew();
- // 顾问业绩等于收款金额
- achieveNew.setT1(orderItem.getPayMoney() + "");
- buildAchieve(pageOrder, orderItem, achieveNew);
- // 新增顾问业绩
- achieveNewList.add(achieveNew);
}
}
}
@@ -245,13 +234,17 @@
ShoppingGoodsDao shoppingGoodsDao;
private void buildAchieve(SysOrder pageOrder, SysOrderItem orderItem, AchieveNew achieveNew) {
+ if (Dictionary.ORDER_STATU_TK.equals(pageOrder.getStatu())) {
+ achieveNew.setId(null);
+ achieveNew.setProjPercentage(0 - achieveNew.getProjPercentage());
+ achieveNew.setT1((0 - Double.parseDouble(achieveNew.getT1())) + "");
+ }
+
achieveNew.setVipId(pageOrder.getVipId());
achieveNew.setSaleId(pageOrder.getStaffId());
- if (pageOrder.getOrderTime() != null) {
- achieveNew.setDatatime(pageOrder.getOrderTime());
- } else if (pageOrder.getOrderTime() != null) {
- achieveNew.setDatatime(pageOrder.getOrderTime());
+ if (pageOrder.getPayTime() != null) {
+ achieveNew.setDatatime(pageOrder.getPayTime());
} else {
achieveNew.setDatatime(new Date());
}
@@ -259,6 +252,7 @@
achieveNew.setOrderId(pageOrder.getId());
achieveNew.setOrderItemId(orderItem.getId());
achieveNew.setShopId(pageOrder.getShopId());
+ achieveNew.setCompanyId(pageOrder.getCompanyId());
achieveNew.setShoppingGoodsId(orderItem.getGoodsId());
// 是否赠送
achieveNew.setT2(orderItem.getIsFree());
--
Gitblit v1.9.1