ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/UserListQueryDto.java
@@ -8,6 +8,8 @@ public class UserListQueryDto extends BasePage { @ApiModelProperty(value = "用户手机号") String userPhone; @ApiModelProperty(value = "所在省code") String provinceCode; @ApiModelProperty(value = "所在地code") String cityCode; @ApiModelProperty(value = "状态 1正常2冻结 3注销") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
@@ -56,6 +56,10 @@ @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") ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
@@ -66,7 +66,6 @@ private String avatar; /** 密码 */ @NotBlank(message = "密码不能为空") private String password; /** 帐号状态(0正常 1停用) */ ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/SysUserFallbackFactory.java
@@ -100,12 +100,6 @@ @Override public R addSysUser(SysUser user) { // 手动进行全局事务回滚 try { GlobalTransactionContext.getCurrent().rollback(); } catch (TransactionException e) { throw new RuntimeException(e); } return R.fail("添加用户失败:" + cause.getMessage()); } ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/handler/GlobalExceptionHandler.java
@@ -27,138 +27,127 @@ /** * 全局异常处理器 * * * @author ruoyi */ @RestControllerAdvice public class GlobalExceptionHandler { private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); @Value("${spring.servlet.multipart.max-file-size:4MB}") private String maxFileSize; @Value("${spring.servlet.multipart.max-request-size:100MB}") private String maxRequestSize; /** * 权限码异常 */ @ExceptionHandler(NotPermissionException.class) public AjaxResult handleNotPermissionException(NotPermissionException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',权限码校验失败'{}'", requestURI, e.getMessage()); return AjaxResult.error(HttpStatus.FORBIDDEN, "没有访问权限,请联系管理员授权"); } /** * 角色权限异常 */ @ExceptionHandler(NotRoleException.class) public AjaxResult handleNotRoleException(NotRoleException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',角色权限校验失败'{}'", requestURI, e.getMessage()); return AjaxResult.error(HttpStatus.FORBIDDEN, "没有访问权限,请联系管理员授权"); } /** * 请求方式不支持 */ @ExceptionHandler(HttpRequestMethodNotSupportedException.class) public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod()); return AjaxResult.error(e.getMessage()); } /** * 业务异常 */ @ExceptionHandler(ServiceException.class) public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) { log.error(e.getMessage(), e); Integer code = e.getCode(); return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); } /** * 拦截未知的运行时异常 */ @ExceptionHandler(RuntimeException.class) public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',发生未知异常.", requestURI, e); return AjaxResult.error(e.getMessage()); } /** * 系统异常 */ @ExceptionHandler(Exception.class) public AjaxResult handleException(Exception e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',发生系统异常.", requestURI, e); return AjaxResult.error(e.getMessage()); } /** * 自定义验证异常 */ @ExceptionHandler(BindException.class) public AjaxResult handleBindException(BindException e) { log.error(e.getMessage(), e); String message = e.getAllErrors().get(0).getDefaultMessage(); return AjaxResult.error(message); } /** * 自定义验证异常 */ @ExceptionHandler(MethodArgumentNotValidException.class) public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { log.error(e.getMessage(), e); String message = e.getBindingResult().getFieldError().getDefaultMessage(); return AjaxResult.error(message); } /** * 内部认证异常 */ @ExceptionHandler(InnerAuthException.class) public AjaxResult handleInnerAuthException(InnerAuthException e) { return AjaxResult.error(e.getMessage()); } /** * 演示模式异常 */ @ExceptionHandler(DemoModeException.class) public AjaxResult handleDemoModeException(DemoModeException e) { return AjaxResult.error("演示模式,不允许操作"); } @ExceptionHandler(MaxUploadSizeExceededException.class) public AjaxResult fileUpLoad(MaxUploadSizeExceededException e) { log.error("上传文件异常 => : {}", e.getMessage()); return AjaxResult.error("文件识别大小超出限制,允许的大小在" + maxFileSize); } /** * 学生端单点登录-异常信息 */ @ExceptionHandler(UserAppletException.class) public AjaxResult<String> studyLoginExceptionHandler(UserAppletException e) { return AjaxResult.error(e.getCode(), e.getMessage()); } public class GlobalExceptionHandler { private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); @Value("${spring.servlet.multipart.max-file-size:50MB}") private String maxFileSize; @Value("${spring.servlet.multipart.max-request-size:100MB}") private String maxRequestSize; /** * 权限码异常 */ @ExceptionHandler(NotPermissionException.class) public AjaxResult handleNotPermissionException(NotPermissionException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',权限码校验失败'{}'", requestURI, e.getMessage()); return AjaxResult.error(HttpStatus.FORBIDDEN, "没有访问权限,请联系管理员授权"); } /** * 角色权限异常 */ @ExceptionHandler(NotRoleException.class) public AjaxResult handleNotRoleException(NotRoleException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',角色权限校验失败'{}'", requestURI, e.getMessage()); return AjaxResult.error(HttpStatus.FORBIDDEN, "没有访问权限,请联系管理员授权"); } /** * 请求方式不支持 */ @ExceptionHandler(HttpRequestMethodNotSupportedException.class) public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod()); return AjaxResult.error(e.getMessage()); } /** * 业务异常 */ @ExceptionHandler(ServiceException.class) public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) { log.error(e.getMessage(), e); Integer code = e.getCode(); return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); } /** * 拦截未知的运行时异常 */ @ExceptionHandler(RuntimeException.class) public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',发生未知异常.", requestURI, e); throw new RuntimeException(e.getMessage()); } /** * 系统异常 */ @ExceptionHandler(Exception.class) public AjaxResult handleException(Exception e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("请求地址'{}',发生系统异常.", requestURI, e); return AjaxResult.error(e.getMessage()); } /** * 自定义验证异常 */ @ExceptionHandler(BindException.class) public AjaxResult handleBindException(BindException e) { log.error(e.getMessage(), e); String message = e.getAllErrors().get(0).getDefaultMessage(); return AjaxResult.error(message); } /** * 自定义验证异常 */ @ExceptionHandler(MethodArgumentNotValidException.class) public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { log.error(e.getMessage(), e); String message = e.getBindingResult().getFieldError().getDefaultMessage(); return AjaxResult.error(message); } /** * 内部认证异常 */ @ExceptionHandler(InnerAuthException.class) public AjaxResult handleInnerAuthException(InnerAuthException e) { return AjaxResult.error(e.getMessage()); } /** * 演示模式异常 */ @ExceptionHandler(DemoModeException.class) public AjaxResult handleDemoModeException(DemoModeException e) { return AjaxResult.error("演示模式,不允许操作"); } @ExceptionHandler(MaxUploadSizeExceededException.class) public AjaxResult fileUpLoad(MaxUploadSizeExceededException e) { log.error("上传文件异常 => : {}", e.getMessage()); return AjaxResult.error("文件识别大小超出限制,允许的大小在" + maxFileSize); } /** * 学生端单点登录-异常信息 */ @ExceptionHandler(UserAppletException.class) public AjaxResult<String> studyLoginExceptionHandler(UserAppletException e) { return AjaxResult.error(e.getCode(), e.getMessage()); } } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/RuoYiSystemApplication.java
@@ -6,6 +6,7 @@ import com.ruoyi.common.security.annotation.EnableCustomConfig; import com.ruoyi.common.security.annotation.EnableRyFeignClients; import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.transaction.annotation.EnableTransactionManagement; /** @@ -21,8 +22,7 @@ @EnableTransactionManagement public class RuoYiSystemApplication { public static void main(String[] args) { public static void main(String[] args) { SpringApplication.run(RuoYiSystemApplication.class, args); System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" + " .-------. ____ __ \n" + ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -19,6 +19,7 @@ import com.ruoyi.system.query.GetSysUserList; import com.ruoyi.system.query.ShopUserStart; import com.ruoyi.system.service.*; import io.seata.core.context.RootContext; import io.seata.spring.annotation.GlobalTransactional; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -678,7 +679,8 @@ @ResponseBody @PostMapping("/addSysUser") @Transactional(rollbackFor = Exception.class) public R addSysUser(@RequestBody SysUser user){ public R addSysUser(@RequestBody SysUser user) { System.err.println("事务ID:" + RootContext.getXID()); if(StringUtils.isEmpty(user.getUserName())){ user.setUserName(user.getPhonenumber()); } ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
@@ -45,7 +45,7 @@ enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: false #关闭数据库代理 enable-auto-data-source-proxy: false service: vgroup-mapping: seata_tx_group: default ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -123,10 +123,10 @@ <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 </select> <select id="getList" resultType="com.ruoyi.system.api.domain.SysUser"> select *,nick_name nickName,login_date loginDate,create_time createTime,user_id userId from sys_user where 1=1 <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}) ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -223,6 +223,7 @@ 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()) @@ -672,7 +673,7 @@ plusDay = 12; } //增加vipDetail giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay); giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay,giveVipDto.getType()); appUserService.updateById(nowUser); } return R.ok(); @@ -976,10 +977,17 @@ 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); ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TInvoiceInformationController.java
@@ -89,7 +89,7 @@ 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())){ ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarNumDto.java
@@ -8,5 +8,6 @@ private String pcode; private String province; private String city; private String code; private String Hp; private String AreaCode; } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/CarUtil.java
Diff too large ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java
@@ -31,11 +31,11 @@ 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()); @@ -56,6 +56,7 @@ tAppUserVipDetail.setDiscountMoney(vip.getMaximumDeduction()); tAppUserVipDetail.setSendMonth(1); tAppUserVipDetail.setVipJson(JSON.toJSONString(info.getData())); tAppUserVipDetail.setVipType(type); tAppUserVipDetailService.save(tAppUserVipDetail); //直接赠送优惠卷 for (SendCouponDto sendCouponDto : javaList) { @@ -83,20 +84,21 @@ }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(); @@ -107,20 +109,18 @@ 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); } // } } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/RuoYiChargingPileApplication.java
@@ -6,6 +6,7 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.annotation.EnableTransactionManagement; ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
@@ -111,7 +111,7 @@ @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(); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
@@ -1,10 +1,7 @@ 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.BatchSetAccountingStrategy; @@ -17,11 +14,8 @@ 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; @@ -29,7 +23,6 @@ import com.ruoyi.integration.api.feignClient.IntegrationClient; 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; @@ -144,7 +137,7 @@ 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()) @@ -351,6 +344,14 @@ } }else { if (byId.getAuditStatus()==1){ byId.setFirstRemark(steategyPassDto.getRemark()); }else if (byId.getAuditStatus()==2){ byId.setTwoRemark(steategyPassDto.getRemark()); } byId.setAuditStatus(4); } accountingStrategyService.updateById(byId); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java
@@ -130,7 +130,7 @@ @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())); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/filter/AuthFilter.java
@@ -81,7 +81,7 @@ return; } } filterChain.doFilter(request, response); filterChain.doFilter(servletRequest, servletResponse); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
@@ -25,7 +25,10 @@ import com.ruoyi.system.api.feignClient.SysUserRoleClient; import com.ruoyi.system.api.model.GetSysRoleByIds; import com.ruoyi.system.api.model.SysUserRoleVo; import io.seata.core.context.RootContext; import io.seata.core.exception.TransactionException; import io.seata.spring.annotation.GlobalTransactional; import io.seata.tm.api.GlobalTransactionContext; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -111,6 +114,7 @@ @Override @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult addPartner(Partner partner) { System.err.println("事务ID:" + RootContext.getXID()); //校验参数和重复数据 AjaxResult ajaxResult = addPartnerParameterCheck(partner); if(ajaxResult.isError()){ @@ -144,7 +148,16 @@ user.setRoleId(partner.getRoleId().longValue()); user.setRoleType(2); user.setObjectId(partner.getId()); sysUserClient.addSysUser(user); R r = sysUserClient.addSysUser(user); if(r.getCode() != 200){ // 手动进行全局事务回滚 try { GlobalTransactionContext.getCurrent().rollback(); } catch (TransactionException e) { throw new RuntimeException(e); } return AjaxResult.error(r.getMsg()); } return AjaxResult.success(); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java
@@ -40,7 +40,7 @@ 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(); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java
@@ -210,6 +210,13 @@ } List<Map<Integer, Integer>> modeStatistics = this.baseMapper.getModeStatistics(siteIds); if(CollectionUtils.isEmpty(modeStatistics)){ Map<Integer, Integer> modeStatistics1 = new HashMap<>(3,0); modeStatistics1.put(1, 0); modeStatistics1.put(2, 0); modeStatistics1.put(3, 0); modeStatistics.add(modeStatistics1); } gunStatusStatisticsVO.setModeStatistics(modeStatistics); List<Map<Integer, Integer>> statusStatistics = new ArrayList<>(); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileNotificationServiceImpl.java
@@ -83,7 +83,8 @@ } } }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); ruoyi-service/ruoyi-chargingPile/src/main/resources/bootstrap.yml
@@ -46,7 +46,7 @@ enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: false #关闭数据库代理 enable-auto-data-source-proxy: false service: vgroup-mapping: seata_tx_group: default ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/produce/IotMessageProduce.java
@@ -1,5 +1,6 @@ package com.ruoyi.integration.iotda.utils.produce; import com.alibaba.fastjson2.JSONObject; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; @@ -34,7 +35,7 @@ * @return */ @PostMapping("/sendMessage") public String sendMessage(String deviceId,String name,String message){ public String sendMessage(String deviceId, String name, JSONObject message){ CreateMessageRequest request = new CreateMessageRequest(); request.withDeviceId(deviceId); DeviceMessageRequest body = new DeviceMessageRequest(); ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/tools/MessageUtil.java
@@ -61,7 +61,7 @@ * @param onlineReply 实体对象 * @return */ public String onlineReply(OnlineReply onlineReply){ public JSONObject onlineReply(OnlineReply onlineReply){ onlineReplyService.create(onlineReply); return getMessageJsonString(onlineReply, ServiceIdMenu.ONLINE_REPLY.getValue()); } @@ -71,7 +71,7 @@ * @param pong 实体对象 * @return */ public String pong(Pong pong){ public JSONObject pong(Pong pong){ pongService.create(pong); return getMessageJsonString(pong, ServiceIdMenu.PONG.getValue()); } @@ -81,7 +81,7 @@ * @param billingModeVerifyReply 实体对象 * @return */ public String billingModeVerifyReply(BillingModeVerifyReply billingModeVerifyReply){ public JSONObject billingModeVerifyReply(BillingModeVerifyReply billingModeVerifyReply){ billingModeVerifyReplyService.create(billingModeVerifyReply); return getMessageJsonString(billingModeVerifyReply, ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getValue()); } @@ -91,7 +91,7 @@ * @param acquisitionBillingModeReply 实体对象 * @return */ public String acquisitionBillingModeReply(AcquisitionBillingModeReply acquisitionBillingModeReply){ public JSONObject acquisitionBillingModeReply(AcquisitionBillingModeReply acquisitionBillingModeReply){ acquisitionBillingModeReplyService.create(acquisitionBillingModeReply); return getMessageJsonString(acquisitionBillingModeReply, ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getValue()); } @@ -101,7 +101,7 @@ * @param readRealTimeMonitoringData 实体对象 * @return */ public String readRealTimeMonitoringData(ReadRealTimeMonitoringData readRealTimeMonitoringData){ public JSONObject readRealTimeMonitoringData(ReadRealTimeMonitoringData readRealTimeMonitoringData){ readRealTimeMonitoringDataService.create(readRealTimeMonitoringData); return getMessageJsonString(readRealTimeMonitoringData, ServiceIdMenu.READ_REAL_TIME_MONITORING_DATA.getValue()); } @@ -121,7 +121,7 @@ * @param platformConfirmationCharging 实体对象 * @return */ public String platformConfirmationCharging(PlatformConfirmationCharging platformConfirmationCharging){ public JSONObject platformConfirmationCharging(PlatformConfirmationCharging platformConfirmationCharging){ platformConfirmationChargingService.create(platformConfirmationCharging); return getMessageJsonString(platformConfirmationCharging, ServiceIdMenu.PLATFORM_CONFIRMATION_CHARGING.getValue()); } @@ -131,7 +131,7 @@ * @param platformStartCharging 实体对象 * @return */ public String platformStartCharging(PlatformStartCharging platformStartCharging){ public JSONObject platformStartCharging(PlatformStartCharging platformStartCharging){ platformStartChargingService.create(platformStartCharging); return getMessageJsonString(platformStartCharging, ServiceIdMenu.PLATFORM_START_CHARGING.getValue()); } @@ -141,7 +141,7 @@ * @param platformStopCharging 实体对象 * @return */ public String platformStopCharging(PlatformStopCharging platformStopCharging){ public JSONObject platformStopCharging(PlatformStopCharging platformStopCharging){ platformStopChargingService.create(platformStopCharging); return getMessageJsonString(platformStopCharging, ServiceIdMenu.PLATFORM_STOP_CHARGING.getValue()); } @@ -151,7 +151,7 @@ * @param confirmTransactionRecord 实体对象 * @return */ public String confirmTransactionRecord(ConfirmTransactionRecord confirmTransactionRecord){ public JSONObject confirmTransactionRecord(ConfirmTransactionRecord confirmTransactionRecord){ confirmTransactionRecordService.create(confirmTransactionRecord); return getMessageJsonString(confirmTransactionRecord, ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getValue()); } @@ -161,7 +161,7 @@ * @param updateBalance 实体对象 * @return */ public String updateBalance(UpdateBalance updateBalance){ public JSONObject updateBalance(UpdateBalance updateBalance){ updateBalanceService.create(updateBalance); return getMessageJsonString(updateBalance, ServiceIdMenu.UPDATE_BALANCE.getValue()); } @@ -171,7 +171,7 @@ * @param synchronizeOfflineCard 实体对象 * @return */ public String synchronizeOfflineCard(SynchronizeOfflineCard synchronizeOfflineCard){ public JSONObject synchronizeOfflineCard(SynchronizeOfflineCard synchronizeOfflineCard){ synchronizeOfflineCardService.create(synchronizeOfflineCard); return getMessageJsonString(synchronizeOfflineCard, ServiceIdMenu.SYNCHRONIZE_OFFLINE_CARD.getValue()); } @@ -181,7 +181,7 @@ * @param clearOfflineCard 实体对象 * @return */ public String clearOfflineCard(ClearOfflineCard clearOfflineCard){ public JSONObject clearOfflineCard(ClearOfflineCard clearOfflineCard){ clearOfflineCardService.create(clearOfflineCard); return getMessageJsonString(clearOfflineCard, ServiceIdMenu.CLEAR_OFFLINE_CARD.getValue()); } @@ -191,7 +191,7 @@ * @param queryOfflineCard 实体对象 * @return */ public String queryOfflineCard(QueryOfflineCard queryOfflineCard){ public JSONObject queryOfflineCard(QueryOfflineCard queryOfflineCard){ queryOfflineCardService.create(queryOfflineCard); return getMessageJsonString(queryOfflineCard, ServiceIdMenu.QUERY_OFFLINE_CARD.getValue()); } @@ -201,7 +201,7 @@ * @param workingParameterSetting 实体对象 * @return */ public String workingParameterSetting(WorkingParameterSetting workingParameterSetting){ public JSONObject workingParameterSetting(WorkingParameterSetting workingParameterSetting){ workingParameterSettingService.create(workingParameterSetting); return getMessageJsonString(workingParameterSetting, ServiceIdMenu.WORKING_PARAMETER_SETTING.getValue()); } @@ -211,7 +211,7 @@ * @param timingSetting 实体对象 * @return */ public String timingSetting(TimingSetting timingSetting){ public JSONObject timingSetting(TimingSetting timingSetting){ timingSettingService.create(timingSetting); return getMessageJsonString(timingSetting, ServiceIdMenu.TIMING_SETTING.getValue()); } @@ -220,7 +220,7 @@ * @param timingSettingReply 实体对象 * @return */ public String timingSettingReply(TimingSettingReply timingSettingReply){ public JSONObject timingSettingReply(TimingSettingReply timingSettingReply){ timingSettingReplyService.create(timingSettingReply); return getMessageJsonString(timingSettingReply, ServiceIdMenu.TIMING_SETTING_REPLY.getValue()); } @@ -230,7 +230,7 @@ * @param setupBillingModel 实体对象 * @return */ public String setupBillingModel(SetupBillingModel setupBillingModel){ public JSONObject setupBillingModel(SetupBillingModel setupBillingModel){ setupBillingModelService.create(setupBillingModel); return getMessageJsonString(setupBillingModel, ServiceIdMenu.SETUP_BILLING_MODEL.getValue()); } @@ -240,7 +240,7 @@ * @param openOrCloseGroundLock 实体对象 * @return */ public String openOrCloseGroundLock(OpenOrCloseGroundLock openOrCloseGroundLock){ public JSONObject openOrCloseGroundLock(OpenOrCloseGroundLock openOrCloseGroundLock){ openOrCloseGroundLockService.create(openOrCloseGroundLock); return getMessageJsonString(openOrCloseGroundLock, ServiceIdMenu.OPEN_OR_CLOSE_GROUND_LOCK.getValue()); } @@ -249,7 +249,7 @@ * @param platformRestart 实体对象 * @return */ public String platformRestart(PlatformRestart platformRestart){ public JSONObject platformRestart(PlatformRestart platformRestart){ platformRestartService.create(platformRestart); return getMessageJsonString(platformRestart, ServiceIdMenu.PLATFORM_RESTART.getValue()); } @@ -258,7 +258,7 @@ * @param platformRemoteUpdate 实体对象 * @return */ public String platformRemoteUpdate(PlatformRemoteUpdate platformRemoteUpdate){ public JSONObject platformRemoteUpdate(PlatformRemoteUpdate platformRemoteUpdate){ platformRemoteUpdateService.create(platformRemoteUpdate); return getMessageJsonString(platformRemoteUpdate, ServiceIdMenu.PLATFORM_REMOTE_UPDATE.getValue()); } @@ -269,9 +269,9 @@ * @param serviceId 服务ID * @return */ public String getMessageJsonString(Object object, String serviceId){ public JSONObject getMessageJsonString(Object object, String serviceId){ JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(object)); jsonObject.put("service_id", serviceId); return jsonObject.toJSONString(); return jsonObject; } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/dto/TEnterpriseExport.java
@@ -27,8 +27,7 @@ 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; ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -51,10 +51,8 @@ import com.ruoyi.other.api.domain.TGoods; import com.ruoyi.order.vo.ChargingOrderListInfoVO; import com.ruoyi.other.api.domain.TIntegralRule; import com.ruoyi.other.api.feignClient.IntegralRuleClient; import com.ruoyi.other.api.feignClient.OtherClient; import com.ruoyi.other.api.feignClient.RoleSiteClient; import com.ruoyi.other.api.feignClient.UserSiteClient; import com.ruoyi.other.api.domain.TVip; import com.ruoyi.other.api.feignClient.*; import com.ruoyi.payment.api.feignClient.AliPaymentClient; import com.ruoyi.payment.api.feignClient.WxPaymentClient; import com.ruoyi.payment.api.model.RefundReq; @@ -182,6 +180,9 @@ @Resource private IntegralRuleClient integralRuleClient; @Resource private VipClient vipClient; //计数器 private Map<String, Integer> counter_map = new HashMap<>(); @@ -828,13 +829,24 @@ String inviteUsersToEarnPoints = integralRule.getInviteUsersToEarnPoints(); JSONObject jsonObject = JSON.parseObject(inviteUsersToEarnPoints); Integer num1 = jsonObject.getInteger("num1"); TAppUser appUser1 = appUserClient.getUserById(appUser.getInviteUserId()).getData(); if(null != appUser1.getVipId()){ TVip vip = vipClient.getInfo(appUser1.getVipId()).getData(); Integer doubleIntegration = vip.getDoubleIntegration(); //双倍积分 if(1 == doubleIntegration){ num1 *= 2; } } GetInviteUser query = new GetInviteUser(); query.setAppUserId(appUser.getInviteUserId()); query.setAppUserId(appUser1.getId()); query.setBeInvitedAppUserId(chargingOrder.getAppUserId()); TInviteUser inviteUser = inviteUserClient.getInviteUser(query).getData(); if(null == inviteUser){ inviteUser = new TInviteUser(); inviteUser.setAppUserId(appUser.getInviteUserId()); inviteUser.setAppUserId(appUser1.getId()); inviteUser.setBeInvitedAppUserId(chargingOrder.getAppUserId()); inviteUser.setAward(num1); inviteUser.setCreateTime(LocalDateTime.now()); @@ -843,11 +855,10 @@ inviteUser.setAward(num1); inviteUserClient.updateInviteUser(inviteUser); } TAppUser appUser1 = appUserClient.getUserById(appUser.getInviteUserId()).getData(); TAppUserIntegralChange appUserIntegralChange = new TAppUserIntegralChange(); String code = Double.valueOf(Math.random() * 1000).intValue() + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")); appUserIntegralChange.setCode(code); appUserIntegralChange.setAppUserId(appUser.getInviteUserId()); appUserIntegralChange.setAppUserId(appUser1.getId()); appUserIntegralChange.setChangeType(5); appUserIntegralChange.setHistoricalIntegral(appUser1.getPoints()); appUserIntegralChange.setCurrentIntegral(appUser1.getPoints() + num1); @@ -895,7 +906,33 @@ chargingOrder.setStatus(5); chargingOrder.setPaymentAmount(payAmount); this.updateById(chargingOrder); //添加积分 TIntegralRule integralRule = integralRuleClient.getSet().getData(); if(null != integralRule){ TAppUser appUser = appUserClient.getUserById(chargingOrder.getAppUserId()).getData(); Integer num1 = JSON.parseObject(integralRule.getChargeCredit()).getInteger("num1"); Integer integral = payAmount.multiply(new BigDecimal(num1)).intValue(); if(null != appUser.getVipId()){ TVip vip = vipClient.getInfo(appUser.getVipId()).getData(); Integer doubleIntegration = vip.getDoubleIntegration(); //双倍积分 if(1 == doubleIntegration){ integral *= 2; } } TAppUserIntegralChange appUserIntegralChange = new TAppUserIntegralChange(); appUserIntegralChange.setAppUserId(appUser.getId()); appUserIntegralChange.setChangeType(2); appUserIntegralChange.setHistoricalIntegral(appUser.getPoints()); appUser.setPoints(appUser.getPoints() + integral); appUserIntegralChange.setCurrentIntegral(appUser.getPoints()); appUserIntegralChange.setCreateTime(LocalDateTime.now()); appUserClient.updateAppUser(appUser); appUserIntegralChangeClient.addAppUserIntegralChange(appUserIntegralChange); } //计算优惠券 if(null != chargingOrder.getAppCouponId()){ //判断实际充电金额是否满足优惠券使用条件,如果不满足则不适用优惠券。 @@ -990,6 +1027,7 @@ } } @@ -1585,7 +1623,7 @@ //计算费用,处理退款 endCharge(chargingOrder); //处理推荐奖励(被推荐首单奖励) TAppUser appUser = appUserClient.getUserById(chargingOrder.getAppUserId()).getData(); long count = this.count(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getAppUserId, chargingOrder.getAppUserId()) @@ -1595,13 +1633,24 @@ String inviteUsersToEarnPoints = integralRule.getInviteUsersToEarnPoints(); JSONObject jsonObject = JSON.parseObject(inviteUsersToEarnPoints); Integer num1 = jsonObject.getInteger("num1"); TAppUser appUser1 = appUserClient.getUserById(appUser.getInviteUserId()).getData(); if(null != appUser1.getVipId()){ TVip vip = vipClient.getInfo(appUser1.getVipId()).getData(); Integer doubleIntegration = vip.getDoubleIntegration(); //双倍积分 if(1 == doubleIntegration){ num1 *= 2; } } GetInviteUser query = new GetInviteUser(); query.setAppUserId(appUser.getInviteUserId()); query.setAppUserId(appUser1.getId()); query.setBeInvitedAppUserId(chargingOrder.getAppUserId()); TInviteUser inviteUser = inviteUserClient.getInviteUser(query).getData(); if(null == inviteUser){ inviteUser = new TInviteUser(); inviteUser.setAppUserId(appUser.getInviteUserId()); inviteUser.setAppUserId(appUser1.getId()); inviteUser.setBeInvitedAppUserId(chargingOrder.getAppUserId()); inviteUser.setAward(num1); inviteUser.setCreateTime(LocalDateTime.now()); @@ -1610,20 +1659,20 @@ inviteUser.setAward(num1); inviteUserClient.updateInviteUser(inviteUser); } TAppUser appUser1 = appUserClient.getUserById(appUser.getInviteUserId()).getData(); TAppUserIntegralChange appUserIntegralChange = new TAppUserIntegralChange(); String code = Double.valueOf(Math.random() * 1000).intValue() + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")); appUserIntegralChange.setCode(code); appUserIntegralChange.setAppUserId(appUser.getInviteUserId()); appUserIntegralChange.setAppUserId(appUser1.getId()); appUserIntegralChange.setChangeType(5); appUserIntegralChange.setHistoricalIntegral(appUser1.getPoints()); appUserIntegralChange.setCurrentIntegral(appUser1.getPoints() + num1); appUserIntegralChange.setCreateTime(LocalDateTime.now()); appUserIntegralChangeClient.addAppUserIntegralChange(appUserIntegralChange); appUser1.setPoints(appUser1.getPoints() + num1); appUserClient.updateAppUser(appUser1); } } /** ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
@@ -90,12 +90,16 @@ 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); @@ -131,15 +135,19 @@ 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); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderAppealServiceImpl.java
@@ -18,6 +18,7 @@ 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; @@ -48,6 +49,9 @@ 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)); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java
@@ -37,8 +37,10 @@ import com.ruoyi.order.service.TOrderEvaluateService; import com.ruoyi.other.api.domain.TEvaluationTag; import com.ruoyi.other.api.domain.TIntegralRule; import com.ruoyi.other.api.domain.TVip; import com.ruoyi.other.api.feignClient.IntegralRuleClient; import com.ruoyi.other.api.feignClient.TEvaluationTagClient; import com.ruoyi.other.api.feignClient.VipClient; import com.ruoyi.other.api.vo.TEvaluationTagVO; import io.seata.spring.annotation.GlobalTransactional; import org.springframework.beans.BeanUtils; @@ -92,6 +94,9 @@ @Resource private AppUserIntegralChangeClient appUserIntegralChangeClient; @Resource private VipClient vipClient; @@ -272,6 +277,14 @@ Integer num1 = JSON.parseObject(credit).getInteger("num1"); if(null != num1 && 0 < num1){ TAppUser appUser = appUserClient.getUserById(userid).getData(); if(null != appUser.getVipId()){ TVip vip = vipClient.getInfo(appUser.getVipId()).getData(); Integer doubleIntegration = vip.getDoubleIntegration(); //双倍积分 if(1 == doubleIntegration){ num1 *= 2; } } Integer points = appUser.getPoints(); appUser.setPoints(appUser.getPoints() + num1); appUserClient.updateAppUser(appUser); ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -1388,7 +1388,7 @@ </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 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
@@ -136,6 +136,7 @@ return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) .eq(TVip::getReveal,1) .orderByDesc(TVip::getMaximumDeduction) .orderByDesc(TVip::getCreateTime) .last("LIMIT 1"))); case 2: return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) @@ -146,6 +147,7 @@ return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) .eq(TVip::getReveal,1) .orderByDesc(TVip::getMonthlyCardDiscount) .orderByDesc(TVip::getCreateTime) .last("LIMIT 1"))); } } ruoyi-service/ruoyi-other/src/main/resources/template/充电桩申请记录.xlsxBinary files differ
sql/quartz.sql
File was deleted sql/ry_20230223.sql
File was deleted sql/ry_config_20220929.sql
File was deleted sql/ry_seata_20210128.sql
File was deleted