From fe2aae24516e0c35f5ff6bb1e994b75016f5333c Mon Sep 17 00:00:00 2001 From: mengff <1198151809@qq.com> Date: Wed, 3 Jan 2024 16:27:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?--=E8=B0=83=E5=BA=A6=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=BD=AE=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5=20--=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=BC=95=E5=85=A5ruoyi-common=E7=9A=84?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zc-business/pom.xml | 6 + .../controller/DcEventProcessController.java | 106 ++++++++++++ .../zc/business/domain/DcEventProcess.java | 154 ++++++++++++++++++ .../business/mapper/DcEventProcessMapper.java | 61 +++++++ .../service/IDcEventProcessService.java | 61 +++++++ .../impl/DcEventProcessServiceImpl.java | 93 +++++++++++ .../mapper/business/DcEventProcessMapper.xml | 93 +++++++++++ 7 files changed, 574 insertions(+) create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java create mode 100644 zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml diff --git a/zc-business/pom.xml b/zc-business/pom.xml index 56c4a708..a402c1d4 100644 --- a/zc-business/pom.xml +++ b/zc-business/pom.xml @@ -10,6 +10,12 @@ zc-business + + + com.ruoyi + ruoyi-common + + com.zc 1.0.0 diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java new file mode 100644 index 00000000..234646b7 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java @@ -0,0 +1,106 @@ +package com.zc.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcEventProcess; +import com.zc.business.service.IDcEventProcessService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 事件处理流程Controller + * + * @author ruoyi + * @date 2024-01-03 + */ +@RestController +@RequestMapping("/system/process") +public class DcEventProcessController extends BaseController +{ + @Autowired + private IDcEventProcessService dcEventProcessService; + + /** + * 查询事件处理流程列表 + */ + @PreAuthorize("@ss.hasPermi('system:process:list')") + @GetMapping("/list") + public TableDataInfo list(DcEventProcess dcEventProcess) + { + startPage(); + List list = dcEventProcessService.selectDcEventProcessList(dcEventProcess); + return getDataTable(list); + } + + + + /** + * 导出事件处理流程列表 + */ + @PreAuthorize("@ss.hasPermi('system:process:export')") + @Log(title = "事件处理流程", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DcEventProcess dcEventProcess) + { + List list = dcEventProcessService.selectDcEventProcessList(dcEventProcess); + ExcelUtil util = new ExcelUtil<>(DcEventProcess.class); + util.exportExcel(response, list, "事件处理流程数据"); + } + + /** + * 获取事件处理流程详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:process:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(dcEventProcessService.selectDcEventProcessById(id)); + } + + /** + * 新增事件处理流程 + */ + @PreAuthorize("@ss.hasPermi('system:process:add')") + @Log(title = "事件处理流程", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcEventProcess dcEventProcess) + { + return toAjax(dcEventProcessService.insertDcEventProcess(dcEventProcess)); + } + + /** + * 修改事件处理流程 + */ + @PreAuthorize("@ss.hasPermi('system:process:edit')") + @Log(title = "事件处理流程", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcEventProcess dcEventProcess) + { + return toAjax(dcEventProcessService.updateDcEventProcess(dcEventProcess)); + } + + /** + * 删除事件处理流程 + */ + @PreAuthorize("@ss.hasPermi('system:process:remove')") + @Log(title = "事件处理流程", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcEventProcessService.deleteDcEventProcessByIds(ids)); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java b/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java new file mode 100644 index 00000000..ff7a4585 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java @@ -0,0 +1,154 @@ +package com.zc.business.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 事件处理流程对象 dc_event_process + * + * @author ruoyi + * @date 2024-01-03 + */ +public class DcEventProcess extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String eventId; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date operationTime; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String operator; + + /** 1-pc端 + 2-手机端 */ + @Excel(name = "1-pc端 2-手机端") + private Integer source; + + /** 1-节点 + 2-信息发布 + */ + @Excel(name = "1-节点 2-信息发布 ") + private Integer processType; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String context; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long processId; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String processName; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setEventId(String eventId) + { + this.eventId = eventId; + } + + public String getEventId() + { + return eventId; + } + public void setOperationTime(Date operationTime) + { + this.operationTime = operationTime; + } + + public Date getOperationTime() + { + return operationTime; + } + public void setOperator(String operator) + { + this.operator = operator; + } + + public String getOperator() + { + return operator; + } + public void setSource(Integer source) + { + this.source = source; + } + + public Integer getSource() + { + return source; + } + public void setProcessType(Integer processType) + { + this.processType = processType; + } + + public Integer getProcessType() + { + return processType; + } + public void setContext(String context) + { + this.context = context; + } + + public String getContext() + { + return context; + } + public void setProcessId(Long processId) + { + this.processId = processId; + } + + public Long getProcessId() + { + return processId; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("eventId", getEventId()) + .append("operationTime", getOperationTime()) + .append("operator", getOperator()) + .append("source", getSource()) + .append("processType", getProcessType()) + .append("context", getContext()) + .append("processId", getProcessId()) + .append("processName", getProcessName()) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java new file mode 100644 index 00000000..f4c5a46a --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java @@ -0,0 +1,61 @@ +package com.zc.business.mapper; + +import java.util.List; +import com.zc.business.domain.DcEventProcess; + +/** + * 事件处理流程Mapper接口 + * + * @author ruoyi + * @date 2024-01-03 + */ +public interface DcEventProcessMapper +{ + /** + * 查询事件处理流程 + * + * @param id 事件处理流程主键 + * @return 事件处理流程 + */ + public DcEventProcess selectDcEventProcessById(Long id); + + /** + * 查询事件处理流程列表 + * + * @param dcEventProcess 事件处理流程 + * @return 事件处理流程集合 + */ + List selectDcEventProcessList(DcEventProcess dcEventProcess); + + /** + * 新增事件处理流程 + * + * @param dcEventProcess 事件处理流程 + * @return 结果 + */ + int insertDcEventProcess(DcEventProcess dcEventProcess); + + /** + * 修改事件处理流程 + * + * @param dcEventProcess 事件处理流程 + * @return 结果 + */ + int updateDcEventProcess(DcEventProcess dcEventProcess); + + /** + * 删除事件处理流程 + * + * @param id 事件处理流程主键 + * @return 结果 + */ + int deleteDcEventProcessById(Long id); + + /** + * 批量删除事件处理流程 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deleteDcEventProcessByIds(Long[] ids); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java new file mode 100644 index 00000000..33cdad22 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java @@ -0,0 +1,61 @@ +package com.zc.business.service; + +import java.util.List; +import com.zc.business.domain.DcEventProcess; + +/** + * 事件处理流程Service接口 + * + * @author ruoyi + * @date 2024-01-03 + */ +public interface IDcEventProcessService +{ + /** + * 查询事件处理流程 + * + * @param id 事件处理流程主键 + * @return 事件处理流程 + */ + public DcEventProcess selectDcEventProcessById(Long id); + + /** + * 查询事件处理流程列表 + * + * @param dcEventProcess 事件处理流程 + * @return 事件处理流程集合 + */ + List selectDcEventProcessList(DcEventProcess dcEventProcess); + + /** + * 新增事件处理流程 + * + * @param dcEventProcess 事件处理流程 + * @return 结果 + */ + int insertDcEventProcess(DcEventProcess dcEventProcess); + + /** + * 修改事件处理流程 + * + * @param dcEventProcess 事件处理流程 + * @return 结果 + */ + int updateDcEventProcess(DcEventProcess dcEventProcess); + + /** + * 批量删除事件处理流程 + * + * @param ids 需要删除的事件处理流程主键集合 + * @return 结果 + */ + int deleteDcEventProcessByIds(Long[] ids); + + /** + * 删除事件处理流程信息 + * + * @param id 事件处理流程主键 + * @return 结果 + */ + int deleteDcEventProcessById(Long id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java new file mode 100644 index 00000000..75189e05 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java @@ -0,0 +1,93 @@ +package com.zc.business.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zc.business.mapper.DcEventProcessMapper; +import com.zc.business.domain.DcEventProcess; +import com.zc.business.service.IDcEventProcessService; + +/** + * 事件处理流程Service业务层处理 + * + * @author ruoyi + * @date 2024-01-03 + */ +@Service +public class DcEventProcessServiceImpl implements IDcEventProcessService +{ + @Autowired + private DcEventProcessMapper dcEventProcessMapper; + + /** + * 查询事件处理流程 + * + * @param id 事件处理流程主键 + * @return 事件处理流程 + */ + @Override + public DcEventProcess selectDcEventProcessById(Long id) + { + return dcEventProcessMapper.selectDcEventProcessById(id); + } + + /** + * 查询事件处理流程列表 + * + * @param dcEventProcess 事件处理流程 + * @return 事件处理流程 + */ + @Override + public List selectDcEventProcessList(DcEventProcess dcEventProcess) + { + return dcEventProcessMapper.selectDcEventProcessList(dcEventProcess); + } + + /** + * 新增事件处理流程 + * + * @param dcEventProcess 事件处理流程 + * @return 结果 + */ + @Override + public int insertDcEventProcess(DcEventProcess dcEventProcess) + { + return dcEventProcessMapper.insertDcEventProcess(dcEventProcess); + } + + /** + * 修改事件处理流程 + * + * @param dcEventProcess 事件处理流程 + * @return 结果 + */ + @Override + public int updateDcEventProcess(DcEventProcess dcEventProcess) + { + return dcEventProcessMapper.updateDcEventProcess(dcEventProcess); + } + + /** + * 批量删除事件处理流程 + * + * @param ids 需要删除的事件处理流程主键 + * @return 结果 + */ + @Override + public int deleteDcEventProcessByIds(Long[] ids) + { + return dcEventProcessMapper.deleteDcEventProcessByIds(ids); + } + + /** + * 删除事件处理流程信息 + * + * @param id 事件处理流程主键 + * @return 结果 + */ + @Override + public int deleteDcEventProcessById(Long id) + { + return dcEventProcessMapper.deleteDcEventProcessById(id); + } +} diff --git a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml new file mode 100644 index 00000000..0d3724ba --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + select id, event_id, operation_time, operator, source, process_type, context, process_id, process_name from dc_event_process + + + + + + + + insert into dc_event_process + + id, + event_id, + operation_time, + operator, + source, + process_type, + context, + process_id, + process_name, + + + #{id}, + #{eventId}, + #{operationTime}, + #{operator}, + #{source}, + #{processType}, + #{context}, + #{processId}, + #{processName}, + + + + + update dc_event_process + + event_id = #{eventId}, + operation_time = #{operationTime}, + operator = #{operator}, + source = #{source}, + process_type = #{processType}, + context = #{context}, + process_id = #{processId}, + process_name = #{processName}, + + where id = #{id} + + + + delete from dc_event_process where id = #{id} + + + + delete from dc_event_process where id in + + #{id} + + + \ No newline at end of file From 84f601b1a58db55c7937263e5cb888a7e2ccb744 Mon Sep 17 00:00:00 2001 From: mengff <1198151809@qq.com> Date: Wed, 3 Jan 2024 16:32:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?--=E5=88=A0=E9=99=A4=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/zc/business/controller/temp.java | 4 ---- zc-business/src/main/java/com/zc/business/domain/temp.java | 4 ---- zc-business/src/main/java/com/zc/business/mapper/temp.java | 4 ---- .../src/main/java/com/zc/business/service/impl/temp.java | 4 ---- zc-business/src/main/resources/mapper/business/temp.java | 4 ---- 5 files changed, 20 deletions(-) delete mode 100644 zc-business/src/main/java/com/zc/business/controller/temp.java delete mode 100644 zc-business/src/main/java/com/zc/business/domain/temp.java delete mode 100644 zc-business/src/main/java/com/zc/business/mapper/temp.java delete mode 100644 zc-business/src/main/java/com/zc/business/service/impl/temp.java delete mode 100644 zc-business/src/main/resources/mapper/business/temp.java diff --git a/zc-business/src/main/java/com/zc/business/controller/temp.java b/zc-business/src/main/java/com/zc/business/controller/temp.java deleted file mode 100644 index e444c792..00000000 --- a/zc-business/src/main/java/com/zc/business/controller/temp.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.zc.business.controller; - -public class temp { -} diff --git a/zc-business/src/main/java/com/zc/business/domain/temp.java b/zc-business/src/main/java/com/zc/business/domain/temp.java deleted file mode 100644 index 35244407..00000000 --- a/zc-business/src/main/java/com/zc/business/domain/temp.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.zc.business.domain; - -public class temp { -} diff --git a/zc-business/src/main/java/com/zc/business/mapper/temp.java b/zc-business/src/main/java/com/zc/business/mapper/temp.java deleted file mode 100644 index b54334a9..00000000 --- a/zc-business/src/main/java/com/zc/business/mapper/temp.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.zc.business.mapper; - -public class temp { -} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/temp.java b/zc-business/src/main/java/com/zc/business/service/impl/temp.java deleted file mode 100644 index ce8ae2f7..00000000 --- a/zc-business/src/main/java/com/zc/business/service/impl/temp.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.zc.business.service.impl; - -public class temp { -} diff --git a/zc-business/src/main/resources/mapper/business/temp.java b/zc-business/src/main/resources/mapper/business/temp.java deleted file mode 100644 index e444c792..00000000 --- a/zc-business/src/main/resources/mapper/business/temp.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.zc.business.controller; - -public class temp { -}