| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import cn.hutool.db.DaoTemplate; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ruoyi.account.api.feignClient.AppUserIntegralChangeClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserIntegralChange; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.feignClient.PartnerClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.HttpUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | |
| | | //校验合作商权限 |
| | | List<Integer> siteIds = new ArrayList<>(); |
| | | SysUser sysUser = sysUserClient.getSysUser(SecurityUtils.getUserId()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | if(null == pageList.getSiteId() || 0 == pageList.getSiteId()){ |
| | | SysUser sysUser = sysUserClient.getSysUser(tokenService.getLoginUser().getUserid()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | //合作商 |
| | | if(roleType == 2){ |
| | | Set<Integer> data = partnerService.authSite(objectId, "/data/site").getData(); |
| | | Set<Integer> data = partnerService.authSite(objectId, SiteMenu.CHARGE_EVALUATION.getValue()).getData(); |
| | | siteIds = new ArrayList<>(data); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | |
| | | List<String> collect = data.stream().map(TEvaluationTag::getName).collect(Collectors.toList()); |
| | | dto.setTags(collect); |
| | | } |
| | | dto.setAuthReply(roleType == 1 ? true : partnerService.authMenu(objectId, dto.getSiteId(), SiteMenu.CHARGE_EVALUATION_ANSWER.getValue())); |
| | | dto.setAuthDelete(roleType == 1 ? true : partnerService.authMenu(objectId, dto.getSiteId(), SiteMenu.CHARGE_EVALUATION_DEL.getValue())); |
| | | } |
| | | return pageInfo.setRecords(list); |
| | | } |
| | |
| | | public OrderEvaluateVo getOrderEvaluate(String orderId, Integer orderType) { |
| | | TOrderEvaluate orderEvaluate = this.getOne(new LambdaQueryWrapper<TOrderEvaluate>().eq(TOrderEvaluate::getOrderId, orderId).eq(TOrderEvaluate::getOrderType, orderType)); |
| | | if(null != orderEvaluate){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!orderEvaluate.getAppUserId().equals(userId)){ |
| | | throw new RuntimeException("权限不足"); |
| | | } |
| | | OrderEvaluateVo orderEvaluateVo = new OrderEvaluateVo(); |
| | | BeanUtils.copyProperties(orderEvaluate, orderEvaluateVo); |
| | | List<TOrderEvaluateTag> tOrderEvaluateTags = orderEvaluateTagMapper.selectList(new LambdaQueryWrapper<TOrderEvaluateTag>().eq(TOrderEvaluateTag::getOrderEvaluateId, orderEvaluate.getId())); |