规范化代码格式-控制器修改2.0
This commit is contained in:
parent
ea74cebeff
commit
6c5fd2522e
@ -12,7 +12,7 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
public class MyResponse {
|
||||
// 报错标识
|
||||
private Boolean flag;
|
||||
private boolean flag;
|
||||
// 报错信息
|
||||
private String message;
|
||||
// 数据
|
||||
|
||||
@ -12,31 +12,36 @@ import com.xdap.self_development.domain.pojo.EngineReviewListPojo;
|
||||
import com.xdap.self_development.domain.dto.*;
|
||||
import com.xdap.self_development.service.ActivitiProcessService;
|
||||
import com.xdap.self_development.service.EngineReviewListService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 参数详情 前端控制器
|
||||
* </p>
|
||||
* 工作流程审批控制器
|
||||
* 提供工作流程相关的审批操作,包括启动审批、处理审批、查看审批详情等功能
|
||||
*
|
||||
* @author Lys111
|
||||
* @since 2025-11-13
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/activiti")
|
||||
public class ActivitiProcessController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private ActivitiProcessService activitiProcessService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private EngineReviewListService engineReviewListService;
|
||||
|
||||
// 修改后继续流程
|
||||
/**
|
||||
* 修改后继续流程
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/continueApproval")
|
||||
public Response continueApproval(
|
||||
@NotBlank @RequestParam String flowId,
|
||||
@ -46,7 +51,12 @@ public class ActivitiProcessController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 获取可修改节点
|
||||
/**
|
||||
* 获取可修改节点
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @return 可修改节点列表
|
||||
*/
|
||||
@GetMapping("/getEditableNodes")
|
||||
public Response getEditableNodes(
|
||||
@NotBlank @RequestParam String flowId
|
||||
@ -55,7 +65,12 @@ public class ActivitiProcessController {
|
||||
return Response.ok().data(nodes);
|
||||
}
|
||||
|
||||
// 修改节点
|
||||
/**
|
||||
* 修改节点
|
||||
*
|
||||
* @param form 更新节点表单数据
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateNode")
|
||||
public Response updateNode(
|
||||
@RequestBody UpdateNodeForm form
|
||||
@ -64,7 +79,13 @@ public class ActivitiProcessController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 修改流程主题
|
||||
/**
|
||||
* 修改流程主题
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @param title 新标题
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping(value = "/updateFlowTitle")
|
||||
public Response updateFlowTitle(
|
||||
@NotBlank @RequestParam String flowId,
|
||||
@ -74,54 +95,84 @@ public class ActivitiProcessController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
//审批前查看1.存入变更说明到DB,返回变更说明
|
||||
/**
|
||||
* 审批前查看,存入变更说明到数据库并返回变更说明
|
||||
*
|
||||
* @param modelID 模型ID
|
||||
* @param userID 用户ID
|
||||
* @return 变更说明列表
|
||||
*/
|
||||
@GetMapping(value = "/initiateApproval")
|
||||
public Response initiateApproval(@RequestParam(value = "modelID") String modelID , @RequestParam(value = "userID") String userID) {
|
||||
List<ActivitiDataDTO> msg = activitiProcessService.initiateApproval(modelID,userID);
|
||||
return Response.ok().data(msg);
|
||||
}
|
||||
// //平台发起审批时生成本地审批流
|
||||
// @PostMapping(value = "/startActivitiByPlatform")
|
||||
// public Response startActivitiByPlatform(@RequestBody ApprovalByPlatformRequest request) {
|
||||
// activitiProcessService.startActivitiByPlatform(request);
|
||||
// return Response.ok();
|
||||
// }
|
||||
|
||||
//正式发起审批
|
||||
/**
|
||||
* 正式发起审批
|
||||
*
|
||||
* @param approvalNodeRequest 审批节点请求对象
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping(value = "/startActiviti")
|
||||
public Response startActiviti(@RequestBody ApprovalNodeRequest approvalNodeRequest) {
|
||||
activitiProcessService.startActiviti(approvalNodeRequest);
|
||||
return Response.ok();
|
||||
}
|
||||
//查看审批详情
|
||||
/**
|
||||
* 查看审批详情
|
||||
*
|
||||
* @param showActivitiDTO 显示审批详情的数据传输对象
|
||||
* @return 审批数据和记录信息
|
||||
*/
|
||||
@PostMapping(value = "/showActiviti")
|
||||
public Response showActiviti(@RequestBody ShowActivitiDTO showActivitiDTO) {
|
||||
ActivitiDataAndRecordDTO activitiDataAndRecordDTO = activitiProcessService
|
||||
.showActivitiData(showActivitiDTO);
|
||||
return Response.ok().data(activitiDataAndRecordDTO);
|
||||
}
|
||||
//操作审批
|
||||
/**
|
||||
* 操作审批
|
||||
*
|
||||
* @param handleApprovalDTO 处理审批的数据传输对象
|
||||
* @return 操作结果消息
|
||||
*/
|
||||
@PostMapping(value = "/handleApproval")
|
||||
public Response handleApproval(@RequestBody HandleApprovalDTO handleApprovalDTO) {
|
||||
String msg = activitiProcessService.handleApproval(handleApprovalDTO);
|
||||
return Response.ok().data(msg);
|
||||
}
|
||||
|
||||
//查看审批
|
||||
/**
|
||||
* 查看评审列表
|
||||
*
|
||||
* @param engineReviewListRequest 工程评审列表请求对象
|
||||
* @return 分页结果的工程评审列表
|
||||
*/
|
||||
@PostMapping(value = "/showEngReview")
|
||||
public Response showEngReview(@RequestBody EngineReviewListRequest engineReviewListRequest) {
|
||||
PageResultDTO<EngineReviewListPojo> msg = engineReviewListService.selectEngineReviewListByUserId(engineReviewListRequest);
|
||||
return Response.ok().data(msg);
|
||||
}
|
||||
|
||||
//申请人退回审批
|
||||
/**
|
||||
* 申请人退回审批
|
||||
*
|
||||
* @param approvalId 审批ID
|
||||
* @return 操作结果消息
|
||||
*/
|
||||
@GetMapping(value = "/returnApproval")
|
||||
public Response returnApproval(@RequestParam(value = "approvalId") String approvalId) {
|
||||
String msg = engineReviewListService.returnApproval(approvalId);
|
||||
return Response.ok().data(msg);
|
||||
}
|
||||
|
||||
// 获取是否直送
|
||||
/**
|
||||
* 获取是否直送
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @return 是否直送的标志
|
||||
*/
|
||||
@GetMapping("/getIsDirect")
|
||||
public Response getIsDirect(
|
||||
@RequestParam String flowId
|
||||
@ -129,7 +180,12 @@ public class ActivitiProcessController {
|
||||
boolean flag = activitiProcessService.getIsDirect(flowId);
|
||||
return Response.ok().data(flag);
|
||||
}
|
||||
// 获取流程审批人
|
||||
/**
|
||||
* 获取流程审批人
|
||||
*
|
||||
* @param templateId 模板ID
|
||||
* @return 审批节点信息
|
||||
*/
|
||||
@GetMapping("/getApprovalUsers")
|
||||
public Response getApprovalUsers(
|
||||
@NotBlank @RequestParam String templateId
|
||||
@ -137,7 +193,13 @@ public class ActivitiProcessController {
|
||||
ApprovalNodesDTO nodes = activitiProcessService.getApprovalUsers(templateId);
|
||||
return Response.ok().data(nodes);
|
||||
}
|
||||
// 直送回退回的节点
|
||||
/**
|
||||
* 直送回退回的节点
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/directSendingApproval")
|
||||
public Response directSendingApproval(
|
||||
@RequestParam @NotBlank String flowId,
|
||||
@ -146,7 +208,12 @@ public class ActivitiProcessController {
|
||||
activitiProcessService.directSendingApproval(flowId, userId);
|
||||
return Response.ok();
|
||||
}
|
||||
// 获取可退回节点
|
||||
/**
|
||||
* 获取可退回节点
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @return 可退回节点列表
|
||||
*/
|
||||
@GetMapping("/getReturnNodes")
|
||||
public Response getReturnNodes(
|
||||
@NotBlank String flowId
|
||||
@ -154,7 +221,13 @@ public class ActivitiProcessController {
|
||||
List<String> result = activitiProcessService.getReturnNodes(flowId);
|
||||
return Response.ok().data(result);
|
||||
}
|
||||
// 处理人退回指定节点
|
||||
/**
|
||||
* 处理人退回指定节点
|
||||
*
|
||||
* @param form 处理退回节点表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/handleReturnToNode")
|
||||
public Response handleReturnToNode(
|
||||
@RequestBody @Valid HandleReturnNodeForm form,
|
||||
@ -168,7 +241,13 @@ public class ActivitiProcessController {
|
||||
activitiProcessService.handleReturnToNode(form);
|
||||
return Response.ok();
|
||||
}
|
||||
// 发起人撤回审批
|
||||
/**
|
||||
* 发起人撤回审批
|
||||
*
|
||||
* @param request 处理审批请求
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/handleReturn")
|
||||
public Response handleReturn(
|
||||
@RequestBody @Valid HandleApprovalRequest request,
|
||||
|
||||
@ -7,41 +7,67 @@ import com.xdap.self_development.domain.pojo.DataEntryEngineModelPojo;
|
||||
import com.xdap.self_development.domain.view.AnalysisModelParamterView;
|
||||
import com.xdap.self_development.domain.view.AnalysisModelParamterViewAndParam;
|
||||
import com.xdap.self_development.service.AnalysisCommonParametersService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据分析公共控制器
|
||||
* 提供数据分析相关的通用功能,包括模型参数查询、可用参数获取、报表展示等功能
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/analysis")
|
||||
public class AnalysisCommonController {
|
||||
@Autowired
|
||||
@Resource
|
||||
AnalysisCommonParametersService analysisCommonParametersService;
|
||||
|
||||
//机型常用返回机型数据 暂未使用
|
||||
/**
|
||||
* 机型常用返回机型数据(暂未使用)
|
||||
*
|
||||
* @param analysisRequest 分析请求对象
|
||||
* @return 机型参数视图列表
|
||||
*/
|
||||
@PostMapping("/selectModelParamByCommon")
|
||||
public Response selectModelParamByCommon(@RequestBody AnalysisRequest analysisRequest) {
|
||||
ArrayList<AnalysisModelParamterView> lists = analysisCommonParametersService.selectModelParamByCommon(analysisRequest);
|
||||
return Response.ok().data(lists);
|
||||
}
|
||||
|
||||
// 获取可用参数
|
||||
/**
|
||||
* 获取可用参数
|
||||
*
|
||||
* @return 可用参数列表
|
||||
*/
|
||||
@GetMapping("/getAvailableParameters")
|
||||
public Response getAvailableParameters() {
|
||||
List<String> lists = analysisCommonParametersService.getAvailableParameters();
|
||||
return Response.ok().data(lists);
|
||||
}
|
||||
|
||||
//统计分析图表
|
||||
/**
|
||||
* 统计分析图表
|
||||
*
|
||||
* @param models 模型列表
|
||||
* @return 分析模型参数视图和参数
|
||||
*/
|
||||
@PostMapping("/showReport")
|
||||
public Response showReport(@NotEmpty @RequestBody List<String> models) {
|
||||
AnalysisModelParamterViewAndParam andParam = analysisCommonParametersService.showReport(models);
|
||||
return Response.ok().data(andParam);
|
||||
}
|
||||
|
||||
// 模糊查询机型
|
||||
/**
|
||||
* 模糊查询机型
|
||||
*
|
||||
* @param request 报表请求对象
|
||||
* @return 引擎模型数据项列表
|
||||
*/
|
||||
@PostMapping("/selectModelByLike")
|
||||
public Response selectModelByLike(
|
||||
@RequestBody ReportRequest request
|
||||
@ -50,11 +76,4 @@ public class AnalysisCommonController {
|
||||
return Response.ok().data(lists);
|
||||
}
|
||||
|
||||
// //模糊查询下拉列表
|
||||
// @GetMapping("/analysisShowList")
|
||||
// public Response analysisShowList(@RequestParam("attribute") String attribute) {
|
||||
// List<String> lists = analysisCommonParametersService.analysisShowList(attribute);
|
||||
// return Response.ok().data(lists);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -18,13 +18,26 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 对标报告控制器
|
||||
* 提供对标报告相关的功能,包括报告上传、保存、审批、更新、删除等操作
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/benchmark")
|
||||
public class BenchmarkingReportController {
|
||||
@Resource
|
||||
private BenchmarkingReportService benchmarkingReportService;
|
||||
|
||||
// 修改后继续流程
|
||||
/**
|
||||
* 修改后继续流程
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/continueApproval")
|
||||
public Response continueApproval(
|
||||
@NotBlank @RequestParam String flowId,
|
||||
@ -34,7 +47,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 上传附件
|
||||
/**
|
||||
* 上传附件
|
||||
*
|
||||
* @param file 文件
|
||||
* @param createBy 创建者
|
||||
* @return 文件URL
|
||||
*/
|
||||
@PostMapping("/uploadFile")
|
||||
public Response uploadFile(
|
||||
@NotNull @RequestPart MultipartFile file,
|
||||
@ -44,7 +63,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().data(fileUrl);
|
||||
}
|
||||
|
||||
// 保存对标报告
|
||||
/**
|
||||
* 保存对标报告
|
||||
*
|
||||
* @param form 保存对标报告表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/insertReport")
|
||||
public Response saveReportApproval(
|
||||
@Valid @RequestBody SaveBenchmarkingReportForm form,
|
||||
@ -59,7 +84,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().setMessage("保存成功");
|
||||
}
|
||||
|
||||
// 发起人发起审批
|
||||
/**
|
||||
* 发起人发起审批
|
||||
*
|
||||
* @param form 审批人员表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/startReportApproval")
|
||||
public Response startReportApproval(
|
||||
@Valid @RequestBody ApprovalPersonForm form,
|
||||
@ -74,7 +105,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().setMessage("保存成功");
|
||||
}
|
||||
|
||||
// 发起人重新发起流程
|
||||
/**
|
||||
* 发起人重新发起流程
|
||||
*
|
||||
* @param form 重启报告审批表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/restartReportApproval")
|
||||
public Response restartReportApproval(
|
||||
@Valid @RequestBody RestartReportApprovalForm form,
|
||||
@ -89,7 +126,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().setMessage("重新提交成功");
|
||||
}
|
||||
|
||||
// 直送回退回的节点
|
||||
/**
|
||||
* 直送回退回的节点
|
||||
*
|
||||
* @param reportId 报告ID
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/directSendingApproval")
|
||||
public Response directSendingApproval(
|
||||
@RequestParam @NotBlank String reportId,
|
||||
@ -99,7 +142,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 处理人处理审批通过还是拒绝
|
||||
/**
|
||||
* 处理人处理审批通过还是拒绝
|
||||
*
|
||||
* @param request 处理审批请求
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/handleReportApproval")
|
||||
public Response handleReportApproval(
|
||||
@RequestBody @Valid HandleApprovalRequest request,
|
||||
@ -114,7 +163,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().setMessage("处理成功");
|
||||
}
|
||||
|
||||
// 处理人退回指定节点
|
||||
/**
|
||||
* 处理人退回指定节点
|
||||
*
|
||||
* @param form 处理退回节点表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/handleReturnToNode")
|
||||
public Response handleReturnToNode(
|
||||
@RequestBody @Valid HandleReturnNodeForm form,
|
||||
@ -129,7 +184,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 发起人撤回审批
|
||||
/**
|
||||
* 发起人撤回审批
|
||||
*
|
||||
* @param request 处理审批请求
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/handleReturn")
|
||||
public Response handleReturn(
|
||||
@RequestBody @Valid HandleApprovalRequest request,
|
||||
@ -144,7 +205,12 @@ public class BenchmarkingReportController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 删除对标报告
|
||||
/**
|
||||
* 删除对标报告
|
||||
*
|
||||
* @param reportId 报告ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/deleteReport")
|
||||
public Response deleteReport(
|
||||
@NotBlank @RequestParam String reportId
|
||||
@ -153,7 +219,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().setMessage("删除成功");
|
||||
}
|
||||
|
||||
// 修改对标报告
|
||||
/**
|
||||
* 修改对标报告
|
||||
*
|
||||
* @param form 更新对标报告表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateReport")
|
||||
public Response restartReportApproval(
|
||||
@Valid @RequestBody UpdateBenchmarkingReportForm form,
|
||||
@ -168,7 +240,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().setMessage("重新提交成功");
|
||||
}
|
||||
|
||||
// 筛选对标报告
|
||||
/**
|
||||
* 筛选对标报告
|
||||
*
|
||||
* @param form 对标报告页面表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 按条件筛选的对标报告列表
|
||||
*/
|
||||
@PostMapping("/getReportAndTodoByCondition")
|
||||
public Response getBenchmarkingReportByCondition(
|
||||
@Valid @RequestBody BenchmarkingReportPageForm form,
|
||||
@ -184,7 +262,13 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
|
||||
// 获取流程列表
|
||||
/**
|
||||
* 获取流程列表
|
||||
*
|
||||
* @param form 审批列表表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 审批列表
|
||||
*/
|
||||
@PostMapping("/getApprovalList")
|
||||
public Response getApprovalList(
|
||||
@Valid @RequestBody ApprovalListForm form,
|
||||
@ -198,7 +282,12 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().data(benchmarkingReportService.getApprovalList(form));
|
||||
}
|
||||
|
||||
// 查看对标报告详情
|
||||
/**
|
||||
* 查看对标报告详情
|
||||
*
|
||||
* @param reportId 报告ID
|
||||
* @return 对标报告详情
|
||||
*/
|
||||
@GetMapping("/getReportDetail")
|
||||
public Response getReportDetail(
|
||||
@NotBlank String reportId
|
||||
@ -208,7 +297,12 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().data(report);
|
||||
}
|
||||
|
||||
// 获取审批流程
|
||||
/**
|
||||
* 获取审批流程
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @return 审批流程节点视图
|
||||
*/
|
||||
@GetMapping("/getReportProcess")
|
||||
public Response getReportProcess(
|
||||
@NotBlank String flowId
|
||||
@ -217,7 +311,12 @@ public class BenchmarkingReportController {
|
||||
return Response.ok().data(approvalFlowView);
|
||||
}
|
||||
|
||||
// 获取流程审批人
|
||||
/**
|
||||
* 获取流程审批人
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @return 审批节点信息
|
||||
*/
|
||||
@GetMapping("/getApprovalUsers")
|
||||
public Response getApprovalUsers(
|
||||
@NotBlank @RequestParam String flowId
|
||||
|
||||
@ -13,20 +13,36 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 常用参数控制器
|
||||
* 提供常用参数相关的功能,包括子系统和参数查询、机型参数常用设置、数据分析常用设置等
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/common")
|
||||
public class CommonParameterController {
|
||||
@Resource
|
||||
private CommonParameterService commonParameterService;
|
||||
|
||||
// 全部子系统和参数
|
||||
/**
|
||||
* 获取全部子系统和参数
|
||||
*
|
||||
* @return 子系统和参数项列表
|
||||
*/
|
||||
@GetMapping("/getSystemAndPara")
|
||||
public Response getSystemAndPara() {
|
||||
List<ModelCommonItem> list = commonParameterService.getSystemAndPara();
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
|
||||
// 查询机型参数常用
|
||||
/**
|
||||
* 查询机型参数常用
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 机型常用参数列表
|
||||
*/
|
||||
@GetMapping("/getModelCommon")
|
||||
public Response getModelCommonParameter(
|
||||
@NotBlank @RequestParam String userId
|
||||
@ -34,7 +50,12 @@ public class CommonParameterController {
|
||||
List<ModelCommon> list = commonParameterService.getModelCommonParameter(userId);
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
// 新增机型参数常用
|
||||
/**
|
||||
* 新增机型参数常用
|
||||
*
|
||||
* @param form 机型参数插入表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/insertModelCommon")
|
||||
public Response insertModelCommonParameter(
|
||||
@Valid @RequestBody ModelCommonParameterInsertForm form,
|
||||
@ -48,7 +69,12 @@ public class CommonParameterController {
|
||||
commonParameterService.insertModelCommonParameter(form);
|
||||
return Response.ok().setMessage("新增成功");
|
||||
}
|
||||
// 修改机型参数常用
|
||||
/**
|
||||
* 修改机型参数常用
|
||||
*
|
||||
* @param form 机型参数更新表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateModelCommon")
|
||||
public Response updateModelCommonParameter(
|
||||
@Valid @RequestBody ModelCommonParameterUpdateForm form,
|
||||
@ -65,7 +91,12 @@ public class CommonParameterController {
|
||||
|
||||
/*-----------------------------------------------------------------*/
|
||||
|
||||
// 查询数据分析常用
|
||||
/**
|
||||
* 查询数据分析常用
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 分析数据常用参数列表
|
||||
*/
|
||||
@GetMapping("/getAnalysisCommonParameter")
|
||||
public Response getAnalysisCommonParameter(
|
||||
@NotBlank @RequestParam String userId
|
||||
@ -74,7 +105,12 @@ public class CommonParameterController {
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
|
||||
// 新增数据分析常用
|
||||
/**
|
||||
* 新增数据分析常用
|
||||
*
|
||||
* @param form 分析参数插入表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/insertAnalysisCommon")
|
||||
public Response insertAnalysisCommonParameter(
|
||||
@Valid @RequestBody AnalysisCommonParameterInsertForm form,
|
||||
@ -89,7 +125,12 @@ public class CommonParameterController {
|
||||
return Response.ok().setMessage("新增成功");
|
||||
}
|
||||
|
||||
// 修改数据分析常用
|
||||
/**
|
||||
* 修改数据分析常用
|
||||
*
|
||||
* @param form 分析参数更新表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateAnalysisCommon")
|
||||
public Response updateAnalysisCommonParameter(
|
||||
@Valid @RequestBody AnalysisCommonParameterUpdateForm form,
|
||||
|
||||
@ -3,7 +3,6 @@ package com.xdap.self_development.controller;
|
||||
import com.definesys.mpaas.common.http.Response;
|
||||
import com.xdap.api.moudle.user.vo.LoginUserVo;
|
||||
import com.xdap.runtime.service.RuntimeAppContextService;
|
||||
import com.xdap.runtime.service.RuntimeDatasourceService;
|
||||
import com.xdap.runtime.service.RuntimeUserService;
|
||||
import com.xdap.self_development.controller.form.OptionForm;
|
||||
import com.xdap.self_development.controller.form.TemplateForm;
|
||||
@ -20,8 +19,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据录入
|
||||
* 列表为管理模板的列表,其中功能有筛选条件、列表显示、添加模板、导入模板、查看、下载、版本、修改。
|
||||
* 数据录入控制器
|
||||
* 管理模板列表,提供筛选条件、列表显示、添加模板、导入模板、查看、下载、版本、修改等功能
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/dataEntry")
|
||||
@ -32,10 +34,12 @@ public class DataEntryController {
|
||||
private RuntimeAppContextService runtimeAppContextService;
|
||||
@Resource
|
||||
private RuntimeUserService runtimeUserService;
|
||||
@Resource
|
||||
private RuntimeDatasourceService runtimeDatasourceService;
|
||||
|
||||
// 测试接口
|
||||
/**
|
||||
* 测试接口
|
||||
*
|
||||
* @return 当前应用上下文信息
|
||||
*/
|
||||
@GetMapping("/test")
|
||||
public Response getTest() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
@ -53,35 +57,61 @@ public class DataEntryController {
|
||||
return Response.ok().data(map);
|
||||
}
|
||||
|
||||
// 筛选条件 模板的模糊搜索
|
||||
/**
|
||||
* 根据条件筛选模板(模板的模糊搜索)
|
||||
*
|
||||
* @param templateName 模板名称
|
||||
* @return 模板列表
|
||||
*/
|
||||
@GetMapping("/getTemplateByCondition")
|
||||
public Response getTemplateByCondition(@RequestParam("templateName") String templateName) {
|
||||
List<TemplatePojo> templates = dataEntryService.getTemplateByCondition(templateName);
|
||||
return Response.ok().data(templates);
|
||||
}
|
||||
|
||||
// 筛选条件 参数的模糊搜索
|
||||
/**
|
||||
* 根据条件筛选参数(参数的模糊搜索)
|
||||
*
|
||||
* @param form 筛选条件表单
|
||||
* @return 参数列表
|
||||
*/
|
||||
@GetMapping("/getParameterByCondition")
|
||||
public Response getParameterByCondition(OptionForm form) {
|
||||
List<ParameterPojo> parameters = dataEntryService.getParameterByCondition(form);
|
||||
return Response.ok().data(parameters);
|
||||
}
|
||||
|
||||
// 添加模板参数 (form需指定模板名称)
|
||||
/**
|
||||
* 添加模板参数(form需指定模板名称)
|
||||
*
|
||||
* @param form 模板表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/insertParameter")
|
||||
public Response insertParameter(@RequestBody TemplateForm form) {
|
||||
dataEntryService.insertParameter(form);
|
||||
return Response.ok().setMessage("添加成功");
|
||||
}
|
||||
|
||||
// 导入模板 导入全部模板参数
|
||||
/**
|
||||
* 导入模板(导入全部模板参数)
|
||||
*
|
||||
* @param file 模板文件
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public Response importTemplate(@RequestParam("file") MultipartFile file) {
|
||||
dataEntryService.readExcel(file);
|
||||
return Response.ok().setMessage("导入成功");
|
||||
}
|
||||
|
||||
// 下载 导出全部模板参数 (可选导出全部、导出指定名称模板、导出空参数模板、可以指定导出某些参数或者不导出某些参数)
|
||||
/**
|
||||
* 导出模板(导出全部模板参数)
|
||||
* 可选择导出全部、导出指定名称模板、导出空参数模板、可以指定导出某些参数或者不导出某些参数
|
||||
*
|
||||
* @param form 导出选项表单
|
||||
* @param response HTTP响应
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportTemplate(
|
||||
@RequestBody OptionForm form,
|
||||
|
||||
@ -6,29 +6,35 @@ import com.xdap.self_development.controller.request.DataEntryEngineModelPageRequ
|
||||
import com.xdap.self_development.domain.dto.DataEntryEngineModelDto;
|
||||
import com.xdap.self_development.domain.dto.PageResultDTO;
|
||||
import com.xdap.self_development.service.DataEntryEngineModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 发动机型号数据表 前端控制器
|
||||
* </p>
|
||||
* 发动机型号数据控制器
|
||||
* 提供发动机型号数据相关的功能,包括Excel导入导出、添加、删除、分页查询等
|
||||
*
|
||||
* @author Lys111
|
||||
* @since 2025-11-12
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/dataEntryEngineModel")
|
||||
public class DataEntryEngineModelController {
|
||||
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private DataEntryEngineModelService entryEngineModelService;
|
||||
|
||||
//Excel导入
|
||||
/**
|
||||
* Excel导入
|
||||
*
|
||||
* @param file 文件
|
||||
* @param userId 用户ID
|
||||
* @param ycOrOt 用途标识
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/excelImport")
|
||||
public Response excelImport(@RequestParam(value = "file") MultipartFile file
|
||||
,String userId,String ycOrOt) {
|
||||
@ -47,7 +53,12 @@ public class DataEntryEngineModelController {
|
||||
}
|
||||
return Response.ok().data("导入成功");
|
||||
}
|
||||
//导出模板
|
||||
/**
|
||||
* 导出Excel模板
|
||||
*
|
||||
* @param response HTTP响应
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/excelExport")
|
||||
public Response excelExport(HttpServletResponse response) {
|
||||
try {
|
||||
@ -58,14 +69,24 @@ public class DataEntryEngineModelController {
|
||||
return Response.ok().data("导出成功");
|
||||
}
|
||||
|
||||
//添加-单条写入
|
||||
/**
|
||||
* 添加-单条写入
|
||||
*
|
||||
* @param pageRequest 页面请求对象
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/insert")
|
||||
public Response insert(@RequestBody DataEntryEngineModelPageRequest pageRequest) {
|
||||
entryEngineModelService.insert(pageRequest,pageRequest.getLoginUserId());
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 删除机型
|
||||
/**
|
||||
* 删除机型
|
||||
*
|
||||
* @param modelId 机型ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/delete")
|
||||
public Response delete(
|
||||
@RequestParam String modelId
|
||||
@ -74,35 +95,28 @@ public class DataEntryEngineModelController {
|
||||
return Response.ok().setMessage("删除成功");
|
||||
}
|
||||
|
||||
//分页查询
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageRequest 页面请求对象
|
||||
* @return 分页查询结果
|
||||
*/
|
||||
@PostMapping("/selectByPage")
|
||||
public Response selectByConditionPage(@RequestBody DataEntryEngineModelPageRequest pageRequest) {
|
||||
PageResultDTO<DataEntryEngineModelDto> tPageResultDTO = entryEngineModelService.selectByConditionPage(pageRequest);
|
||||
System.out.println("进入方法");
|
||||
return Response.ok().data(tPageResultDTO);
|
||||
}
|
||||
|
||||
// 多版本机型分页查询
|
||||
/**
|
||||
* 多版本机型分页查询
|
||||
*
|
||||
* @return 分页查询结果
|
||||
*/
|
||||
@GetMapping("/selectVersionByPage")
|
||||
public Response selectVersionByConditionPage() {
|
||||
PageResultDTO<DataEntryEngineModelDto> tPageResultDTO =
|
||||
entryEngineModelService.selectVersionByConditionPage();
|
||||
return Response.ok().data(tPageResultDTO);
|
||||
}
|
||||
// //模板更新审核通过同步机型参数
|
||||
// @GetMapping("/updateModelForNewVersion")
|
||||
// public Response updateModelForNewVersion() {
|
||||
// entryEngineModelService.updateModelForNewVersion();
|
||||
// return Response.ok();
|
||||
// }
|
||||
|
||||
|
||||
//Excel导出
|
||||
// @GetMapping("/excelExport")
|
||||
// public Response excelExport(HttpServletResponse response){
|
||||
// entryEngineModelService.excelExport(response);
|
||||
// return Response.ok().data("导入成功");
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
package com.xdap.self_development.controller;
|
||||
|
||||
import com.definesys.mpaas.common.http.Response;
|
||||
import com.xdap.self_development.common.MyResponse;
|
||||
import com.xdap.self_development.schedule.ParameterValueCalculationTimer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/custom/delete")
|
||||
public class DeleteController {
|
||||
|
||||
@Resource
|
||||
private ParameterValueCalculationTimer parameterValueCalculationTimer;
|
||||
|
||||
@GetMapping("/testCalculate")
|
||||
public Response testCalculate() {
|
||||
MyResponse myResponse = parameterValueCalculationTimer.dailyCalculate();
|
||||
return Response.ok().data(myResponse);
|
||||
}
|
||||
}
|
||||
@ -7,51 +7,71 @@ import com.xdap.self_development.controller.request.EngineParamDetailRequest;
|
||||
import com.xdap.self_development.domain.pojo.EngineParamDetailPojo;
|
||||
import com.xdap.self_development.domain.dto.EngineParamDetailDTO;
|
||||
import com.xdap.self_development.service.EngineParamDetailService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 参数详情 前端控制器
|
||||
* </p>
|
||||
* 发动机参数详情控制器
|
||||
* 提供发动机参数详情相关的功能,包括参数列表查询、参数值查询、Excel导入导出、参数值修改等
|
||||
*
|
||||
* @author Lys111
|
||||
* @since 2025-11-13
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/engineParamDetailPojo")
|
||||
public class EngineParamDetailController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private EngineParamDetailService engineParamDetailService;
|
||||
|
||||
|
||||
//参数列表查询
|
||||
/**
|
||||
* 参数列表查询
|
||||
*
|
||||
* @param modelID 机型ID
|
||||
* @param tcData TC数据
|
||||
* @return 参数列表
|
||||
*/
|
||||
@GetMapping("/selectParamList")
|
||||
public Response selectParamList(@RequestParam(value = "modelID", required = false) String modelID,@RequestParam(value = "tcData", required = false) String tcData) {
|
||||
Map<String, List<String>> list = engineParamDetailService.selectParamList(modelID,tcData);
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
//参数列表查询
|
||||
/**
|
||||
* 参数列表和模型查询
|
||||
*
|
||||
* @param modelID 机型ID
|
||||
* @return 参数列表和模型映射
|
||||
*/
|
||||
@GetMapping("/selectParamListAndModel")
|
||||
public Response selectParamListAndModel(@RequestParam(value = "modelID"/*, required = false*/) String modelID) {
|
||||
Map<String, HashMap<String,List<String>>> list = engineParamDetailService.selectParamListAndModel(modelID);
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
|
||||
//参数值查询 一般不用
|
||||
/**
|
||||
* 参数值查询(一般不用)
|
||||
*
|
||||
* @param engineParamDetailRequest 发动机参数详情请求
|
||||
* @return 参数详情列表
|
||||
*/
|
||||
@PostMapping("/selectValueByParam")
|
||||
public Response selectValueByParam(@RequestBody EngineParamDetailRequest engineParamDetailRequest) {
|
||||
List<EngineParamDetailDTO> dtoList = engineParamDetailService.selectValueByParam(engineParamDetailRequest);
|
||||
return Response.ok().data(dtoList);
|
||||
}
|
||||
|
||||
//参数值多项查询(待办点进来和机型查看点进来都要传入机型ID)
|
||||
/**
|
||||
* 参数值多项查询(待办点进来和机型查看点进来都要传入机型ID)
|
||||
*
|
||||
* @param engineParamDetailRequest 发动机参数详情请求
|
||||
* @return 参数详情映射
|
||||
*/
|
||||
@PostMapping("/selectValueByMoreParam")
|
||||
public Response selectValueByMoreParam(@RequestBody EngineParamDetailRequest engineParamDetailRequest) {
|
||||
Map<String, List<EngineParamDetailDTO>> stringListMap = engineParamDetailService.selectValueByMoreParam(engineParamDetailRequest);
|
||||
@ -59,7 +79,14 @@ public class EngineParamDetailController {
|
||||
}
|
||||
|
||||
|
||||
//Excel导入
|
||||
/**
|
||||
* Excel导入
|
||||
*
|
||||
* @param file 文件
|
||||
* @param userId 用户ID
|
||||
* @param modelId 机型ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/excelImport")
|
||||
public Response excelImport(@RequestParam(value = "file") MultipartFile file,
|
||||
@RequestParam(value = "userId") String userId,
|
||||
@ -80,7 +107,14 @@ public class EngineParamDetailController {
|
||||
return Response.ok().data("导入成功");
|
||||
}
|
||||
|
||||
//导出模板
|
||||
/**
|
||||
* 导出Excel模板
|
||||
*
|
||||
* @param response HTTP响应
|
||||
* @param engineModelID 发动机型号ID
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/excelExport")
|
||||
public Response excelExport(
|
||||
HttpServletResponse response,
|
||||
@ -95,14 +129,26 @@ public class EngineParamDetailController {
|
||||
return Response.ok().data("导出成功");
|
||||
}
|
||||
|
||||
//修改
|
||||
/**
|
||||
* 修改参数值
|
||||
*
|
||||
* @param engineParamDetailPojos 发动机参数详情列表
|
||||
* @param currentUserId 当前用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping(value = "/updateParamValue")
|
||||
public Response updateParamValue(@RequestBody List<EngineParamDetailPojo> engineParamDetailPojos,@RequestParam("userID") String currentUserId) {
|
||||
engineParamDetailService.updateParamValue(engineParamDetailPojos, currentUserId);
|
||||
return Response.ok().data("修改成功,保存草稿,准备进入审批");
|
||||
}
|
||||
|
||||
//分解任务
|
||||
/**
|
||||
* 分解任务
|
||||
*
|
||||
* @param engineParamDetailPojos 发动机参数详情列表
|
||||
* @param userID 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping(value = "/updateToInsertFiledBy")
|
||||
public Response updateToInsertFiledBy(@RequestBody List<EngineParamDetailPojo> engineParamDetailPojos,
|
||||
@RequestParam(value = "userID") String userID) {
|
||||
@ -110,13 +156,26 @@ public class EngineParamDetailController {
|
||||
return Response.ok().data("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询版本列表
|
||||
*
|
||||
* @param modelId 机型ID
|
||||
* @return 版本号列表
|
||||
*/
|
||||
@GetMapping(value = "/selectVersionList")
|
||||
public Response selectVersionList(@RequestParam(value = "modelId") String modelId) {
|
||||
List<Integer> versionNumList = engineParamDetailService.selectVersionList(modelId);
|
||||
return Response.ok().data(versionNumList);
|
||||
}
|
||||
|
||||
//查找责任人或填写人列表
|
||||
/**
|
||||
* 查找责任人或填写人列表
|
||||
*
|
||||
* @param subSystem 子系统
|
||||
* @param dept 部门
|
||||
* @param type 类型
|
||||
* @return 用户列表
|
||||
*/
|
||||
@GetMapping(value = "/selectPersonoByType")
|
||||
public Response selectPersonoByType(@RequestParam(value = "subSystem") String subSystem,@RequestParam(value = "dept") String dept
|
||||
,@RequestParam(value = "type") Integer type) {
|
||||
|
||||
@ -14,13 +14,25 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 模板参数控制器
|
||||
* 提供模板参数相关的功能,包括参数模糊搜索、维护参数等
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/parameter")
|
||||
public class ParameterController {
|
||||
@Resource
|
||||
private ParameterService parameterService;
|
||||
|
||||
// 参数的模糊搜索
|
||||
/**
|
||||
* 参数的模糊搜索
|
||||
*
|
||||
* @param form 参数页面表单
|
||||
* @return 按条件筛选的参数分页结果
|
||||
*/
|
||||
@GetMapping("/getParameterByCondition")
|
||||
public Response getParameterByCondition(
|
||||
@Valid ParameterPageForm form,
|
||||
@ -36,7 +48,12 @@ public class ParameterController {
|
||||
}
|
||||
|
||||
|
||||
// 维护参数
|
||||
/**
|
||||
* 维护参数
|
||||
*
|
||||
* @param form 更新参数表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/maintenanceParameters")
|
||||
public Response maintenanceParameters(
|
||||
@Valid @RequestBody UpdateParameterForm form,
|
||||
|
||||
@ -8,11 +8,10 @@ import com.xdap.self_development.controller.request.UserRoleBindingRequest;
|
||||
import com.xdap.self_development.domain.pojo.ModelRolesPojo;
|
||||
import com.xdap.self_development.domain.view.MenuListView;
|
||||
import com.xdap.self_development.domain.view.MenuParamView;
|
||||
import com.xdap.self_development.exception.CommonException;
|
||||
import com.xdap.self_development.service.ModelMenuPermissionService;
|
||||
import com.xdap.self_development.service.ModelRoleService;
|
||||
import com.xdap.self_development.service.ParameterService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -20,51 +19,76 @@ import javax.validation.constraints.NotBlank;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限控制器
|
||||
* 提供权限管理相关的功能,包括角色管理、用户权限分配、角色权限管理等
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/permission")
|
||||
public class PermissionController {
|
||||
@Autowired
|
||||
ModelRoleService modelRoleService;
|
||||
@Autowired
|
||||
ModelMenuPermissionService modelMenuPermissionService;
|
||||
@Resource
|
||||
private ParameterService parameterService;
|
||||
ModelRoleService modelRoleService;
|
||||
@Resource
|
||||
ModelMenuPermissionService modelMenuPermissionService;
|
||||
|
||||
//添加角色
|
||||
/**
|
||||
* 添加角色
|
||||
*
|
||||
* @param request 角色请求对象
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/addRoles")
|
||||
Response addRoles(@RequestBody ModelRolesRequest request) {
|
||||
try {
|
||||
modelRoleService.addRoles(request);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("添加失败:检查是否存在重复角色(代码)" + e.getMessage());
|
||||
throw new CommonException("添加失败:检查是否存在重复角色(代码)" + e.getMessage());
|
||||
}
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
//查看角色
|
||||
/**
|
||||
* 查看角色
|
||||
*
|
||||
* @return 角色列表
|
||||
*/
|
||||
@GetMapping("/selectRoles")
|
||||
Response selectRoles() {
|
||||
try {
|
||||
List<ModelRolesPojo> modelRolesPojos = modelRoleService.selectRoles();
|
||||
return Response.ok().data(modelRolesPojos);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
throw new CommonException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//删除角色
|
||||
/**
|
||||
* 删除角色
|
||||
*
|
||||
* @param roleID 角色ID
|
||||
* @param userID 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/removeRoles")
|
||||
Response removeRoles(@RequestParam String roleID, String userID) {
|
||||
try {
|
||||
modelRoleService.removeRoles(roleID, userID);
|
||||
return Response.ok();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
throw new CommonException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取用户权限
|
||||
/**
|
||||
* 获取用户权限
|
||||
*
|
||||
* @param userOrDepID 用户或部门ID
|
||||
* @return 菜单参数视图列表
|
||||
*/
|
||||
@GetMapping("/selectPersByUser")
|
||||
Response selectPersByUser(@RequestParam String userOrDepID) {
|
||||
|
||||
@ -73,7 +97,12 @@ public class PermissionController {
|
||||
|
||||
}
|
||||
|
||||
//获取角色权限
|
||||
/**
|
||||
* 获取角色权限
|
||||
*
|
||||
* @param roleID 角色ID
|
||||
* @return 菜单参数视图列表
|
||||
*/
|
||||
@GetMapping("/selectPersByRole")
|
||||
Response selectPersByRole(@RequestParam String roleID) {
|
||||
List<MenuParamView> views = modelRoleService.selectPersByRole(roleID);
|
||||
@ -84,30 +113,46 @@ public class PermissionController {
|
||||
}
|
||||
|
||||
|
||||
//为用户绑定角色
|
||||
/**
|
||||
* 为用户绑定角色
|
||||
*
|
||||
* @param userRoleBindingRequest 用户角色绑定请求
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/userRoleBinding")
|
||||
public Response userRoleBinding(@RequestBody UserRoleBindingRequest userRoleBindingRequest) {
|
||||
try {
|
||||
modelRoleService.userRoleBinding(userRoleBindingRequest);
|
||||
return Response.ok();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
throw new CommonException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//修改角色权限(关联权限修改 增加,修改,删除)
|
||||
/**
|
||||
* 修改角色权限(关联权限修改 增加,修改,删除)
|
||||
*
|
||||
* @param request 角色权限关联请求列表
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updatePerForRole")
|
||||
public Response updatePerForRole(@RequestBody List<RolePerJoinRequest> request) {
|
||||
try {
|
||||
modelRoleService.updatePerForRole(request);
|
||||
return Response.ok();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
throw new CommonException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// 修改单个角色信息(基础信息)
|
||||
/**
|
||||
* 修改单个角色信息(基础信息)
|
||||
*
|
||||
* @param modelRolesPojo 角色POJO对象
|
||||
* @param userID 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateRole")
|
||||
public Response updateRole(@RequestBody ModelRolesPojo modelRolesPojo, @RequestParam String userID) {
|
||||
modelRoleService.updateRole(modelRolesPojo, userID);
|
||||
@ -115,17 +160,26 @@ public class PermissionController {
|
||||
}
|
||||
|
||||
|
||||
//菜单查询
|
||||
/**
|
||||
* 菜单查询
|
||||
*
|
||||
* @return 菜单列表视图
|
||||
*/
|
||||
@GetMapping("/selectMenus")
|
||||
Response selectMenus() {
|
||||
try {
|
||||
List<MenuListView> modelRolesPojos = modelMenuPermissionService.selectMenus();
|
||||
return Response.ok().data(modelRolesPojos);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
throw new CommonException(e.getMessage());
|
||||
}
|
||||
}
|
||||
// 查看角色绑定的人员或部门列表
|
||||
/**
|
||||
* 查看角色绑定的人员或部门列表
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 用户或部门映射
|
||||
*/
|
||||
@GetMapping("/selectUserOrDeptByRole")
|
||||
public Response selectUserOrDeptByRole(
|
||||
@NotBlank String roleId
|
||||
|
||||
@ -23,6 +23,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 责任人控制器
|
||||
* 提供责任人管理相关的功能,包括责任人导入导出、查询、保存、修改、删除等
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/responsible")
|
||||
public class ResponsiblePersonController {
|
||||
@ -31,21 +38,31 @@ public class ResponsiblePersonController {
|
||||
@Resource
|
||||
private ResponsiblePersonService responsiblePersonService;
|
||||
|
||||
// 导入责任人
|
||||
/**
|
||||
* 导入责任人
|
||||
*
|
||||
* @param file 文件
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public Response importPerson(
|
||||
@RequestPart("file") MultipartFile file,
|
||||
@RequestPart("userId") String userId
|
||||
) {
|
||||
MyResponse templateImportView = responsiblePersonService.importPerson(file, userId);
|
||||
if (templateImportView.getFlag()) {
|
||||
if (templateImportView.isFlag()) {
|
||||
return Response.error("导入异常").data(templateImportView);
|
||||
} else {
|
||||
return Response.ok().setMessage("导入成功");
|
||||
}
|
||||
}
|
||||
|
||||
// 导出责任人
|
||||
/**
|
||||
* 导出责任人
|
||||
*
|
||||
* @param response HTTP响应
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportPerson(
|
||||
HttpServletResponse response
|
||||
@ -53,7 +70,11 @@ public class ResponsiblePersonController {
|
||||
responsiblePersonService.exportPerson(response);
|
||||
}
|
||||
|
||||
// 获取导入模板
|
||||
/**
|
||||
* 获取导入模板
|
||||
*
|
||||
* @param response HTTP响应
|
||||
*/
|
||||
@GetMapping("/getImportTemplate")
|
||||
public void getImportTemplate(
|
||||
HttpServletResponse response
|
||||
@ -61,7 +82,12 @@ public class ResponsiblePersonController {
|
||||
responsiblePersonService.exportVoidPerson(response);
|
||||
}
|
||||
|
||||
// 判断是否为责任人
|
||||
/**
|
||||
* 判断是否为责任人
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 是否为责任人的判断结果
|
||||
*/
|
||||
@GetMapping("/isResponsiblePerson")
|
||||
public Response isResponsiblePerson(
|
||||
@NotBlank String userId
|
||||
@ -69,7 +95,12 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().data(responsiblePersonService.isResponsiblePerson(userId));
|
||||
}
|
||||
|
||||
// 查询所有部门责任人
|
||||
/**
|
||||
* 查询所有部门责任人
|
||||
*
|
||||
* @param form 部门责任人页面表单
|
||||
* @return 部门责任人分页查询结果
|
||||
*/
|
||||
@GetMapping("/getDeptResponsible")
|
||||
public Response getDeptResponsible(
|
||||
@Valid DeptResponsiblePageForm form,
|
||||
@ -85,7 +116,12 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().data(deptResponsible);
|
||||
}
|
||||
|
||||
// 查询所有部门填写人
|
||||
/**
|
||||
* 查询所有部门填写人
|
||||
*
|
||||
* @param form 部门责任人页面表单
|
||||
* @return 部门填写人分页查询结果
|
||||
*/
|
||||
@GetMapping("/getDeptFilled")
|
||||
public Response getDeptFilled(
|
||||
@Valid DeptResponsiblePageForm form,
|
||||
@ -101,7 +137,12 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().data(deptResponsible);
|
||||
}
|
||||
|
||||
// 根据部门id获取子部门
|
||||
/**
|
||||
* 根据部门id获取子部门
|
||||
*
|
||||
* @param departmentId 部门ID
|
||||
* @return 子部门列表
|
||||
*/
|
||||
@GetMapping("/getSubDepartmentById")
|
||||
public Response getSubDepartmentById(
|
||||
@RequestParam(defaultValue = "") String departmentId
|
||||
@ -124,7 +165,12 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().data(xdapDepartments);
|
||||
}
|
||||
|
||||
// 根据部门id获取部门的用户
|
||||
/**
|
||||
* 根据部门id获取部门的用户
|
||||
*
|
||||
* @param form 部门用户表单
|
||||
* @return 部门用户视图列表
|
||||
*/
|
||||
@GetMapping("/getUserByDepartmentId")
|
||||
public Response getUserByDepartmentId(
|
||||
@Valid DepartmentUserForm form
|
||||
@ -139,14 +185,23 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().data(responsiblePeoples);
|
||||
}
|
||||
|
||||
// 获取全部子系统名
|
||||
/**
|
||||
* 获取全部子系统名
|
||||
*
|
||||
* @return 子系统名称集合
|
||||
*/
|
||||
@GetMapping("/getAllSubsystem")
|
||||
public Response getAllSubsystem() {
|
||||
Set<String> set = responsiblePersonService.getAllSubsystem();
|
||||
return Response.ok().data(set);
|
||||
}
|
||||
|
||||
// 保存部门责任人
|
||||
/**
|
||||
* 保存部门责任人
|
||||
*
|
||||
* @param form 责任人表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/saveResponsiblePerson")
|
||||
public Response saveResponsiblePerson(
|
||||
@Valid @RequestBody ResponsiblePersonForm form,
|
||||
@ -161,7 +216,12 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().setMessage("添加成功");
|
||||
}
|
||||
|
||||
// 保存部门填写人
|
||||
/**
|
||||
* 保存部门填写人
|
||||
*
|
||||
* @param form 填写人表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/saveFilledPerson")
|
||||
public Response saveFilledPerson(
|
||||
@Valid @RequestBody FilledPersonForm form,
|
||||
@ -176,7 +236,12 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().setMessage("添加成功");
|
||||
}
|
||||
|
||||
// 修改部门责任人
|
||||
/**
|
||||
* 修改部门责任人
|
||||
*
|
||||
* @param form 更新责任人表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateResponsiblePerson")
|
||||
public Response updateResponsiblePerson(
|
||||
@Valid @RequestBody UpdateResponsiblePersonForm form,
|
||||
@ -192,7 +257,12 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().setMessage("添加成功");
|
||||
}
|
||||
|
||||
// 修改部门填写人
|
||||
/**
|
||||
* 修改部门填写人
|
||||
*
|
||||
* @param form 更新填写人表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateFilledPerson")
|
||||
public Response updateFilledPerson(
|
||||
@Valid @RequestBody UpdateFilledPersonForm form,
|
||||
@ -208,7 +278,12 @@ public class ResponsiblePersonController {
|
||||
return Response.ok().setMessage("添加成功");
|
||||
}
|
||||
|
||||
// 删除部门责任人
|
||||
/**
|
||||
* 删除部门责任人
|
||||
*
|
||||
* @param rowId 行ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/deleteResponsiblePerson")
|
||||
public Response deleteResponsiblePerson(
|
||||
@NotBlank @RequestParam String rowId
|
||||
@ -216,7 +291,13 @@ public class ResponsiblePersonController {
|
||||
responsiblePersonService.deleteResponsiblePerson(rowId);
|
||||
return Response.ok();
|
||||
}
|
||||
// 查询部门责任人
|
||||
/**
|
||||
* 查询部门责任人
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @param subsystem 子系统
|
||||
* @return 部门用户列表
|
||||
*/
|
||||
@GetMapping("/getUserBydepartment")
|
||||
public Response getUserBydepartment(
|
||||
@RequestParam("deptName")String deptName,@RequestParam("subsystem")String subsystem
|
||||
|
||||
@ -5,29 +5,41 @@ import com.definesys.mpaas.common.http.Response;
|
||||
import com.xdap.self_development.controller.request.AnalysisRequest;
|
||||
import com.xdap.self_development.controller.request.AnalysisVerRequest;
|
||||
import com.xdap.self_development.controller.request.ModelComparisonExportRequest;
|
||||
import com.xdap.self_development.exception.CommonException;
|
||||
import com.xdap.self_development.domain.pojo.EngineParamDetailPojo;
|
||||
import com.xdap.self_development.exception.CommonException;
|
||||
import com.xdap.self_development.service.TcDataQueryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* TC数据查询控制器
|
||||
* 提供TC数据查询相关的功能,包括根据版本、子系统-零部件查询参数数据,以及数据导出功能
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/tcDataQuery")
|
||||
public class TcDataQueryController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private TcDataQueryService tcDataQueryService;
|
||||
|
||||
// 根据机型ID、版本和子系统-零部件查询参数数据
|
||||
/**
|
||||
* 根据机型ID、版本和子系统-零部件查询参数数据
|
||||
*
|
||||
* @param analysisRequest 分析版本请求
|
||||
* @return 参数数据映射
|
||||
*/
|
||||
@PostMapping("/tcDataSelectByVersion")
|
||||
public Response tcDataSelectByVersion(
|
||||
@Valid @RequestBody AnalysisVerRequest analysisRequest,
|
||||
@ -43,25 +55,46 @@ public class TcDataQueryController {
|
||||
return Response.ok().data(stringListHashMap);
|
||||
}
|
||||
|
||||
//根据机型ID和子系统-零部件查询参数数据
|
||||
/**
|
||||
* 根据机型ID和子系统-零部件查询参数数据
|
||||
*
|
||||
* @param analysisRequest 分析请求
|
||||
* @return 参数数据映射
|
||||
*/
|
||||
@PostMapping("/tcDataSelectByPartsNames")
|
||||
public Response tcDataSelectByPartsNames(@RequestBody AnalysisRequest analysisRequest) {
|
||||
Map<String, List<EngineParamDetailPojo>> stringListHashMap = tcDataQueryService.tcDataSelectAllByPartsName(analysisRequest);
|
||||
return Response.ok().data(stringListHashMap);
|
||||
}
|
||||
//根据机型ID和子系统-零部件查询参数数据 备----未使用
|
||||
/**
|
||||
* 根据机型ID和子系统-零部件查询参数数据(备份--未使用)
|
||||
*
|
||||
* @param analysisRequest 分析请求
|
||||
* @return 参数数据映射
|
||||
*/
|
||||
@PostMapping("/tcDataSelectAllByPartsNameBack")
|
||||
public Response tcDataSelectAllByPartsNameBack(@RequestBody AnalysisRequest analysisRequest) {
|
||||
Map<String, List<EngineParamDetailPojo>> stringListHashMap = tcDataQueryService.tcDataSelectAllByPartsNameBack(analysisRequest);
|
||||
return Response.ok().data(stringListHashMap);
|
||||
}
|
||||
//根据机型ID和子系统-零部件+userID下载为excel
|
||||
/**
|
||||
* 根据机型ID和子系统-零部件+userID下载为excel
|
||||
*
|
||||
* @param request 模型比较导出请求
|
||||
* @param response HTTP响应
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/modelComparisonExport")
|
||||
public Response modelComparisonExport(@RequestBody ModelComparisonExportRequest request,HttpServletResponse response) {
|
||||
tcDataQueryService.modelComparisonExport(request,response);
|
||||
return Response.ok().data("导出成功");
|
||||
}
|
||||
//下载TC数据ads_prd_f_yfsjglpt_fdjlbjcjb
|
||||
/**
|
||||
* 下载TC数据ads_prd_f_yfsjglpt_fdjlbjcjb
|
||||
*
|
||||
* @param response HTTP响应
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/syncA")
|
||||
public Response excelExportA(HttpServletResponse response) {
|
||||
try {
|
||||
@ -71,7 +104,12 @@ public class TcDataQueryController {
|
||||
}
|
||||
return Response.ok().data("导出成功");
|
||||
}
|
||||
//下载TC数据ads_prd_f_tc_flsxb
|
||||
/**
|
||||
* 下载TC数据ads_prd_f_tc_flsxb
|
||||
*
|
||||
* @param response HTTP响应
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/syncB")
|
||||
public Response excelExportB(HttpServletResponse response) {
|
||||
try {
|
||||
|
||||
@ -18,6 +18,13 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模板审批控制器
|
||||
* 提供模板审批相关的功能,包括发起审批、处理审批、查询审批列表、获取审批流程等
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/approval")
|
||||
public class TemplateApprovalController {
|
||||
@ -26,7 +33,13 @@ public class TemplateApprovalController {
|
||||
@Resource
|
||||
private RuntimeDatasourceService runtimeDatasourceService;
|
||||
|
||||
// 修改后继续流程
|
||||
/**
|
||||
* 修改后继续流程
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/continueApproval")
|
||||
public Response continueApproval(
|
||||
@NotBlank @RequestParam String flowId,
|
||||
@ -36,7 +49,12 @@ public class TemplateApprovalController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 获取可修改节点
|
||||
/**
|
||||
* 获取可修改节点
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @return 可修改节点列表
|
||||
*/
|
||||
@GetMapping("/getEditableNodes")
|
||||
public Response getEditableNodes(
|
||||
@NotBlank @RequestParam String flowId
|
||||
@ -45,7 +63,12 @@ public class TemplateApprovalController {
|
||||
return Response.ok().data(nodes);
|
||||
}
|
||||
|
||||
// 修改节点
|
||||
/**
|
||||
* 修改节点
|
||||
*
|
||||
* @param form 更新节点表单
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateNode")
|
||||
public Response updateNode(
|
||||
@RequestBody UpdateNodeForm form
|
||||
@ -54,7 +77,13 @@ public class TemplateApprovalController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 修改流程主题
|
||||
/**
|
||||
* 修改流程主题
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @param title 标题
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/updateFlowTitle")
|
||||
public Response updateFlowTitle(
|
||||
@NotBlank @RequestParam String flowId,
|
||||
@ -65,7 +94,12 @@ public class TemplateApprovalController {
|
||||
}
|
||||
|
||||
|
||||
// 获取是否直送
|
||||
/**
|
||||
* 获取是否直送
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @return 是否直送标志
|
||||
*/
|
||||
@GetMapping("/getIsDirect")
|
||||
public Response getIsDirect(
|
||||
@RequestParam String flowId
|
||||
@ -74,7 +108,12 @@ public class TemplateApprovalController {
|
||||
return Response.ok().data(flag);
|
||||
}
|
||||
|
||||
// 获取流程审批人
|
||||
/**
|
||||
* 获取流程审批人
|
||||
*
|
||||
* @param templateId 模板ID
|
||||
* @return 审批节点信息
|
||||
*/
|
||||
@GetMapping("/getApprovalUsers")
|
||||
public Response getApprovalUsers(
|
||||
@NotBlank @RequestParam String templateId
|
||||
@ -83,7 +122,12 @@ public class TemplateApprovalController {
|
||||
return Response.ok().data(nodes);
|
||||
}
|
||||
|
||||
// 获取用户和部门
|
||||
/**
|
||||
* 获取用户和部门
|
||||
*
|
||||
* @param name 用户名
|
||||
* @return 部门用户视图列表
|
||||
*/
|
||||
@GetMapping("/getUsersByCondition")
|
||||
public Response getUsersByCondition(
|
||||
@RequestParam String name
|
||||
@ -95,7 +139,13 @@ public class TemplateApprovalController {
|
||||
.doQuery(DepartmentUserView.class);
|
||||
return Response.ok().data(users);
|
||||
}
|
||||
// 发起人发起审批
|
||||
/**
|
||||
* 发起人发起审批
|
||||
*
|
||||
* @param request 开始审批请求
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 审批结果数据
|
||||
*/
|
||||
@PostMapping("/startApproval")
|
||||
public Response startApproval(
|
||||
@RequestBody @Valid StartApprovalRequest request,
|
||||
@ -109,7 +159,13 @@ public class TemplateApprovalController {
|
||||
return Response.ok().data(templateApprovalService.startApproval(request));
|
||||
}
|
||||
|
||||
// 直送回退回的节点
|
||||
/**
|
||||
* 直送回退回的节点
|
||||
*
|
||||
* @param templateId 模板ID
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/directSendingApproval")
|
||||
public Response directSendingApproval(
|
||||
@RequestParam @NotBlank String templateId,
|
||||
@ -119,7 +175,13 @@ public class TemplateApprovalController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 查询审批列表
|
||||
/**
|
||||
* 查询审批列表
|
||||
*
|
||||
* @param form 审批列表表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 审批列表数据
|
||||
*/
|
||||
@GetMapping("/getApprovalList")
|
||||
public Response getTodoList(
|
||||
@Valid ApprovalListForm form,
|
||||
@ -133,7 +195,13 @@ public class TemplateApprovalController {
|
||||
return Response.ok().data(templateApprovalService.getApprovalList(form));
|
||||
}
|
||||
|
||||
// 处理人处理审批通过还是拒绝
|
||||
/**
|
||||
* 处理人处理审批通过还是拒绝
|
||||
*
|
||||
* @param request 处理审批请求
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/handleApproval")
|
||||
public Response handleApproval(
|
||||
@RequestBody @Valid HandleApprovalRequest request,
|
||||
@ -148,7 +216,12 @@ public class TemplateApprovalController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 获取可退回节点
|
||||
/**
|
||||
* 获取可退回节点
|
||||
*
|
||||
* @param flowId 流程ID
|
||||
* @return 可退回节点列表
|
||||
*/
|
||||
@GetMapping("/getReturnNodes")
|
||||
public Response getReturnNodes(
|
||||
@NotBlank String flowId
|
||||
@ -157,7 +230,13 @@ public class TemplateApprovalController {
|
||||
return Response.ok().data(result);
|
||||
}
|
||||
|
||||
// 处理人退回指定节点
|
||||
/**
|
||||
* 处理人退回指定节点
|
||||
*
|
||||
* @param form 处理退回节点表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/handleReturnToNode")
|
||||
public Response handleReturnToNode(
|
||||
@RequestBody @Valid HandleReturnNodeForm form,
|
||||
@ -172,7 +251,13 @@ public class TemplateApprovalController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 发起人撤回审批
|
||||
/**
|
||||
* 发起人撤回审批
|
||||
*
|
||||
* @param request 处理审批请求
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/handleReturn")
|
||||
public Response handleReturn(
|
||||
@RequestBody @Valid HandleApprovalRequest request,
|
||||
@ -187,7 +272,13 @@ public class TemplateApprovalController {
|
||||
return Response.ok();
|
||||
}
|
||||
|
||||
// 获取模板变动
|
||||
/**
|
||||
* 获取模板变动
|
||||
*
|
||||
* @param form 审批和参数表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 模板变动分页结果
|
||||
*/
|
||||
@GetMapping("/getTemplateChanges")
|
||||
public Response getTemplateChanges(
|
||||
@Valid ApprovalAndParameterForm form,
|
||||
@ -202,7 +293,13 @@ public class TemplateApprovalController {
|
||||
return Response.ok().data(result);
|
||||
}
|
||||
|
||||
// 获取审批流程
|
||||
/**
|
||||
* 获取审批流程
|
||||
*
|
||||
* @param form 审批流程表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 审批流程节点视图
|
||||
*/
|
||||
@GetMapping("/getApprovalProcess")
|
||||
public Response getApprovalProcess(
|
||||
@Valid ApprovalFlowForm form,
|
||||
|
||||
@ -18,6 +18,13 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模板控制器
|
||||
* 提供模板管理相关的功能,包括模板的增删改查、导入导出、版本管理等
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/custom/template")
|
||||
@ -25,6 +32,12 @@ public class TemplateController {
|
||||
@Resource
|
||||
private TemplateService templateService;
|
||||
|
||||
/**
|
||||
* 删除模板
|
||||
*
|
||||
* @param templateId 模板ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@GetMapping("/deleteTemplate")
|
||||
public Response deleteTemplate(
|
||||
@NotBlank @RequestParam String templateId
|
||||
@ -33,7 +46,13 @@ public class TemplateController {
|
||||
return Response.ok().setMessage("删除成功");
|
||||
}
|
||||
|
||||
// 模板名的模糊搜索
|
||||
/**
|
||||
* 模板名的模糊搜索
|
||||
*
|
||||
* @param form 模板页面表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 模板分页查询结果
|
||||
*/
|
||||
@GetMapping("/getTemplateByCondition")
|
||||
public Response getTemplateByCondition(
|
||||
@Valid TemplatePageForm form,
|
||||
@ -49,7 +68,12 @@ public class TemplateController {
|
||||
return Response.ok().data(page);
|
||||
}
|
||||
|
||||
// 获取指定模板详情
|
||||
/**
|
||||
* 获取指定模板详情
|
||||
*
|
||||
* @param templateId 模板ID
|
||||
* @return 模板详情
|
||||
*/
|
||||
@GetMapping("/getTemplateById")
|
||||
public Response getTemplateById(
|
||||
@NotBlank String templateId
|
||||
@ -59,7 +83,13 @@ public class TemplateController {
|
||||
}
|
||||
|
||||
|
||||
// 查看版本 某个模板的全部版本
|
||||
/**
|
||||
* 查看版本(某个模板的全部版本)
|
||||
*
|
||||
* @param form 模板行ID表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 模板版本列表
|
||||
*/
|
||||
@GetMapping("getTemplateVersion")
|
||||
public Response getTemplateVersion(
|
||||
@Valid TemplateRowIdForm form,
|
||||
@ -74,7 +104,13 @@ public class TemplateController {
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
|
||||
// 添加模板
|
||||
/**
|
||||
* 添加模板
|
||||
*
|
||||
* @param form 插入模板表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/insertTemplate")
|
||||
public Response insertTemplate(
|
||||
@Valid @RequestBody InsertTemplateForm form,
|
||||
@ -89,7 +125,14 @@ public class TemplateController {
|
||||
return Response.ok().setMessage("添加成功");
|
||||
}
|
||||
|
||||
// 导入模板 导入全部模板参数和单页模板参数
|
||||
/**
|
||||
* 导入模板(导入全部模板参数和单页模板参数)
|
||||
*
|
||||
* @param file 文件
|
||||
* @param templateRowId 模板行ID
|
||||
* @param userId 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public Response importTemplate(
|
||||
@RequestPart("file") MultipartFile file,
|
||||
@ -97,14 +140,20 @@ public class TemplateController {
|
||||
@RequestPart("userId") String userId
|
||||
) {
|
||||
MyResponse templateImportProblemView = templateService.importTemplate(file, templateRowId, userId);
|
||||
if (templateImportProblemView.getFlag()) {
|
||||
if (templateImportProblemView.isFlag()) {
|
||||
return Response.error("导入异常").data(templateImportProblemView);
|
||||
} else {
|
||||
return Response.ok().setMessage("导入成功");
|
||||
}
|
||||
}
|
||||
|
||||
// 修改模板
|
||||
/**
|
||||
* 修改模板
|
||||
*
|
||||
* @param form 更新模板表单
|
||||
* @param bindingResult 绑定结果
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateTemplate")
|
||||
public Response updateTemplate(
|
||||
@Valid @RequestBody UpdateTemplateForm form,
|
||||
@ -119,7 +168,13 @@ public class TemplateController {
|
||||
return Response.ok().setMessage("修改成功");
|
||||
}
|
||||
|
||||
// 下载 空模板或全参模板
|
||||
/**
|
||||
* 下载(空模板或全参模板)
|
||||
*
|
||||
* @param form 导出模板表单
|
||||
* @param response HTTP响应
|
||||
* @param bindingResult 绑定结果
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportTemplate(
|
||||
@Valid ExportTemplateForm form,
|
||||
@ -134,7 +189,11 @@ public class TemplateController {
|
||||
templateService.exportTemplate(form, response);
|
||||
}
|
||||
|
||||
// 导出所有模板
|
||||
/**
|
||||
* 导出所有模板
|
||||
*
|
||||
* @param response HTTP响应
|
||||
*/
|
||||
@GetMapping("/exportMultiple")
|
||||
public void exportMultipleTemplates(HttpServletResponse response) {
|
||||
templateService.exportMultipleTemplates(response);
|
||||
|
||||
@ -4,32 +4,34 @@ package com.xdap.self_development.controller;
|
||||
import com.definesys.mpaas.common.http.Response;
|
||||
import com.xdap.self_development.controller.request.TodoReturnRequest;
|
||||
import com.xdap.self_development.controller.request.TodoTaskRequest;
|
||||
import com.xdap.self_development.domain.dto.EngineParamDetailDTO;
|
||||
import com.xdap.self_development.domain.dto.PageResultDTO;
|
||||
import com.xdap.self_development.domain.pojo.CompletedTaskPojo;
|
||||
import com.xdap.self_development.domain.pojo.InitiatedTaskPojo;
|
||||
import com.xdap.self_development.domain.pojo.TodoTaskPojo;
|
||||
import com.xdap.self_development.domain.dto.EngineParamDetailDTO;
|
||||
import com.xdap.self_development.domain.dto.PageResultDTO;
|
||||
import com.xdap.self_development.service.TodoTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 待办事项表 前端控制器
|
||||
* </p>
|
||||
* 待办任务控制器
|
||||
* 提供待办任务相关的功能,包括查询发起的待办、用户待办、用户已办、创建责任人、退回单据等
|
||||
*
|
||||
* @author Lys111
|
||||
* @since 2025-11-18
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/todoTaskPojo")
|
||||
public class TodoTaskController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private TodoTaskService todoTaskService;
|
||||
/**
|
||||
* 查询发起的待办
|
||||
*
|
||||
* @param todoTaskRequest 待办任务请求
|
||||
* @return 发起的待办分页结果
|
||||
*/
|
||||
@PostMapping("/selectByPageByCreate")
|
||||
public Response selectByPageByCreate(@RequestBody TodoTaskRequest todoTaskRequest){
|
||||
@ -38,6 +40,9 @@ public class TodoTaskController {
|
||||
}
|
||||
/**
|
||||
* 查询用户待办
|
||||
*
|
||||
* @param todoTaskRequest 待办任务请求
|
||||
* @return 用户待办分页结果
|
||||
*/
|
||||
@PostMapping("/selectByresPersonTodoPage")
|
||||
public Response selectByresPersonTodoPage(@RequestBody TodoTaskRequest todoTaskRequest){
|
||||
@ -46,6 +51,9 @@ public class TodoTaskController {
|
||||
}
|
||||
/**
|
||||
* 查询用户已办
|
||||
*
|
||||
* @param todoTaskRequest 待办任务请求
|
||||
* @return 用户已办分页结果
|
||||
*/
|
||||
@PostMapping("/selectByresPersonCompletedPage")
|
||||
public Response selectByresPersonCompletedPage(@RequestBody TodoTaskRequest todoTaskRequest){
|
||||
@ -54,6 +62,10 @@ public class TodoTaskController {
|
||||
}
|
||||
/**
|
||||
* 通过管理员或分解待办任务创建责任人
|
||||
*
|
||||
* @param paramDetailPojos 参数详情列表
|
||||
* @param userID 用户ID
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/createResPerson")
|
||||
public Response createResPerson(@RequestBody List<EngineParamDetailDTO> paramDetailPojos
|
||||
@ -64,6 +76,9 @@ public class TodoTaskController {
|
||||
}
|
||||
/**
|
||||
* 退回单据
|
||||
*
|
||||
* @param todoReturnRequest 待办退回请求
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/todoReturn")
|
||||
public Response todoReturn( @RequestBody TodoReturnRequest todoReturnRequest){
|
||||
|
||||
@ -5,30 +5,32 @@ import com.definesys.mpaas.common.http.Response;
|
||||
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||
import com.xdap.self_development.service.XdapDeptUsersService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门成员关系表 前端控制器
|
||||
* </p>
|
||||
* 部门用户控制器
|
||||
* 提供部门用户相关的功能,用于选择参数填写人等
|
||||
*
|
||||
* @author Lys111
|
||||
* @since 2025-11-19
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/xdapDeptUsersPojo")
|
||||
public class XdapDeptUsersController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private XdapDeptUsersService xdapDeptUsersService;
|
||||
|
||||
/**
|
||||
* 查询部门下的人 用于选择参数填写人
|
||||
* 查询部门下的人(用于选择参数填写人)
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @return 部门用户列表
|
||||
*/
|
||||
@PostMapping("/selectUsersByDept")
|
||||
public Response selectUsersByDept(@RequestParam("deptName") String deptName) {
|
||||
|
||||
@ -7,36 +7,58 @@ import com.xdap.self_development.domain.dto.PageResultDTO;
|
||||
import com.xdap.self_development.domain.dto.YcTodoTaskCommonResultDTO;
|
||||
import com.xdap.self_development.domain.dto.YcTodoTaskResultDTO;
|
||||
import com.xdap.self_development.service.TodoTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 玉柴任务结果控制器
|
||||
* 提供玉柴任务相关的功能,包括返回待办、已办和申请人发起的任务给玉柴云
|
||||
*
|
||||
* @version 1.0
|
||||
* @since 2025
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/YcTaskResult")
|
||||
public class YcTaskResultController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
TodoTaskService todoTaskService;
|
||||
|
||||
//返回待办给玉柴云
|
||||
/**
|
||||
* 返回待办给玉柴云
|
||||
*
|
||||
* @param ycGetTodoTaskRequest 玉柴获取待办任务请求
|
||||
* @return 待办任务结果列表
|
||||
*/
|
||||
@PostMapping("/returnTodoTask")
|
||||
public Response returnTodoTask(@RequestBody YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
||||
List<YcTodoTaskResultDTO> dtos = todoTaskService.returnTodoTask(ycGetTodoTaskRequest);
|
||||
return Response.ok().data(dtos);
|
||||
}
|
||||
|
||||
//返回经办(已办)给玉柴云
|
||||
/**
|
||||
* 返回经办(已办)给玉柴云
|
||||
*
|
||||
* @param ycGetTodoTaskRequest 玉柴获取待办任务请求
|
||||
* @return 已办任务分页结果
|
||||
*/
|
||||
@PostMapping("/returnCompleted")
|
||||
public Response returnCompleted(@RequestBody YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
||||
PageResultDTO<YcTodoTaskCommonResultDTO> dtos = todoTaskService.returnCompleted(ycGetTodoTaskRequest);
|
||||
return Response.ok().data(dtos);
|
||||
}
|
||||
|
||||
//返回申请人所发起的给玉柴云
|
||||
/**
|
||||
* 返回申请人所发起的给玉柴云
|
||||
*
|
||||
* @param ycGetTodoTaskRequest 玉柴获取待办任务请求
|
||||
* @return 发起任务分页结果
|
||||
*/
|
||||
@PostMapping("/returnInitiator")
|
||||
public Response returnInitiator(@RequestBody YcGetTodoTaskRequest ycGetTodoTaskRequest) {
|
||||
PageResultDTO<YcTodoTaskCommonResultDTO> dtos = todoTaskService.returnInitiator(ycGetTodoTaskRequest);
|
||||
|
||||
@ -298,7 +298,7 @@ public class TemplateServiceImpl implements TemplateService {
|
||||
problems.getErrors().add("模板导入失败:模板'" + templateName + "'正在审批中");
|
||||
}
|
||||
|
||||
if (problems.getFlag()) {
|
||||
if (problems.isFlag()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user