bin/clean.bat
New file @@ -0,0 +1,12 @@ @echo off echo. echo [ÐÅÏ¢] ÇåÀí¹¤³ÌtargetÉú³É·¾¶¡£ echo. %~d0 cd %~dp0 cd .. call mvn clean pause bin/package.bat
New file @@ -0,0 +1,12 @@ @echo off echo. echo [ÐÅÏ¢] ´ò°üWeb¹¤³Ì£¬Éú³Éwar/jar°üÎļþ¡£ echo. %~d0 cd %~dp0 cd .. call mvn clean package -Dmaven.test.skip=true pause bin/run-auth.bat
New file @@ -0,0 +1,14 @@ @echo off echo. echo [ÐÅÏ¢] ʹÓÃJarÃüÁîÔËÐÐAuth¹¤³Ì¡£ echo. cd %~dp0 cd ../ruoyi-auth/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-auth.jar cd bin pause bin/run-gateway.bat
New file @@ -0,0 +1,14 @@ @echo off echo. echo [ÐÅÏ¢] ʹÓÃJarÃüÁîÔËÐÐGateway¹¤³Ì¡£ echo. cd %~dp0 cd ../ruoyi-gateway/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-gateway.jar cd bin pause bin/run-modules-file.bat
New file @@ -0,0 +1,14 @@ @echo off echo. echo [ÐÅÏ¢] ʹÓÃJarÃüÁîÔËÐÐModules-File¹¤³Ì¡£ echo. cd %~dp0 cd ../ruoyi-modules/ruoyi-file/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-file.jar cd bin pause bin/run-modules-gen.bat
New file @@ -0,0 +1,14 @@ @echo off echo. echo [ÐÅÏ¢] ʹÓÃJarÃüÁîÔËÐÐModules-Gen¹¤³Ì¡£ echo. cd %~dp0 cd ../ruoyi-modules/ruoyi-gen/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-gen.jar cd bin pause bin/run-modules-job.bat
New file @@ -0,0 +1,14 @@ @echo off echo. echo [ÐÅÏ¢] ʹÓÃJarÃüÁîÔËÐÐModules-Job¹¤³Ì¡£ echo. cd %~dp0 cd ../ruoyi-modules/ruoyi-job/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-job.jar cd bin pause bin/run-modules-system.bat
New file @@ -0,0 +1,14 @@ @echo off echo. echo [ÐÅÏ¢] ʹÓÃJarÃüÁîÔËÐÐModules-System¹¤³Ì¡£ echo. cd %~dp0 cd ../ruoyi-modules/ruoyi-system/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-system.jar cd bin pause bin/run-monitor.bat
New file @@ -0,0 +1,14 @@ @echo off echo. echo [ÐÅÏ¢] ʹÓÃJarÃüÁîÔËÐÐMonitor¹¤³Ì¡£ echo. cd %~dp0 cd ../ruoyi-visual/ruoyi-monitor/target set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-visual-monitor.jar cd bin pause ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/AppUserInfoDto.java
New file @@ -0,0 +1,25 @@ package com.ruoyi.account.api.dto; import com.ruoyi.account.api.model.TAppUserCar; import io.swagger.annotations.Api; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.time.LocalDateTime; import java.util.List; @Data public class AppUserInfoDto { @ApiModelProperty("1是0否") private Integer isVip; @ApiModelProperty("vip结束时间") private LocalDateTime vipExpireTime; @ApiModelProperty("当天是否签到") private Integer isSign; @ApiModelProperty("当前积分") private Integer points; @ApiModelProperty("当前优惠卷数量") private Integer couponNum; @ApiModelProperty("当前绑定的车辆") private List<TAppUserCar> userCars; } ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java
New file @@ -0,0 +1,35 @@ package com.ruoyi.account.api.dto; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.time.LocalDateTime; @Data public class InfoCouponDto { @ApiModelProperty(value = "优惠券名称") @TableField("name") private String name; @ApiModelProperty(value = "优惠方式(1=满减,2=抵扣)") @TableField("preferential_mode") private Integer preferentialMode; @ApiModelProperty(value = "优惠金额") @TableField("discount_amount") private BigDecimal discountAmount; @ApiModelProperty(value = "满减条件为0时无条件") @TableField("meet_the_conditions") private BigDecimal meetTheConditions; @ApiModelProperty(value = "折扣") @TableField("discount") private BigDecimal discount; @ApiModelProperty(value = "结束时间") @TableField("end_time") private LocalDateTime endTime; @ApiModelProperty(value = "开始时间") @TableField("start_time") private LocalDateTime startTime; } ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/SendCouponDto.java
New file @@ -0,0 +1,9 @@ package com.ruoyi.account.api.dto; import lombok.Data; @Data public class SendCouponDto { private Integer id; private Integer number; } ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserAddressClient.java
@@ -5,7 +5,7 @@ import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; /** @@ -21,6 +21,6 @@ * @param id * @return */ @PostMapping("/t-app-user-address/getAppUserAddressById") R<TAppUserAddress> getAppUserAddressById(Long id); @PostMapping("/t-app-user-address/getAppUserAddressById/{id}") R<TAppUserAddress> getAppUserAddressById(@PathVariable("id") Long id); } ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
@@ -6,10 +6,7 @@ import com.ruoyi.common.core.domain.R; import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; 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; @@ -37,11 +34,11 @@ * @param id * @return */ @PostMapping(value = "/t-app-user/user/getUserById") R<TAppUser> getUserById(Long id); @PostMapping(value = "/t-app-user/user/getUserById/{id}") R<TAppUser> getUserById(@PathVariable("id") Long id); @PostMapping("/t-app-user/") R updateAppUser(TAppUser appUser); @PostMapping("/t-app-user//user/updateAppUser") R updateAppUser(@RequestBody TAppUser appUser); } ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserIntegralChangeClient.java
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.R; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; /** * @author zhibing.pu @@ -20,5 +21,5 @@ * @return */ @PostMapping("/t-app-user-integral-change/addAppUserIntegralChange") R addAppUserIntegralChange(TAppUserIntegralChange appUserIntegralChange); R addAppUserIntegralChange(@RequestBody TAppUserIntegralChange appUserIntegralChange); } ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppCoupon.java
@@ -45,6 +45,9 @@ @ApiModelProperty(value = "结束时间") @TableField("end_time") private LocalDateTime endTime; @ApiModelProperty(value = "开始时间") @TableField("start_time") private LocalDateTime startTime; @ApiModelProperty(value = "获得方式(1=积分兑换,2=现金购买)") @TableField("ways_to_obtain") @@ -77,6 +80,10 @@ @TableField("orderId") private Long orderId; @ApiModelProperty(value = "当前领取优惠卷的json记录") @TableField("coupon_json") private String couponJson; } ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
@@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; /** @@ -38,6 +39,16 @@ @TableField("charge_num") private Integer chargeNum; @ApiModelProperty(value = "购买时折扣金额") @TableField("discount_money") private BigDecimal discountMoney; @ApiModelProperty(value = "该会员记录应赠送的充电次数") @TableField("send_charge_num") private Integer sendChargeNum; @ApiModelProperty(value = "会员id") @TableField("vip_id") private Integer vipId; @@ -53,5 +64,14 @@ @TableField("create_time") private LocalDateTime createTime; @ApiModelProperty(value = "已赠送的月份") @TableField("send_month") private Integer sendMonth; @ApiModelProperty(value = "要赠送的优惠卷") @TableField("coupon_ids") private String couponIds; } ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java
@@ -2,6 +2,7 @@ import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; import com.ruoyi.chargingPile.api.model.TChargingPile; import com.ruoyi.chargingPile.api.vo.SiteInfoVO; import com.ruoyi.common.core.domain.R; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,6 +36,11 @@ public R<BigDecimal> getServiceMoney(String param) { return R.fail("根据会员折扣、预付金额 计算服务费失败:"+throwable.getMessage()); } @Override public R<SiteInfoVO> getSiteInfoByNumber(String number) { return R.fail("通过桩编号获取电站信息失败:"+throwable.getMessage()); } }; } } ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingGunClient.java
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.R; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; /** @@ -20,8 +21,8 @@ * @param id * @return */ @PostMapping("/t-charging-gun/getAllName") R<String> getAllName(Integer id); @PostMapping("/t-charging-gun/getAllName/{id}") R<String> getAllName(@PathVariable("id") Integer id); /** @@ -29,6 +30,6 @@ * @param id * @return */ @PostMapping("/t-charging-gun/getChargingGunById") R<TChargingGun> getChargingGunById(Integer id); @PostMapping("/t-charging-gun/getChargingGunById/{id}") R<TChargingGun> getChargingGunById(@PathVariable("id") Integer id); } ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java
@@ -2,6 +2,7 @@ import com.ruoyi.chargingPile.api.factory.ChargingPileFallbackFactory; import com.ruoyi.chargingPile.api.model.TChargingPile; import com.ruoyi.chargingPile.api.vo.SiteInfoVO; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import io.swagger.annotations.ApiOperation; @@ -24,12 +25,16 @@ */ @ApiOperation(value = "管理后台-通过站点id获取充电桩列表 不分页") @PostMapping(value = "/t-charging-pile/getChargingPileBySiteId") public R<List<TChargingPile>> getChargingPileBySiteId(@RequestParam("siteId") Integer siteId); R<List<TChargingPile>> getChargingPileBySiteId(@RequestParam("siteId") Integer siteId); /** * 小程序远程调用 根据会员折扣、预付金额 计算服务费 * @return */ @PostMapping(value = "/getServiceMoney") public R<BigDecimal> getServiceMoney(@RequestParam("param") String param); @PostMapping(value = "/t-accounting-strategy/getServiceMoney") R<BigDecimal> getServiceMoney(@RequestParam("param") String param); @PostMapping("/site/getSiteInfoByNumber") @ApiOperation(value = "扫一扫后通过桩编号获取电站信息", tags = {"小程序-扫一扫"}) R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number); } ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java
@@ -20,4 +20,13 @@ private BigDecimal vipElectrovalence; @ApiModelProperty(value = "超时占位费说明") private String spaceChargeExplain; @ApiModelProperty(value = "上次选择车辆logo") private String carLogo; @ApiModelProperty(value = "上次选择车辆车牌号") private String licensePlate; @ApiModelProperty(value = "上次选择车辆品牌") private String vehicleBrand; @ApiModelProperty(value = "上次选择车辆id") private Long id; } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
@@ -44,6 +44,11 @@ public R<TChargingOrder> getOrderDetailByGunId(Integer chargingGunId) { return R.fail("根据充电枪获取正在充电的订单:" + throwable.getMessage()); } @Override public R<Long> getCar() { return R.fail("获取用户最近使用车辆充电的车辆id:" + throwable.getMessage()); } }; } } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderAccountingStrategyClient.java
@@ -6,6 +6,7 @@ import com.ruoyi.order.api.factory.ChargingOrderFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -26,8 +27,8 @@ * @param days 天数 * @return */ @PostMapping("/t-charging-order-accounting-strategy/getTotalElectricQuantity") R<List<List<Map<String, Object>>>> getTotalElectricQuantity(Integer days, @RequestParam("siteIds") Set<Integer> siteIds); @PostMapping("/t-charging-order-accounting-strategy/getTotalElectricQuantity/{days}") R<List<List<Map<String, Object>>>> getTotalElectricQuantity(@PathVariable("days") Integer days, @RequestParam("siteIds") Set<Integer> siteIds); /** @@ -35,6 +36,6 @@ * @param days * @return */ @PostMapping("/t-charging-order-getDailyChargingDegree-strategy/getUtilizationTrend") R<List<Double>> getDailyChargingDegree(Integer days, @RequestParam("siteIds") Set<Integer> siteIds); @PostMapping("/t-charging-order-getDailyChargingDegree-strategy/getUtilizationTrend/{days}") R<List<Double>> getDailyChargingDegree(@PathVariable("days") Integer days, @RequestParam("siteIds") Set<Integer> siteIds); } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
@@ -39,4 +39,11 @@ */ @PostMapping(value = "/t-charging-order/getOrderDetailByGunId") R<TChargingOrder> getOrderDetailByGunId(@RequestParam("chargingGunId") Integer chargingGunId); /** * 获取用户最近使用车辆充电的车辆id * @return */ @GetMapping(value = "/t-charging-order/getCar") public R<Long> getCar(); } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
@@ -7,6 +7,7 @@ import com.ruoyi.order.api.query.TActivityStatisticsQuery; import com.ruoyi.order.api.vo.TActivityVO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -36,4 +37,5 @@ */ @PostMapping(value = "/t-exchange-order/activityStatistics") public R<TActivityVO> activityStatistics(@RequestBody TActivityStatisticsQuery dto); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/THtml.java
@@ -24,7 +24,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_html") @ApiModel(value="THtml对象", description="") public class THtml extends BasePojo { public class THtml { private static final long serialVersionUID = 1L; ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/NoticeQueryDto.java
New file @@ -0,0 +1,12 @@ package com.ruoyi.other.api.dto; import com.ruoyi.common.core.web.page.BasePage; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data public class NoticeQueryDto extends BasePage { private String content; @ApiModelProperty("0未开始1已开始2已结束") private Integer status; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipCouponDto.java
New file @@ -0,0 +1,10 @@ package com.ruoyi.other.api.dto; import com.ruoyi.other.api.domain.TCoupon; import lombok.Data; @Data public class VipCouponDto { private TCoupon tCoupon; private Integer num; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java
New file @@ -0,0 +1,35 @@ package com.ruoyi.other.api.dto; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.License; import lombok.Data; import java.math.BigDecimal; import java.util.List; @Data public class VipInfoDto { @ApiModelProperty("月卡价格") private BigDecimal monthlyCard; @ApiModelProperty("季卡价格") private BigDecimal seasonCard; @ApiModelProperty("年卡价格") private BigDecimal annualCard; @ApiModelProperty("最高抵扣价格") private BigDecimal maximumDeduction; @ApiModelProperty("抵扣次数") private Integer discountTimes; @ApiModelProperty(value = "双倍积分开关(0=否,1=是)") private Integer doubleIntegration; @ApiModelProperty(value = "商城专享价开关(0=否,1=是)") private Integer mallExclusivePrice; @ApiModelProperty(value = "可赠送的优惠卷列表") private List<VipCouponDto> vipCouponDtos; @ApiModelProperty(value = "最高总折扣") private BigDecimal totalDiscount; } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
@@ -6,6 +6,7 @@ import com.ruoyi.account.api.vo.CouponListVOVO; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.TCompany; import com.ruoyi.other.api.domain.TCoupon; import com.ruoyi.other.api.domain.TUserTag; import com.ruoyi.other.api.feignClient.OtherClient; import org.slf4j.Logger; @@ -85,6 +86,11 @@ public R<List<CouponListVOVO>> getCouponInfoByCouponIds(List<CouponListVOVO> list) { return R.fail("我的优惠券列表获取信息:"+throwable.getMessage()); } @Override public R<TCoupon> getCouponById(Integer id) { return R.fail("查询优惠卷:"+throwable.getMessage()); } }; } } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipFallbackFactory.java
@@ -1,6 +1,7 @@ package com.ruoyi.other.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.api.domain.TVip; import com.ruoyi.other.api.feignClient.VipClient; import org.slf4j.Logger; @@ -28,6 +29,10 @@ return R.fail("获取最高抵扣、最低起步价,最高折扣的会员失败:" + throwable.getMessage()); } @Override public R<TVip> getInfo(Integer type) { return null; } @Override public R<TVip> getInfo1(Integer id) { ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
@@ -6,6 +6,7 @@ import com.ruoyi.other.api.factory.CouponFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; /** @@ -21,6 +22,6 @@ * @param id * @return */ @PostMapping("/t-coupon/getCouponById") R<TCoupon> getCouponById(Integer id); @PostMapping("/t-coupon/getCouponById/{id}") R<TCoupon> getCouponById(@PathVariable("id") Integer id); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
@@ -6,6 +6,7 @@ import com.ruoyi.other.api.factory.GoodsFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; /** @@ -20,6 +21,6 @@ * @param id * @return */ @PostMapping("/t-goods/getGoodsById") R<TGoods> getGoodsById(Integer id); @PostMapping("/t-goods/getGoodsById/{id}") R<TGoods> getGoodsById(@PathVariable("id") Integer id); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java
@@ -7,6 +7,7 @@ import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.TCompany; import com.ruoyi.other.api.domain.TCoupon; import com.ruoyi.other.api.domain.TUserTag; import com.ruoyi.other.api.factory.OtherFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -64,6 +65,10 @@ R<List<CouponListVOVO>> getCouponInfoByCouponIds(@RequestBody List<CouponListVOVO> list); @PostMapping(value = "/t-coupon/getCouponById") R<TCoupon> getCouponById(@RequestParam Integer id); ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/RoleSiteClient.java
@@ -6,10 +6,7 @@ import com.ruoyi.other.api.factory.RoleSiteFallbackFactory; import com.ruoyi.other.api.factory.UserSiteFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -26,8 +23,8 @@ * @param roleId * @return */ @PostMapping("/t-role-site/getSiteIds") R<List<Integer>> getSiteIds(Long roleId); @PostMapping("/t-role-site/getSiteIds/{roleId}") R<List<Integer>> getSiteIds(@PathVariable("roleId") Long roleId); /** @@ -36,13 +33,13 @@ * @return */ @PostMapping("/t-role-site/addRoleSite") R addRoleSite(List<TRoleSite> roleSites); R addRoleSite(@RequestBody List<TRoleSite> roleSites); /** * 删除角色站点数据 * @param roleId * @return */ @DeleteMapping("/t-role-site/delRoleSite") R delRoleSite(Long roleId); @DeleteMapping("/t-role-site/delRoleSite/{roleId}") R delRoleSite(@PathVariable("roleId") Long roleId); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/TEvaluationTagClient.java
@@ -8,6 +8,7 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -34,5 +35,5 @@ * @return */ @PostMapping("/t-evaluation-tag/getListByIds") R<List<TEvaluationTag>> getListByIds(List<Integer> tagIds); R<List<TEvaluationTag>> getListByIds(@RequestBody List<Integer> tagIds); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserSiteClient.java
@@ -6,10 +6,7 @@ import com.ruoyi.other.api.factory.UserSiteFallbackFactory; import org.apache.ibatis.annotations.Delete; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -26,8 +23,8 @@ * @param userId * @return */ @PostMapping("/t-user-site/getSiteIds") R<List<Integer>> getSiteIds(Long userId); @PostMapping("/t-user-site/getSiteIds/{userId}") R<List<Integer>> getSiteIds(@PathVariable("userId") Long userId); /** @@ -35,8 +32,8 @@ * @param userSite * @return */ @PostMapping("/t-user-site/getSiteIds") R addUserSite(List<TUserSite> userSite); @PostMapping("/t-user-site/addUserSite") R addUserSite(@RequestBody List<TUserSite> userSite); /** @@ -44,6 +41,6 @@ * @param userId * @return */ @DeleteMapping("/t-user-site/delUserSite") R delUserSite(Long userId); @DeleteMapping("/t-user-site/delUserSite/{userId}") R delUserSite(@PathVariable("userId") Long userId); } ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipClient.java
@@ -2,6 +2,7 @@ import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.api.domain.TVip; import com.ruoyi.other.api.factory.VipFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -31,4 +32,8 @@ */ @PostMapping("/vip/getInfo1") public R<TVip> getInfo1(@RequestParam("id") Integer id); @PostMapping(value = "/vip/getInfo") R<TVip> getInfo(@RequestParam("id") Integer id); } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java
@@ -38,23 +38,11 @@ @TableField("role_key") private String roleKey; /** 角色排序 */ @Excel(name = "角色排序") @TableField("role_sort") private Integer roleSort; /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") @TableField("data_scope") private String dataScope; /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */ @TableField("menu_check_strictly") private boolean menuCheckStrictly; /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */ @TableField("dept_check_strictly") private boolean deptCheckStrictly; /** 角色状态(0正常 1停用) */ @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") @@ -137,17 +125,6 @@ this.roleKey = roleKey; } @NotNull(message = "显示顺序不能为空") public Integer getRoleSort() { return roleSort; } public void setRoleSort(Integer roleSort) { this.roleSort = roleSort; } public String getDataScope() { return dataScope; @@ -156,26 +133,6 @@ public void setDataScope(String dataScope) { this.dataScope = dataScope; } public boolean isMenuCheckStrictly() { return menuCheckStrictly; } public void setMenuCheckStrictly(boolean menuCheckStrictly) { this.menuCheckStrictly = menuCheckStrictly; } public boolean isDeptCheckStrictly() { return deptCheckStrictly; } public void setDeptCheckStrictly(boolean deptCheckStrictly) { this.deptCheckStrictly = deptCheckStrictly; } public String getStatus() @@ -252,10 +209,7 @@ .append("roleId", getRoleId()) .append("roleName", getRoleName()) .append("roleKey", getRoleKey()) .append("roleSort", getRoleSort()) .append("dataScope", getDataScope()) .append("menuCheckStrictly", isMenuCheckStrictly()) .append("deptCheckStrictly", isDeptCheckStrictly()) .append("status", getStatus()) .append("delFlag", getDelFlag()) .append("createBy", getCreateBy()) ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
@@ -4,7 +4,9 @@ import java.util.List; import javax.validation.constraints.*; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -28,7 +30,7 @@ /** 用户ID */ @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") @TableField("user_id") @TableId(value = "user_id", type = IdType.AUTO) private Long userId; /** 部门ID */ ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysUserClient.java
@@ -100,7 +100,7 @@ * @param user */ @PostMapping("/user/addSysUser") R addSysUser(SysUser user); R addSysUser(@RequestBody SysUser user); /** @@ -109,5 +109,5 @@ * @return */ @PostMapping("/user/resetPassword") R resetPassword(SysUser user); R resetPassword(@RequestBody SysUser user); } ruoyi-auth/src/main/resources/bootstrap.yml
@@ -43,7 +43,7 @@ enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: true #开启数据库代理 enable-auto-data-source-proxy: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/SignFilter.java
@@ -127,13 +127,13 @@ * @return */ private boolean authSign(JSONObject jsonStr, String sign, String nonce_str) { System.err.println("请求签名:" + sign); String signUrlEncode = localSignUrl(jsonStr, nonce_str); signUrlEncode = signUrlEncode.replaceAll("& #40;", "\\(") .replaceAll("& #41;", "\\)"); if(sign.equals(signUrlEncode)){ return true; } System.err.println("签名值:" + signUrlEncode); return false; } ruoyi-modules/ruoyi-system/pom.xml
@@ -61,10 +61,10 @@ </dependency> <!-- RuoYi Common DataSource --> <dependency> <groupId>com.ruoyi</groupId> <artifactId>ruoyi-common-datasource</artifactId> </dependency> <!--<dependency>--> <!--<groupId>com.ruoyi</groupId>--> <!--<artifactId>ruoyi-common-datasource</artifactId>--> <!--</dependency>--> <!-- RuoYi Common DataScope --> <dependency> ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
@@ -112,8 +112,10 @@ for (SysRole record : page.getRecords()) { List<Integer> data = roleSiteClient.getSiteIds(record.getRoleId()).getData(); List<Site> sites = siteClient.getSiteByIds(data).getData(); List<String> collect = sites.stream().map(Site::getName).collect(Collectors.toList()); record.setSiteNames(collect); if(null != sites){ List<String> collect = sites.stream().map(Site::getName).collect(Collectors.toList()); record.setSiteNames(collect); } } return AjaxResult.success(page); } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -695,7 +695,9 @@ @PostMapping("/addSysUser") @Transactional(rollbackFor = Exception.class) public R addSysUser(@RequestBody SysUser user){ user.setUserName(user.getPhonenumber()); if(StringUtils.isEmpty(user.getUserName())){ user.setUserName(user.getPhonenumber()); } if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ user.setNickName(user.getPhonenumber()); } @@ -707,7 +709,9 @@ } user.setCreateBy(SecurityUtils.getUsername()); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setRoleType(1); if(null == user.getRoleType()){ user.setRoleType(1); } userService.insertUser(user); SysUserRole sysUserRole = new SysUserRole(); sysUserRole.setRoleId(user.getRoleId()); ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
@@ -1,25 +1,26 @@ package com.ruoyi.system.mapper; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.api.domain.SysOperLog; /** * 操作日志 数据层 * * * @author ruoyi */ public interface SysOperLogMapper { public interface SysOperLogMapper extends BaseMapper<SysOperLog> { /** * 新增操作日志 * * * @param operLog 操作日志对象 */ public int insertOperlog(SysOperLog operLog); /** * 查询系统操作日志集合 * * * @param operLog 操作日志对象 * @return 操作日志集合 */ @@ -27,7 +28,7 @@ /** * 批量删除系统操作日志 * * * @param operIds 需要删除的操作日志ID * @return 结果 */ @@ -35,7 +36,7 @@ /** * 查询操作日志详细 * * * @param operId 操作ID * @return 操作日志对象 */ ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -112,7 +112,7 @@ public List<Long> selectDeptListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); return deptMapper.selectDeptListByRoleId(roleId, false); } /** ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
@@ -156,7 +156,7 @@ public List<Long> selectMenuListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); return menuMapper.selectMenuListByRoleId(roleId, false); } /** ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
@@ -7,11 +7,14 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.mapper.SysOperLogMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.api.domain.SysOperLog; import com.ruoyi.system.service.ISysOperLogService; import javax.annotation.Resource; /** * 操作日志 服务层处理 @@ -19,8 +22,10 @@ * @author ruoyi */ @Service public class SysOperLogServiceImpl implements ISysOperLogService { @Autowired public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService { @Resource private SysOperLogMapper operLogMapper; /** @@ -73,50 +78,5 @@ @Override public void cleanOperLog() { operLogMapper.cleanOperLog(); } @Override public boolean saveBatch(Collection<SysOperLog> entityList, int batchSize) { return false; } @Override public boolean saveOrUpdateBatch(Collection<SysOperLog> entityList, int batchSize) { return false; } @Override public boolean updateBatchById(Collection<SysOperLog> entityList, int batchSize) { return false; } @Override public boolean saveOrUpdate(SysOperLog entity) { return false; } @Override public SysOperLog getOne(Wrapper<SysOperLog> queryWrapper, boolean throwEx) { return null; } @Override public Map<String, Object> getMap(Wrapper<SysOperLog> queryWrapper) { return null; } @Override public <V> V getObj(Wrapper<SysOperLog> queryWrapper, Function<? super Object, V> mapper) { return null; } @Override public BaseMapper<SysOperLog> getBaseMapper() { return null; } @Override public Class<SysOperLog> getEntityClass() { return null; } } ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
@@ -44,7 +44,7 @@ enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: true #开启数据库代理 enable-auto-data-source-proxy: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -164,7 +164,7 @@ <select id="getSysRoleByIds" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> <if test="null != ids and ids.size() > 0"> where r.id in where r.role_id in <foreach collection="ids" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
@@ -12,23 +12,25 @@ import com.ruoyi.account.api.vo.ExchangeRecordVO; import com.ruoyi.account.service.TAppCouponService; import com.ruoyi.account.service.TAppUserCarService; import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; import com.ruoyi.chargingPile.api.vo.SiteInfoVO; import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.BasePage; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.order.api.feignClient.ChargingOrderClient; import com.ruoyi.other.api.domain.TCoupon; import com.ruoyi.other.api.feignClient.OtherClient; import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; /** @@ -44,13 +46,45 @@ public class TAppCouponController { @Autowired private TAppCouponService tAppCouponService; @Autowired private OtherClient otherClient; @Autowired private TAppUserCarService appUserCarService; @Autowired private TokenService tokenService; @Autowired private ChargingPileClient chargingPileClient; @Autowired private ChargingOrderClient chargingOrderClient; /** * 查询用户可用优惠券数量 * @return */ @ApiOperation(value = "通过桩编号获取电站详情", tags = {"小程序-扫一扫"}) @GetMapping(value = "/scan/siteInfo") public AjaxResult<SiteInfoVO> siteInfo(String number) { SiteInfoVO data = chargingPileClient.getSiteInfoByNumber(number).getData(); List<TAppUserCar> cars = appUserCarService.list(new QueryWrapper<TAppUserCar>() .eq("app_user_id",tokenService.getLoginUserApplet().getUserId()) .orderByDesc("create_time")); Long data1 = chargingOrderClient.getCar().getData(); if (!cars.isEmpty()){ if (data1 == -1){ // 没有充电订单 展示最新添加的车辆 data.setLicensePlate(cars.get(0).getLicensePlate()); data.setVehicleBrand(cars.get(0).getVehicleBrand()); data.setId(cars.get(0).getId()); }else{ for (TAppUserCar car : cars) { if (car.getId().equals(data1)){ data.setLicensePlate(car.getLicensePlate()); data.setVehicleBrand(car.getVehicleBrand()); data.setId(car.getId()); } } } } return AjaxResult.ok(data); } /** * 查询用户可用优惠券数量 * @param dto @@ -63,16 +97,15 @@ return AjaxResult.ok(res); } /** * 选择车辆列表 * 选择车辆列表 远程调用 * @return */ @ApiOperation(value = "选择车辆列表", tags = {"小程序-扫一扫"}) @PostMapping(value = "/scan/carList") public AjaxResult<List<TAppUserCar>> carList() { // todo 用户id public R<List<TAppUserCar>> carList() { List<TAppUserCar> appUserId = appUserCarService.list(new QueryWrapper<TAppUserCar>() .eq("app_user_id",tokenService.getLoginUserApplet().getUserId())); return AjaxResult.ok(appUserId); return R.ok(appUserId); } /** ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -1,6 +1,7 @@ package com.ruoyi.account.controller; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; @@ -14,6 +15,7 @@ import com.ruoyi.account.wx.body.resq.Code2SessionResqBody; import com.ruoyi.account.wx.model.WeixinProperties; import com.ruoyi.account.wx.tools.WxAppletTools; import com.ruoyi.account.util.GiveVipUtil; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.bean.BeanUtils; import com.ruoyi.common.core.web.domain.AjaxResult; @@ -27,6 +29,7 @@ import com.ruoyi.order.api.model.TChargingOrder; import com.ruoyi.order.api.model.TExchangeOrder; import com.ruoyi.other.api.domain.TCompany; import com.ruoyi.other.api.domain.TCoupon; import com.ruoyi.other.api.domain.TUserTag; import com.ruoyi.other.api.feignClient.OtherClient; import com.ruoyi.system.api.domain.SysRole; @@ -34,13 +37,16 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.poi.ss.formula.functions.T; import lombok.extern.slf4j.Slf4j; import org.aspectj.weaver.loadtime.Aj; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.client.RestTemplate; import javax.annotation.Resource; import java.time.Duration; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; @@ -78,12 +84,70 @@ @Resource private ExchangeOrderClient exchangeOrderClient; @Autowired private TokenService tokenService; @Autowired private RedisService redisService; @Autowired private WeixinProperties wxConfig; @Autowired private RestTemplate wxRestTemplate; @Resource private TAppUserSignService signService; @Resource private TAppCouponService appCouponService; @Resource private TAppUserCarService carService; @ApiOperation(value = "查询当前用户是否为会员 0否1是", tags = {"小程序--查询当前用户是否为会员"}) @PostMapping(value = "/getUserInfo") public AjaxResult<Integer> getUserInfo() { TAppUser byId = appUserService.getById(tokenService.getLoginUserApplet().getUserId()); if (byId.getVipEndTime() == null){ return AjaxResult.ok(0); }else if (byId.getVipEndTime().isAfter(LocalDateTime.now())){ return AjaxResult.ok(1); }else{ return AjaxResult.ok(0); } } @ApiOperation(value = "通过code获得openid, 1 --->对应的appid:wx4c405fa42539fc21 2---->对应的appid:wx02d9f6c92e6d3c86") @GetMapping("openId-by-jscode2session/{code}") public AjaxResult<Map<String, Object>> jscode2session(@PathVariable String code) { log.info("<<<<<<<<换取openid开始<<<<<<<<:{}", code); WxAppletTools appletTools = new WxAppletTools(wxRestTemplate, wxConfig); Code2SessionRespBody body = appletTools.getOpenIdByJscode2session(new Code2SessionResqBody().build(code)); String openid = body.getOpenid(); String sessionKey = body.getSessionKey(); TAppUser appUser = appUserService.getOne(Wrappers.lambdaQuery(TAppUser.class).eq(TAppUser::getWxOpenid, openid).last("limit 1")); if (Objects.isNull(appUser)) { appUser = new TAppUser(); appUser.setWxOpenid(openid); appUserService.save(appUser); } // 提前对sessionKey进行删除 log.info("换取sessionKey:{}", sessionKey); // 将sessionKey进行存储,后续获取信息需要 redisService.setCacheObject(openid, sessionKey); LoginUserApplet loginUserApplet = new LoginUserApplet(); if(ObjectUtils.isNotNull(appUser)){ loginUserApplet.setUserId(appUser.getId()); } HashMap<String, Object> tokenInfos = new HashMap<>(); tokenInfos.put("token",tokenService.createTokenApplet(loginUserApplet)); tokenInfos.put("info",loginUserApplet); return AjaxResult.ok(tokenInfos); } @ApiOperation(value = "管理后台-根据手机号查询用户ids", tags = {"管理后台-活动费用统计"}) @PostMapping(value = "/user/getUserIdsByPhone") public R<List<Long>> getUserIdsByPhone(@RequestParam("phone") String phone) { return R.ok(appUserService.list(new QueryWrapper<TAppUser>().like("phone",phone)).stream().map(TAppUser::getId).collect(Collectors.toList())); } @Resource private GiveVipUtil giveVipUtil; @ApiOperation(value = "单位管理列表", tags = {"用户管理-单位管理"}) @PostMapping(value = "/unit/page") public R<Page<TCompany>> unitPage(@RequestBody UnitListQueryDto unitListQueryDto) { @@ -96,6 +160,20 @@ } return R.ok(data); } @ApiOperation(value = "单位下拉框", tags = {"用户管理-单位管理"}) @PostMapping(value = "/unit/select") public R<List<TCompany>> unitSelect() { UnitListQueryDto unitListQueryDto = new UnitListQueryDto(); unitListQueryDto.setPageCurr(1); unitListQueryDto.setPageSize(9999); //拿到单位列表 R<Page<TCompany>> pageR = otherClient.queryUnitPage(unitListQueryDto); return R.ok(pageR.getData().getRecords()); } @ApiOperation(value = "单位管理添加或编辑", tags = {"用户管理-单位管理"}) @PostMapping(value = "/unit/addOrUpdate") @@ -267,7 +345,7 @@ return R.ok(userDetailDto); } @ApiOperation(value = "用户详情积分明细", tags = {"用户管理-用户列表"}) @ApiOperation(value = "用户详情积分明细", tags = {"后台-用户管理-用户列表","小程序-个人中心"}) @PostMapping(value = "/user/points/page") public R<Page<TAppUserIntegralChange>> pointsDetail(@RequestBody PointsQueryDto pointsQueryDto) { List<Integer> types = new ArrayList<>(); @@ -303,7 +381,7 @@ } @ApiOperation(value = "用户详情积分明细", tags = {"用户管理-用户列表"}) @ApiOperation(value = "冻结解冻用户", tags = {"后台-用户管理-用户列表"}) @PostMapping(value = "/user/status/change") public R pointsDetail(@RequestBody UserChangeDto userChangeDto) { TAppUser appUser = appUserService.getById(userChangeDto.getUserId()); @@ -312,37 +390,76 @@ return R.ok(); } @ApiOperation(value = "个人中心信息", tags = {"小程序-个人中心"}) @PostMapping(value = "/user/info") public R<AppUserInfoDto> info() { Long userId = 1L; TAppUser byId = appUserService.getById(userId); AppUserInfoDto appUserInfoDto = new AppUserInfoDto(); //判断会员 if (byId.getVipEndTime()==null||byId.getVipEndTime().isBefore(LocalDateTime.now())){ appUserInfoDto.setIsVip(0); }else { appUserInfoDto.setIsVip(1); appUserInfoDto.setVipExpireTime(byId.getVipEndTime()); } //判断当天是否签到 Long count = signService.lambdaQuery().eq(TAppUserSign::getSignDay, LocalDate.now()).count(); appUserInfoDto.setIsSign(count>0?1:0); //获取当前拥有的优惠卷数量 Long coupons = appCouponService.lambdaQuery().eq(TAppCoupon::getAppUserId, userId).eq(TAppCoupon::getStatus, 1).count(); appUserInfoDto.setCouponNum(Math.toIntExact(coupons)); //当前绑定的车辆 List<TAppUserCar> list = carService.lambdaQuery().eq(TAppUserCar::getAppUserId, userId).list(); appUserInfoDto.setUserCars(list); return R.ok(appUserInfoDto); } @ApiOperation(value = "优惠卷列表不分页(1可使用2不可用)", tags = {"小程序-个人中心"}) @PostMapping(value = "/user/coupon") public R<List<InfoCouponDto>> userCoupon(@RequestParam("type") Integer type) { LocalDateTime now = LocalDateTime.now(); List<InfoCouponDto> couponDtos = new ArrayList<>(); List<TAppCoupon> list = appCouponService.lambdaQuery().le(TAppCoupon::getStartTime, now).ge(TAppCoupon::getEndTime, now).eq(TAppCoupon::getStatus, type).list(); for (TAppCoupon tAppCoupon : list) { TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); InfoCouponDto infoCouponDto = new InfoCouponDto(); BeanUtils.copyProperties(coupon,infoCouponDto); couponDtos.add(infoCouponDto); } return R.ok(couponDtos); } @ApiOperation(value = "赠送会员", tags = {"用户管理-用户列表"}) @PostMapping(value = "/user/give/vip") public R giveVip(@RequestBody GiveVipDto giveVipDto) { TAppUser nowUser = appUserService.getById(giveVipDto.getUserId()); //如果vipEndTime为空或已过期,直接增加 if (nowUser.getVipEndTime()==null||nowUser.getVipEndTime().isBefore(LocalDateTime.now())) { if (giveVipDto.getType() == 1) { nowUser.setVipEndTime(LocalDateTime.now().plusDays(31)); //直接增加vipDetail } else if (giveVipDto.getType() == 2) { nowUser.setVipEndTime(LocalDateTime.now().plusDays(93)); } else if (giveVipDto.getType() == 3) { nowUser.setVipEndTime(LocalDateTime.now().plusDays(365)); } //直接赠送优惠卷 }else { if (giveVipDto.getType() == 1) { nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(31)); //如果有这个类型的vip,累加,没有的话,从entTime新增 } else if (giveVipDto.getType() == 2) { nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(93)); } else if (giveVipDto.getType() == 3) { nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(365)); } int plusDay = 0; if (giveVipDto.getType() == 1) { plusDay = 1; } else if (giveVipDto.getType() == 2) { plusDay = 3; } else if (giveVipDto.getType() == 3) { plusDay = 12; } //增加vipDetail giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay); appUserService.updateById(nowUser); //执行一次赠送优惠卷的定时任务 return R.ok(); } @@ -357,7 +474,7 @@ return R.ok(appUserService.list(Wrappers.<TAppUser>lambdaQuery().in(TAppUser::getId,appUserIds))); } /** * 根据用户id获取用户 * @param id @@ -368,8 +485,8 @@ TAppUser appUser = appUserService.getById(id); return R.ok(appUser); } /** * 修改用户信息 * @param appUser ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserVipDetailService.java
@@ -13,4 +13,5 @@ */ public interface TAppUserVipDetailService extends IService<TAppUserVipDetail> { void giveVipCoupun(Long appUserId, Integer vipId,Long recordId,Integer monthNum); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java
@@ -241,8 +241,8 @@ break; } } // 通过集合的money字段 将money从大到小排序 data.sort(Comparator.comparing(CouponListVOVO::getMoney).reversed()); // 通过集合的money、isUse字段 将money、isUse从大到小排序 将不可用的排在最后 data.sort(Comparator.comparing(CouponListVOVO::getMoney).reversed().thenComparing(CouponListVOVO::getIsUse)); pageInfo.setRecords(data); return pageInfo; } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppUserVipDetailServiceImpl.java
@@ -1,11 +1,27 @@ package com.ruoyi.account.service.impl; import com.alibaba.fastjson2.JSON; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.api.dto.SendCouponDto; import com.ruoyi.account.api.feignClient.AppCouponClient; import com.ruoyi.account.api.model.TAppCoupon; import com.ruoyi.account.api.model.TAppUserVipDetail; import com.ruoyi.account.mapper.TAppUserVipDetailMapper; import com.ruoyi.account.service.TAppCouponService; import com.ruoyi.account.service.TAppUserVipDetailService; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; 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 org.springframework.stereotype.Service; import javax.annotation.Resource; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; /** * <p> @@ -17,5 +33,49 @@ */ @Service public class TAppUserVipDetailServiceImpl extends ServiceImpl<TAppUserVipDetailMapper, TAppUserVipDetail> implements TAppUserVipDetailService { @Resource private VipClient vipClient; @Resource private OtherClient otherClient; @Resource private TAppCouponService appCouponService; @Resource private TAppUserVipDetailService tAppUserVipDetailService; @Override public void giveVipCoupun(Long appUserId, Integer vipId,Long recordId,Integer monthNum) { //如果不包含,则更新sendNum,并且赠送优惠卷 TAppUserVipDetail byId = tAppUserVipDetailService.getById(recordId); if (byId.getStartTime().plusMonths(byId.getSendMonth()).toLocalDate().compareTo(LocalDate.now())==0&&LocalDate.now().isBefore(byId.getEndTime().toLocalDate())){ byId.setSendMonth(byId.getSendMonth()+1); //给这个用户发放对应vip的优惠卷以及充电次数加满 List<SendCouponDto> javaList = JSON.parseArray(byId.getCouponIds()).toJavaList(SendCouponDto.class); for (SendCouponDto sendCouponDto : javaList) { Integer number = sendCouponDto.getNumber(); for (Integer i = 0; i < number; i++) { R<TCoupon> couponById = otherClient.getCouponById(sendCouponDto.getId()); TCoupon coupon = couponById.getData(); //将该优惠卷添加到用户优惠卷中 TAppCoupon tAppCoupon = new TAppCoupon(); tAppCoupon.setAppUserId(appUserId); tAppCoupon.setCouponId(sendCouponDto.getId()); if (coupon.getValidityPeriodMode() == 1) { tAppCoupon.setEndTime(coupon.getEndTime()); } else { tAppCoupon.setEndTime(LocalDateTime.now().plusDays(coupon.getDays())); } tAppCoupon.setWaysToObtain(4); tAppCoupon.setStatus(1); tAppCoupon.setCouponJson(JSON.toJSONString(coupon)); appCouponService.save(tAppCoupon); } } } byId.setChargeNum(byId.getSendChargeNum()); tAppUserVipDetailService.updateById(byId); } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java
New file @@ -0,0 +1,54 @@ package com.ruoyi.account.task; import com.ruoyi.account.api.model.TAppUserVipDetail; import com.ruoyi.account.service.TAppUserVipDetailService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.time.LocalDate; import java.util.List; /** * 定时任务工具类 */ @Component public class TaskUtil { @Resource private TAppUserVipDetailService tAppUserVipDetailService; /** * 每隔一分钟去处理的定时任务 */ @Scheduled(fixedRate = 1000 * 60) public void sendVipCoupon(){ try { //首先获取当前的月份,用int类型标识 LocalDate currentDate = LocalDate.now(); int monthNum = currentDate.getMonthValue(); //获取在当前时间内生效的vipDetail List<TAppUserVipDetail> recentDetails = tAppUserVipDetailService.lambdaQuery() .ge(TAppUserVipDetail::getStartTime, currentDate) .le(TAppUserVipDetail::getEndTime, currentDate) .orderByDesc(TAppUserVipDetail::getStartTime).list(); //判断sendNum是否包括当前月份 for (TAppUserVipDetail recentDetail : recentDetails) { //赠送优惠卷 tAppUserVipDetailService.giveVipCoupun(recentDetail.getAppUserId(), recentDetail.getVipId(),recentDetail.getId(),monthNum); } } catch (Exception e) { e.printStackTrace(); } } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java
New file @@ -0,0 +1,96 @@ package com.ruoyi.account.util; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.ruoyi.account.api.dto.SendCouponDto; import com.ruoyi.account.api.model.TAppCoupon; import com.ruoyi.account.api.model.TAppUser; import com.ruoyi.account.api.model.TAppUserVipDetail; import com.ruoyi.account.service.TAppCouponService; import com.ruoyi.account.service.TAppUserVipDetailService; import com.ruoyi.common.core.domain.R; 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 org.springframework.stereotype.Component; import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.List; @Component public class GiveVipUtil { @Resource private VipClient vipClient; @Resource private TAppUserVipDetailService tAppUserVipDetailService; @Resource private OtherClient otherClient; @Resource private TAppCouponService appCouponService; public void sendVip(TAppUser nowUser,Integer vipId,Integer plusDay){ if (nowUser.getVipEndTime()==null||nowUser.getVipEndTime().isBefore(LocalDateTime.now())) { nowUser.setVipEndTime(LocalDateTime.now().plusMonths(plusDay)); //直接再detail里新增数据,因为不是续费 TAppUserVipDetail tAppUserVipDetail = new TAppUserVipDetail(); tAppUserVipDetail.setAppUserId(nowUser.getId()); tAppUserVipDetail.setStartTime(LocalDateTime.now()); tAppUserVipDetail.setEndTime(LocalDateTime.now().plusMonths(plusDay).minusDays(1)); tAppUserVipDetail.setVipId(vipId); R<TVip> info = vipClient.getInfo(vipId); TVip vip = info.getData(); List<SendCouponDto> javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class); tAppUserVipDetail.setCouponIds(vip.getCoupon()); tAppUserVipDetail.setSendChargeNum(vip.getDiscountTimes()); tAppUserVipDetail.setChargeNum(vip.getDiscountTimes()); tAppUserVipDetail.setDiscountMoney(vip.getMaximumDeduction()); tAppUserVipDetail.setSendMonth(1); tAppUserVipDetailService.save(tAppUserVipDetail); //直接赠送优惠卷 for (SendCouponDto sendCouponDto : javaList) { Integer number = sendCouponDto.getNumber(); for (Integer i = 0; i < number; i++) { R<TCoupon> couponById = otherClient.getCouponById(sendCouponDto.getId()); TCoupon coupon = couponById.getData(); //将该优惠卷添加到用户优惠卷中 TAppCoupon tAppCoupon = new TAppCoupon(); tAppCoupon.setAppUserId(nowUser.getId()); tAppCoupon.setCouponId(Integer.valueOf(sendCouponDto.getId())); if (coupon.getValidityPeriodMode() == 1) { tAppCoupon.setEndTime(coupon.getEndTime()); } else { tAppCoupon.setEndTime(LocalDateTime.now().plusDays(coupon.getDays())); } tAppCoupon.setWaysToObtain(4); tAppCoupon.setStatus(1); tAppCoupon.setCouponJson(JSON.toJSONString(coupon)); appCouponService.save(tAppCoupon); } } }else { nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(plusDay)); //获取detail里结束时间大于当前时间的数据,并将enttime延长 TAppUserVipDetail tAppUserVipDetail = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one(); // TAppUserVipDetail newAppUser = new TAppUserVipDetail(); // newAppUser.setAppUserId(nowUser.getId()); // newAppUser.setStartTime(tAppUserVipDetail.getEndTime()); tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1)); // newAppUser.setVipId(vipId); tAppUserVipDetailService.updateById(tAppUserVipDetail); // tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusDays(plusDay)); // tAppUserVipDetailService.updateById(tAppUserVipDetail); } } } ruoyi-service/ruoyi-account/src/main/resources/bootstrap.yml
@@ -43,7 +43,7 @@ enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: true #开启数据库代理 enable-auto-data-source-proxy: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default ruoyi-service/ruoyi-chargingPile/pom.xml
@@ -15,7 +15,12 @@ </description> <dependencies> <dependency> <groupId>com.ruoyi</groupId> <artifactId>ruoyi-api-account</artifactId> <version>3.6.2</version> <scope>compile</scope> </dependency> <!-- ruoyi-modules-chargingPile-api --> <dependency> <groupId>com.ruoyi</groupId> ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/config/DataUpdateHandlerConfig.java
@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import java.time.LocalDateTime; import java.util.Date; /** @@ -33,8 +34,8 @@ */ @Override public void insertFill(MetaObject metaObject) { this.setFieldValByName("createTime", new Date(), metaObject); this.setFieldValByName("updateTime", new Date(), metaObject); this.setFieldValByName("createTime", LocalDateTime.now(), metaObject); this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); } /** @@ -44,6 +45,6 @@ */ @Override public void updateFill(MetaObject metaObject) { this.setFieldValByName("updateTime", new Date(), metaObject); this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); } } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java
@@ -81,12 +81,12 @@ @ResponseBody @DeleteMapping("/delPartner/{id}") @DeleteMapping("/delPartner") @ApiOperation(value = "删除合作商", tags = {"管理后台-合作商管理"}) @ApiImplicitParams({ @ApiImplicitParam(value = "合作商id", name = "id", dataTypeClass = Integer.class, required = true) }) public AjaxResult delPartner(@PathVariable("id") Integer[] id){ public AjaxResult delPartner(@RequestParam("id") List<Integer> id){ return partnerService.delPartner(id); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
@@ -5,17 +5,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; import com.ruoyi.chargingPile.api.feignClient.ParkingLotClient; import com.ruoyi.chargingPile.api.model.Site; import com.ruoyi.chargingPile.api.model.TChargingGun; import com.ruoyi.chargingPile.api.model.TChargingPile; import com.ruoyi.chargingPile.api.model.TParkingLot; import com.ruoyi.chargingPile.api.model.*; import com.ruoyi.chargingPile.api.query.GetSiteList; import com.ruoyi.chargingPile.api.query.SiteDetailQuery; import com.ruoyi.chargingPile.api.query.SiteQuery; import com.ruoyi.chargingPile.api.vo.ChargingGunCountVO; import com.ruoyi.chargingPile.api.vo.SiteDetailVO; import com.ruoyi.chargingPile.api.vo.SiteVO; import com.ruoyi.chargingPile.api.vo.TChargingPileVO; import com.ruoyi.chargingPile.api.vo.*; import com.ruoyi.chargingPile.domain.SiteMenu; import com.ruoyi.chargingPile.service.*; import com.ruoyi.common.core.domain.R; @@ -36,6 +30,8 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalTime; import java.util.*; /** @@ -69,18 +65,44 @@ @Autowired private TParkingLotService parkingLotService; @Autowired private TAccountingStrategyService accountingStrategyService; @Autowired private TAccountingStrategyDetailService accountingStrategyDetailService; /** * 小程序扫一扫 * @param number * @return */ @PostMapping("/getSiteInfoByNumber") @ApiOperation(value = "扫一扫后通过桩编号获取电站信息", tags = {"小程序-扫一扫"}) public R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number){ SiteInfoVO siteInfoVO = new SiteInfoVO(); TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getNumber, 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(); for (TAccountingStrategyDetail tAccountingStrategyDetail : list) { // 当前时间属于那个阶段 取哪个阶段的电价 if(LocalTime.now().isAfter(LocalTime.parse(tAccountingStrategyDetail.getStartTime())) && LocalTime.now().isBefore(LocalTime.parse(tAccountingStrategyDetail.getEndTime()))){ siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence()); siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().multiply(byId1.getDiscount()).setScale(2, BigDecimal.ROUND_HALF_UP)); } } siteInfoVO.setName(byId.getName()); siteInfoVO.setNumber(one.getNumber().toString()); siteInfoVO.setSpaceChargeExplain(byId.getSpaceChargeExplain()); return R.ok(siteInfoVO); } @ResponseBody @GetMapping("/getSiteList") @ApiOperation(value = "获取站点列表", tags = {"管理后台-站点管理"}) public AjaxResult<PageInfo<GetSiteListDTO>> getSiteList(GetSiteList siteList){ PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList); return AjaxResult.success(list); } @ResponseBody @GetMapping("/getSiteList1") @ApiOperation(value = "获取站点列表 不分页", tags = {"管理后台-活动费用统计"}) public AjaxResult<List<Site>> getSiteList1(){ @@ -148,12 +170,12 @@ } @ResponseBody @DeleteMapping("/delSite/{id}") @DeleteMapping("/delSite") @ApiOperation(value = "删除站点", tags = {"管理后台-站点管理"}) @ApiImplicitParams({ @ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true) }) public AjaxResult delSite(@PathVariable Integer[] id){ public AjaxResult delSite(@RequestParam("id") Integer[] id){ return siteService.delSite(id); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
@@ -179,8 +179,6 @@ } } return AjaxResult.ok(accountingStrategyService.pageList(query)); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
@@ -92,8 +92,7 @@ @DeleteMapping(value = "/deleteById") public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) { TChargingGun chargingGun = chargingGunService.getById(id); chargingGun.setDelFlag(true); chargingGunService.updateById(chargingGun); chargingGunService.removeById(chargingGun); return AjaxResult.success(); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
@@ -117,13 +117,13 @@ @ResponseBody @DeleteMapping("/delChargingPile/{id}") @DeleteMapping("/delChargingPile") @Log(title = "删除充电桩", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) @ApiOperation(value = "删除充电桩", tags = {"管理后台-充电桩信息"}) @ApiImplicitParams({ @ApiImplicitParam(value = "充电桩id", name = "id", dataTypeClass = Integer.class, required = true) }) public AjaxResult delChargingPile(@PathVariable Integer[] id){ public AjaxResult delChargingPile(@RequestParam("id") Integer[] id){ return chargingPileService.delChargingPile(id); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileNotificationController.java
@@ -39,9 +39,9 @@ @ResponseBody @DeleteMapping("/delChargingPileNotification/{id}") @DeleteMapping("/delChargingPileNotification") @ApiOperation(value = "删除系统通知", tags = {"管理后台-系统通知"}) public AjaxResult delChargingPileNotification(@PathVariable Long id){ public AjaxResult delChargingPileNotification(@RequestParam("id") Long id){ TChargingPileNotification chargingPileNotification = chargingPileNotificationService.getById(id); chargingPileNotification.setDelFlag(1); chargingPileNotificationService.updateById(chargingPileNotification); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/IPartnerService.java
@@ -58,7 +58,7 @@ * 删除合作商 * @param id */ AjaxResult delPartner(Integer[] id); AjaxResult delPartner(List<Integer> id); /** * 重置密码 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
@@ -165,10 +165,10 @@ if(StringUtils.isEmpty(partner.getPhoneOne())){ return AjaxResult.error("合作商电话1不能为空"); } if(StringUtils.isEmpty(partner.getAccount())){ if(null == partner.getId() && StringUtils.isEmpty(partner.getAccount())){ return AjaxResult.error("登录账号不能为空"); } if(StringUtils.isEmpty(partner.getPassword())){ if(null == partner.getId() && StringUtils.isEmpty(partner.getPassword())){ return AjaxResult.error("登录密码不能为空"); } return AjaxResult.success(); @@ -272,7 +272,7 @@ */ @Override @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult delPartner(Integer[] ids) { public AjaxResult delPartner(List<Integer> ids) { //查询有无关联数据 //站点 long count = siteService.count(new LambdaQueryWrapper<Site>().in(Site::getPartnerId, Arrays.asList(ids)).eq(Site::getDelFlag, 0)); @@ -289,8 +289,7 @@ if(null == partner){ return AjaxResult.error("删除失败"); } partner.setDelFlag(true); this.updateById(partner); this.removeById(partner); SysUser user = sysUserClient.queryUserByUserName(partner.getAccount()).getData(); user.setDelFlag("2"); sysUserClient.updateUser(user); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
@@ -210,8 +210,7 @@ } for (Integer id : ids) { Site site = this.getById(id); site.setDelFlag(true); this.updateById(site); this.removeById(site); } return AjaxResult.success(); } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -222,8 +222,7 @@ } for (Integer id : ids) { TChargingPile chargingPile = this.getById(id); chargingPile.setDelFlag(true); this.updateById(chargingPile); this.removeById(chargingPile); } return AjaxResult.success(); } ruoyi-service/ruoyi-chargingPile/src/main/resources/bootstrap.yml
@@ -44,7 +44,7 @@ enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: true #开启数据库代理 enable-auto-data-source-proxy: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default ruoyi-service/ruoyi-integration/src/main/resources/bootstrap.yml
@@ -44,7 +44,7 @@ enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: true #开启数据库代理 enable-auto-data-source-proxy: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -44,7 +44,7 @@ * @param * @return */ @PostMapping(value = "/getCar") @GetMapping(value = "/getCar") public R<Long> getCar() { List<TChargingOrder> list = chargingOrderService.list(new LambdaQueryWrapper<TChargingOrder>() .eq(TChargingOrder::getAppUserId, tokenService.getLoginUserApplet().getUserId()) ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java
@@ -62,7 +62,7 @@ @GetMapping(value = "/addOrderAppeal") @ApiOperation(value = "申诉订单", tags = {"小程序-充电记录(个人中心)"}) public AjaxResult addOrderAppeal(@RequestBody TOrderAppeal orderAppeal){ Long appUserId = tokenService.getLoginUser().getUserid(); Long appUserId = tokenService.getLoginUserApplet().getUserId(); orderAppeal.setAppUserId(appUserId); orderAppeal.setStatus(1); orderAppealService.save(orderAppeal); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java
@@ -67,8 +67,7 @@ @ApiOperation(value = "删除充电评价", tags = {"管理后台-充电评价"}) public AjaxResult delOrderEvaluate(@PathVariable Long id){ TOrderEvaluate orderEvaluate = orderEvaluateService.getById(id); orderEvaluate.setDelFlag(true); orderEvaluateService.updateById(orderEvaluate); orderEvaluateService.removeById(orderEvaluate); return AjaxResult.success(); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -65,7 +65,7 @@ */ @Override public Map<String, Object> getMyChargingOrderList(GetMyChargingOrderList query) { Long appUserId = tokenService.getLoginUser().getUserid(); Long appUserId = tokenService.getLoginUserApplet().getUserId(); Map<String, Object> map = new HashMap<>(); int size = this.baseMapper.getMyChargingOrderList(appUserId, 1, null, null).size(); map.put("number", size); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
@@ -58,7 +58,7 @@ */ @Override public List<MyExchangeOrderList> getMyExchangeOrder(GetMyExchangeOrder query) { Long userid = tokenService.getLoginUser().getUserid(); Long userid = tokenService.getLoginUserApplet().getUserId(); LambdaQueryWrapper<TExchangeOrder> wrapper = new LambdaQueryWrapper<TExchangeOrder>().eq(TExchangeOrder::getDelFlag, 0).eq(TExchangeOrder::getAppUserId, userid); if(query.getStatus() == 0){ wrapper.ne(TExchangeOrder::getStatus, 4); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java
@@ -246,7 +246,7 @@ } orderEvaluate = new TOrderEvaluate(); BeanUtils.copyProperties(query, orderEvaluate); Long userid = tokenService.getLoginUser().getUserid(); Long userid = tokenService.getLoginUserApplet().getUserId(); orderEvaluate.setAppUserId(userid); if(query.getOrderType() == 1){ TChargingOrder chargingOrder = chargingOrderService.getById(query.getOrderId()); ruoyi-service/ruoyi-order/src/main/resources/bootstrap.yml
@@ -44,7 +44,7 @@ enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: true #开启数据库代理 enable-auto-data-source-proxy: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default ruoyi-service/ruoyi-other/pom.xml
@@ -51,6 +51,11 @@ <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> </dependency> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-seata</artifactId> </dependency> <!-- SpringBoot Actuator --> <dependency> <groupId>org.springframework.boot</groupId> ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/DataSourceProxyConfig.java
New file @@ -0,0 +1,21 @@ //package com.ruoyi.other.config; // //import io.seata.rm.datasource.DataSourceProxy; //import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Configuration; // //import javax.sql.DataSource; // ///** // * @author zhibing.pu // * @date 2024/8/17 11:10 // */ //@Configuration //public class DataSourceProxyConfig { // // // @Bean // public DataSource dataSource(DataSource druidDataSource){ // return new DataSourceProxy(druidDataSource); // } //} ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
@@ -117,6 +117,11 @@ return AjaxResult.ok(tCouponService.pageList(dto)); } @PostMapping(value = "/getCouponById") public R<TCoupon> getCouponById(@RequestParam Integer id) { return R.ok(tCouponService.getById(id)); } /** * 小程序远程调用 获取优惠券信息 */ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEvaluationTagController.java
@@ -38,8 +38,8 @@ } @PostMapping("/getTagList") public R<List<TEvaluationTagVO>> getTagList() { return R.ok(evaluationTagService.getTagList()); public R<List<TEvaluationTagVO>> getTagList(@RequestParam("type") Integer type) { return R.ok(evaluationTagService.getTagList(type)); } @@ -80,13 +80,12 @@ @ResponseBody @DeleteMapping("/delEvaluationTag/{id}") @DeleteMapping("/delEvaluationTag") @ApiOperation(value = "删除评价标签", tags = {"管理后台-评价标签设置"}) public AjaxResult<TInvoiceType> delEvaluationTag(@PathVariable Integer[] id){ public AjaxResult<TInvoiceType> delEvaluationTag(@RequestParam("id") Integer[] id){ List<TEvaluationTag> tEvaluationTags = evaluationTagService.listByIds(Arrays.asList(id)); for (TEvaluationTag evaluationTag : tEvaluationTags) { evaluationTag.setDelFlag(true); evaluationTagService.updateById(evaluationTag); evaluationTagService.removeById(evaluationTag); } return AjaxResult.success(); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java
@@ -1,9 +1,14 @@ package com.ruoyi.other.controller; import org.springframework.web.bind.annotation.RequestMapping; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.api.domain.THtml; import com.ruoyi.other.api.domain.TNotice; import com.ruoyi.other.service.THtmlService; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * <p> @@ -16,6 +21,21 @@ @RestController @RequestMapping("/t-html") public class THtmlController { @Resource private THtmlService htmlService; @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "新增修改") @PostMapping(value = "/saveOrUpdate") public AjaxResult saveOrUpdate(@RequestBody THtml tHtml) { htmlService.saveOrUpdate(tHtml); return AjaxResult.success(); } @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "查询") @PostMapping(value = "/selectByType/{type}") public AjaxResult selectByType(@PathVariable Integer type) { THtml one = htmlService.lambdaQuery().eq(THtml::getType, type).last("limit 1").one(); return AjaxResult.success(one); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java
@@ -62,6 +62,9 @@ "11=开票说明") public R<String> getInfo(Integer type) { THtml g = htmlService.getOne(new QueryWrapper<THtml>().eq("type",type)); if (g == null){ return R.ok(""); } return R.ok(g.getContent()); } @GetMapping("/saveInfo") @@ -87,10 +90,6 @@ THtml tHtml = new THtml(); tHtml.setType(type); tHtml.setContent(info); tHtml.setCreateTime(LocalDateTime.now()); tHtml.setDelFlag(false); htmlService.save(tHtml); }else{ g.setContent(info); ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TInvoiceTypeController.java
@@ -65,13 +65,12 @@ @ResponseBody @DeleteMapping("/delInvoiceType/{id}") @DeleteMapping("/delInvoiceType") @ApiOperation(value = "删除发票类型", tags = {"管理后台-发票类型管理"}) public AjaxResult<TInvoiceType> delInvoiceType(@PathVariable Integer[] id){ public AjaxResult<TInvoiceType> delInvoiceType(@RequestParam("id") Integer[] id){ List<TInvoiceType> tInvoiceTypes = invoiceTypeService.listByIds(Arrays.asList(id)); for (TInvoiceType invoiceType : tInvoiceTypes) { invoiceType.setDelFlag(true); invoiceTypeService.updateById(invoiceType); invoiceTypeService.removeById(invoiceType); } return AjaxResult.success(); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TNoticeController.java
@@ -1,9 +1,17 @@ package com.ruoyi.other.controller; import org.springframework.web.bind.annotation.RequestMapping; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.other.api.domain.TNotice; import com.ruoyi.other.api.dto.NoticeQueryDto; import com.ruoyi.other.mapper.SysNoticeMapper; import com.ruoyi.other.service.TNoticeService; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.time.LocalDateTime; /** * <p> @@ -16,6 +24,49 @@ @RestController @RequestMapping("/t-notice") public class TNoticeController { @Resource private TNoticeService noticeService; @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "新增修改") @PostMapping(value = "/saveOrUpdate") public AjaxResult saveOrUpdate(@RequestBody TNotice notice) { noticeService.saveOrUpdate(notice); return AjaxResult.success(); } @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "删除") @PostMapping(value = "/deleteById/{id}") public AjaxResult deleteById(@PathVariable Integer id) { noticeService.removeById(id); return AjaxResult.success(); } @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "查询") @PostMapping(value = "/pageList") public AjaxResult<Page<TNotice>> authPageList(@RequestBody NoticeQueryDto query) { if (query.getStatus()==0){ return AjaxResult.success(noticeService.lambdaQuery() .le(TNotice::getStartTime, LocalDateTime.now()) .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent()) .page(Page.of(query.getPageCurr(),query.getPageSize()))); }else if (query.getStatus()==1){ return AjaxResult.success(noticeService.lambdaQuery() .ge(TNotice::getStartTime, LocalDateTime.now()).le(TNotice::getEndTime,LocalDateTime.now()) .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent()) .page(Page.of(query.getPageCurr(),query.getPageSize()))); }else if (query.getStatus()==2){ return AjaxResult.success(noticeService.lambdaQuery() .ge(TNotice::getEndTime, LocalDateTime.now()) .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent()) .page(Page.of(query.getPageCurr(),query.getPageSize()))); }else{ return AjaxResult.success(noticeService.lambdaQuery() .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent()) .page(Page.of(query.getPageCurr(),query.getPageSize()))); } } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TSystemConfigurationController.java
@@ -8,11 +8,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; /** * <p> @@ -36,12 +32,19 @@ /** * 查看系统设置 */ @ApiOperation(tags = {"小程序-系统设置"},value = "联系客服") @ApiOperation(tags = {"小程序-系统设置","后台-内容设置"},value = "联系客服,查询设置") @GetMapping(value = "/getDetailById") public AjaxResult<TSystemConfiguration> getDetailById(@RequestParam(name = "type")@ApiParam(value = "1=客服信息,2=系统设置") Integer type) { return AjaxResult.ok(systemConfigurationService.getOne(Wrappers.lambdaQuery(TSystemConfiguration.class) .eq(TSystemConfiguration::getType, type))); } @ApiOperation(tags = {"后台-内容设置"},value = "客户信息,系统内容设置") @GetMapping(value = "/save") public AjaxResult getDetailById(@RequestBody TSystemConfiguration systemConfiguration) { systemConfigurationService.saveOrUpdate(systemConfiguration); return AjaxResult.success(); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
@@ -1,13 +1,19 @@ package com.ruoyi.other.controller; import com.alibaba.fastjson2.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.account.api.dto.SendCouponDto; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.other.api.domain.TCoupon; import com.ruoyi.other.api.domain.TIntegralRule; import com.ruoyi.other.api.domain.TUserTag; import com.ruoyi.other.api.domain.TVip; import com.ruoyi.other.api.dto.VipCouponDto; import com.ruoyi.other.api.dto.VipInfoDto; import com.ruoyi.other.service.TCouponService; import com.ruoyi.other.service.TVipService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -16,6 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -33,6 +42,8 @@ public class TVipController { @Autowired private TVipService vipService; @Resource private TCouponService couponService; @PostMapping("/saveVip") @ApiOperation(tags = {"管理后台-会员管理"},value = "会员添加") public AjaxResult saveVip(@RequestBody TVip dto) { @@ -57,6 +68,13 @@ return AjaxResult.ok(vipService.getById(id)); } @GetMapping("/getById") @ApiOperation(value = "通过id查会员") public R<TVip> getById(Integer id) { return R.ok(vipService.getById(id)); } /** * 远程调用 * @param id @@ -74,6 +92,16 @@ }) public AjaxResult<PageInfo<TVip>> pageList(Integer pageCurr,Integer pageSize) { return AjaxResult.ok(vipService.pageList(pageCurr,pageSize)); } @ApiOperation(tags = {"会员下拉框"},value = "会员列表分页查询") @PostMapping(value = "/select") @ApiImplicitParams({ @ApiImplicitParam(name = "pageCurr", value = "分页参数,当前页码", required = true), @ApiImplicitParam(name = "pageSize", value = "分页参数,每页数量",required = true) }) public AjaxResult<List<TVip>> select() { return AjaxResult.ok(vipService.list()); } //获取会员Map @@ -115,5 +143,47 @@ } } @ApiOperation(value = "会员信息", tags = {"小程序-个人中心"}) @PostMapping("/vipInfo") public AjaxResult vipInfo() { List<VipInfoDto> vipInfoDtos = new ArrayList<>(); List<TVip> vips = vipService.lambdaQuery().eq(TVip::getReveal, 1).list(); for (TVip vip : vips) { VipInfoDto vipInfoDto = new VipInfoDto(); vipInfoDto.setMonthlyCard(vip.getMonthlyCardReveal()==1?vip.getMonthlyCard():null); vipInfoDto.setSeasonCard(vip.getSeasonCardReveal()==1?vip.getSeasonCard():null); vipInfoDto.setAnnualCard(vip.getAnnualCardReveal()==1?vip.getAnnualCard():null); vipInfoDto.setMaximumDeduction(vip.getMaximumDeduction()); vipInfoDto.setDiscountTimes(vip.getDiscountTimes()); vipInfoDto.setDoubleIntegration(vip.getDoubleIntegration()); vipInfoDto.setMallExclusivePrice(vip.getMallExclusivePrice()); List<SendCouponDto> javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class); List<VipCouponDto> vipCouponDtos = new ArrayList<>(); if (!javaList.isEmpty()){ for (SendCouponDto sendCouponDto : javaList) { VipCouponDto vipCouponDto = new VipCouponDto(); TCoupon byId = couponService.getById(sendCouponDto.getId()); vipCouponDto.setNum(sendCouponDto.getNumber()); vipCouponDto.setTCoupon(byId); vipCouponDtos.add(vipCouponDto); } } vipInfoDto.setVipCouponDtos(vipCouponDtos); //计算总折扣 BigDecimal total = BigDecimal.ZERO; total = total.add(vip.getMaximumDeduction().multiply(BigDecimal.valueOf(vip.getDiscountTimes()))); for (VipCouponDto vipCouponDto : vipCouponDtos) { TCoupon tCoupon = vipCouponDto.getTCoupon(); total.add(tCoupon.getDiscount()); } vipInfoDto.setTotalDiscount(total); vipInfoDtos.add(vipInfoDto); } return AjaxResult.success(vipInfoDtos); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TEvaluationTagMapper.java
@@ -22,7 +22,7 @@ * 获取评价标签列表 * @return */ List<TEvaluationTagVO> getTagList(); List<TEvaluationTagVO> getTagList(Integer type); /** ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TEvaluationTagService.java
@@ -22,7 +22,7 @@ * 查询标签列表 * @return */ List<TEvaluationTagVO> getTagList(); List<TEvaluationTagVO> getTagList(Integer type); /** ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TEvaluationTagServiceImpl.java
@@ -23,8 +23,8 @@ public class TEvaluationTagServiceImpl extends ServiceImpl<TEvaluationTagMapper, TEvaluationTag> implements TEvaluationTagService { @Override public List<TEvaluationTagVO> getTagList() { return this.baseMapper.getTagList(); public List<TEvaluationTagVO> getTagList(Integer type) { return this.baseMapper.getTagList(type); } ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml
@@ -37,14 +37,12 @@ # 共享配置 shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} --- seata: enabled: true application-id: ${spring.application.name} tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 enable-auto-data-source-proxy: true #开启数据库代理 enable-auto-data-source-proxy: true #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TEvaluationTagMapper.xml
@@ -17,7 +17,11 @@ </sql> <select id="getTagList" resultType="com.ruoyi.other.api.vo.TEvaluationTagVO"> select <include refid="Base_Column_List"></include> from t_evaluation_tag where del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} ORDER BY `type` from t_evaluation_tag where del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} <if test="null != type"> and `type` = #{type} </if> ORDER BY `type` </select> ruoyi-service/ruoyi-payment/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: true #开启数据库代理 enable-auto-data-source-proxy: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default