Merge remote-tracking branch 'origin/dev' into dev
| | |
| | | public R delSysUserById(Long userId) { |
| | | return R.fail("根据id删除管理员账户失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<SysUser> queryUserBySiteId(Integer siteId) { |
| | | return R.fail("根据站点id查询账户失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.factory.SysUserFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | @PostMapping("/user/delSysUserById") |
| | | R delSysUserById(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 通过站点id查询用户 |
| | | * @param siteId |
| | | * @return |
| | | */ |
| | | @GetMapping("/user/queryUserBySiteId") |
| | | R<SysUser> queryUserBySiteId(@RequestParam("siteId")Integer siteId); |
| | | |
| | | } |
| | |
| | | String status = otherClient.getServiceStatus(data.getUserId().intValue()).getData(); |
| | | switch (status){ |
| | | case "1": |
| | | return R.fail("未缴纳服务费"); |
| | | // return R.fail("未缴纳服务费"); |
| | | break; |
| | | case "2": |
| | | return R.fail("服务费已过期"); |
| | | } |
| | |
| | | String status = otherClient.getServiceStatus(data.getUserId().intValue()).getData(); |
| | | switch (status){ |
| | | case "1": |
| | | return R.fail("未缴纳服务费"); |
| | | // return R.fail("未缴纳服务费"); |
| | | break; |
| | | case "2": |
| | | return R.fail("服务费已过期"); |
| | | } |
| | |
| | | userService.deleteUserById(userId); |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/queryUserBySiteId") |
| | | public R queryUserBySiteId(@RequestParam("siteId") Integer siteId){ |
| | | SysUser user = userService.selectUserBySiteId(siteId); |
| | | return R.ok(user); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<SysUser> getChangeUserList(@Param("pageInfo")PageInfo<SysUser> pageInfo,@Param("query") ChangeUserQuery query); |
| | | |
| | | SysUser selectUserBySiteId(@Param("siteId")Integer siteId); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<SysUser> getChangeUserList(ChangeUserQuery query); |
| | | |
| | | SysUser selectUserBySiteId(Integer siteId); |
| | | } |
| | |
| | | List<SysUser> list = this.baseMapper.getChangeUserList(pageInfo, query); |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public SysUser selectUserBySiteId(Integer siteId) { |
| | | return this.baseMapper.selectUserBySiteId(siteId); |
| | | } |
| | | |
| | | } |
| | |
| | | select user_id, user_name from sys_user where nick_name = #{nickName} |
| | | and del_flag = '0' limit 1 |
| | | </select> |
| | | <select id="selectUserBySiteId" resultType="com.ruoyi.system.api.domain.SysUser"> |
| | | select u.user_id as userId, u.dept_id as deptId, u.user_name as userName, u.nick_name as nickName, u.email, u.avatar, u.phonenumber, u.password, |
| | | u.sex, u.status, u.del_flag as delFlag, u.login_ip as loginIp, u.login_date as loginDate, u.role_type as roleType, |
| | | u.create_by as createBy, u.create_time as createTime, u.remark from sys_user u where u.del_flag = '0' and u.status = '0' and u.site_id = #{siteId} |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="com.ruoyi.system.api.domain.SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | <insert id="insertUser" parameterType="com.ruoyi.system.api.domain.SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user( |
| | | <if test="userId != null and userId != 0">user_id,</if> |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | |
| | | if (result == null || result.get("total_points") == null) { |
| | | userStatistics.setTotalScore(0L); |
| | | }else { |
| | | userStatistics.setTotalScore(((BigDecimal) result.get("total_points")).longValue()); |
| | | userStatistics.setTotalScore(Long.valueOf(result.get("total_points").toString())); |
| | | } |
| | | //条件构造 消费积分现金支付金额 |
| | | queryWrapper.clear(); |
| | |
| | | @GetMapping("/map/getSiteList") |
| | | @ApiOperation(value = "获取站点", tags = {"2.0-管理后台-数据分析-电站分布"}) |
| | | public R<List<GetSiteListDTO>> getMapSiteList(GetSiteList siteList){ |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser data = sysUserClient.getSysUser(userid).getData(); |
| | | |
| | | if (data.getRoleType()==2){ |
| | | siteList.setSiteId(data.getSiteId()); |
| | | } |
| | | List<GetSiteListDTO> list = siteService.getSiteListNolimit(siteList); |
| | | SysUser sysUser = tokenService.getLoginUser().getSysUser(); |
| | | List<GetSiteListDTO> list = siteService.getSiteListNolimit(siteList,sysUser); |
| | | List<GetSiteListDTO> records = list; |
| | | |
| | | for (GetSiteListDTO record : records) { |
| | |
| | | @PostMapping("/editSite") |
| | | @ApiOperation(value = "编辑站点", tags = {"管理后台-站点管理"}) |
| | | @Log(title = "【站点管理】编辑站点", businessType = BusinessType.UPDATE) |
| | | public AjaxResult editSite(@RequestBody Site site){ |
| | | return siteService.editSite(site); |
| | | public AjaxResult editSite(@RequestBody SiteDTO dto){ |
| | | return siteService.editSite(dto); |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | private final TChargingPileService chargingPileService; |
| | | private final TChargingGunService chargingGunService; |
| | | |
| | | private final TokenService tokenService; |
| | | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Autowired |
| | | public TChargingPileController(TChargingPileService chargingPileService, TChargingGunService chargingGunService) { |
| | | public TChargingPileController(TChargingPileService chargingPileService, TChargingGunService chargingGunService, TokenService tokenService) { |
| | | this.chargingPileService = chargingPileService; |
| | | this.chargingGunService = chargingGunService; |
| | | this.tokenService = tokenService; |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/pageChargingPileList") |
| | | @ApiOperation(value = "获取充电桩列表数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult<PageInfo<PageChargingPileListDTO>> pageChargingPileList(PageChargingPileList page){ |
| | | PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page); |
| | | SysUser sysUser = tokenService.getLoginUser().getSysUser(); |
| | | PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page,sysUser); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.chargingPile.dto.SiteDTO; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<GetSiteListDTO> getSiteList(GetSiteList siteList); |
| | | List<GetSiteListDTO> getSiteListNolimit(GetSiteList siteList); |
| | | List<GetSiteListDTO> getSiteListNolimit(GetSiteList siteList, SysUser sysUser); |
| | | |
| | | PageInfo<GetSiteListDTO> getSiteList1(Long userId); |
| | | |
| | |
| | | * @param site |
| | | * @return |
| | | */ |
| | | AjaxResult editSite(Site site); |
| | | AjaxResult editSite(SiteDTO dto); |
| | | |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.chargingPile.api.vo.TChargingPileVO; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param page |
| | | * @return |
| | | */ |
| | | PageInfo<PageChargingPileListDTO> pageChargingPileList(PageChargingPileList page); |
| | | PageInfo<PageChargingPileListDTO> pageChargingPileList(PageChargingPileList page, SysUser sysUser); |
| | | |
| | | |
| | | /** |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<GetSiteListDTO> getSiteListNolimit(GetSiteList siteList) { |
| | | Set<Integer> ids = null; |
| | | public List<GetSiteListDTO> getSiteListNolimit(GetSiteList siteList,SysUser sysUser) { |
| | | Set<Integer> ids = new HashSet<>(); |
| | | if(sysUser.getRoleType() != 1){ |
| | | ids.add(sysUser.getSiteId()); |
| | | } |
| | | List<GetSiteListDTO> list = this.baseMapper.getSiteListNolimit( siteList, ids); |
| | | return list; |
| | | } |
| | |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | SysUser sysUser = sysUserClient.queryUserByUserName(dto.getAccount()).getData(); |
| | | if (Objects.nonNull(sysUser)){ |
| | | return AjaxResult.error("账号已存在"); |
| | | } |
| | | Site one = this.getOne(new LambdaQueryWrapper<Site>().eq(Site::getCode, dto.getCode()).eq(Site::getDelFlag, 0)); |
| | | if(null != one){ |
| | | return AjaxResult.error("站点编号重复"); |
| | |
| | | |
| | | /** |
| | | * 编辑站点 |
| | | * @param site |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult editSite(Site site) { |
| | | AjaxResult ajaxResult = addSiteVerify(site); |
| | | public AjaxResult editSite(SiteDTO dto) { |
| | | AjaxResult ajaxResult = addSiteVerify(dto); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | Site one = this.getOne(new LambdaQueryWrapper<Site>().eq(Site::getCode, site.getCode()).eq(Site::getDelFlag, 0)); |
| | | if(null != one && !one.getCode().equals(site.getCode())){ |
| | | Site one = this.getOne(new LambdaQueryWrapper<Site>().eq(Site::getCode, dto.getCode()).eq(Site::getDelFlag, 0)); |
| | | if(null != one && !one.getCode().equals(dto.getCode())){ |
| | | return AjaxResult.error("站点编号重复"); |
| | | } |
| | | this.updateById(site); |
| | | |
| | | // 通过站点id查询登录账号 |
| | | SysUser sysUser = sysUserClient.queryUserBySiteId(dto.getId()).getData(); |
| | | // 判断是否更换了账号 更换了账号判断是否已存在 |
| | | if(null != sysUser && !sysUser.getUserName().equals(dto.getAccount())){ |
| | | SysUser sysUser1 = sysUserClient.queryUserByUserName(dto.getAccount()).getData(); |
| | | if(null != sysUser1){ |
| | | return AjaxResult.error("账号已存在"); |
| | | } |
| | | // 添加登录账号 |
| | | SysUser user = new SysUser(); |
| | | user.setPhonenumber(dto.getAccount()); |
| | | user.setUserName(dto.getAccount()); |
| | | user.setNickName(dto.getName()); |
| | | user.setPassword(dto.getPassword()); |
| | | user.setStatus("0"); |
| | | user.setDelFlag("0"); |
| | | user.setRoleId(2L); |
| | | user.setSiteId(dto.getId()); |
| | | R<Long> r = sysUserClient.addSysUserSite(user); |
| | | if(200 != r.getCode()){ |
| | | throw new RuntimeException(r.getMsg()); |
| | | } |
| | | dto.setUserId(r.getData()); |
| | | // 删除原有的登录账号 |
| | | R res = sysUserClient.delSysUserById(sysUser.getUserId()); |
| | | } |
| | | if(Objects.nonNull(sysUser) && sysUser.getUserName().equals(dto.getAccount())) { |
| | | // 修改密码 |
| | | R res = sysUserClient.resetPassword(sysUser); |
| | | } |
| | | |
| | | this.updateById(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | 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.domain.SysUser; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<PageChargingPileListDTO> pageChargingPileList(PageChargingPileList page) { |
| | | Set<Integer> siteIds = null; |
| | | public PageInfo<PageChargingPileListDTO> pageChargingPileList(PageChargingPileList page, SysUser sysUser) { |
| | | // 获取当前登录账号站点 |
| | | Set<Integer> siteIds = new HashSet<>(); |
| | | if(sysUser.getRoleType() != 1){ |
| | | siteIds.add(sysUser.getSiteId()); |
| | | } |
| | | PageInfo<PageChargingPileListDTO> pageInfo = new PageInfo<>(page.getPageCurr(), page.getPageSize()); |
| | | List<PageChargingPileListDTO> list = this.baseMapper.pageChargingPileList(pageInfo, page, siteIds); |
| | | return pageInfo.setRecords(list); |
| | |
| | | <if test="null != item.siteId"> |
| | | and a.id = #{item.siteId} |
| | | </if> |
| | | <if test="null != item.name and item.name != ''"> |
| | | and a.name LIKE concat('%',#{item.name},'%') |
| | | </if> |
| | | <if test="null != ids and ids.size() > 0"> |
| | | and a.id in |
| | | <foreach collection="ids" item="itemm" index="index" open="(" separator="," close=")"> |
| | | #{itemm} |
| | | </foreach> |
| | | </if> |
| | | order by a.sort desc, a.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | @ApiImplicitParam(value = "订单状态", name = "status", required = true, dataType = "int"), |
| | | }) |
| | | @GetMapping("/getMyOrderList") |
| | | public TableDataInfo<OrderVO> getMyOrderList(@RequestParam("status") Integer status) { |
| | | public TableDataInfo<OrderVO> getMyOrderList(@RequestParam(value = "status",required = false) Integer status) { |
| | | startPage(); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | return getDataTable(orderService.selectOrderListByUserId(status, loginUserApplet.getUserid())); |
| | |
| | | private String phone; |
| | | // 开始时间 |
| | | @Excel(name = "开始时间", width = 20) |
| | | private LocalDateTime beginTime; |
| | | private String beginTime; |
| | | // 结束时间 |
| | | @Excel(name = "结束时间", width = 20) |
| | | private LocalDateTime endTime; |
| | | private String endTime; |
| | | // 充电时长 |
| | | @Excel(name = "充电时长", width = 20) |
| | | private String chargingDuration; |
| | |
| | | @Excel(name = "终端编码", width = 20) |
| | | private String terminalCode; |
| | | // 车牌号 |
| | | @Excel(name = "车牌号", width = 20) |
| | | @Excel(name = "车牌号码", width = 20) |
| | | private String plateNumber; |
| | | // 电站价电费金额 |
| | | @Excel(name = "电站价电费金额", width = 20) |
| | |
| | | @Excel(name = "电站价总金额", width = 20) |
| | | private BigDecimal totalAmount; |
| | | //获得积分 |
| | | @Excel(name = "获得积分", width = 20) |
| | | @Excel(name = "获得绿电分", width = 20) |
| | | private Integer point; |
| | | } |
| | |
| | | throw new ServiceException(e.getMessage()); |
| | | } |
| | | if(!result.isEmpty()){ |
| | | return R.fail(result); |
| | | return R.fail(result.toString()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @Excel(name = "订单状态" , readConverterExp = "3=待使用,4=已完成,5=已取消,8=已评价") |
| | | private String orderStatus; |
| | | |
| | | |
| | | /** |
| | | * 商户单号 |
| | | */ |
| | |
| | | AND end_time between #{dto.beginTime2 } and #{dto.endTime2 } |
| | | </if> |
| | | <if test="dto.siteId != null"> |
| | | AND site_id = #{dto.siteId} |
| | | AND power_station_id = #{dto.siteId} |
| | | </if> |
| | | order by begin_time DESC |
| | | </select> |
| | |
| | | og.goods_id, |
| | | og.selling_price, |
| | | og.good_json, |
| | | o.pay_method, |
| | | o.pay_method, |
| | | o.payment_amount orderMoney, |
| | | o.point , |
| | | o.serial_number, |
| | | o.shop_id as shopId |
| | | o.shop_id as shopId |
| | | |
| | | FROM |
| | | t_order_good og |
| | | LEFT JOIN t_order o ON og.order_id = o.id |
| | | left join |
| | | t_order_good og |
| | | LEFT JOIN t_order o ON og.order_id = o.id |
| | | where o.del_flag = 0 and o.pay_status = 2 |
| | | <if test="null != item.orderNumber and '' != item.orderNumber"> |
| | | and o.order_number like CONCAT('%', #{item.orderNumber}, '%') |
| | | </if> |
| | | <if test="null != item.goodName and '' != item.goodName"> |
| | | and good_name like CONCAT('%', #{item.goodName}, '%') |
| | | and og.good_name like CONCAT('%', #{item.goodName}, '%') |
| | | </if> |
| | | |
| | | <if test="null != item.appUserIds and item.appUserIds.size() > 0"> |
| | |
| | | and o.order_status in (4, 8) |
| | | </if> |
| | | <if test="null != item.shopIds and item.shopIds.size() > 0"> |
| | | and shop_id in |
| | | and o.shop_id in |
| | | <foreach collection="item.shopIds" separator="," item="tem" index="index" open="(" close=")"> |
| | | #{tem} |
| | | </foreach> |
| | |
| | | // 查询服务费缴纳情况 |
| | | @GetMapping("/getServiceStatus/{userId}") |
| | | public R<String> getServiceStatus(@PathVariable("userId") Integer userId) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | ServicePay servicePayBefore = servicePayService.lambdaQuery() |
| | | .eq(ServicePay::getUserId, userid) |
| | | .eq(ServicePay::getUserId, userId) |
| | | .eq(ServicePay::getPayStatus,2) |
| | | .eq(ServicePay::getDelFlag,0) |
| | | .orderByDesc(ServicePay::getCreateTime) |