From bbe0a2fd03063316e50cf141986bda984599bbda Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Tue, 22 Feb 2022 23:41:42 +0800
Subject: [PATCH] Merge branch 'developer'

---
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java
index 7b87e5f..d4f04d6 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java
@@ -1,10 +1,13 @@
 package com.matrix.system.shopXcx.api.action;
 
 import com.matrix.core.pojo.AjaxResult;
-import com.matrix.system.hive.bean.SysVipInfo;
-import com.matrix.component.redis.RedisUserLoginUtils;
+import com.matrix.system.common.bean.BusParameterSettings;
 import com.matrix.system.common.constance.AppConstance;
-
+import com.matrix.system.common.dao.BusParameterSettingsDao;
+import com.matrix.system.common.init.UserCacheManager;
+import com.matrix.system.hive.bean.SysVipInfo;
+import com.matrix.system.score.constant.ScoreSettingConstant;
+import com.matrix.system.score.entity.ScoreVipDetail;
 import com.matrix.system.score.service.ScoreVipDetailService;
 import com.matrix.system.shopXcx.bean.ShopOrder;
 import com.matrix.system.shopXcx.bean.ShopProductComment;
@@ -31,10 +34,15 @@
     @Autowired
     private ShopProductCommentDao productCommentDao;
     @Autowired
-    private RedisUserLoginUtils redisUserLoginUtils;
+    private UserCacheManager userCacheManager;
     @Autowired
     private ShopOrderDao shopOrderDao;
 
+    @Autowired
+    ScoreVipDetailService scoreVipDetailService;
+
+    @Autowired
+    private BusParameterSettingsDao busParameterSettingsDao;
     /**
      * 根据ID逻辑删除产品评价
      * @param
@@ -53,16 +61,13 @@
         return new AjaxResult(AjaxResult.STATUS_SUCCESS, "删除成功");
     }
 
-    @Autowired
-    ScoreVipDetailService scoreVipDetailService;
-
     /**
      * 接收保存产品评价数据
      */
     @PostMapping(value = "/saveProductComment")
     public @ResponseBody
     AjaxResult saveProductComment(@RequestBody List<ShopProductComment> commentList) {
-        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
+        SysVipInfo loginUser = userCacheManager.getLoginUser();
         int flag = 0;
         if(CollectionUtils.isNotEmpty(commentList)){
             for(ShopProductComment productComment : commentList){
@@ -86,7 +91,10 @@
         modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_ALREADY_REMARK);
         shopOrderDao.updateByMap(modifyMap);
 
-        //scoreVipDetailService.addScoreByParamSetting(loginUser.getId(),null,);
+        //添加用户积分
+        BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP_NAME, loginUser.getCompanyId());
+        scoreVipDetailService.addScoreByParamSetting(loginUser.getId(), null,null, commentList.get(0).getComId(),
+                ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"评价送积分", parameterSetting);
 
 
         return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功");
@@ -100,7 +108,7 @@
     @PostMapping("/findProductComment")
     @ResponseBody
     public AjaxResult getProductCommentByUserId(@RequestBody ShopProductComment productComment) {
-        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
+        SysVipInfo loginUser = userCacheManager.getLoginUser();
         String userId = loginUser.getOpenId();
         productComment.setUserId(userId);
         List<ShopProductComment> list = productCommentDao.selectByUserId(productComment);

--
Gitblit v1.9.1