无关风月
2025-08-14 79d5e91444eca538d523d3bd014528abd939da33
Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
# ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralController.java
8个文件已修改
172 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysConfigClient.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ChargeOrderServiceImpl.java 124 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysConfigClient.java
@@ -7,6 +7,7 @@
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.RequestBody;
@@ -19,7 +20,6 @@
    @GetMapping(value = "config/{configId}")
    R<SysConfig> getInfo(@PathVariable("configId") Long configId);
    @GetMapping(value = "config/update")
    @PostMapping(value = "config/update")
    void update(@RequestBody SysConfig data1);
}
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
@@ -95,16 +95,16 @@
            recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员");
            throw new ServiceException("您的账号已被停用,请联系平台");
        }
        if (user.getRoleType()==2){
            Shop data = shopClient.getShopById(user.getObjectId()).getData();
            if (data==null){
                throw new ServiceException("门店不存在");
            }else{
                if (data.getStatus()==2){
                    throw new ServiceException("您所属门店已被冻结,请联系平台");
                }
            }
        }
//        if (user.getRoleType()==2){
//            Shop data = shopClient.getShopById(user.getSiteId()).getData();
//            if (data==null){
//                throw new ServiceException("站点不存在");
//            }else{
//                if (data.getStatus()==2){
//                    throw new ServiceException("您所属门店已被冻结,请联系平台");
//                }
//            }
//        }
        passwordService.validate(user, password, request);
        recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功");
        return userInfo;
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java
@@ -38,7 +38,7 @@
        return getDataTable(list);
    }
    @GetMapping("/update")
    @PostMapping("/update")
    public void update (@RequestBody SysConfig data1) {
        configService.updateConfig(data1);
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
@@ -376,9 +376,17 @@
                && e.getMenuId() != 1198
                && e.getMenuId() != 1199
                && e.getMenuId() != 1201
                && e.getMenuId() != 319
                && e.getMenuId() != 318
                && e.getMenuId() != 321
                && e.getMenuId() != 322
                && e.getMenuId() != 323
                && e.getMenuId() != 1205).collect(Collectors.toList());
        // 第一级
        List<SysMenus> s1 = list.stream().filter(e -> e.getMenuType().equals("M")).collect(Collectors.toList());
        List<SysMenus> s1 = list.stream().filter(e -> e.getMenuType().equals("M")
                && e.getMenuId() != 317
                && e.getMenuId() != 320
                && e.getMenuId() != 324).collect(Collectors.toList());
        for (SysMenus menus : s2) {
            List<SysMenus> collect = s3.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList());
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
@@ -222,7 +222,7 @@
        int isLogin = StringUtils.isEmpty(SecurityUtils.getToken(request)) ? 0 : 1;
        return AjaxResult.success(siteService.pageList(query,isLogin));
    }
    @RequiresPermissions(value = {"/chargeDistribution"}, logical = Logical.OR)
//    @RequiresPermissions(value = {"/chargeDistribution"}, logical = Logical.OR)
    @PostMapping("/map/getPercentByprovinceCode")
    @ApiOperation(value = "获取该充电站的利用率", tags = {"管理后台-数据分析-电站分析"})
    public R getPercentByCityCode(@RequestBody ChargingPercentProvinceDto chargingPercentProvinceDto){
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
@@ -258,6 +258,8 @@
        }
        for (Integer id : ids) {
            Site site = this.getById(id);
            // 删除账号
            sysUserClient.delSysUserById(site.getUserId());
            this.removeById(site);
        }
        return AjaxResult.success();
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ChargeOrderServiceImpl.java
@@ -51,11 +51,14 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -135,127 +138,130 @@
                // 开始时间
                Cell beginTimeCell = row.getCell(6);
                Cell beginTimeCell = row.getCell(4);
                if (beginTimeCell == null) {
                    throw new ServiceException("第" + (i + 1) + "行开始时间为空", 500);
                }
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                LocalDateTime beginTime;
                if (beginTimeCell.getCellType() == CellType.NUMERIC || DateUtil.isCellDateFormatted(beginTimeCell)) {
                    // 处理数值型日期(包括Excel内置日期格式)
                    beginTime = beginTimeCell.getDateCellValue().toInstant()
                            .atZone(ZoneId.systemDefault())
                            .toLocalDateTime();
                } else {
                    // 处理文本型日期(如 "2025/4/3 23:25:38")
                    String dateStr = beginTimeCell.getStringCellValue().trim();
                    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/M/d H:mm:ss");
                    beginTime = LocalDateTime.parse(dateStr, formatter);
                try {
                    Date startDate = format.parse(beginTimeCell.getStringCellValue());
                    beginTime = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
                } catch (ParseException e) {
                    throw new RuntimeException(e);
                }
//                LocalDateTime beginTime;
//                if (beginTimeCell.getCellType() == CellType.NUMERIC || DateUtil.isCellDateFormatted(beginTimeCell)) {
//                    // 处理数值型日期(包括Excel内置日期格式)
//                    beginTime = beginTimeCell.getDateCellValue().toInstant()
//                            .atZone(ZoneId.systemDefault())
//                            .toLocalDateTime();
//                } else {
//                    // 处理文本型日期(如 "2025/4/3 23:25:38")
//                    String dateStr = beginTimeCell.getStringCellValue().trim();
//                    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/M/d H:mm:ss");
//                    beginTime = LocalDateTime.parse(dateStr, formatter);
//                }
                // 结束时间
                Cell endTimeCell = row.getCell(7);
                Cell endTimeCell = row.getCell(5);
                if (endTimeCell == null) {
                    throw new ServiceException("第" + (i + 1) + "行开始时间为空", 500);
                }
                LocalDateTime endTime;
                if (endTimeCell.getCellType() == CellType.NUMERIC || DateUtil.isCellDateFormatted(endTimeCell)) {
                    // 处理数值型日期(包括Excel内置日期格式)
                    endTime = endTimeCell.getDateCellValue().toInstant()
                            .atZone(ZoneId.systemDefault())
                            .toLocalDateTime();
                } else {
                    // 处理文本型日期(如 "2025/4/3 23:25:38")
                    String dateStr = beginTimeCell.getStringCellValue().trim();
                    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/M/d H:mm:ss");
                    endTime = LocalDateTime.parse(dateStr, formatter);
                try {
                    Date startDate = format.parse(endTimeCell.getStringCellValue());
                    endTime = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
                } catch (ParseException e) {
                    throw new RuntimeException(e);
                }
                // 充电时长
                if (row.getCell(8 )== null){
                if (row.getCell(6 )== null){
                    throw new ServiceException("第" + i + "行充电时长为空", 500);
                }
                row.getCell(8).setCellType(CellType.STRING);
                String chargingDuration = row.getCell(8).getStringCellValue();
                row.getCell(6).setCellType(CellType.STRING);
                String chargingDuration = row.getCell(6).getStringCellValue();
                // 充电电量
                if (row.getCell(9 )== null){
                if (row.getCell(7 )== null){
                    throw new ServiceException("第" + i + "行充电电量为空", 500);
                }
                row.getCell(9).setCellType(CellType.STRING);
                String chargingCapacity = row.getCell(9).getStringCellValue();
                row.getCell(7).setCellType(CellType.STRING);
                String chargingCapacity = row.getCell(7).getStringCellValue();
                // 电站运营商
                if (row.getCell(15 )== null){
                if (row.getCell(8 )== null){
                    throw new ServiceException("第" + i + "行电站运营商为空", 500);
                }
                row.getCell(15).setCellType(CellType.STRING);
                String powerStationOperator = row.getCell(15).getStringCellValue();
                row.getCell(8).setCellType(CellType.STRING);
                String powerStationOperator = row.getCell(8).getStringCellValue();
                // 城市名称
                if (row.getCell(16 )== null){
                if (row.getCell(9 )== null){
                    throw new ServiceException("第" + i + "行城市名称为空", 500);
                }
                row.getCell(16).setCellType(CellType.STRING);
                String city = row.getCell(16).getStringCellValue();
                row.getCell(9).setCellType(CellType.STRING);
                String city = row.getCell(9).getStringCellValue();
                // 充电场站
                if (row.getCell(17 )== null){
                if (row.getCell(10 )== null){
                    throw new ServiceException("第" + i + "行充电场站为空", 500);
                }
                row.getCell(17).setCellType(CellType.STRING);
                String chargingStation = row.getCell(17).getStringCellValue();
                row.getCell(10).setCellType(CellType.STRING);
                String chargingStation = row.getCell(10).getStringCellValue();
                // 电站id
                if (row.getCell(18 )== null){
                if (row.getCell(11 )== null){
                    throw new ServiceException("第" + i + "行电站id为空", 500);
                }
                row.getCell(18).setCellType(CellType.STRING);
                String powerStationId = row.getCell(18).getStringCellValue();
                row.getCell(11).setCellType(CellType.STRING);
                String powerStationId = row.getCell(11).getStringCellValue();
                // 终端编码
                if (row.getCell(19 )== null){
                if (row.getCell(12 )== null){
                    throw new ServiceException("第" + i + "行终端编码为空", 500);
                }
                row.getCell(19).setCellType(CellType.STRING);
                String terminalCode = row.getCell(19).getStringCellValue();
                row.getCell(12).setCellType(CellType.STRING);
                String terminalCode = row.getCell(12).getStringCellValue();
                // 车牌号
                if (row.getCell(20 )== null){
                if (row.getCell(13 )== null){
                    throw new ServiceException("第" + i + "行车牌号为空", 500);
                }
                row.getCell(20).setCellType(CellType.STRING);
                String plateNumber = row.getCell(26).getStringCellValue();
                row.getCell(13).setCellType(CellType.STRING);
                String plateNumber = row.getCell(13).getStringCellValue();
                // 电站价电费金额
                if (row.getCell(21 )== null){
                if (row.getCell(14 )== null){
                    throw new ServiceException("第" + i + "行电站价电费金额为空", 500);
                }
                row.getCell(21).setCellType(CellType.STRING);
                String electricityAmount = row.getCell(21).getStringCellValue();
                row.getCell(14).setCellType(CellType.STRING);
                String electricityAmount = row.getCell(14).getStringCellValue();
                // 电站价服务费金额
                if (row.getCell(22 )== null){
                if (row.getCell(15 )== null){
                    throw new ServiceException("第" + i + "行电站价服务费金额为空", 500);
                }
                row.getCell(22).setCellType(CellType.STRING);
                String serviceAmount = row.getCell(22).getStringCellValue();
                row.getCell(15).setCellType(CellType.STRING);
                String serviceAmount = row.getCell(15).getStringCellValue();
                // 电站价总金额
                if (row.getCell(23 )== null){
                if (row.getCell(16 )== null){
                    throw new ServiceException("第" + i + "行电站价总金额为空", 500);
                }
                row.getCell(23).setCellType(CellType.STRING);
                String totalAmount = row.getCell(23).getStringCellValue();
                row.getCell(16).setCellType(CellType.STRING);
                String totalAmount = row.getCell(16).getStringCellValue();
                // 绿电分
                if (row.getCell(24 )== null){
                if (row.getCell(17 )== null){
                    throw new ServiceException("第" + i + "行绿电分为空", 500);
                }
                row.getCell(24).setCellType(CellType.STRING);
                String point = row.getCell(24).getStringCellValue();
                row.getCell(17).setCellType(CellType.STRING);
                String point = row.getCell(17).getStringCellValue();
                //检查订单号是否重复
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralController.java
@@ -513,13 +513,13 @@
        Long userid = tokenService.getLoginUser().getUserid();
        SysUser data = sysUserClient.getSysUser(userid).getData();
        if (data != null && data.getSiteId() != null) {
        if (data != null ) {
            if (data.getRoleType() == 1) {
                // 平台
                SysConfig data1 = sysConfigClient.getInfo(8L).getData();
                sysConfigClient.update(data1);
                TIntegralRule tIntegralRule = new TIntegralRule();
                tIntegralRule.setChargeCredit(data1.getConfigValue());
                tIntegralRule.setChargeCredit("{\"num1\":"+data1.getConfigValue()+"}");
                tIntegralRule.setContent(data1.getRemark());
                tIntegralRule.setSiteId(0);
                return R.ok(tIntegralRule);
@@ -550,7 +550,9 @@
        if (data.getRoleType() == 1) {
            SysConfig data1 = sysConfigClient.getInfo(8L).getData();
            data1.setConfigValue(dto.getChargeCredit());
            JSONObject jsonObject = JSONObject.parseObject(dto.getChargeCredit());
            Integer num1 = jsonObject.getInteger("num1");
            data1.setConfigValue(num1.toString());
            data1.setRemark(dto.getContent());
            sysConfigClient.update(data1);
        } else {