| | |
| | | public class UserListQueryDto extends BasePage { |
| | | @ApiModelProperty(value = "用户手机号") |
| | | String userPhone; |
| | | @ApiModelProperty(value = "所在省code") |
| | | String provinceCode; |
| | | @ApiModelProperty(value = "所在地code") |
| | | String cityCode; |
| | | @ApiModelProperty(value = "状态 1正常2冻结 3注销") |
| | |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | |
| | | @ApiModelProperty(value = "1月卡2季卡3年卡") |
| | | @TableField("vip_type") |
| | | private Integer vipType; |
| | | |
| | | @ApiModelProperty(value = "会员开始时间") |
| | | @TableField("start_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | |
| | | private String avatar; |
| | | |
| | | /** 密码 */ |
| | | @NotBlank(message = "密码不能为空") |
| | | private String password; |
| | | |
| | | /** 帐号状态(0正常 1停用) */ |
| | |
| | | public class GlobalExceptionHandler { |
| | | private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); |
| | | |
| | | @Value("${spring.servlet.multipart.max-file-size:10MB}") |
| | | @Value("${spring.servlet.multipart.max-file-size:50MB}") |
| | | private String maxFileSize; |
| | | @Value("${spring.servlet.multipart.max-request-size:100MB}") |
| | | private String maxRequestSize; |
| | |
| | | <select id="getList" resultMap="SysUserResult"> |
| | | select * from sys_user where 1=1 |
| | | <if test="req.search !=null and req.search !=''"> |
| | | and (phonenumber like concat("%", #{phonenumber},"%") or nick_name like concat("%", #{phonenumber},"%")) |
| | | and (phonenumber like concat("%", #{req.search},"%") or nick_name like concat("%", #{req.search},"%")) |
| | | </if> |
| | | <if test="null != req.siteId"> |
| | | and user_id in (select user_id from t_user_site where site_id = #{req.siteId}) |
| | |
| | | Page<TAppUser> page = appUserService.lambdaQuery() |
| | | .like(userListQueryDto.getUserPhone() != null && !"".equals(userListQueryDto.getUserPhone()), TAppUser::getPhone, userListQueryDto.getUserPhone()) |
| | | .eq(userListQueryDto.getCompanyId() != null, TAppUser::getCompanyId, userListQueryDto.getCompanyId()) |
| | | .like(userListQueryDto.getProvinceCode() != null && !"".equals(userListQueryDto.getProvinceCode()), TAppUser::getProvinceCode, userListQueryDto.getProvinceCode()) |
| | | .eq(userListQueryDto.getCityCode() != null && !"".equals(userListQueryDto.getCityCode()), TAppUser::getCityCode, userListQueryDto.getCityCode()) |
| | | .eq(userListQueryDto.getStatus() != null, TAppUser::getStatus, userListQueryDto.getStatus()) |
| | | .eq(userListQueryDto.getVipTypeId() != null, TAppUser::getVipId, userListQueryDto.getVipTypeId()) |
| | |
| | | plusDay = 12; |
| | | } |
| | | //增加vipDetail |
| | | giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay); |
| | | giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay,giveVipDto.getType()); |
| | | appUserService.updateById(nowUser); |
| | | } |
| | | return R.ok(); |
| | |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+point,5,userId,appUserCar.getLicensePlate(),""); |
| | | byId.setPoints(byId.getPoints()+point); |
| | | byId.setFirstAdd(1); |
| | | appUserService.updateById(byId); |
| | | |
| | | |
| | | } |
| | | CarNumDto carNumDto = CarUtil.carNum(appUserCar.getLicensePlate()); |
| | | if (carNumDto==null){ |
| | | return R.fail("请输入正确的车牌"); |
| | | } |
| | | |
| | | byId.setCityCode(carNumDto.getAreaCode()); |
| | | byId.setProvinceCode(carNumDto.getAreaCode().substring(0,2)+"0000"); |
| | | appUserService.updateById(byId); |
| | | |
| | | // |
| | | appUserCarService.saveOrUpdate(appUserCar); |
| | |
| | | public AjaxResult editInvoiceInformation(@RequestBody TInvoiceInformation invoiceInformation){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | //如果当前是默认抬头,则需要去除其他的默认配置 |
| | | if(1 == invoiceInformation.getIsDefault()){ |
| | | if(null != invoiceInformation.getIsDefault() && 1 == invoiceInformation.getIsDefault()){ |
| | | TInvoiceInformation one = invoiceInformationService.getOne(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getDelFlag, 0) |
| | | .eq(TInvoiceInformation::getIsDefault, 1).eq(TInvoiceInformation::getAppUserId, userId)); |
| | | if(null != one && !one.getId().equals(invoiceInformation.getId())){ |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void changeVipId(){ |
| | | LocalDate currentDate = LocalDate.now(); |
| | | LocalDateTime currentDate = LocalDateTime.now(); |
| | | List<TAppUserVipDetail> recentDetails = tAppUserVipDetailService.lambdaQuery() |
| | | .le(TAppUserVipDetail::getStartTime, currentDate) |
| | | .ge(TAppUserVipDetail::getEndTime, currentDate) |
| | |
| | | private String pcode; |
| | | private String province; |
| | | private String city; |
| | | private String code; |
| | | private String Hp; |
| | | private String AreaCode; |
| | | } |
| | |
| | | private OtherClient otherClient; |
| | | @Resource |
| | | private TAppCouponService appCouponService; |
| | | public void sendVip(TAppUser nowUser,Integer vipId,Integer plusDay){ |
| | | public void sendVip(TAppUser nowUser,Integer vipId,Integer plusDay,Integer type){ |
| | | if (nowUser.getVipEndTime()==null||nowUser.getVipEndTime().isBefore(LocalDateTime.now())) { |
| | | |
| | | nowUser.setVipEndTime(LocalDateTime.now().plusMonths(plusDay)); |
| | | |
| | | nowUser.setVipEndTime(LocalDateTime.now().plusMonths(plusDay).minusDays(1)); |
| | | nowUser.setVipId(vipId); |
| | | //直接再detail里新增数据,因为不是续费 |
| | | TAppUserVipDetail tAppUserVipDetail = new TAppUserVipDetail(); |
| | | tAppUserVipDetail.setAppUserId(nowUser.getId()); |
| | |
| | | tAppUserVipDetail.setDiscountMoney(vip.getMaximumDeduction()); |
| | | tAppUserVipDetail.setSendMonth(1); |
| | | tAppUserVipDetail.setVipJson(JSON.toJSONString(info.getData())); |
| | | tAppUserVipDetail.setVipType(type); |
| | | tAppUserVipDetailService.save(tAppUserVipDetail); |
| | | //直接赠送优惠卷 |
| | | for (SendCouponDto sendCouponDto : javaList) { |
| | |
| | | |
| | | |
| | | }else { |
| | | nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(plusDay).minusDays(1)); |
| | | // nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(plusDay).minusDays(1)); |
| | | //获取detail里结束时间大于当前时间的数据,并将enttime延长 |
| | | TAppUserVipDetail tAppUserVipDetail = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getVipId,vipId).eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one(); |
| | | if (tAppUserVipDetail!=null) { |
| | | List<TAppUserVipDetail> list = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).ge(TAppUserVipDetail::getStartTime, tAppUserVipDetail.getEndTime()).list(); |
| | | for (TAppUserVipDetail appUserVipDetail : list) { |
| | | appUserVipDetail.setStartTime(appUserVipDetail.getStartTime().plusMonths(plusDay).minusDays(1)); |
| | | appUserVipDetail.setEndTime(appUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1)); |
| | | } |
| | | tAppUserVipDetailService.updateBatchById(list); |
| | | tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1)); |
| | | |
| | | tAppUserVipDetailService.updateById(tAppUserVipDetail); |
| | | }else { |
| | | // TAppUserVipDetail tAppUserVipDetail = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getVipId,vipId).eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one(); |
| | | // if (tAppUserVipDetail!=null) { |
| | | // List<TAppUserVipDetail> list = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).ge(TAppUserVipDetail::getStartTime, tAppUserVipDetail.getEndTime()).list(); |
| | | // for (TAppUserVipDetail appUserVipDetail : list) { |
| | | // appUserVipDetail.setStartTime(appUserVipDetail.getStartTime().plusMonths(plusDay).minusDays(1)); |
| | | // appUserVipDetail.setEndTime(appUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1)); |
| | | // } |
| | | // tAppUserVipDetailService.updateBatchById(list); |
| | | // tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1)); |
| | | // |
| | | // tAppUserVipDetailService.updateById(tAppUserVipDetail); |
| | | // }else |
| | | // { |
| | | TAppUserVipDetail tAppUserVipDetail2 = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one(); |
| | | |
| | | TAppUserVipDetail tAppUserVipDetail1 = new TAppUserVipDetail(); |
| | |
| | | |
| | | R<TVip> info = vipClient.getInfo1(vipId); |
| | | TVip vip = info.getData(); |
| | | List<SendCouponDto> javaList = new ArrayList<>(); |
| | | if (vip.getCoupon()!=null) { |
| | | javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class); |
| | | } |
| | | |
| | | |
| | | tAppUserVipDetail1.setCouponIds(vip.getCoupon()); |
| | | tAppUserVipDetail1.setSendChargeNum(vip.getDiscountTimes()); |
| | | tAppUserVipDetail1.setChargeNum(vip.getDiscountTimes()); |
| | | tAppUserVipDetail1.setDiscountMoney(vip.getMaximumDeduction()); |
| | | tAppUserVipDetail1.setSendMonth(1); |
| | | tAppUserVipDetail.setVipJson(JSON.toJSONString(info.getData())); |
| | | tAppUserVipDetail1.setVipType(type); |
| | | tAppUserVipDetail1.setVipJson(JSON.toJSONString(info.getData())); |
| | | tAppUserVipDetailService.save(tAppUserVipDetail1); |
| | | |
| | | } |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "扫一扫后通过桩编号获取电站信息", tags = {"小程序-扫一扫"}) |
| | | public R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number){ |
| | | SiteInfoVO siteInfoVO = new SiteInfoVO(); |
| | | TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getNumber, number).one(); |
| | | TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getCode, number).one(); |
| | | Site byId = siteService.getById(one.getSiteId()); |
| | | TAccountingStrategy byId1 = accountingStrategyService.getById(byId.getAccountingStrategyId()); |
| | | List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list(); |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.chargingPile.api.dto.TAccountingStrategyDTO; |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | | import com.ruoyi.chargingPile.api.query.TAccountingStrategyQuery; |
| | |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.SteategyPassDto; |
| | | import com.ruoyi.common.core.enums.AuditStateEnum; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.domain.BaseDelete; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private TChargingPileService chargingPileService; |
| | | @Autowired |
| | | private ISiteService siteService; |
| | | @Autowired |
| | | private SysUserClient sysUserClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | private SysUserClient sysUserClient; |
| | | |
| | | @Autowired |
| | | public TAccountingStrategyController(TAccountingStrategyService accountingStrategyService, TAccountingStrategyDetailService accountingStrategyDetailService) { |
| | |
| | | return AjaxResult.error("同阶段费率值需一致"); |
| | | } |
| | | // 判断修改的计费策略是否为已通过 |
| | | if(dto.getAuditStatus() == 3 || dto.getAuditStatus() == 4){ |
| | | if(null != dto.getAuditStatus() && (dto.getAuditStatus() == 3 || dto.getAuditStatus() == 4)){ |
| | | // 查询是否有下级审核中的策略 |
| | | TAccountingStrategy children = accountingStrategyService.getOne(Wrappers.lambdaQuery(TAccountingStrategy.class) |
| | | .eq(TAccountingStrategy::getParentId, dto.getId()) |
| | |
| | | |
| | | } |
| | | }else { |
| | | if (byId.getAuditStatus()==1){ |
| | | |
| | | byId.setFirstRemark(steategyPassDto.getRemark()); |
| | | |
| | | }else if (byId.getAuditStatus()==2){ |
| | | byId.setTwoRemark(steategyPassDto.getRemark()); |
| | | } |
| | | |
| | | byId.setAuditStatus(4); |
| | | } |
| | | accountingStrategyService.updateById(byId); |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "列表") |
| | | @PostMapping(value = "/page") |
| | | public AjaxResult<Page<TApplyChargingPile>> page(ApplyChargingQuery applyChargingQuery) { |
| | | public AjaxResult<Page<TApplyChargingPile>> page(@RequestBody ApplyChargingQuery applyChargingQuery) { |
| | | Page<TApplyChargingPile> page = applyChargingPileService.lambdaQuery() |
| | | .like(applyChargingQuery.getLandlordPhone() != null && !applyChargingQuery.getLandlordPhone().equals(""), TApplyChargingPile::getLandlordPhone, applyChargingQuery.getLandlordPhone()) |
| | | .page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize())); |
| | |
| | | return; |
| | | } |
| | | } |
| | | filterChain.doFilter(request, response); |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | } |
| | | |
| | | |
| | |
| | | List<TAccountingStrategyVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | List<Integer> parentIds = list.stream().map(TAccountingStrategyVO::getId).collect(Collectors.toList()); |
| | | List<TAccountingStrategy> list1 = this.list(Wrappers.lambdaQuery(TAccountingStrategy.class) |
| | | .in(TAccountingStrategy::getParentId, parentIds) |
| | | .in(!parentIds.isEmpty(),TAccountingStrategy::getParentId, parentIds) |
| | | .in(TAccountingStrategy::getAuditStatus, Arrays.asList(1,2))); |
| | | for (TAccountingStrategyVO tAccountingStrategyVO : list) { |
| | | SysUser data = sysUserClient.getSysUser(tAccountingStrategyVO.getUserId()).getData(); |
| | |
| | | } |
| | | } |
| | | }else{ |
| | | siteIds = new HashSet<>(siteId); |
| | | siteIds = new HashSet<>(); |
| | | siteIds.add(siteId); |
| | | } |
| | | PageInfo<TChargingPileNotification> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); |
| | | List<TChargingPileNotification> list = this.baseMapper.chargingPileNotificationPageList(pageInfo, siteIds); |
| | |
| | | private String phone; |
| | | @Excel(name = "备注",width = 30) |
| | | private String remark; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "申请时间",width = 30,exportFormat="yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "申请时间",width = 30) |
| | | private String createTime; |
| | | |
| | | |
| | |
| | | String imgUrl = ""; |
| | | if(tExchangeOrder.getOrderType() == 1){ |
| | | TGoods goods = goodsClient.getGoodsById(tExchangeOrder.getGoodsId()).getData(); |
| | | name = goods.getName(); |
| | | imgUrl = goods.getCoverPicture(); |
| | | if(null != goods){ |
| | | name = goods.getName(); |
| | | imgUrl = goods.getCoverPicture(); |
| | | } |
| | | }else{ |
| | | TCoupon coupon = couponClient.getCouponById1(tExchangeOrder.getCouponId()).getData(); |
| | | name = coupon.getName(); |
| | | imgUrl = coupon.getCoverPicture(); |
| | | if(null != coupon){ |
| | | name = coupon.getName(); |
| | | imgUrl = coupon.getCoverPicture(); |
| | | } |
| | | } |
| | | exchangeOrderList.setName(name); |
| | | exchangeOrderList.setImgUrl(imgUrl); |
| | |
| | | String imgUrl = ""; |
| | | if(exchangeOrder.getOrderType() == 1){ |
| | | TGoods goods = goodsClient.getGoodsById(exchangeOrder.getGoodsId()).getData(); |
| | | name = goods.getName(); |
| | | imgUrl = goods.getCoverPicture(); |
| | | if(null != goods){ |
| | | name = goods.getName(); |
| | | imgUrl = goods.getCoverPicture(); |
| | | } |
| | | }else{ |
| | | TCoupon coupon = couponClient.getCouponById1(exchangeOrder.getCouponId()).getData(); |
| | | info.setCouponType(coupon.getType()); |
| | | info.setDays(coupon.getDays()); |
| | | info.setEndTime(coupon.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | name = coupon.getName(); |
| | | imgUrl = coupon.getCoverPicture(); |
| | | if(null != coupon){ |
| | | info.setCouponType(coupon.getType()); |
| | | info.setDays(coupon.getDays()); |
| | | info.setEndTime(coupon.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | name = coupon.getName(); |
| | | imgUrl = coupon.getCoverPicture(); |
| | | } |
| | | } |
| | | info.setName(name); |
| | | info.setImgUrl(imgUrl); |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | PageInfo<TOrderAppealVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TOrderAppealVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | List<Long> orderIds = list.stream().map(TOrderAppealVO::getOrderId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(orderIds)){ |
| | | return new PageInfo<>(); |
| | | } |
| | | // 查询当前页的订单 |
| | | List<TChargingOrder> chargingOrders = chargingOrderMapper.selectList(Wrappers.lambdaQuery(TChargingOrder.class) |
| | | .in(TChargingOrder::getId, orderIds)); |
| | |
| | | </select> |
| | | <select id="getchargingCapacity" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d %H' ) as time, |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(charging_capacity) as chargingCapacity |
| | | FROM |
| | | t_charging_order |