From eb706a988e747b624fda0d44e0aaf6a4ee5e20eb Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Thu, 26 May 2022 11:27:03 +0800
Subject: [PATCH] fix saveOrder zkPrice is null

---
 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java |   44 ++++++++++++++++++++++++++++++++------------
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java
index 11a6648..52188d8 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java
@@ -21,6 +21,7 @@
 import com.matrix.system.common.service.BusParameterSettingService;
 import com.matrix.system.common.service.OperationLogService;
 import com.matrix.system.constance.Dictionary;
+import com.matrix.system.enums.BooleanEnum;
 import com.matrix.system.enums.OperationButtonEnum;
 import com.matrix.system.enums.OperationFunctionEnum;
 import com.matrix.system.hive.bean.*;
@@ -797,15 +798,15 @@
         BusParameterSettings principalConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, vipInfo.getCompanyId());
         //本金消耗
         if (principalPrice > 0
-                && StringUtils.isNotBlank(principalConsumption.getParamValue())) {
+                && StringUtils.isNotBlank(principalConsumption.getParamValue()) && Double.parseDouble(principalConsumption.getParamValue()) > 0 ) {
 
             principalConsumScore[0] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue()));
 
-            if (StringUtils.isNotBlank(principalConsumption.getParamValue1())) {
+            if (StringUtils.isNotBlank(principalConsumption.getParamValue1()) && Double.parseDouble(principalConsumption.getParamValue1()) > 0 ) {
                 principalConsumScore[1] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue1()));
             }
 
-            if (StringUtils.isNotBlank(principalConsumption.getParamValue2())) {
+            if (StringUtils.isNotBlank(principalConsumption.getParamValue2()) && Double.parseDouble(principalConsumption.getParamValue2()) > 0 ) {
                 principalConsumScore[2] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue2()));
             }
         }
@@ -814,15 +815,15 @@
         BusParameterSettings giveConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.GIVE_CONSUMPTION, vipInfo.getCompanyId());
         //本金消耗
         if (giftPrice > 0
-                && StringUtils.isNotBlank(giveConsumption.getParamValue())) {
+                && StringUtils.isNotBlank(giveConsumption.getParamValue()) &&  Double.parseDouble(giveConsumption.getParamValue())>0) {
 
             giveConsumScore[0] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue()));
 
-            if (StringUtils.isNotBlank(giveConsumption.getParamValue1())) {
+            if (StringUtils.isNotBlank(giveConsumption.getParamValue1()) && Double.parseDouble(giveConsumption.getParamValue1())>0) {
                 giveConsumScore[1] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue1()));
             }
 
-            if (StringUtils.isNotBlank(giveConsumption.getParamValue2())) {
+            if (StringUtils.isNotBlank(giveConsumption.getParamValue2()) && Double.parseDouble(giveConsumption.getParamValue2())>0 ) {
                 giveConsumScore[2] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue2()));
             }
         }
@@ -1029,7 +1030,8 @@
 
         if (CollectionUtils.isNotEmpty(projServicesVo.getOutStoreItem())) {
             BusParameterSettings manageStockSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WAREHOUSE_MANAGE_STOCK, projServicesVo.getCompanyId());
-            if (AppConstance.IS_Y.equals(manageStockSetting.getParamValue())) {
+//            if (AppConstance.IS_Y.equals(manageStockSetting.getParamValue())) {
+            if (BooleanEnum.TRUE.getValue() == manageStockSetting.getIntParamValue()) {
                 for (SysOutStoreItem item : projServicesVo.getOutStoreItem()) {
                     if (item.getAmount() != null && item.getAmount() > 0) {
                         return true;
@@ -1123,12 +1125,18 @@
             sysProjServicesDao.update(checkprojServices);
         }
         //保存单据日志
-        operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(),
+//        operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(),
+//                OperationFunctionEnum.SERVICE_ORDER,
+//                OperationButtonEnum.SERVICE_ORDER_END,
+//                projServices.getId(),
+//                projServices.getServiceNo(),
+//                projServices.getVipId());
+        operationLogService.saveOperation(checkprojServices.getCompanyId(), checkprojServices.getShopId(),users.getSuId(),
                 OperationFunctionEnum.SERVICE_ORDER,
                 OperationButtonEnum.SERVICE_ORDER_END,
-                projServices.getId(),
-                projServices.getServiceNo(),
-                projServices.getVipId());
+                checkprojServices.getId(),
+                checkprojServices.getServiceNo(),
+                checkprojServices.getVipId());
         return rerunlt;
     }
 
@@ -1168,7 +1176,11 @@
         boolean flag = false;
         if (CollUtil.isNotEmpty(settings)) {
             for (ParameterSettings setting : settings) {
-                if (step.equals(setting.getCode()) && Dictionary.FLAG_YES.equals(setting.getUserValue())) {
+//                if (step.equals(setting.getCode()) && Dictionary.FLAG_YES.equals(setting.getUserValue())) {
+//                    flag = true;
+//                    break;
+//                }
+                if (step.equals(setting.getCode()) && BooleanEnum.TRUE.getValue() == Integer.parseInt(setting.getUserValue())) {
                     flag = true;
                     break;
                 }
@@ -1210,5 +1222,13 @@
         return i;
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int signService(SysProjServices services) {
+        SysProjServices projServices =findById(services.getId());
+        projServices.setSignPic(services.getSignPic());
+        return sysProjServicesDao.update(projServices);
+    }
+
 
 }

--
Gitblit v1.9.1