| | |
| | | @ApiModelProperty(value = "备注") |
| | | private String permissionRemarks; |
| | | @ApiModelProperty(value = "权限菜单") |
| | | private Map<String, Object> menu; |
| | | private List<Map<String, Object>> menu; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "策略名称") |
| | | private String strategyName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "编辑权限") |
| | | private boolean authUpdate = true; |
| | | |
| | | |
| | | @ApiModelProperty(value = "删除权限") |
| | | private boolean authDelete = true; |
| | | |
| | | |
| | | @ApiModelProperty(value = "查看费率权限") |
| | | private boolean authViewRates = true; |
| | | |
| | | @ApiModelProperty(value = "编辑权限") |
| | | |
| | | @ApiModelProperty(value = "下载二维码权限") |
| | | private boolean authDownloadQRCode = true; |
| | | |
| | | @ApiModelProperty(value = "编辑权限") |
| | | |
| | | @ApiModelProperty(value = "查看详情权限") |
| | | private boolean authQueryInfo = true; |
| | | |
| | | @ApiModelProperty(value = "编辑权限") |
| | | |
| | | @ApiModelProperty(value = "结束充电权限") |
| | | private boolean authEndCharge = true; |
| | | |
| | | } |
| | |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import com.ruoyi.other.api.dto.ExchangeDto; |
| | | import com.ruoyi.order.api.vo.ExchangeDto; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | |
| | | import com.ruoyi.order.api.factory.ChargingOrderFallbackFactory; |
| | | import com.ruoyi.order.api.factory.OrderFallbackFactory; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.vo.ExchangeDto; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import com.ruoyi.other.api.dto.ExchangeDto; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ExchangeDto { |
| | | @ApiModelProperty("商品id") |
| | | Integer goodId; |
| | | @ApiModelProperty("地址id") |
| | | Integer addressId; |
| | | @ApiModelProperty("备注") |
| | | String remark; |
| | | @ApiModelProperty(hidden = true) |
| | | Long userId; |
| | | |
| | | |
| | | } |
| | |
| | | String remark; |
| | | @ApiModelProperty(hidden = true) |
| | | Long userId; |
| | | @ApiModelProperty(hidden = true) |
| | | Integer userId; |
| | | |
| | | |
| | | } |
| | |
| | | return AjaxResult.ok(accountingStrategyService.pageList(query)); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "审核") |
| | | @PostMapping(value = "/auth/pass") |
| | | public AjaxResult<PageInfo<TAccountingStrategyVO>> authPass(@RequestBody SteategyPassDto steategyPassDto) { |
| | | TAccountingStrategy byId = accountingStrategyService.getById(steategyPassDto.getId()); |
| | | Long userId = tokenService.getLoginUser().getSysUser().getUserId(); |
| | | if (byId.getAuditStatus()==1&&byId.getFirstUserId()!=userId){ |
| | | return AjaxResult.error("您不是一级审核人员,无法审核"); |
| | | } |
| | | if (byId.getAuditStatus()==2&&byId.getTwoUserId()!=userId){ |
| | | return AjaxResult.error("您不是二级审核人员,无法审核"); |
| | | } |
| | | if (steategyPassDto.getPass()==1){ |
| | | if (byId.getAuditStatus()==1){ |
| | | |
| | | byId.setAuditStatus(2); |
| | | byId.setFirstRemark(steategyPassDto.getRemark()); |
| | | |
| | | }else if (byId.getAuditStatus()==2){ |
| | | byId.setAuditStatus(3); |
| | | byId.setTwoRemark(steategyPassDto.getRemark()); |
| | | |
| | | } |
| | | }else { |
| | | byId.setAuditStatus(4); |
| | | } |
| | | return AjaxResult.success(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | // @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "审核") |
| | | // @PostMapping(value = "/auth/pass") |
| | | // public AjaxResult<PageInfo<TAccountingStrategyVO>> authPass(@RequestBody SteategyPassDto steategyPassDto) { |
| | | // TAccountingStrategy byId = accountingStrategyService.getById(steategyPassDto.getId()); |
| | | // Long userId = tokenService.getLoginUser().getSysUser().getUserId(); |
| | | // if (byId.getAuditStatus()==1&&byId.getFirstUserId()!=userId){ |
| | | // return AjaxResult.error("您不是一级审核人员,无法审核"); |
| | | // } |
| | | // if (byId.getAuditStatus()==2&&byId.getTwoUserId()!=userId){ |
| | | // return AjaxResult.error("您不是二级审核人员,无法审核"); |
| | | // } |
| | | // if (steategyPassDto.getPass()==1){ |
| | | // if (byId.getAuditStatus()==1){ |
| | | // |
| | | // byId.setAuditStatus(2); |
| | | // byId.setFirstRemark(steategyPassDto.getRemark()); |
| | | // |
| | | // }else if (byId.getAuditStatus()==2){ |
| | | // byId.setAuditStatus(3); |
| | | // byId.setTwoRemark(steategyPassDto.getRemark()); |
| | | // |
| | | // } |
| | | // }else { |
| | | // byId.setAuditStatus(4); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | |
| | | /** |
| | | * 小程序远程调用 根据会员折扣、预付金额 计算服务费 |
| | |
| | | applyChargingPileService.updateById(byId); |
| | | return AjaxResult.success(); |
| | | } |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "删除") |
| | | @DeleteMapping(value = "/remark") |
| | | public AjaxResult remark(String ids) { |
| | | |
| | | String[] split = ids.split(","); |
| | | for (String s : split) { |
| | | applyChargingPileService.removeById(s); |
| | | |
| | | } |
| | | return AjaxResult.success(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | Partner partner = this.getById(partnerId); |
| | | GetPermissionConfigurationDTO dto = new GetPermissionConfigurationDTO(); |
| | | dto.setPermissionRemarks(partner.getPermissionRemarks()); |
| | | Map<String, Object> menu = new HashMap<>(); |
| | | List<TPartnerSite> list = partnerSiteService.list(new LambdaQueryWrapper<TPartnerSite>() |
| | | .eq(TPartnerSite::getPartnerId, partnerId) |
| | | .eq(TPartnerSite::getSiteId, siteId)); |
| | |
| | | .eq(TSiteMenu::getParentId, 0) |
| | | .eq(TSiteMenu::getVisible, 0) |
| | | .eq(TSiteMenu::getStatus, 0).orderByAsc(TSiteMenu::getOrderNum)); |
| | | List<Map<String, Object>> list1 = new ArrayList<>(); |
| | | for (TSiteMenu tSiteMenu : tSiteMenus) { |
| | | Map<String, Object> menu = new HashMap<>(); |
| | | menu.put("id", tSiteMenu.getMenuId()); |
| | | menu.put("name", tSiteMenu.getMenuName()); |
| | | menu.put("path", tSiteMenu.getPath()); |
| | |
| | | .eq(TSiteMenu::getParentId, tSiteMenu.getMenuId()) |
| | | .eq(TSiteMenu::getVisible, 0) |
| | | .eq(TSiteMenu::getStatus, 0).orderByAsc(TSiteMenu::getOrderNum)); |
| | | Map<String, Object> child = new HashMap<>(); |
| | | List<Map<String, Object>> list2 = new ArrayList<>(); |
| | | for (TSiteMenu siteMenu : tSiteMenus1) { |
| | | Map<String, Object> child = new HashMap<>(); |
| | | child.put("id", siteMenu.getMenuId()); |
| | | child.put("name", siteMenu.getMenuName()); |
| | | child.put("path", siteMenu.getPath()); |
| | | child.put("type", siteMenu.getMenuType()); |
| | | child.put("selected", collect.contains(siteMenu.getMenuId())); |
| | | list2.add(child); |
| | | } |
| | | menu.put("selected", child.keySet().size() > 0 ? true : false); |
| | | menu.put("child", child); |
| | | menu.put("selected", list2.size() > 0 ? true : false); |
| | | menu.put("child", list2); |
| | | list1.add(menu); |
| | | } |
| | | dto.setMenu(menu); |
| | | dto.setMenu(list1); |
| | | return dto; |
| | | } |
| | | |
| | |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.chargingPile.api.vo.TChargingGunVO"> |
| | | SELECT |
| | | tas.id, tas.code, tas.site_id, tas.partner_id, tas.charging_pile_id, tas.`name`, tas.`type`, tas.status, tas.charge_mode, tas.accounting_strategy_id, |
| | | tas.upper_rated_voltage, tas.lower_limit_of_rated_voltage, tas.rated_current, tas.rated_power, tas.parking_number, tas.parking_status, |
| | | tas.parking_lock_state, tas.national_standard, tas.remark, tas.create_time, tas.del_flag,tcg.name AS strategyName |
| | | tcg.id, tcg.code, tcg.site_id, tcg.partner_id, tcg.charging_pile_id, tcg.`name`, tcg.`type`, tcg.status, tcg.charge_mode, tcg.accounting_strategy_id, |
| | | tcg.upper_rated_voltage, tcg.lower_limit_of_rated_voltage, tcg.rated_current, tcg.rated_power, tcg.parking_number, tcg.parking_status, |
| | | tcg.parking_lock_state, tcg.national_standard, tcg.remark, tcg.create_time, tcg.del_flag,tas.name AS strategyName |
| | | FROM t_charging_gun tcg |
| | | LEFT JOIN t_accounting_strategy tas ON tas.id = tcg.accounting_strategy_id |
| | | <where> |
| | | <if test="query.siteId != null"> |
| | | AND tas.site_id = #{query.siteId} |
| | | AND tcg.site_id = #{query.siteId} |
| | | </if> |
| | | <if test="query.chargingPileId != null"> |
| | | AND tas.charging_pile_id = #{query.chargingPileId} |
| | | AND tcg.charging_pile_id = #{query.chargingPileId} |
| | | </if> |
| | | <if test="query.name != null and query.name != ''"> |
| | | AND tas.`name` LIKE concat('%',#{query.name},'%') |
| | | AND tcg.`name` LIKE concat('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.type != null"> |
| | | AND tas.`type` = #{query.type} |
| | | AND tcg.`type` = #{query.type} |
| | | </if> |
| | | <if test="query.status != null"> |
| | | AND tas.status = #{query.status} |
| | | AND tcg.status = #{query.status} |
| | | </if> |
| | | <if test="query.chargeMode != null"> |
| | | AND tas.chargeMode = #{query.chargeMode} |
| | | AND tcg.chargeMode = #{query.chargeMode} |
| | | </if> |
| | | <if test="null != siteIds"> |
| | | and tcg.site_id in |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND tas.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | AND tcg.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tas.create_time DESC |
| | | ORDER BY tcg.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.EnterpriseQuery; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.TEnterpriseUserApplication; |
| | | import com.ruoyi.other.query.PassDto; |
| | | import com.ruoyi.other.service.TEnterpriseUserApplicationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * 添加计费策略管理 |
| | | */ |
| | | @Log(title = "添加集团用户申请", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"小程序-集团用户","后台-申请表单-集团用户"},value = "添加集团用户申请") |
| | | @ApiOperation(tags = {"小程序-集团用户"},value = "添加集团用户申请") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@Validated @RequestBody TEnterpriseUserApplication dto) { |
| | | // 用户id |
| | |
| | | return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); |
| | | } |
| | | |
| | | @Log(title = "添加集团用户申请", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "后台添加集团用户申请") |
| | | @PostMapping(value = "/back/add") |
| | | public AjaxResult<Boolean> backAdd(@Validated @RequestBody TEnterpriseUserApplication dto) { |
| | | // 用户id |
| | | return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "集团用户列表") |
| | | @PostMapping(value = "/page") |
| | | public AjaxResult<Page<TEnterpriseUserApplication>> page(EnterpriseQuery enterpriseQuery) { |
| | | public R<Page<TEnterpriseUserApplication>> page(EnterpriseQuery enterpriseQuery) { |
| | | // 用户id |
| | | if (enterpriseQuery.getPhone()!=null) { |
| | | List<Long> userIds = appUserClient.getUserIdsByPhone(enterpriseQuery.getPhone()).getData(); |
| | | if (userIds.isEmpty()){ |
| | | return AjaxResult.warn("未查询到用户"); |
| | | return R.ok(); |
| | | } |
| | | Page<TEnterpriseUserApplication> page = enterpriseUserApplicationService.lambdaQuery().in(TEnterpriseUserApplication::getAppUserId, userIds).page(Page.of(enterpriseQuery.getPageCurr(), enterpriseQuery.getPageSize())); |
| | | return AjaxResult.ok(page); |
| | | return R.ok(page); |
| | | }else { |
| | | Page<TEnterpriseUserApplication> page = enterpriseUserApplicationService.lambdaQuery().page(Page.of(enterpriseQuery.getPageCurr(), enterpriseQuery.getPageSize())); |
| | | return AjaxResult.ok(page); |
| | | return R.ok(page); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "备注") |
| | | @GetMapping(value = "/remark") |
| | | public AjaxResult pass(Integer id,String remark) { |
| | | @PostMapping(value = "/remark") |
| | | public AjaxResult pass(@RequestBody PassDto passDto) { |
| | | // 用户id |
| | | TEnterpriseUserApplication byId = enterpriseUserApplicationService.getById(id); |
| | | byId.setRemark(remark); |
| | | TEnterpriseUserApplication byId = enterpriseUserApplicationService.getById(passDto.getId()); |
| | | byId.setRemark(passDto.getRemark()); |
| | | |
| | | enterpriseUserApplicationService.updateById(byId); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | return AjaxResult.ok(goodsService.pageList1(basePage)); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"小程序-兑换商城"},value = "兑换商品") |
| | | @PostMapping(value = "/app/shop") |
| | | public AjaxResult<PageInfo<TGoods>> shop(@RequestBody ExchangeDto exchangeDto) { |
| | | //查询当前商品信息 |
| | | TGoods good = goodsService.getById(exchangeDto.getGoodId()); |
| | | |
| | | //检查当前用户积分是否够 |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUser user = appUserClient.getUserById(userId).getData(); |
| | | if (user.getPoints()<good.getRedeemPoints()){ |
| | | return AjaxResult.error("当前用户积分不足"); |
| | | } |
| | | //检查当前用户是否到达兑换上限 |
| | | Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId).getData(); |
| | | if (good.getLimitExchangeTimes()!=-1&&count>=good.getLimitExchangeTimes()){ |
| | | return AjaxResult.error("当前用户已到达兑换上限"); |
| | | } |
| | | //生成积分兑换成功的订单 |
| | | orderClient.exchangeCreate(exchangeDto); |
| | | |
| | | //如果是优惠卷,赠送优惠卷给用户 |
| | | |
| | | |
| | | |
| | | |
| | | //生成消耗积分的记录 |
| | | |
| | | |
| | | } |
| | | // @ApiOperation(tags = {"小程序-兑换商城"},value = "兑换商品") |
| | | // @PostMapping(value = "/app/shop") |
| | | // public AjaxResult<PageInfo<TGoods>> shop(@RequestBody ExchangeDto exchangeDto) { |
| | | // //查询当前商品信息 |
| | | // TGoods good = goodsService.getById(exchangeDto.getGoodId()); |
| | | // |
| | | // //检查当前用户积分是否够 |
| | | // Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // TAppUser user = appUserClient.getUserById(userId).getData(); |
| | | // if (user.getPoints()<good.getRedeemPoints()){ |
| | | // return AjaxResult.error("当前用户积分不足"); |
| | | // } |
| | | // //检查当前用户是否到达兑换上限 |
| | | // Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId).getData(); |
| | | // if (good.getLimitExchangeTimes()!=-1&&count>=good.getLimitExchangeTimes()){ |
| | | // return AjaxResult.error("当前用户已到达兑换上限"); |
| | | // } |
| | | // //生成积分兑换成功的订单 |
| | | //// orderClient.exchangeCreate(exchangeDto); |
| | | // |
| | | // //如果是优惠卷,赠送优惠卷给用户 |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // //生成消耗积分的记录 |
| | | // |
| | | // |
| | | // } |
| | | |
| | | |
| | | /** |
New file |
| | |
| | | package com.ruoyi.other.query; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2024/8/20 18:25 |
| | | */ |
| | | @Data |
| | | public class PassDto { |
| | | Integer id; |
| | | String remark; |
| | | } |