切换mysql为达梦数据库-代码审查
1.advanceboot模块
This commit is contained in:
@@ -2,9 +2,6 @@ package com.njcn.advance.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.netflix.ribbon.proxy.annotation.Http;
|
||||
import com.njcn.advance.pojo.dto.BalanceInfo;
|
||||
import com.njcn.advance.pojo.param.AdvanceBaseParam;
|
||||
import com.njcn.advance.pojo.po.PqsRelevanceLog;
|
||||
import com.njcn.advance.service.EventRelevantAnalysisService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
@@ -18,19 +15,13 @@ import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailAssPO;
|
||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.DataInputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityDResultVO;
|
||||
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityDataIVO;
|
||||
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityDataQVO;
|
||||
import com.njcn.advance.pojo.carrycapacity.vo.CarryCapacityDataVO;
|
||||
import com.njcn.advance.service.carrycapacity.CarryCapcityService;
|
||||
import com.njcn.advance.service.carrycapacity.CarryCapacityService;
|
||||
import com.njcn.advance.utils.EasyExcelUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
@@ -44,7 +44,7 @@ import java.util.List;
|
||||
public class CarryCapacityController extends BaseController {
|
||||
|
||||
|
||||
private final CarryCapcityService carryCapcityService;
|
||||
private final CarryCapacityService carryCapcityService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryCarryCapacityData")
|
||||
@@ -72,8 +72,7 @@ public class CarryCapacityController extends BaseController {
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<CarryCapacityDataQVO> queryCarryCapacityQData(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("queryCarryCapacityQData");
|
||||
CarryCapacityDataQVO carryCapacityDataQVO = carryCapcityService.queryCarryCapacityQData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapacityDataQVO, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityQData(queryParam), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@@ -82,8 +81,7 @@ public class CarryCapacityController extends BaseController {
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<CarryCapacityDataIVO> queryCarryCapacityIData(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("queryCarryCapacityIData");
|
||||
CarryCapacityDataIVO carryCapacityDataIVO = carryCapcityService.queryCarryCapacityIData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapacityDataIVO, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityIData(queryParam), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@@ -92,8 +90,7 @@ public class CarryCapacityController extends BaseController {
|
||||
@ApiImplicitParam(name = "calParam", value = "计算参数", required = true)
|
||||
public HttpResult<CarryCapacityDResultVO> carryCapacityCal(@RequestBody @Validated CarryCapacityCalParam calParam) {
|
||||
String methodDescribe = getMethodDescribe("carryCapacityCal");
|
||||
CarryCapacityDResultVO carryCapacityDResultVO = carryCapcityService.carryCapacityCal(calParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapacityDResultVO, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.carryCapacityCal(calParam), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
package com.njcn.advance.controller.govern.harmonic;
|
||||
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||
import com.njcn.advance.pojo.dto.govern.voltage.SgEventExcel;
|
||||
import com.njcn.advance.pojo.po.govern.harmonic.SgHarmonicFile;
|
||||
import com.njcn.advance.service.govern.harmonic.ISgHarmonicFileService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
@@ -14,17 +9,14 @@ import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
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.poi.util.PoiUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@@ -33,7 +25,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -71,7 +62,7 @@ public class SgHarmonicFileController extends BaseController {
|
||||
|
||||
@PostMapping(value = "/listHarmonicData")
|
||||
@ApiOperation("获取谐波数据数据")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.QUERY)
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<List<SgHarmonicFile>> listHarmonicData() {
|
||||
String methodDescribe = getMethodDescribe("listHarmonicData");
|
||||
LambdaQueryWrapper<SgHarmonicFile> sgHarmonicFileLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package com.njcn.advance.controller.govern.voltage;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgGovernSchemeHistoryParam;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgGovernSchemeHistoryAllVO;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgGovernSchemeHistoryVO;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgUserVO;
|
||||
import com.njcn.advance.service.govern.voltage.IGovernSchemeCalcService;
|
||||
import com.njcn.advance.service.govern.voltage.ISgGovernSchemeHistoryService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class SgEventController extends BaseController {
|
||||
@PostMapping("/getEventDataByProductLineId")
|
||||
@ApiOperation("查询生产线下时间范围内的暂降数据")
|
||||
@ApiImplicitParam(name = "sgEventParamQueryParam", value = "查询参数", required = true)
|
||||
public HttpResult<List<SgEventVO>> getEventDataByProductLineId(@RequestBody SgEventParam.SgEventParamQueryParam sgEventParamQueryParam) {
|
||||
public HttpResult<List<SgEventVO>> getEventDataByProductLineId(@RequestBody SgEventParam.SgEventParamQueryParam sgEventParamQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("getEventDataByProductLineId");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sgEventParamQueryParam);
|
||||
List<SgEventVO> result = sgEventService.getEventDataByProductLineId(sgEventParamQueryParam);
|
||||
@@ -104,7 +104,7 @@ public class SgEventController extends BaseController {
|
||||
@PostMapping(value = "/importEventData")
|
||||
@ApiOperation("批量导入暂降数据")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
public HttpResult<String> importEventData(@RequestParam("file") MultipartFile file, @RequestParam("incomingLineId") String incomingLineId, @RequestParam("productLineId") String productLineId,HttpServletResponse response) {
|
||||
public HttpResult<String> importEventData(@RequestParam("file") MultipartFile file, @RequestParam("incomingLineId") String incomingLineId, @RequestParam("productLineId") String productLineId, HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("importEventData");
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);
|
||||
@@ -115,12 +115,13 @@ public class SgEventController extends BaseController {
|
||||
ExcelImportResult<SgEventExcel> sgEventExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SgEventExcel.class, params);
|
||||
//如果存在非法数据,将不合格的数据导出
|
||||
if (sgEventExcelExcelImportResult.isVerifyFail()) {
|
||||
// PoiUtil.exportFileByWorkbook(sgEventExcelExcelImportResult.getFailWorkbook(), "非法暂降数据.xlsx", response);
|
||||
// 此处到处前端要做特殊处理,具体可以参考技术监督的数据导入,todo...
|
||||
PoiUtil.exportFileByWorkbook(sgEventExcelExcelImportResult.getFailWorkbook(), "非法暂降数据.xlsx", response);
|
||||
throw new BusinessException(AdvanceResponseEnum.IMPORT_EVENT_DATA_FAIL);
|
||||
} else {
|
||||
//批量录入暂降数据
|
||||
List<SgEventExcel> sgEventExcels = sgEventExcelExcelImportResult.getList();
|
||||
sgEventService.importEventData(sgEventExcels, incomingLineId,productLineId);
|
||||
sgEventService.importEventData(sgEventExcels, incomingLineId, productLineId);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(AdvanceResponseEnum.IMPORT_EVENT_DATA_FAIL);
|
||||
@@ -129,7 +130,6 @@ public class SgEventController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/calcLoss")
|
||||
@ApiOperation("计算暂降损失")
|
||||
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgProductLineVO;
|
||||
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
|
||||
@@ -4,7 +4,6 @@ package com.njcn.advance.controller.govern.voltage;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgProductLineParam;
|
||||
import com.njcn.advance.pojo.po.govern.voltage.SgProductLine;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgProductLineVO;
|
||||
import com.njcn.advance.service.govern.voltage.ISgProductLineService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
|
||||
@@ -4,7 +4,6 @@ package com.njcn.advance.controller.govern.voltage;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
||||
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
|
||||
@@ -102,6 +102,7 @@ public class UserDataController extends BaseController {
|
||||
if (fileSize > 3072) {
|
||||
throw new BusinessException(CommonResponseEnum.FILE_SIZE_ERROR);
|
||||
}
|
||||
assert fileName != null;
|
||||
if (!fileName.matches("^.+\\.(?i)(xlsx)$") && !fileName.matches("^.+\\.(?i)(xls)$")) {
|
||||
throw new BusinessException(CommonResponseEnum.FILE_XLSX_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user