|
@@ -2,13 +2,9 @@ package com.example.opc_da.controller;
|
|
|
|
|
|
import com.example.opc_common.entity.ReportTable;
|
|
|
import com.example.opc_common.entity.TableTemplate;
|
|
|
-import com.example.opc_common.enums.ModelEnum;
|
|
|
-import com.example.opc_common.enums.OperationEnum;
|
|
|
import com.example.opc_common.enums.ResultEnum;
|
|
|
-import com.example.opc_common.enums.ServerEnum;
|
|
|
import com.example.opc_common.util.Blank;
|
|
|
import com.example.opc_common.util.Result;
|
|
|
-import com.example.opc_da.annotation.WebLog;
|
|
|
import com.example.opc_da.service.ReportTableService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -31,7 +27,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getSysTableTemplate")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getSysTableTemplate(String keyType, Integer dictId, String templateName) {
|
|
|
if (Blank.isEmpty(keyType)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "系统报表模板参数不能为空");
|
|
@@ -46,7 +42,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getSysTableTemplateById/{id}")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getSysTableTemplateById(@PathVariable Integer id) {
|
|
|
if (Blank.isEmpty(id)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -61,7 +57,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/addTableTemplate")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.ADD)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.ADD)
|
|
|
public Result addTableTemplate(@RequestBody TableTemplate tableTemplate) {
|
|
|
if (Blank.isEmpty(tableTemplate, tableTemplate.getTemplateName(), tableTemplate.getTemplateType(),
|
|
|
tableTemplate.getTemplateData())) {
|
|
@@ -77,7 +73,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/updateTableTemplate")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.UPDATE)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.UPDATE)
|
|
|
public Result updateTableTemplate(@RequestBody TableTemplate tableTemplate) {
|
|
|
if (Blank.isEmpty(tableTemplate, tableTemplate.getId(), tableTemplate.getTemplateName(),
|
|
|
tableTemplate.getTemplateData(), tableTemplate.getVersion())) {
|
|
@@ -94,7 +90,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/updateTableTemplateNameById")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.UPDATE)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.UPDATE)
|
|
|
public Result updateTableTemplateNameById(Integer id, String templateName) {
|
|
|
if (Blank.isEmpty(id)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "报表id不能为空");
|
|
@@ -111,7 +107,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getAllTableTemplate")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getAllTableTemplate(Integer page, Integer limit, String userId, Integer templateType) {
|
|
|
return reportTableService.getAllTableTemplate(page, limit, userId, templateType);
|
|
|
}
|
|
@@ -123,7 +119,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getTableTemplateById/{id}")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getTableTemplateById(@PathVariable Integer id) {
|
|
|
if (Blank.isEmpty(id)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -140,7 +136,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/delTableTemplateById")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.DELETE)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TABLETEMPLATE, OperationEnum = OperationEnum.DELETE)
|
|
|
public Result delTableTemplateById(Integer id, Integer isDelete) {
|
|
|
if (Blank.isEmpty(id, isDelete)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -157,7 +153,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getAllReportTable")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getAllReportTable(Integer page, Integer limit, Integer isAutoReport) {
|
|
|
return reportTableService.getAllReportTable(page, limit, isAutoReport);
|
|
|
}
|
|
@@ -169,7 +165,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getReportTableById")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getReportTableById(String id) {
|
|
|
if (Blank.isEmpty(id)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -184,7 +180,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getPrintReportById/{id}")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getPrintReportById(@PathVariable String id) {
|
|
|
if (Blank.isEmpty(id)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -199,7 +195,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/delReportTableById/{id}")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.DELETE)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.DELETE)
|
|
|
public Result delReportTableById(@PathVariable String id) {
|
|
|
if (Blank.isEmpty(id)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -229,7 +225,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/runAutoTableById")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.UPDATE)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.UPDATE)
|
|
|
public Result runAutoTableById(String id, Integer runState) {
|
|
|
if (Blank.isEmpty(id, runState)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "id,启停状态不能为空");
|
|
@@ -241,7 +237,7 @@ public class ReportTableController {
|
|
|
* 查询报表数量
|
|
|
*/
|
|
|
@GetMapping("/queryTableNum")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result queryTableNum() {
|
|
|
return reportTableService.queryTableNum();
|
|
|
}
|
|
@@ -253,7 +249,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/tableAssignUserById")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.ASSIGN)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.ASSIGN)
|
|
|
public Result tableAssignUserById(@RequestBody ReportTable reportTable) {
|
|
|
if (Blank.isEmpty(reportTable, reportTable.getId())) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "报表id不能为空");
|
|
@@ -269,7 +265,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/updateTableNameById")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.UPDATE)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.UPDATE)
|
|
|
public Result updateTableNameById(String id, String reportTableName) {
|
|
|
if (Blank.isEmpty(id)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "报表id不能为空");
|
|
@@ -288,7 +284,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getAllOkReportTable")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getAllOkReportTable(Integer page, Integer limit, String reportTableName, Integer isAutoReport, Integer isDelete) {
|
|
|
if (Blank.isEmpty(page, limit) || page < 1 || limit < 1) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "page,limit不能为空,且必须大于0");
|
|
@@ -306,7 +302,7 @@ public class ReportTableController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getAutoChReportTable")
|
|
|
- @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
+// @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.REPORTTABLE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getAutoChReportTable(Integer page, Integer limit, String autoTableId, String reportTableName) {
|
|
|
if (Blank.isEmpty(page, limit, autoTableId) || page < 1 || limit < 1) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "page,limit不能为空,且必须大于0,自动报表的id不能为空");
|