xiaoyong931011
2021-04-12 a13a93a493e7e94e28b2225c26e7e13b52d3288c
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java
@@ -1,10 +1,14 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.biz.bean.BizUser;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
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.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;
import com.matrix.system.shopXcx.dao.ShopOrderDao;
@@ -34,6 +38,11 @@
    @Autowired
    private ShopOrderDao shopOrderDao;
    @Autowired
    ScoreVipDetailService scoreVipDetailService;
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
    /**
     * 根据ID逻辑删除产品评价
     * @param
@@ -58,7 +67,7 @@
    @PostMapping(value = "/saveProductComment")
    public @ResponseBody
    AjaxResult saveProductComment(@RequestBody List<ShopProductComment> commentList) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        int flag = 0;
        if(CollectionUtils.isNotEmpty(commentList)){
            for(ShopProductComment productComment : commentList){
@@ -81,6 +90,13 @@
        modifyMap.put("id", orderId);
        modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_ALREADY_REMARK);
        shopOrderDao.updateByMap(modifyMap);
        //添加用户积分
        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, "保存成功");
    }
@@ -92,7 +108,7 @@
    @PostMapping("/findProductComment")
    @ResponseBody
    public AjaxResult getProductCommentByUserId(@RequestBody ShopProductComment productComment) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String userId = loginUser.getOpenId();
        productComment.setUserId(userId);
        List<ShopProductComment> list = productCommentDao.selectByUserId(productComment);