ruoyi-auth/pom.xml
@@ -38,11 +38,6 @@ <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> </dependency> <dependency> <groupId>com.ruoyi</groupId> <artifactId>ruoyi-common-seata</artifactId> </dependency> <!-- SpringBoot Web --> <dependency> ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java
@@ -8,7 +8,6 @@ import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.SysUserClient; import io.seata.spring.annotation.GlobalTransactional; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; @@ -50,7 +49,6 @@ @PostMapping("login") @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public R<?> login(@RequestBody LoginBody form, HttpServletRequest request) { // 用户登录 LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword(), request); ruoyi-auth/src/main/resources/bootstrap.yml
@@ -42,70 +42,7 @@ # 共享配置 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: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP username: nacos password: nacos cloud: nacos: discovery: # 开发环境 # server-addr: 192.168.110.169:8848 # nacos注册中心地址 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos sentinel: transport: dashboard: 127.0.0.1:8080 # Sentinel控制台地址 eager: true --- spring: config: ruoyi-modules/ruoyi-system/pom.xml
@@ -39,11 +39,6 @@ <groupId>com.alibaba.cloud</groupId> <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> ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
@@ -34,7 +34,6 @@ import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserRoleService; import com.ruoyi.system.service.ISysUserService; import io.seata.spring.annotation.GlobalTransactional; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -128,7 +127,6 @@ @ResponseBody @PostMapping("/roleAdd") @ApiOperation(value = "添加角色", tags = {"管理后台-角色管理"}) @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult roleAdd(@Validated @RequestBody RoleAddDto dto) { SysRole role = new SysRole(); role.setRoleName(dto.getRoleName()); @@ -210,7 +208,6 @@ @RequiresPermissions(value = {"/roleManagement/update"}, logical = Logical.OR) @PostMapping("/roleUpdate") @ApiOperation(value = "编辑角色", tags = {"管理后台-角色管理"}) @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult roleUpdate(@Validated @RequestBody RoleUpdateDto dto) { SysRole role = new SysRole(); role.setRoleName(dto.getRoleName()); ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -21,8 +21,6 @@ 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; import org.apache.commons.lang3.ArrayUtils; @@ -115,7 +113,6 @@ @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping("/add") @ApiOperation(value = "添加系统用户", tags = {"管理后台-系统用户管理"}) @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult add(@RequestBody SysUser user) { user.setUserName(user.getPhonenumber()); if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ @@ -212,7 +209,6 @@ @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/update") @ApiOperation(value = "编辑系统用户", tags = {"管理后台-系统用户管理"}) @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult edit(@Validated @RequestBody SysUser user) { user.setUserName(user.getPhonenumber()); if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
@@ -41,70 +41,7 @@ # 共享配置 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: false service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP username: nacos password: nacos cloud: nacos: discovery: # 开发环境 # server-addr: 192.168.110.169:8848 # nacos注册中心地址 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos sentinel: transport: dashboard: 127.0.0.1:8080 # Sentinel控制台地址 eager: true --- spring: config: ruoyi-service/ruoyi-account/pom.xml
@@ -51,11 +51,6 @@ <groupId>com.alibaba.cloud</groupId> <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> ruoyi-service/ruoyi-account/src/main/resources/bootstrap.yml
@@ -42,70 +42,7 @@ # 共享配置 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: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP username: nacos password: nacos cloud: nacos: discovery: # 开发环境 # server-addr: 192.168.110.169:8848 # nacos注册中心地址 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos sentinel: transport: dashboard: 192.168.0.137:8080 # Sentinel控制台地址 eager: true --- spring: config: ruoyi-service/ruoyi-chargingPile/pom.xml
@@ -44,11 +44,6 @@ <groupId>com.alibaba.cloud</groupId> <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> @@ -162,6 +157,11 @@ <groupId>com.ruoyi</groupId> <artifactId>ruoyi-api-jianguan</artifactId> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> </dependencies> <build> ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
@@ -353,7 +353,7 @@ faultMessage.setContent("设备故障"); faultMessageService.save(faultMessage); } if(2 == status){ if(2 == status && !Arrays.asList(3, 4, 5).contains(tChargingGun.getStatus())){ TChargingOrderVo order = new TChargingOrderVo(); order.setChargingPileId(tChargingGun.getChargingPileId()); order.setChargingGunId(tChargingGun.getId()); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/dto/ParkingRecordPageQuery.java
@@ -2,7 +2,6 @@ import com.ruoyi.common.core.web.page.BasePage; import lombok.Data; import org.stringtemplate.v4.ST; import java.time.LocalDate; import java.time.LocalDateTime; ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
@@ -24,7 +24,6 @@ import com.ruoyi.system.api.feignClient.SysUserRoleClient; import com.ruoyi.system.api.model.GetSysRoleByIds; import com.ruoyi.system.api.model.SysUserRoleVo; import io.seata.spring.annotation.GlobalTransactional; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -107,7 +106,6 @@ * @return */ @Override @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult addPartner(Partner partner) { //校验参数和重复数据 AjaxResult ajaxResult = addPartnerParameterCheck(partner); @@ -213,7 +211,6 @@ * @return */ @Override @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult editPartner(Partner partner) { //校验参数和重复数据 AjaxResult ajaxResult = addPartnerParameterCheck(partner); @@ -279,7 +276,6 @@ * @param ids 合作商id */ @Override @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult delPartner(List<Integer> ids) { //查询有无关联数据 //站点 @@ -311,7 +307,6 @@ * @param resetPassword */ @Override @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 public AjaxResult resetPassword(ResetPassword resetPassword) { if(null == resetPassword.getId()){ return AjaxResult.error("合作商id不能为空"); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -737,7 +737,7 @@ Long time = (Long) redisTemplate.opsForHash().get("charging_gun_online", key); if(null != time && System.currentTimeMillis() - time > 300000){ log.info("设备编号:{} 已离线", key); log.info("间隔时间", System.currentTimeMillis() - time); log.info("间隔时间:{}", System.currentTimeMillis() - time); fullNumbers.add(key.toString()); } }); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/util/TaskUtil.java
@@ -1,17 +1,17 @@ package com.ruoyi.chargingPile.util; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.ruoyi.chargingPile.api.model.Site; import com.ruoyi.chargingPile.api.model.TChargingGun; import com.ruoyi.chargingPile.service.ISiteService; import com.ruoyi.chargingPile.service.TChargingGunService; import com.ruoyi.chargingPile.service.TChargingPileService; import com.ruoyi.chargingPile.api.model.*; import com.ruoyi.chargingPile.service.*; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.integration.api.elutong.model.*; import com.ruoyi.integration.api.feignClient.ELuTongClient; import com.ruoyi.integration.api.feignClient.IntegrationClient; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.context.ApplicationListener; @@ -21,6 +21,7 @@ import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.Set;import java.util.stream.Collectors; /** @@ -43,6 +44,12 @@ @Resource private TChargingGunService chargingGunService; @Resource private TAccountingStrategyDetailService accountingStrategyDetailService; @Resource private IntegrationClient integrationClient; @Override @@ -64,6 +71,46 @@ /** * 主动下发计费策略 */ @Scheduled(cron = "0 0 6 * * ?") public void taskMonth() { if(null != port && port == 5300){ //主动下发计费策略 //下发桩独立的 log.info("主动下发计费策略开始"); List<TChargingGun> tChargingGuns = chargingGunService.list(new QueryWrapper<TChargingGun>().eq("del_flag", 0).isNotNull("accounting_strategy_id")); Set<Integer> collect = tChargingGuns.stream().map(TChargingGun::getChargingPileId).collect(Collectors.toSet()); List<TChargingPile> tChargingPiles = chargingPileService.listByIds(collect); for (TChargingPile chargingPile : tChargingPiles) { TChargingGun tChargingGun = tChargingGuns.stream().filter(s->s.getChargingPileId().equals(chargingPile.getId())).findFirst().orElse(null); Integer accountingStrategyId = tChargingGun.getAccountingStrategyId(); List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailService.list(new LambdaQueryWrapper<TAccountingStrategyDetail>() .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategyId).orderByAsc(TAccountingStrategyDetail::getStartTime)); integrationClient.setupBillingModel1(chargingPile.getCode(), JSON.toJSONString(accountingStrategyDetails)); } //下发场站统一的计费策略 List<TChargingGun> tChargingGuns1 = chargingGunService.list(new QueryWrapper<TChargingGun>().eq("del_flag", 0).isNull("accounting_strategy_id")); if(!tChargingGuns1.isEmpty()){ Set<Integer> collect2 = tChargingGuns1.stream().map(TChargingGun::getSiteId).collect(Collectors.toSet()); List<Site> sites = siteService.listByIds(collect2); Set<Integer> collect1 = tChargingGuns1.stream().map(TChargingGun::getChargingPileId).collect(Collectors.toSet()); List<TChargingPile> tChargingPiles1 = chargingPileService.listByIds(collect1); for (TChargingPile chargingPile : tChargingPiles1) { Site site = sites.stream().filter(s->s.getId().equals(chargingPile.getSiteId())).findFirst().orElse(null); Integer accountingStrategyId = site.getAccountingStrategyId(); List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailService.list(new LambdaQueryWrapper<TAccountingStrategyDetail>() .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategyId).orderByAsc(TAccountingStrategyDetail::getStartTime)); integrationClient.setupBillingModel1(chargingPile.getCode(), JSON.toJSONString(accountingStrategyDetails)); } } log.info("主动下发计费策略结束"); } } /** * 1分钟定时推送设备状态E路通 */ private void pushStationsStatus(){ ruoyi-service/ruoyi-chargingPile/src/main/resources/bootstrap.yml
@@ -42,70 +42,7 @@ # 共享配置 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: false service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP username: nacos password: nacos cloud: nacos: discovery: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos sentinel: transport: dashboard: 127.0.0.1:8080 # Sentinel控制台地址 eager: true --- spring: config: ruoyi-service/ruoyi-integration/pom.xml
@@ -36,11 +36,6 @@ <groupId>com.alibaba.cloud</groupId> <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> ruoyi-service/ruoyi-integration/src/main/resources/bootstrap.yml
@@ -43,73 +43,7 @@ # 共享配置 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: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos # 生产环境 # server-addr: 192.168.0.137:8848,192.168.0.123:8848 server-addr: 192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # username: nacos # password: nacos # 生产环境 # server-addr: 192.168.0.137:8848,192.168.0.123:8848 server-addr: 192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP username: nacos password: nacos cloud: nacos: discovery: # 开发环境 # server-addr: 192.168.110.169:8848 # nacos注册中心地址 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos # 生产环境 # server-addr: 192.168.0.137:8848,192.168.0.123:8848 server-addr: 192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos sentinel: transport: dashboard: 127.0.0.1:8080 # Sentinel控制台地址 eager: true --- spring: config: ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/KsolarUtils.java
@@ -25,104 +25,104 @@ private static String accessToken; private static List<String> stationIds= Arrays.asList("2025060710462417","2025060711331323","2025060715425437","2025060716010425"); private static List<String> stationIds = Arrays.asList("2025060710462417", "2025060711331323", "2025060715425437", "2025060716010425"); /** * 获取今日总发电量 * * @param time * @return */ public static Double getTodayEnergy(String time) { try { HttpRequest get = HttpUtil.createGet("http://111.230.136.62:8092/station/list/earn"); get.header("Authorization", "Bearer "+token); get.header("Authorization", "Bearer " + token); get.form("startDate", time); HttpResponse execute = get.execute(); String body = execute.body(); JSONObject jsonObject = JSONObject.parseObject(body); String code = jsonObject.get("code").toString(); if(!"200".equals(code)){ if (!"200".equals(code)) { token = token(); return getTodayEnergy(time); } Object data = jsonObject.get("data"); Object data = jsonObject.get("data"); JSONObject jsonObject1 = JSONObject.parseObject(data.toString()); Double earn = jsonObject1.getDouble("dayGeneration"); return earn; } catch (Exception e) { e.printStackTrace(); token = token(); return getTodayEnergy(time); } return 0D; } public static ArrayList<Map<String, Object>> getMonthEnergy(String time,String time1) { public static ArrayList<Map<String, Object>> getMonthEnergy(String time, String time1) { ArrayList<Map<String, Object>> list = new ArrayList<>(); try { HttpRequest get = HttpUtil.createGet("http://111.230.136.62:8092/protocol/user/statistic/elec/chart"); get.header("Authorization", "Bearer "+token); get.header("Authorization", "Bearer " + token); get.form("stime", time); get.form("attribId", "201"); HttpResponse execute = get.execute(); String body = execute.body(); if(body.contains("code")){ if (body.contains("code")) { token = token(); return getMonthEnergy(time,time1); return getMonthEnergy(time, time1); } JSONArray jsonArray = JSONArray.parseArray(body); for (Object o1 : jsonArray) { HashMap<String, Object> stringObjectHashMap = new HashMap<>(); JSONObject jsonObject = JSONObject.parseObject(o1.toString()) ; JSONObject jsonObject = JSONObject.parseObject(o1.toString()); stringObjectHashMap.put("time", jsonObject.getString("saveTime")); stringObjectHashMap.put("value", jsonObject.getString("attribValue")); list.add(stringObjectHashMap); } // 相同月份 if(!time.equals(time1)){ list.addAll(getMonthEnergy(time1,time1)); if (!time.equals(time1)) { list.addAll(getMonthEnergy(time1, time1)); } return list; } catch (Exception e) { e.printStackTrace(); token = token(); return getMonthEnergy(time,time1); } return list; } /** * 光伏累计 * * @return */ public static Double getAllEnergy(String time) { try { HttpRequest get = HttpUtil.createGet("http://111.230.136.62:8092/station/list/earn"); get.header("Authorization", "Bearer "+token); get.header("Authorization", "Bearer " + token); get.form("startDate", time); HttpResponse execute = get.execute(); String body = execute.body(); JSONObject jsonObject = JSONObject.parseObject(body); String code = jsonObject.get("code").toString(); if(!"200".equals(code)){ if (!"200".equals(code)) { token = token(); return getAllEnergy(time); } Object data = jsonObject.get("data"); Object data = jsonObject.get("data"); JSONObject jsonObject1 = JSONObject.parseObject(data.toString()); Double earn = jsonObject1.getDouble("totalGeneration"); return earn; } catch (Exception e) { e.printStackTrace(); token = token(); return getAllEnergy(time); } return 0D; } /** * 光伏碳减排 * * @return */ public static BigDecimal getYearAllEnergy() { @@ -136,14 +136,13 @@ } private static Double getYearAllEnergy(String stationId) { try { HttpRequest get = HttpUtil.createGet("http://111.230.136.62:8092/protocol/station/statistic/elec/chart"); get.header("Authorization", "Bearer "+token); get.header("Authorization", "Bearer " + token); get.form("stationId", stationId); get.form("attribId", "202"); get.form("stime",LocalDate.now().getYear()+"" ); get.form("stime", LocalDate.now().getYear() + ""); HttpResponse execute = get.execute(); String body = execute.body(); JSONArray jsonArray = JSONArray.parseArray(body); @@ -154,16 +153,14 @@ return earn; } catch (Exception e) { e.printStackTrace(); token = token(); return getYearAllEnergy(stationId); } return 0D; } public static String token() { HttpRequest post = HttpUtil.createPost("http://111.230.136.62:8092/authentication/form"); post.basicAuth("kstar","kstarSecret"); post.basicAuth("kstar", "kstarSecret"); post.form("username", "环岛光伏"); post.form("password", "cR8GGwIXMI462A8Dfl9eXg=="); HttpResponse execute = post.execute(); @@ -172,11 +169,11 @@ String token = jsonObject.getString("token"); JSONObject jsonObject1 = JSONObject.parseObject(token); String access_token = jsonObject1.getString("access_token"); return access_token; return access_token; } public static String getAccessToken(){ public static String getAccessToken() { HttpRequest post = HttpRequest.post("https://www.zsdcloud.cn:8443/openApi/getAccessToken.action?accessId=87bde117-1f29-4371-8d4d-82324d17ddc3"); HttpResponse execute = post.execute(); String body = execute.body(); @@ -187,9 +184,10 @@ /** * 消纳数据 * * @return */ public static String getElectricity(){ public static String getElectricity() { String valueTotal = "0"; String value = "0"; HttpRequest post = HttpRequest.post("https://www.zsdcloud.cn:8443/openApi/equipment/select.action"); @@ -200,9 +198,9 @@ String body = execute.body(); JSONObject jsonObject = JSONObject.parseObject(body); String string = jsonObject.get("statusCode").toString(); if(!string.equals("200")){ accessToken = getAccessToken(); return getElectricity(); if (!string.equals("200")) { accessToken = getAccessToken(); return getElectricity(); } String string1 = jsonObject.getString("result"); @@ -215,21 +213,21 @@ JSONArray jsonArray1 = JSONArray.parseArray(string2); for (Object o1 : jsonArray1) { JSONObject jsonObject3 = JSONObject.parseObject(o1.toString()); if(jsonObject3.get("Name").toString().equals("系统累计充电量")){ valueTotal= jsonObject3.get("Value").toString(); if (jsonObject3.get("Name").toString().equals("系统累计充电量")) { valueTotal = jsonObject3.get("Value").toString(); } if(jsonObject3.get("Name").toString().equals("系统累计放电量")){ value= jsonObject3.get("Value").toString(); if (jsonObject3.get("Name").toString().equals("系统累计放电量")) { value = jsonObject3.get("Value").toString(); } } } return valueTotal+"_"+value; return valueTotal + "_" + value; } public static void main(String[] args) throws Exception { String electricity = getElectricity(); System.out.println(electricity); } } ruoyi-service/ruoyi-order/pom.xml
@@ -71,11 +71,6 @@ <groupId>com.alibaba.cloud</groupId> <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> ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -73,8 +73,6 @@ import com.ruoyi.payment.api.vo.*; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.SysUserClient; import io.seata.spring.annotation.GlobalTransactional; import org.redisson.Redisson; import org.redisson.api.RLock; import org.redisson.api.RedissonClient; import org.slf4j.Logger; @@ -1820,13 +1818,15 @@ if (StringUtils.hasLength(dto.getStartTime())) { String[] split = dto.getStartTime().split(" - "); startTime1 = split[0]; startTime2 = split[1]; String[] split1 = split[1].split(":"); startTime2 = split1[0] + ":" + split1[1] + ":59"; } if (StringUtils.hasLength(dto.getEndTime())) { String[] split = dto.getEndTime().split(" - "); endTime1 = split[0]; endTime2 = split[1]; String[] split1 = split[1].split(":"); endTime2 = split1[0] + ":" + split1[1] + ":59"; } ChargingOrderTimeVO chargingOrderTimeVO = new ChargingOrderTimeVO(); if (StringUtils.hasLength(dto.getPhone())) { ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java
@@ -43,7 +43,6 @@ import com.ruoyi.system.api.feignClient.SysUserClient; import com.ruoyi.system.api.feignClient.SysUserRoleClient; import com.ruoyi.system.api.model.SysUserRoleVo; import io.seata.spring.annotation.GlobalTransactional; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java
@@ -29,7 +29,6 @@ import com.ruoyi.other.api.feignClient.CouponClient; import com.ruoyi.other.api.feignClient.GoodsClient; import com.ruoyi.other.api.feignClient.InvoiceTypeClient; import io.seata.spring.annotation.GlobalTransactional; import org.redisson.api.RLock; import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Autowired; ruoyi-service/ruoyi-order/src/main/resources/bootstrap.yml
@@ -42,70 +42,7 @@ # 共享配置 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: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP username: nacos password: nacos cloud: nacos: discovery: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos sentinel: transport: dashboard: 127.0.0.1:8080 # Sentinel控制台地址 eager: true --- spring: config: ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -458,8 +458,7 @@ FROM t_charging_order_accounting_strategy t1 LEFT JOIN t_charging_order t2 on t1.charging_order_id = t2.id where t2.del_flag = 0 and t2.status = 5 and t2.recharge_payment_status = 2 and t2.create_time between #{start} and #{end} where t2.del_flag = 0 and t2.recharge_payment_status = 2 and t2.start_time between #{start} and #{end} <if test="null != siteIds and siteIds.size() > 0"> and t2.site_id in <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> @@ -491,8 +490,8 @@ sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) <where> a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and DATE(a.create_time) = CURDATE() and a.create_time between #{start} and #{end} a.del_flag = 0 and a.recharge_payment_status = 2 and DATE(a.create_time) = CURDATE() and a.start_time between #{start} and #{end} <if test="null != siteIds and siteIds.size() > 0"> and a.site_id in <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> @@ -528,9 +527,9 @@ sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) <where> a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and YEARWEEK(DATE_FORMAT(a.create_time, a.del_flag = 0 and a.recharge_payment_status = 2 and YEARWEEK(DATE_FORMAT(a.create_time, '%Y-%m-%d'), 1) = YEARWEEK(NOW(), 1) and a.create_time between #{start} and #{end} and a.start_time between #{start} and #{end} <if test="null != siteIds and siteIds.size() > 0"> and a.site_id in <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> @@ -566,9 +565,9 @@ sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) <where> a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and MONTH(a.create_time) = MONTH(NOW()) a.del_flag = 0 and a.recharge_payment_status = 2 and MONTH(a.create_time) = MONTH(NOW()) AND YEAR(a.create_time) = YEAR(NOW()) and a.create_time between #{start} and #{end} and a.start_time between #{start} and #{end} <if test="null != siteIds and siteIds.size() > 0"> and a.site_id in <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> @@ -604,8 +603,8 @@ sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) <where> a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and YEAR(a.create_time) = YEAR(NOW()) and a.create_time between #{start} and #{end} a.del_flag = 0 and a.recharge_payment_status = 2 and YEAR(a.create_time) = YEAR(NOW()) and a.start_time between #{start} and #{end} <if test="null != siteIds and siteIds.size() > 0"> and a.site_id in <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> @@ -640,8 +639,8 @@ sum(period_service_price) as period_service_price, sum(period_electric_price + period_service_price) as money from t_charging_order_accounting_strategy group by charging_order_id) b on (a.id = b.charging_order_id) <where> a.del_flag = 0 and a.status = 5 and a.recharge_payment_status = 2 and a.create_time between #{start} and #{end} a.del_flag = 0 and a.recharge_payment_status = 2 and a.start_time between #{start} and #{end} <if test="null != siteIds and siteIds.size() > 0"> and a.site_id in <foreach collection="siteIds" separator="," open="(" close=")" item="item" index="index"> @@ -1179,7 +1178,10 @@ and b.site_id = #{req.siteId} </if> <if test="startTime1 != null and startTime1!=''"> and (b.create_time between #{startTime1} and #{startTime2}) and (b.end_time between #{startTime1} and #{startTime2}) and b.start_time between #{startTime1} and #{startTime2} </if> <if test="endTime1 != null and endTime2!=''"> and b.end_time between #{endTime1} and #{endTime2} </if> and b.start_time IS NOT NULL and b.end_time is not null ) as aa group by aa.id, aa.`code`, aa.siteId, aa.siteName, aa.orderType, aa.terminalName, aa.electricity, aa.rechargeAmount, aa.paymentAmount, aa.electrovalence, aa.serviceCharge, aa.tripartitePlatformName, @@ -1247,7 +1249,10 @@ and co.site_id = #{req.siteId} </if> <if test="startTime1 != null and startTime1!=''"> and (co.create_time between #{startTime1} and #{startTime2}) and (co.end_time between #{startTime1} and #{startTime2}) and co.start_time between #{startTime1} and #{startTime2} </if> <if test="endTime1 != null and endTime2!=''"> and co.end_time between #{endTime1} and #{endTime2} </if> and co.start_time IS NOT NULL and co.end_time is not null ) as a group by a.id @@ -1297,7 +1302,10 @@ and co.site_id = #{req.siteId} </if> <if test="startTime1 != null and startTime1!=''"> and (co.create_time between #{startTime1} and #{startTime2}) and (co.end_time between #{startTime1} and #{startTime2}) and co.start_time between #{startTime1} and #{startTime2} </if> <if test="endTime1 != null and endTime2!=''"> and co.end_time between #{endTime1} and #{endTime2} </if> and co.start_time IS NOT NULL and co.end_time is not null ) as a @@ -2057,11 +2065,11 @@ (UNIX_TIMESTAMP(b.end_time) - UNIX_TIMESTAMP(b.start_time)) as time, sum(a.charging_capacity) as total, sum(a.period_electric_price) as electronicMoney, sum(a.period_service_price) as serviceMoney, sum(CASE WHEN b.order_source = 1 THEN a.period_service_price ELSE a.period_service_price * 0.8 END) as serviceMoney, sum(a.period_electric_price + (CASE WHEN b.order_source = 1 THEN a.period_service_price ELSE a.period_service_price * 0.8 END)) as income from `charging_pile_order`.t_charging_order_accounting_strategy a left join `charging_pile_order`.t_charging_order b on (a.charging_order_id = b.id) where b.del_flag = 0 where b.del_flag = 0 and b.recharge_payment_status = 2 and b.start_time IS NOT NULL and b.end_time is not null <if test="null != req.code and req.code!=''"> and b.code LIKE CONCAT('%',#{req.code},'%') </if> ruoyi-service/ruoyi-other/pom.xml
@@ -44,11 +44,6 @@ <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/service/impl/TScreenContentServiceImpl.java
@@ -1,42 +1,26 @@ package com.ruoyi.other.service.impl; import com.alibaba.fastjson2.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.BasePojo; import com.ruoyi.order.api.feignClient.ChargingOrderClient; import com.ruoyi.order.api.model.TChargingOrder; import com.ruoyi.other.api.domain.TScreenContent; import com.ruoyi.other.api.domain.TSystemConfiguration; import com.ruoyi.other.mapper.TScreenContentMapper; import com.ruoyi.other.mapper.TSystemConfigurationMapper; import com.ruoyi.other.service.TScreenContentService; import com.ruoyi.other.service.TSystemConfigurationService; import com.ruoyi.other.util.KsolarUtils; import com.ruoyi.other.vo.EmissionReductionVO; import com.ruoyi.other.vo.PhotovoltaicPowerGenerationVO; import com.ruoyi.other.vo.ScreenStorageConfigVO; import com.ruoyi.other.vo.ScreenTopVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; import javax.json.Json; import javax.json.JsonObject; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.temporal.ChronoUnit; import java.util.*; import java.util.concurrent.ThreadLocalRandom; /** * <p> * 服务实现类 * 服务实现类 * </p> * * @author huliguo @@ -54,23 +38,23 @@ //需调用接口 计算光伏减排 EmissionReductionVO vo = new EmissionReductionVO(); //获取总电量 计算累计充电二氧化碳减排量 BigDecimal charge=top.getCarCharge(); BigDecimal charge = top.getCarCharge(); BigDecimal multiplier = new BigDecimal("0.1404"); //计算累计充电二氧化碳减排量 if (charge.compareTo(BigDecimal.ZERO) != 0) { // 定义乘数和除数 // 0.1404 // 0.1404 // 计算:charge × 0.1404 ÷ 1000 charge = charge .multiply(multiplier) // 乘以 0.1404 .divide(new BigDecimal("1000"),2, RoundingMode.HALF_DOWN); // 除以 1000,保留6位小数,四舍五入 .divide(new BigDecimal("1000"), 2, RoundingMode.HALF_DOWN); // 除以 1000,保留6位小数,四舍五入 } vo.setCharge(charge); //获取累计储能放电量 String s = KsolarUtils.getElectricity().split("_")[0]; vo.setEnergyStorage(new BigDecimal(s).multiply(multiplier) // 乘以 0.1404 .divide(new BigDecimal("1000"),2, RoundingMode.HALF_DOWN)); .divide(new BigDecimal("1000"), 2, RoundingMode.HALF_DOWN)); //获取累计发电 vo.setPhotovoltaic(KsolarUtils.getYearAllEnergy()); @@ -80,12 +64,10 @@ vo.setTotal(total); //计算比率 vo.setPhotovoltaicRate(calculateRatio(vo.getPhotovoltaic(),vo.getTotal()).multiply(new BigDecimal("100"))); vo.setEnergyStorageRate(calculateRatio(vo.getEnergyStorage(),vo.getTotal()).multiply(new BigDecimal("100"))); vo.setChargeRate(calculateRatio(vo.getCharge(),vo.getTotal()).multiply(new BigDecimal("100"))); vo.setPhotovoltaicRate(calculateRatio(vo.getPhotovoltaic(), vo.getTotal()).multiply(new BigDecimal("100"))); vo.setEnergyStorageRate(calculateRatio(vo.getEnergyStorage(), vo.getTotal()).multiply(new BigDecimal("100"))); vo.setChargeRate(calculateRatio(vo.getCharge(), vo.getTotal()).multiply(new BigDecimal("100"))); return vo; } @@ -111,9 +93,9 @@ LocalDate day = today.minusDays(i); dates.add(day); Map<String, Object> stringObjectMap = monthEnergy.stream().filter(e -> e.get("time").toString().contains(day.toString())).findFirst().orElse(null); if(stringObjectMap!=null){ if (stringObjectMap != null) { values.add(Double.valueOf(stringObjectMap.get("value").toString())); }else { } else { values.add(0.0); } } @@ -126,14 +108,14 @@ public ScreenTopVO top(List<Integer> siteIds) { ScreenTopVO vo = new ScreenTopVO(); BigDecimal charge=new BigDecimal("0.00"); BigDecimal carCharge=new BigDecimal("0.00"); BigDecimal greenElectricity=new BigDecimal("0.00"); if (siteIds!=null && !siteIds.isEmpty()){ BigDecimal charge = new BigDecimal("0.00"); BigDecimal carCharge = new BigDecimal("0.00"); BigDecimal greenElectricity = new BigDecimal("0.00"); if (siteIds != null && !siteIds.isEmpty()) { //获取充电量 R<BigDecimal> r = chargingOrderClient.getSumDegreeBySiteIds(Arrays.asList(25,26)); if (r.getCode()==200){ charge=r.getData(); R<BigDecimal> r = chargingOrderClient.getSumDegreeBySiteIds(Arrays.asList(25, 26)); if (r.getCode() == 200) { charge = r.getData(); } //汽车放电量 carCharge = this.baseMapper.getCarDisCharge(siteIds); @@ -147,24 +129,24 @@ //计算储能充电量 String electricity = KsolarUtils.getElectricity(); vo.setStorageCharge(new BigDecimal( electricity.split("_")[0])); vo.setStorageCharge(new BigDecimal(electricity.split("_")[0])); vo.setPhotovoltaic(new BigDecimal(KsolarUtils.getAllEnergy(LocalDate.now().toString()))); vo.setGreenElectricity(vo.getPhotovoltaic().multiply(new BigDecimal("0.94")).setScale(2, RoundingMode.HALF_UP)); vo.setGreenElectricity(vo.getPhotovoltaic().multiply(new BigDecimal("0.94")).setScale(2, RoundingMode.HALF_UP)); vo.setStorageDisCharge(new BigDecimal(electricity.split("_")[1])); return vo; } @Override public void carportData(Integer parkingPlace, Integer remainPlace) { this.baseMapper.carportData(parkingPlace,remainPlace); this.baseMapper.carportData(parkingPlace, remainPlace); } @Override public HashMap<String, Object> getCarportData() { HashMap<String, Object> carportData = this.baseMapper.getCarportData(); int count = Integer.valueOf(carportData.get("parkingPlace").toString()) - Integer.valueOf(carportData.get("remainPlace").toString()); carportData.put("useCarport",count); carportData.put("useCarport", count); return carportData; } } ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml
@@ -42,70 +42,7 @@ # 共享配置 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: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP username: nacos password: nacos cloud: nacos: discovery: # 开发环境 # server-addr: 192.168.110.169:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos sentinel: transport: dashboard: 127.0.0.1:8080 # Sentinel控制台地址 eager: true --- spring: config: ruoyi-service/ruoyi-payment/pom.xml
@@ -32,11 +32,6 @@ <groupId>com.alibaba.cloud</groupId> <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> ruoyi-service/ruoyi-payment/src/main/resources/bootstrap.yml
@@ -39,72 +39,6 @@ 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: false #关闭数据库代理 service: vgroup-mapping: seata_tx_group: default data-source-proxy-mode: AT config: type: nacos nacos: # 开发环境 # server-addr: 127.0.0.1:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # data-id: seata-server.properties # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP data-id: seata-server.properties username: nacos password: nacos registry: type: nacos nacos: application: seata-server # 开发环境 # server-addr: 127.0.0.1:8848 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # group: DEFAULT_GROUP # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP username: nacos password: nacos cloud: nacos: discovery: # 开发环境 # server-addr: 127.0.0.1:8848 # nacos注册中心地址 # namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 # group: DEFAULT_GROUP # application: seata-server #Nacos 中 Seata 名称 # username: nacos # password: nacos # 生产环境 server-addr: 192.168.0.137:8848,192.168.0.123:8848 namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a group: DEFAULT_GROUP application: seata-server #Nacos 中 Seata 名称 username: nacos password: nacos sentinel: transport: dashboard: 127.0.0.1:8080 # Sentinel控制台地址 eager: true --- spring: config: