Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | @ApiModelProperty("剩余天数") |
| | | @TableField(exist = false) |
| | | private Long lastDays; |
| | | @ApiModelProperty(value = "单位名称") |
| | | @TableField(exist = false) |
| | | private String companyName; |
| | | |
| | | |
| | | } |
| | |
| | | @PostMapping("/t-vip-order/callBack") |
| | | public R vipCallBack(@RequestParam("code")String code,@RequestParam("outTradeNo")String outTradeNo); |
| | | |
| | | |
| | | /** |
| | | * 管理后台 活动费用统计 |
| | | * @param |
| | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @TableField("code") |
| | | private String code; |
| | | @ApiModelProperty(value = "标题") |
| | | @TableField("title") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | |
| | | |
| | | @ApiModelProperty(value = "服务费税率") |
| | | private BigDecimal serviceTariff; |
| | | |
| | | @ApiModelProperty(value = "uid") |
| | | private String uid; |
| | | @ApiModelProperty(value = "增值服务费税率") |
| | | private BigDecimal addedServiceTariff; |
| | | @ApiModelProperty(value = "电费") |
| | |
| | | import java.util.List; |
| | | @Data |
| | | public class VipInfoDto { |
| | | |
| | | private Integer id; |
| | | @ApiModelProperty("月卡价格") |
| | | private BigDecimal monthlyCard; |
| | | @ApiModelProperty(value = "月卡折扣") |
| | |
| | | return R.ok(page); |
| | | } |
| | | List<Integer> vipIds = new ArrayList<>(); |
| | | vipIds = page.getRecords().stream().map(TAppUser::getVipId).collect(Collectors.toList()); |
| | | // vipIds = page.getRecords().stream().map(TAppUser::getVipId).collect(Collectors.toList()); |
| | | //获取会员map |
| | | R<Map<Integer, String>> vipMap = otherClient.getVipMap(vipIds); |
| | | //循环处理 |
| | |
| | | appUser.setTagName(byIdTag.getData().getName()); |
| | | } |
| | | } |
| | | //匹配vipMap的值 |
| | | appUser.setVipName(vipMap.getData().get(appUser.getVipId())); |
| | | if (appUser.getVipEndTime()!=null&&appUser.getVipEndTime().isAfter(LocalDateTime.now())) { |
| | | //匹配vipMap的值 |
| | | appUser.setVipName(vipMap.getData().get(appUser.getVipId())); |
| | | } |
| | | //累计充电次数 |
| | | R<Long> useOrderCount = chargingOrderClient.useOrderCount(appUser.getId()); |
| | | appUser.setOrderCount(useOrderCount.getData()); |
| | | appUser.setUid(appUser.getId().toString()); |
| | | if (appUser.getCompanyId()!=null){ |
| | | TCompany data = otherClient.unitDetail(appUser.getCompanyId()).getData(); |
| | | if (data!=null){ |
| | | appUser.setCompanyName(data.getName()); |
| | | } |
| | | } |
| | | |
| | | TAppUserCar one1 = appUserCarService.lambdaQuery().eq(TAppUserCar::getAppUserId, appUser.getId()).orderByDesc(BasePojo::getCreateTime).last("limit 1").one(); |
| | | if (one1!=null){ |
| | |
| | | package com.ruoyi.account.task; |
| | | |
| | | |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserVipDetail; |
| | | import com.ruoyi.account.service.TAppUserService; |
| | | import com.ruoyi.account.service.TAppUserVipDetailService; |
| | | import org.intellij.lang.annotations.RegExp; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Resource |
| | | private TAppUserVipDetailService tAppUserVipDetailService; |
| | | |
| | | @Resource |
| | | private TAppUserService appUserService; |
| | | |
| | | |
| | | /** |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void changeVipId(){ |
| | | LocalDate currentDate = LocalDate.now(); |
| | | List<TAppUserVipDetail> recentDetails = tAppUserVipDetailService.lambdaQuery() |
| | | .le(TAppUserVipDetail::getStartTime, currentDate) |
| | | .ge(TAppUserVipDetail::getEndTime, currentDate) |
| | | .orderByDesc(TAppUserVipDetail::getStartTime).list(); |
| | | for (TAppUserVipDetail recentDetail : recentDetails) { |
| | | TAppUser byId = appUserService.getById(recentDetail.getAppUserId()); |
| | | if (byId!=null) { |
| | | byId.setVipId(recentDetail.getVipId()); |
| | | appUserService.updateById(byId); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | "]}"; |
| | | String hp = num.substring(0, 2);// |
| | | JSONObject jsonObject = JSONObject.parseObject(jsonStr); |
| | | JSONArray data = jsonObject.getJSONArray("data"); |
| | | JSONArray data = jsonObject.getJSONArray("date"); |
| | | List<CarNumDto> carNumDtos = JSONObject.parseArray(data.toJSONString(), CarNumDto.class); |
| | | CarNumDto carNumDto = new CarNumDto(); |
| | | for (CarNumDto carNumDtoTemp : carNumDtos) { |
| | | if (StringUtils.equals(carNumDto.getCode(), hp)) { |
| | | if (carNumDtoTemp.getCode().equals(hp)) { |
| | | carNumDto.setCity(carNumDtoTemp.getCity()); |
| | | carNumDto.setCode(carNumDtoTemp.getCode()); |
| | | carNumDto.setProvince(carNumDtoTemp.getProvince()); |
| | |
| | | @ApiOperation(value = "下载", tags = {"管理后台-结算表记录"}) |
| | | @PutMapping("/downloadSettlement") |
| | | @Log(title = "【结算表记录】下载结算表", businessType = BusinessType.EXPORT) |
| | | public R downloadSettlement(String uid,HttpServletResponse response) |
| | | public R downloadSettlement(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | TSettlementConfirm data = chargingOrderClient.downloadSettlement(uid).getData(); |
| | | TSettlementConfirm data = chargingOrderClient.downloadSettlement(uid.getUid()).getData(); |
| | | List<Site> data1 = siteClient.getSiteByIds(Arrays.asList(data.getSiteId())).getData(); |
| | | if (!data1.isEmpty()){ |
| | | data.setSiteName(data1.get(0).getName()); |
| | |
| | | SysUser data = sysUserClient.getSysUser(tAccountingStrategyVO.getUserId()).getData(); |
| | | tAccountingStrategyVO.setUserName(data.getNickName()); |
| | | if (tAccountingStrategyVO.getFirstUserId()!=null){ |
| | | SysUser first = sysUserClient.getSysUser(tAccountingStrategyVO.getUserId()).getData(); |
| | | SysUser first = sysUserClient.getSysUser(tAccountingStrategyVO.getFirstUserId()).getData(); |
| | | tAccountingStrategyVO.setFirstUserName(first==null?null:first.getNickName()); |
| | | } |
| | | if (tAccountingStrategyVO.getTwoUserId()!=null){ |
| | | SysUser two = sysUserClient.getSysUser(tAccountingStrategyVO.getUserId()).getData(); |
| | | SysUser two = sysUserClient.getSysUser(tAccountingStrategyVO.getTwoUserId()).getData(); |
| | | tAccountingStrategyVO.setTwoUserName(two==null?null:two.getNickName()); |
| | | } |
| | | // 匹配编辑后的未审核的 |
| | |
| | | |
| | | TVipOrder one = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, code).one(); |
| | | one.setSerialNumber(outTradeNo); |
| | | one.setPaymentStatus(2); |
| | | vipOrderService.updateById(one); |
| | | GiveVipDto giveVipDto = new GiveVipDto(); |
| | | giveVipDto.setVipId(one.getVipId()); |
| | |
| | | for (TChargingPile datum : data) { |
| | | bigDecimal = bigDecimal.add(datum.getRatedPower()); |
| | | } |
| | | BigDecimal bigDecimal1 = bigDecimal.divide(new BigDecimal(data.size())).setScale(2, RoundingMode.HALF_DOWN); |
| | | |
| | | |
| | | tSettlementConfirm.setIncome(tSettlementConfirm.getElectrovalence().add(tSettlementConfirm.getServiceCharge())); |
| | | // todo 计算利用率 该电站充电桩本月利用率: |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | addOrderInvoice.setAppUserId(userId); |
| | | addOrderInvoice.setCode(code); |
| | | addOrderInvoice.setStatus(1); |
| | | addOrderInvoice.setCreateTime(LocalDateTime.now()); |
| | | this.save(addOrderInvoice); |
| | | //获取开票类型 |
| | | TInvoiceType invoiceType = invoiceTypeClient.getInvoiceType(addOrderInvoice.getInvoiceTypeId()).getData(); |
| | |
| | | PageInfo<TOrderInvoiceVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TOrderInvoiceVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (TOrderInvoiceVO tOrderInvoiceVO : list) { |
| | | tOrderInvoiceVO.setUid(tOrderInvoiceVO.getId().toString()); |
| | | List<Long> collect = orderInvoiceDetailService.lambdaQuery().eq(TOrderInvoiceDetail::getOrderInvoiceId, tOrderInvoiceVO.getId()) |
| | | .eq(TOrderInvoiceDetail::getOrderType, 1).list().stream() |
| | | .map(TOrderInvoiceDetail::getOrderId).collect(Collectors.toList()); |
| | |
| | | <if test="data.createTime2 != null"> |
| | | AND o.create_time <= #{data.createTime2} |
| | | </if> |
| | | <if test="data.ids != null and data.ids() > 0"> |
| | | <if test="data.ids != null and data.ids.size() > 0"> |
| | | AND o.id IN |
| | | <foreach collection="data.ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | |
| | | public R delete(@RequestParam("id") Integer id) { |
| | | return R.ok(companyService.removeById(id)); |
| | | } |
| | | |
| | | @PostMapping(value = "/unit/detail") |
| | | public R detail(@RequestParam("id") Integer id) { |
| | | return R.ok(companyService.getById(id)); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "集团用户列表") |
| | | @PostMapping(value = "/page") |
| | | public R<Page<TEnterpriseUserApplication>> page(EnterpriseQuery enterpriseQuery) { |
| | | public R<Page<TEnterpriseUserApplication>> page(@RequestBody EnterpriseQuery enterpriseQuery) { |
| | | // 用户id |
| | | if (enterpriseQuery.getPhone()!=null) { |
| | | List<Long> userIds = appUserClient.getUserIdsByPhone(enterpriseQuery.getPhone()).getData(); |
| | | if (userIds.isEmpty()){ |
| | | return R.ok(); |
| | | } |
| | | Page<TEnterpriseUserApplication> page = enterpriseUserApplicationService.lambdaQuery().in(TEnterpriseUserApplication::getAppUserId, userIds).page(Page.of(enterpriseQuery.getPageCurr(), enterpriseQuery.getPageSize())); |
| | | return R.ok(page); |
| | | }else { |
| | | Page<TEnterpriseUserApplication> page = enterpriseUserApplicationService.lambdaQuery().page(Page.of(enterpriseQuery.getPageCurr(), enterpriseQuery.getPageSize())); |
| | | // if (enterpriseQuery.getPhone()!=null) { |
| | | // List<Long> userIds = appUserClient.getUserIdsByPhone(enterpriseQuery.getPhone()).getData(); |
| | | // if (userIds.isEmpty()){ |
| | | // return R.ok(); |
| | | // } |
| | | // Page<TEnterpriseUserApplication> page = enterpriseUserApplicationService.lambdaQuery().in(TEnterpriseUserApplication::getAppUserId, userIds).page(Page.of(enterpriseQuery.getPageCurr(), enterpriseQuery.getPageSize())); |
| | | // return R.ok(page); |
| | | // }else { |
| | | Page<TEnterpriseUserApplication> page = enterpriseUserApplicationService.lambdaQuery().eq(enterpriseQuery.getPhone()!=null&&enterpriseQuery.getPhone()!="",TEnterpriseUserApplication::getPhone,enterpriseQuery.getPhone()).page(Page.of(enterpriseQuery.getPageCurr(), enterpriseQuery.getPageSize())); |
| | | return R.ok(page); |
| | | } |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | vipInfoDto.setDoubleIntegration(vip.getDoubleIntegration()); |
| | | vipInfoDto.setMallExclusivePrice(vip.getMallExclusivePrice()); |
| | | vipInfoDto.setName(vip.getName()); |
| | | vipInfoDto.setId(vip.getId()); |
| | | List<SendCouponDto> javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class); |
| | | List<VipCouponDto> vipCouponDtos = new ArrayList<>(); |
| | | if (!javaList.isEmpty()){ |
| | |
| | | |
| | | @ApiOperation(value = "购买会员", tags = {"小程序-个人中心"}) |
| | | @GetMapping("/vipInfo/pay") |
| | | public R vipInfoPay(@RequestParam("vipId")Integer vipId,@RequestParam(name = "1月2季3年",value = "buyType") Integer buyType, |
| | | @RequestParam(name = "1微信2支付宝",value = "payType") Integer payType |
| | | public R vipInfoPay(@RequestParam("vipId")Integer vipId,@RequestParam("buyType") Integer buyType, |
| | | @RequestParam("payType") Integer payType |
| | | ) { |
| | | |
| | | TVip byId = vipService.getById(vipId); |
| | |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import com.ruoyi.other.mapper.TCouponMapper; |
| | | import com.ruoyi.other.mapper.TVipMapper; |
| | | import com.ruoyi.other.service.TVipService; |
| | |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | @Override |
| | | public Object vipInfoPay(TVip byId, BigDecimal payMoney, Integer payType,BigDecimal discountMoney,BigDecimal discount,Integer buyType, Long userId) { |
| | | TAppUser user = appUserClient.getUserById(userId).getData(); |
| | | |
| | | |
| | | //生成会员购买订单 |
| | | |
| | | TVipOrder shopOrder = new TVipOrder(); |
| | | shopOrder.setCode(OrderCodeUtil.getOrderCode("HY")); |
| | | shopOrder.setType(1); |
| | | |
| | | shopOrder.setAppUserId(userId); |
| | | shopOrder.setType(1); |
| | | shopOrder.setVipId(byId.getId()); |
| | | shopOrder.setTitle(byId.getName()); |
| | | if (buyType==1){ |
| | | shopOrder.setTitle(byId.getName()+"月卡"); |
| | | }else if (buyType==2){ |
| | | shopOrder.setTitle(byId.getName()+"季卡"); |
| | | }else { |
| | | shopOrder.setTitle(byId.getName()+"年卡"); |
| | | } |
| | | shopOrder.setVipType(buyType); |
| | | shopOrder.setOrderAmount(payMoney.add(discountMoney)); |
| | | shopOrder.setDiscount(discount); |
| | |
| | | paymentOrder.setAmount(shopOrder.getPaymentAmount()); |
| | | paymentOrder.setOpenId(user.getWxOpenid()); |
| | | paymentOrder.setDescription("购买会员"); |
| | | return wxPaymentClient.orderPay(paymentOrder); |
| | | return wxPaymentClient.orderPay(paymentOrder).getData(); |
| | | }else { |
| | | AliPaymentReq req = new AliPaymentReq(); |
| | | req.setOutTradeNo(shopOrder.getCode()); |
| | |
| | | System.err.println("----收到购物回调"); |
| | | break; |
| | | case "HY": |
| | | orderClient.vipCallBack(out_trade_no,outRefundNo); |
| | | System.err.println("----收到会员回调"); |
| | | break; |
| | | } |
| | |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb |
| | | username: nacos |
| | | password: nacos |
| | | ip: 192.168.110.85 |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.110.169:8848 |