| | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.feignClient.PartnerClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.TOrderAppealQuery; |
| | | import com.ruoyi.order.api.vo.ChargingOrderVO; |
| | | import com.ruoyi.order.api.vo.TOrderAppealVO; |
| | | import com.ruoyi.order.dto.ManageFeedbackDto; |
| | | import com.ruoyi.order.dto.ManageOrderAppealQuery; |
| | |
| | | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | @Resource |
| | | private PartnerClient partnerClient; |
| | | |
| | | @Autowired |
| | | public TOrderAppealController(TOrderAppealService orderAppealService, TokenService tokenService) { |
| | | this.orderAppealService = orderAppealService; |
| | | this.tokenService = tokenService; |
| | | } |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appealOrder"}, logical = Logical.OR) |
| | |
| | | .in(TOrderAppeal::getOrderType, 1, 2) |
| | | .orderByDesc(TOrderAppeal::getCreateTime) |
| | | .page(Page.of(manageOrderAppealQuery.getPageCurr(), manageOrderAppealQuery.getPageSize())); |
| | | |
| | | SysUser sysUser = sysUserClient.getSysUser(tokenService.getLoginUser().getUserid()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | List<TOrderAppeal> res = new ArrayList<>(); |
| | | for (TOrderAppeal record : page.getRecords()) { |
| | | if (record.getOrderType()!=1){ |
| | | res.add(record); |
| | | } |
| | | if (roleType == 2 && record.getOrderType()==1){ |
| | | List<Integer> siteIds = new ArrayList<>(); |
| | | if (sysUser.getUserId() != null){ |
| | | List<GetSiteListDTO> data = siteClient.getSiteListByUserId(sysUser.getUserId()).getData(); |
| | | for (GetSiteListDTO datum : data) { |
| | | siteIds.add(datum.getId()); |
| | | } |
| | | } |
| | | if (siteIds.isEmpty()){ |
| | | siteIds.add(-1); |
| | | } |
| | | TChargingOrder byId = chargingOrderService.getById(record.getOrderId()); |
| | | if (byId!=null&&siteIds.contains(byId.getSiteId())){ |
| | | res.add(record); |
| | | // 校验有没有这个站点的权限 |
| | | List<Boolean> data = partnerClient.managePageListMenu(sysUser.getObjectId(), byId.getSiteId()).getData(); |
| | | record.setAuthInfo(data.get(0)); |
| | | record.setAuthHandle(data.get(1)); |
| | | } |
| | | |
| | | }else{ |
| | | res.add(record); |
| | | } |
| | | record.setUid(record.getId().toString()); |
| | | } |
| | | |
| | | return R.ok(page); |
| | | |
| | | |