表单提交
This commit is contained in:
@@ -592,6 +592,23 @@ public enum DicDataEnum {
|
||||
QINGHUANGDAO("秦皇岛市","qinghuangdao"),
|
||||
FENGFENGRESERVE("风光储","fengfengreserve"),
|
||||
EXTRA_HIGH_PRESSURE("超高压","extra_high_pressure"),
|
||||
|
||||
//行业类型-冀北
|
||||
TRAFFIC("交通","Traffic"),
|
||||
METALLURGY("冶金","Metallurgy"),
|
||||
MACHINERY("机械","Machinery"),
|
||||
CHEMICAL_INDUSTRY("化工","Chemical_Industry"),
|
||||
MANUFACTURING("制造","Manufacturing"),
|
||||
SHIPBUILDING("造船","Shipbuilding"),
|
||||
UTILITIES("公用事业","Utilities"),
|
||||
POWER_PLANT("电厂","Power_Plant"),
|
||||
COMMERCE("商业","Commerce"),
|
||||
MUNICIPAL("市政","Municipal"),
|
||||
CIVILIAN("民用","Civilian"),
|
||||
ELECTRONICS("电子","Electronics"),
|
||||
COMMUNICATION("通讯","Communication"),
|
||||
ELECTRIC_POWER("电力","Electric_Power"),
|
||||
OTHER_INDUSTRY("其他","Other_Industry"),
|
||||
;
|
||||
|
||||
private final String name;
|
||||
|
||||
@@ -132,7 +132,9 @@ public enum DicDataTypeEnum {
|
||||
|
||||
CARRY_CAPCITYUSER_MODE("用户模式","carry_capcity_user_mode"),
|
||||
LOCAL_MUNICIPALITY("所属地市","local_municipality"),
|
||||
;
|
||||
INDUSTRY_TYPE_JB("行业类型-冀北","industry_type_jb"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,18 +30,41 @@ public enum DicTreeEnum {
|
||||
Electrolytic_Load("电解负荷","2309"),
|
||||
|
||||
//冀北主要非线性设备类型
|
||||
Nonlinear_Load_User("非线性负荷用户","nonlinear_load_user"),
|
||||
New_Energy_Power("新能源发电","new_energy_power"),
|
||||
Converter_Station("换流站","converter_station"),
|
||||
/**
|
||||
* 类型 类别 名称 所属行业 主要关注的电能质量指标
|
||||
* 非线性负荷用户 电气化铁路 电气化铁路 交通 谐波、电压波动和闪变、负序、电压偏差
|
||||
* 城市轨道交通 有轨及无轨电车、地铁、轻轨 交通 谐波、电压波动和闪变
|
||||
* 电动汽车充电站 电动汽车充电站 交通 谐波
|
||||
* 电加热负荷 交流电弧炉 冶金、机械 谐波(间谐波)、电压波动和闪变、负序
|
||||
* 直流电弧炉、精炼炉 冶金、机械 谐波(间谐波)、电压波动和闪变
|
||||
* 电热炉 冶金、机械、化工 谐波、电压波动和闪变、负序
|
||||
* 中频炉 冶金、机械、化工 谐波、电压波动和闪变
|
||||
* 单(多)晶硅(锗)生产设备 制造 谐波
|
||||
* 轧机 交、直流轧机 冶金 谐波(间谐波)、电压波动和闪变
|
||||
* 电解负荷 电解设备 冶金、机械、化工 谐波、电压波动和闪变
|
||||
* 电焊负荷 电焊机 冶金、机械、造船 谐波、电压波动和闪变
|
||||
* 起重负荷 电铲、升降机、门吊等 冶金、机械等 谐波、电压波动和闪变
|
||||
* 变频调速负荷 变频电机、水泵 公用事业、电厂、冶金、化工等 谐波、电压波动和闪变
|
||||
* 其他 变频空调、大型电梯、节能照明设备 商业、市政、民用等 谐波
|
||||
* UPS、开关电源、逆变电源 电子、通讯等 谐波
|
||||
* 新能源发电 风电场 风力发电机 电力 闪变、谐波(间谐波)、电压偏差
|
||||
* 光伏电站 光伏发电系统 电力 谐波、闪变
|
||||
* 换流站 换流站 换流器 电力 谐波、电压波动
|
||||
*
|
||||
*/
|
||||
Nonlinear_Load_User_JB("非线性负荷用户","Nonlinear_Load_User_JB"),
|
||||
New_Energy_Power_JB("新能源发电","New_Energy_Power_JB"),
|
||||
Converter_Station_JB("换流站","Converter_Station_JB"),
|
||||
|
||||
//非线性负荷用户
|
||||
Electrified_Railway_JB("电气化铁路","Electrified_Railway_JB"),
|
||||
|
||||
Electrified_Railway_Name_JB("电气化铁路","Electrified_Railway_Name_JB"),
|
||||
|
||||
Urban_Rail_Transit_JB("城市轨道交通","Urban_Rail_Transit_JB"),
|
||||
Subways_Light_Rail_JB("有轨及无轨电车、地铁、轻轨","Urban_Rail_Transit_JB"),
|
||||
Subways_Light_Rail_JB("有轨及无轨电车、地铁、轻轨","Subways_Light_Rail_JB"),
|
||||
|
||||
Charging_Stations_For_Electric_JB("电动汽车充电站","Charging_Stations_For_Electric_JB"),
|
||||
Charging_Stations_Name_JB("电动汽车充电站","Charging_Stations_Name_JB"),
|
||||
|
||||
Electric_Heating_Load_JB("电加热负荷","Electric_Heating_Load_JB"),
|
||||
|
||||
@@ -49,18 +72,40 @@ public enum DicTreeEnum {
|
||||
Furnace_JB("直流电弧炉、精炼炉","Furnace_JB"),
|
||||
Electric_Heater_JB("电热炉","Electric_Heater_JB"),
|
||||
Frequency_Furnace_JB("中频炉","Frequency_Furnace_JB"),
|
||||
Production_Equipment("单(多)晶硅(锗)生产设备","Production_Equipment"),
|
||||
Production_Equipment_JB("单(多)晶硅(锗)生产设备","Production_Equipment_JB"),
|
||||
|
||||
Rolling_Mill_JB("轧机","Rolling_Mill_JB"),
|
||||
Ac_DC_Rolling_Mill_JB("交、直流轧机","Ac_DC_Rolling_Mill_JB"),
|
||||
|
||||
Electrolytic_Load_JB("电解负荷","Electrolytic_Load_JB"),
|
||||
Electrolytic_Equipment_JB("电解设备","Electrolytic_Equipment_JB"),
|
||||
|
||||
Welding_Load_JB("电焊负荷","Welding_Load_JB"),
|
||||
Welding_Machine_JB("电焊机","Welding_Machine_JB"),
|
||||
|
||||
Lifting_Load_JB("起重负荷","Lifting_Load_JB"),
|
||||
Electric_Shovel_JB("电铲、升降机、门吊等","Electric_Shovel_JB"),
|
||||
|
||||
|
||||
Variable_Frequency_Speed_Control_Load_JB("变频调速负荷","Variable_Frequency_Speed_Control_Load_JB"),
|
||||
other_JB("其他","nonlinear_load_user"),
|
||||
Variable_Frequency_Water_Pump_JB("变频电机、水泵","Variable_Frequency_Water_Pump_JB"),
|
||||
|
||||
|
||||
Other_JB("其他","other_JB"),
|
||||
Equipment_JB("变频空调、大型电梯、节能照明设备","Equipment_JB"),
|
||||
Power_Source_JB("UPS、开关电源、逆变电源","Power_Source_JB"),
|
||||
|
||||
|
||||
Wind_Farms_JB("风电场","Wind_Farms_JB"),
|
||||
Wind_Turbine_JB("风力发电机","Wind_Turbine_JB"),
|
||||
|
||||
|
||||
Power_Station_JB("光伏电站","Power_Station_JB"),
|
||||
Power_System_JB("光伏发电系统","Power_System_JB"),
|
||||
|
||||
Converter_JB("换流站","Converter_JB"),
|
||||
Current_Converter_JB("换流器","Current_Converter_JB"),
|
||||
|
||||
|
||||
|
||||
;
|
||||
|
||||
@@ -11,9 +11,25 @@ import java.io.Serializable;
|
||||
@AllArgsConstructor
|
||||
public class FileVO implements Serializable {
|
||||
|
||||
|
||||
//全名 路径+文件名
|
||||
private String name;
|
||||
//文件名
|
||||
private String fileName;
|
||||
|
||||
private String url;
|
||||
public FileVO( String name,String url){
|
||||
this.name = name;
|
||||
this.fileName = getFileName(name);
|
||||
this.url = url;
|
||||
|
||||
}
|
||||
public static String getFileName(String filePath) {
|
||||
int index = filePath.lastIndexOf("/");
|
||||
if (index == -1) {
|
||||
return filePath; // 如果没有/,则返回整个路径
|
||||
} else {
|
||||
return filePath.substring(index + 1); // 截取最后一个/后面的部分作为文件名
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.pojo.vo.FileVO;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
@@ -40,13 +38,14 @@ public class FileController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("文件上传")
|
||||
@RequestMapping(value = "/upload", method = RequestMethod.POST)
|
||||
public HttpResult<FileVO> upload(@RequestParam(value = "file") MultipartFile file, @RequestParam("path") String path) {
|
||||
public HttpResult<FileVO> upload(@RequestParam(value = "file") MultipartFile file, @RequestParam("path") String path,@RequestParam(defaultValue = "true") Boolean isReserveName) {
|
||||
String methodDescribe = getMethodDescribe("upload");
|
||||
String ossPath = fileStorageUtil.uploadMultipart(file, path);
|
||||
String ossPath = fileStorageUtil.uploadMultipart(file, path,isReserveName);
|
||||
String url = fileStorageUtil.getFileUrl(ossPath);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new FileVO(ossPath,url), methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除文件服务器文件")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@@ -70,6 +69,14 @@ public class FileController extends BaseController {
|
||||
String methodDescribe = getMethodDescribe("getFileUrl");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, fileStorageUtil.getFileUrl(filePath), methodDescribe);
|
||||
}
|
||||
@ApiOperation("获取文件的一个短期url及文件名")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@RequestMapping(value = "/getFileVO", method = RequestMethod.GET)
|
||||
public HttpResult<FileVO> getFileVO(String filePath) {
|
||||
String methodDescribe = getMethodDescribe("getFileVO");
|
||||
String url = fileStorageUtil.getFileUrl(filePath);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new FileVO(filePath,url), methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.njcn.system.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.system.enums.EventResponseEnum;
|
||||
import com.njcn.system.enums.TemplateTreeEnum;
|
||||
@@ -11,12 +10,8 @@ import com.njcn.system.mapper.DicMapper;
|
||||
import com.njcn.system.pojo.constant.DicState;
|
||||
import com.njcn.system.pojo.param.DicParam;
|
||||
import com.njcn.system.pojo.po.Dic;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.vo.DicVO;
|
||||
import com.njcn.system.service.IDicService;
|
||||
import com.njcn.user.pojo.constant.FunctionState;
|
||||
import com.njcn.user.pojo.param.FunctionParam;
|
||||
import com.njcn.user.pojo.po.Function;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
Reference in New Issue
Block a user