|
@@ -0,0 +1,141 @@
|
|
|
+package com.platform.rest.controller.custom;
|
|
|
+
|
|
|
+import com.platform.common.util.R;
|
|
|
+import com.platform.dao.dto.custom.CustomWorkflowRelationDTO;
|
|
|
+import com.platform.dao.entity.custom.CustomWorkflowRelation;
|
|
|
+import com.platform.service.custom.CustomWorkflowRelationService;
|
|
|
+import com.platform.dao.util.ExcelUtil;
|
|
|
+import com.platform.dao.vo.export.custom.ExportCustomWorkflowRelationVO;
|
|
|
+import com.platform.dao.vo.query.custom.CustomWorkflowRelationVO;
|
|
|
+import com.platform.common.util.BeanConverterUtil;
|
|
|
+import com.platform.common.validation.group.AddGroup;
|
|
|
+import com.platform.common.validation.group.UpdateGroup;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import com.platform.common.bean.AbstractPageResultBean;
|
|
|
+import com.platform.rest.log.annotation.SysLog;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description 流程业务关联 控制器
|
|
|
+ * @Author lsq
|
|
|
+ * @Date 2024-08-13 09:25:27
|
|
|
+ * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/custom/flowrelation")
|
|
|
+public class CustomWorkflowRelationController {
|
|
|
+
|
|
|
+ private final CustomWorkflowRelationService customWorkflowRelationService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id查询单条记录
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public R<CustomWorkflowRelation> getById(@PathVariable("id") String id) {
|
|
|
+ return new R<>(customWorkflowRelationService.getModelById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增记录
|
|
|
+ *
|
|
|
+ * @param customWorkflowRelationDTO 流程业务关联DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("新增流程业务关联")
|
|
|
+ @PostMapping
|
|
|
+ @PreAuthorize("@pms.hasPermission('custom-flowrelation-add')")
|
|
|
+ public R save(@Validated({AddGroup.class}) @RequestBody CustomWorkflowRelationDTO customWorkflowRelationDTO) {
|
|
|
+ return new R<>(customWorkflowRelationService.saveModelByDTO(customWorkflowRelationDTO));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改记录
|
|
|
+ *
|
|
|
+ * @param customWorkflowRelationDTO 流程业务关联DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("修改流程业务关联")
|
|
|
+ @PutMapping("/{id}")
|
|
|
+ @PreAuthorize("@pms.hasPermission('custom-flowrelation-edit')")
|
|
|
+ public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody CustomWorkflowRelationDTO customWorkflowRelationDTO) {
|
|
|
+ customWorkflowRelationService.modModelByDTO(customWorkflowRelationDTO);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id删除一条记录
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("删除流程业务关联")
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ @PreAuthorize("@pms.hasPermission('custom-flowrelation-del')")
|
|
|
+ public R removeById(@PathVariable String id) {
|
|
|
+ customWorkflowRelationService.deleteByPrimaryKey(id);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量记录
|
|
|
+ *
|
|
|
+ * @param ids 主键
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("批量删除流程业务关联")
|
|
|
+ @DeleteMapping("")
|
|
|
+ @PreAuthorize("@pms.hasPermission('custom-flowrelation-del')")
|
|
|
+ public R removeIds(@RequestBody List<String> ids) {
|
|
|
+ customWorkflowRelationService.batchDelete(ids);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取分页
|
|
|
+ *
|
|
|
+ * @param pageNum 当前页码
|
|
|
+ * @param pageSize 每页条数
|
|
|
+ * @param customWorkflowRelationDTO 流程业务关联DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ public R<AbstractPageResultBean<CustomWorkflowRelationVO>> query(CustomWorkflowRelationDTO customWorkflowRelationDTO, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize) {
|
|
|
+ return new R<>(customWorkflowRelationService.selectPageList(customWorkflowRelationDTO, pageNum, pageSize));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取列表
|
|
|
+ *
|
|
|
+ * @param customWorkflowRelationDTO 流程业务关联DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("")
|
|
|
+ public R query(CustomWorkflowRelationDTO customWorkflowRelationDTO) {
|
|
|
+ return new R<>(customWorkflowRelationService.getModelListByDTO(customWorkflowRelationDTO));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 流程业务关联导出
|
|
|
+ *
|
|
|
+ * @param customWorkflowRelationDTO 流程业务关联DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/export")
|
|
|
+ @SysLog("流程业务关联导出")
|
|
|
+ @PreAuthorize("@pms.hasPermission('custom-flowrelation-export')")
|
|
|
+ public void export(HttpServletResponse response, CustomWorkflowRelationDTO customWorkflowRelationDTO) {
|
|
|
+ List<CustomWorkflowRelation> list = customWorkflowRelationService.getModelListByDTO(customWorkflowRelationDTO);
|
|
|
+ ExcelUtil.exportResponseDict(response, ExportCustomWorkflowRelationVO.class, BeanConverterUtil.copyListProperties(list, ExportCustomWorkflowRelationVO.class), "流程业务关联");
|
|
|
+ }
|
|
|
+
|
|
|
+}
|