Browse Source

事件流程配置

develop
lau572 11 months ago
parent
commit
1a671e0b35
  1. 6
      zc-business/pom.xml
  2. 104
      zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java
  3. 104
      zc-business/src/main/java/com/zc/business/controller/DcProcessConfigController.java
  4. 79
      zc-business/src/main/java/com/zc/business/domain/DcEventType.java
  5. 92
      zc-business/src/main/java/com/zc/business/domain/DcProcessConfig.java
  6. 61
      zc-business/src/main/java/com/zc/business/mapper/DcEventTypeMapper.java
  7. 85
      zc-business/src/main/java/com/zc/business/mapper/DcProcessConfigMapper.java
  8. 63
      zc-business/src/main/java/com/zc/business/service/IDcEventTypeService.java
  9. 61
      zc-business/src/main/java/com/zc/business/service/IDcProcessConfigService.java
  10. 162
      zc-business/src/main/java/com/zc/business/service/impl/DcEventTypeServiceImpl.java
  11. 93
      zc-business/src/main/java/com/zc/business/service/impl/DcProcessConfigServiceImpl.java
  12. 58
      zc-business/src/main/resources/mapper/business/DcEventTypeMapper.xml
  13. 86
      zc-business/src/main/resources/mapper/business/DcProcessConfigMapper.xml

6
zc-business/pom.xml

@ -3,6 +3,12 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<dependencies>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>

104
zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java

@ -0,0 +1,104 @@
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.DcEventType;
import com.zc.business.service.IDcEventTypeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 事件类型Controller
*
* @author ruoyi
* @date 2024-01-03
*/
@RestController
@RequestMapping("/system/dcEventType")
public class DcEventTypeController extends BaseController
{
@Autowired
private IDcEventTypeService dcEventTypeService;
/**
* 查询事件类型列表
*/
@PreAuthorize("@ss.hasPermi('system:dcEventType:list')")
@GetMapping("/list")
public TableDataInfo list(DcEventType dcEventType)
{
startPage();
List<DcEventType> list = dcEventTypeService.selectDcEventTypeList(dcEventType);
return getDataTable(list);
}
/**
* 导出事件类型列表
*/
@PreAuthorize("@ss.hasPermi('system:dcEventType:export')")
@Log(title = "事件类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcEventType dcEventType)
{
List<DcEventType> list = dcEventTypeService.selectDcEventTypeList(dcEventType);
ExcelUtil<DcEventType> util = new ExcelUtil<>(DcEventType.class);
util.exportExcel(response, list, "事件类型数据");
}
/**
* 获取事件类型详细信息
*/
@PreAuthorize("@ss.hasPermi('system:dcEventType:query')")
@GetMapping(value = "/{eventType}")
public AjaxResult getInfo(@PathVariable("eventType") Integer eventType)
{
return AjaxResult.success(dcEventTypeService.selectDcEventTypeByEventType(eventType));
}
/**
* 新增事件类型
*/
@PreAuthorize("@ss.hasPermi('system:dcEventType:add')")
@Log(title = "事件类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcEventType dcEventType)
{
return dcEventTypeService.insertDcEventType(dcEventType);
}
/**
* 修改事件类型
*/
@PreAuthorize("@ss.hasPermi('system:dcEventType:edit')")
@Log(title = "事件类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcEventType dcEventType)
{
return dcEventTypeService.updateDcEventType(dcEventType);
}
/**
* 删除事件类型
*/
@PreAuthorize("@ss.hasPermi('system:dcEventType:remove')")
@Log(title = "事件类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{eventType}")
public AjaxResult remove(@PathVariable Integer eventType)
{
return dcEventTypeService.deleteDcEventTypeByEventType(eventType);
}
}

104
zc-business/src/main/java/com/zc/business/controller/DcProcessConfigController.java

@ -0,0 +1,104 @@
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.DcProcessConfig;
import com.zc.business.service.IDcProcessConfigService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 事件流程配置Controller
*
* @author ruoyi
* @date 2024-01-03
*/
@RestController
@RequestMapping("/system/dcProcessConfig")
public class DcProcessConfigController extends BaseController
{
@Autowired
private IDcProcessConfigService dcProcessConfigService;
/**
* 查询事件流程配置列表
*/
@PreAuthorize("@ss.hasPermi('system:dcProcessConfig:list')")
@GetMapping("/list")
public TableDataInfo list(DcProcessConfig dcProcessConfig)
{
startPage();
List<DcProcessConfig> list = dcProcessConfigService.selectDcProcessConfigList(dcProcessConfig);
return getDataTable(list);
}
/**
* 导出事件流程配置列表
*/
@PreAuthorize("@ss.hasPermi('system:dcProcessConfig:export')")
@Log(title = "事件流程配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcProcessConfig dcProcessConfig)
{
List<DcProcessConfig> list = dcProcessConfigService.selectDcProcessConfigList(dcProcessConfig);
ExcelUtil<DcProcessConfig> util = new ExcelUtil<>(DcProcessConfig.class);
util.exportExcel(response, list, "事件流程配置数据");
}
/**
* 获取事件流程配置详细信息
*/
@PreAuthorize("@ss.hasPermi('system:dcProcessConfig:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(dcProcessConfigService.selectDcProcessConfigById(id));
}
/**
* 新增事件流程配置
*/
@PreAuthorize("@ss.hasPermi('system:dcProcessConfig:add')")
@Log(title = "事件流程配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcProcessConfig dcProcessConfig)
{
return toAjax(dcProcessConfigService.insertDcProcessConfig(dcProcessConfig));
}
/**
* 修改事件流程配置
*/
@PreAuthorize("@ss.hasPermi('system:dcProcessConfig:edit')")
@Log(title = "事件流程配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcProcessConfig dcProcessConfig)
{
return toAjax(dcProcessConfigService.updateDcProcessConfig(dcProcessConfig));
}
/**
* 删除事件流程配置
*/
@PreAuthorize("@ss.hasPermi('system:dcProcessConfig:remove')")
@Log(title = "事件流程配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcProcessConfigService.deleteDcProcessConfigByIds(ids));
}
}

79
zc-business/src/main/java/com/zc/business/domain/DcEventType.java

@ -0,0 +1,79 @@
package com.zc.business.domain;
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;
import java.util.ArrayList;
import java.util.List;
/**
* 事件类型对象 dc_event_type
*
* @author ruoyi
* @date 2024-01-03
*/
public class DcEventType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 事件类型 */
@Excel(name = "事件类型")
private Integer eventType;
/** 事件名称 */
@Excel(name = "事件名称")
private String eventName;
/** 处置流程 */
@Excel(name = "处置流程")
private String processConfig;
/** 处置流程 */
private List<DcProcessConfig> processConfigList = new ArrayList<>();
public void setEventType(Integer eventType)
{
this.eventType = eventType;
}
public Integer getEventType()
{
return eventType;
}
public void setEventName(String eventName)
{
this.eventName = eventName;
}
public String getEventName()
{
return eventName;
}
public String getProcessConfig() {
return processConfig;
}
public void setProcessConfig(String processConfig) {
this.processConfig = processConfig;
}
public List<DcProcessConfig> getProcessConfigList() {
return processConfigList;
}
public void setProcessConfigList(List<DcProcessConfig> processConfigList) {
this.processConfigList = processConfigList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("eventType", getEventType())
.append("eventName", getEventName())
.append("processConfig", getProcessConfig())
.toString();
}
}

92
zc-business/src/main/java/com/zc/business/domain/DcProcessConfig.java

@ -0,0 +1,92 @@
package com.zc.business.domain;
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_process_config
*
* @author ruoyi
* @date 2024-01-03
*/
public class DcProcessConfig extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 事件类型 */
private Integer eventType;
/** 处置流程 */
@Excel(name = "处置流程")
private String nodeNode;
/** 处置流程名称 */
@Excel(name = "处置流程名称")
private String processNode;
/** 格式:{流程节点: [常用语,常用语]} */
@Excel(name = "格式:{流程节点: [常用语,常用语]}")
private String commonPhrases;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setEventType(Integer eventType)
{
this.eventType = eventType;
}
public Integer getEventType()
{
return eventType;
}
public void setNodeNode(String nodeNode)
{
this.nodeNode = nodeNode;
}
public String getNodeNode()
{
return nodeNode;
}
public void setProcessNode(String processNode)
{
this.processNode = processNode;
}
public String getProcessNode()
{
return processNode;
}
public void setCommonPhrases(String commonPhrases)
{
this.commonPhrases = commonPhrases;
}
public String getCommonPhrases()
{
return commonPhrases;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("eventType", getEventType())
.append("nodeNode", getNodeNode())
.append("processNode", getProcessNode())
.append("commonPhrases", getCommonPhrases())
.toString();
}
}

61
zc-business/src/main/java/com/zc/business/mapper/DcEventTypeMapper.java

@ -0,0 +1,61 @@
package com.zc.business.mapper;
import java.util.List;
import com.zc.business.domain.DcEventType;
/**
* 事件类型Mapper接口
*
* @author ruoyi
* @date 2024-01-03
*/
public interface DcEventTypeMapper
{
/**
* 查询事件类型
*
* @param eventType 事件类型主键
* @return 事件类型
*/
public DcEventType selectDcEventTypeByEventType(Integer eventType);
/**
* 查询事件类型列表
*
* @param dcEventType 事件类型
* @return 事件类型集合
*/
List<DcEventType> selectDcEventTypeList(DcEventType dcEventType);
/**
* 新增事件类型
*
* @param dcEventType 事件类型
* @return 结果
*/
int insertDcEventType(DcEventType dcEventType);
/**
* 修改事件类型
*
* @param dcEventType 事件类型
* @return 结果
*/
int updateDcEventType(DcEventType dcEventType);
/**
* 删除事件类型
*
* @param eventType 事件类型主键
* @return 结果
*/
int deleteDcEventTypeByEventType(Integer eventType);
/**
* 批量删除事件类型
*
* @param eventTypes 需要删除的数据主键集合
* @return 结果
*/
int deleteDcEventTypeByEventTypes(Integer[] eventTypes);
}

85
zc-business/src/main/java/com/zc/business/mapper/DcProcessConfigMapper.java

@ -0,0 +1,85 @@
package com.zc.business.mapper;
import java.util.List;
import com.zc.business.domain.DcProcessConfig;
/**
* 事件流程配置Mapper接口
*
* @author ruoyi
* @date 2024-01-03
*/
public interface DcProcessConfigMapper
{
/**
* 查询事件流程配置
*
* @param id 事件流程配置主键
* @return 事件流程配置
*/
public DcProcessConfig selectDcProcessConfigById(Long id);
/**
* 查询事件流程配置列表
*
* @param dcProcessConfig 事件流程配置
* @return 事件流程配置集合
*/
List<DcProcessConfig> selectDcProcessConfigList(DcProcessConfig dcProcessConfig);
/**
* 根据事件类型查询事件流程配置列表
*
* @param eventType 事件类型
* @return 事件流程配置集合
*/
List<DcProcessConfig> selectDcProcessConfigByEventType(Integer eventType);
/**
* 新增事件流程配置
*
* @param dcProcessConfig 事件流程配置
* @return 结果
*/
int insertDcProcessConfig(DcProcessConfig dcProcessConfig);
/**
* 批量新增事件流程配置
*
* @param processConfigList 事件流程配置列表
* @return 结果
*/
int insertDcProcessConfigByList(List<DcProcessConfig> processConfigList);
/**
* 修改事件流程配置
*
* @param dcProcessConfig 事件流程配置
* @return 结果
*/
int updateDcProcessConfig(DcProcessConfig dcProcessConfig);
/**
* 删除事件流程配置
*
* @param id 事件流程配置主键
* @return 结果
*/
int deleteDcProcessConfigById(Long id);
/**
* 批量删除事件流程配置
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteDcProcessConfigByIds(Long[] ids);
/**
* 根据事件类型批量删除事件流程配置
*
* @param eventType 事件类型
* @return 结果
*/
int deleteDcProcessConfigByEventType(Integer eventType);
}

63
zc-business/src/main/java/com/zc/business/service/IDcEventTypeService.java

@ -0,0 +1,63 @@
package com.zc.business.service;
import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.domain.DcEventType;
/**
* 事件类型Service接口
*
* @author ruoyi
* @date 2024-01-03
*/
public interface IDcEventTypeService
{
/**
* 查询事件类型
*
* @param eventType 事件类型主键
* @return 事件类型
*/
public DcEventType selectDcEventTypeByEventType(Integer eventType);
/**
* 查询事件类型列表
*
* @param dcEventType 事件类型
* @return 事件类型集合
*/
List<DcEventType> selectDcEventTypeList(DcEventType dcEventType);
/**
* 新增事件类型
*
* @param dcEventType 事件类型
* @return 结果
*/
AjaxResult insertDcEventType(DcEventType dcEventType);
/**
* 修改事件类型
*
* @param dcEventType 事件类型
* @return 结果
*/
AjaxResult updateDcEventType(DcEventType dcEventType);
/**
* 批量删除事件类型
*
* @param eventTypes 需要删除的事件类型主键集合
* @return 结果
*/
AjaxResult deleteDcEventTypeByEventTypes(Integer[] eventTypes);
/**
* 删除事件类型信息
*
* @param eventType 事件类型主键
* @return 结果
*/
AjaxResult deleteDcEventTypeByEventType(Integer eventType);
}

61
zc-business/src/main/java/com/zc/business/service/IDcProcessConfigService.java

@ -0,0 +1,61 @@
package com.zc.business.service;
import java.util.List;
import com.zc.business.domain.DcProcessConfig;
/**
* 事件流程配置Service接口
*
* @author ruoyi
* @date 2024-01-03
*/
public interface IDcProcessConfigService
{
/**
* 查询事件流程配置
*
* @param id 事件流程配置主键
* @return 事件流程配置
*/
public DcProcessConfig selectDcProcessConfigById(Long id);
/**
* 查询事件流程配置列表
*
* @param dcProcessConfig 事件流程配置
* @return 事件流程配置集合
*/
List<DcProcessConfig> selectDcProcessConfigList(DcProcessConfig dcProcessConfig);
/**
* 新增事件流程配置
*
* @param dcProcessConfig 事件流程配置
* @return 结果
*/
int insertDcProcessConfig(DcProcessConfig dcProcessConfig);
/**
* 修改事件流程配置
*
* @param dcProcessConfig 事件流程配置
* @return 结果
*/
int updateDcProcessConfig(DcProcessConfig dcProcessConfig);
/**
* 批量删除事件流程配置
*
* @param ids 需要删除的事件流程配置主键集合
* @return 结果
*/
int deleteDcProcessConfigByIds(Long[] ids);
/**
* 删除事件流程配置信息
*
* @param id 事件流程配置主键
* @return 结果
*/
int deleteDcProcessConfigById(Long id);
}

162
zc-business/src/main/java/com/zc/business/service/impl/DcEventTypeServiceImpl.java

@ -0,0 +1,162 @@
package com.zc.business.service.impl;
import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.domain.DcProcessConfig;
import com.zc.business.mapper.DcProcessConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zc.business.mapper.DcEventTypeMapper;
import com.zc.business.domain.DcEventType;
import com.zc.business.service.IDcEventTypeService;
/**
* 事件类型Service业务层处理
*
* @author ruoyi
* @date 2024-01-03
*/
@Service
public class DcEventTypeServiceImpl implements IDcEventTypeService
{
@Autowired
private DcEventTypeMapper dcEventTypeMapper;
@Autowired
private DcProcessConfigMapper dcProcessConfigMapper;
/**
* 查询事件类型
*
* @param eventType 事件类型主键
* @return 事件类型
*/
@Override
public DcEventType selectDcEventTypeByEventType(Integer eventType)
{
return dcEventTypeMapper.selectDcEventTypeByEventType(eventType);
}
/**
* 查询事件类型列表
*
* @param dcEventType 事件类型
* @return 事件类型
*/
@Override
public List<DcEventType> selectDcEventTypeList(DcEventType dcEventType)
{
List<DcEventType> eventTypeList = dcEventTypeMapper.selectDcEventTypeList(dcEventType);
if (eventTypeList != null && eventTypeList.size() > 0){
for (DcEventType eventType : eventTypeList) {
List<DcProcessConfig> processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(eventType.getEventType());
eventType.setProcessConfigList(processConfigList);
String processConfig = "";
if (processConfigList != null && processConfigList.size() > 0){
for (DcProcessConfig dcProcessConfig : processConfigList) {
processConfig = processConfig + dcProcessConfig.getProcessNode() + "-";
}
processConfig = processConfig.substring(0,processConfig.length()-1);
}
eventType.setProcessConfig(processConfig);
}
}
return eventTypeList;
}
/**
* 新增事件类型
*
* @param dcEventType 事件类型
* @return 结果
*/
@Override
public AjaxResult insertDcEventType(DcEventType dcEventType)
{
Integer eventType = dcEventType.getEventType();
if (eventType == null || eventType == 0){
return AjaxResult.error("添加失败,参数错误");
}
DcEventType oldData = dcEventTypeMapper.selectDcEventTypeByEventType(eventType);
if (oldData != null){
return AjaxResult.error("添加失败,事件类型重复");
}
//事件类型表
dcEventTypeMapper.insertDcEventType(dcEventType);
//事件流程配置
List<DcProcessConfig> processConfigList = dcEventType.getProcessConfigList();
if (processConfigList != null && processConfigList.size() > 0){
for (DcProcessConfig dcProcessConfig : processConfigList) {
dcProcessConfig.setEventType(dcEventType.getEventType());
}
//先批量删除
dcProcessConfigMapper.deleteDcProcessConfigByEventType(eventType);
//重新添加
dcProcessConfigMapper.insertDcProcessConfigByList(processConfigList);
}
return AjaxResult.success("添加成功");
}
/**
* 修改事件类型
*
* @param dcEventType 事件类型
* @return 结果
*/
@Override
public AjaxResult updateDcEventType(DcEventType dcEventType)
{
Integer eventType = dcEventType.getEventType();
if (eventType == null || eventType == 0){
return AjaxResult.error("修改失败,参数错误");
}
//事件类型表
dcEventTypeMapper.updateDcEventType(dcEventType);
//事件流程配置
List<DcProcessConfig> processConfigList = dcEventType.getProcessConfigList();
if (processConfigList != null && processConfigList.size() > 0){
for (DcProcessConfig dcProcessConfig : processConfigList) {
dcProcessConfig.setEventType(dcEventType.getEventType());
}
//先批量删除
dcProcessConfigMapper.deleteDcProcessConfigByEventType(eventType);
//重新添加
dcProcessConfigMapper.insertDcProcessConfigByList(processConfigList);
}
return AjaxResult.success("修改成功");
}
/**
* 批量删除事件类型
*
* @param eventTypes 需要删除的事件类型主键
* @return 结果
*/
@Override
public AjaxResult deleteDcEventTypeByEventTypes(Integer[] eventTypes)
{
dcEventTypeMapper.deleteDcEventTypeByEventTypes(eventTypes);
return AjaxResult.success("删除成功");
}
/**
* 删除事件类型信息
*
* @param eventType 事件类型主键
* @return 结果
*/
@Override
public AjaxResult deleteDcEventTypeByEventType(Integer eventType)
{
//删除事件类型
dcEventTypeMapper.deleteDcEventTypeByEventType(eventType);
//删除事件流程配置
dcProcessConfigMapper.deleteDcProcessConfigByEventType(eventType);
return AjaxResult.success("删除成功");
}
}

93
zc-business/src/main/java/com/zc/business/service/impl/DcProcessConfigServiceImpl.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.DcProcessConfigMapper;
import com.zc.business.domain.DcProcessConfig;
import com.zc.business.service.IDcProcessConfigService;
/**
* 事件流程配置Service业务层处理
*
* @author ruoyi
* @date 2024-01-03
*/
@Service
public class DcProcessConfigServiceImpl implements IDcProcessConfigService
{
@Autowired
private DcProcessConfigMapper dcProcessConfigMapper;
/**
* 查询事件流程配置
*
* @param id 事件流程配置主键
* @return 事件流程配置
*/
@Override
public DcProcessConfig selectDcProcessConfigById(Long id)
{
return dcProcessConfigMapper.selectDcProcessConfigById(id);
}
/**
* 查询事件流程配置列表
*
* @param dcProcessConfig 事件流程配置
* @return 事件流程配置
*/
@Override
public List<DcProcessConfig> selectDcProcessConfigList(DcProcessConfig dcProcessConfig)
{
return dcProcessConfigMapper.selectDcProcessConfigList(dcProcessConfig);
}
/**
* 新增事件流程配置
*
* @param dcProcessConfig 事件流程配置
* @return 结果
*/
@Override
public int insertDcProcessConfig(DcProcessConfig dcProcessConfig)
{
return dcProcessConfigMapper.insertDcProcessConfig(dcProcessConfig);
}
/**
* 修改事件流程配置
*
* @param dcProcessConfig 事件流程配置
* @return 结果
*/
@Override
public int updateDcProcessConfig(DcProcessConfig dcProcessConfig)
{
return dcProcessConfigMapper.updateDcProcessConfig(dcProcessConfig);
}
/**
* 批量删除事件流程配置
*
* @param ids 需要删除的事件流程配置主键
* @return 结果
*/
@Override
public int deleteDcProcessConfigByIds(Long[] ids)
{
return dcProcessConfigMapper.deleteDcProcessConfigByIds(ids);
}
/**
* 删除事件流程配置信息
*
* @param id 事件流程配置主键
* @return 结果
*/
@Override
public int deleteDcProcessConfigById(Long id)
{
return dcProcessConfigMapper.deleteDcProcessConfigById(id);
}
}

58
zc-business/src/main/resources/mapper/business/DcEventTypeMapper.xml

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.DcEventTypeMapper">
<resultMap type="DcEventType" id="DcEventTypeResult">
<result property="eventType" column="event_type" />
<result property="eventName" column="event_name" />
</resultMap>
<sql id="selectDcEventTypeVo">
select event_type, event_name from dc_event_type
</sql>
<select id="selectDcEventTypeList" parameterType="DcEventType" resultMap="DcEventTypeResult">
<include refid="selectDcEventTypeVo"/>
<where>
<if test="eventType != null "> and event_type = #{eventType}</if>
</where>
</select>
<select id="selectDcEventTypeByEventType" parameterType="Integer" resultMap="DcEventTypeResult">
<include refid="selectDcEventTypeVo"/>
where event_type = #{eventType}
</select>
<insert id="insertDcEventType" parameterType="DcEventType">
insert into dc_event_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="eventType != null">event_type,</if>
<if test="eventName != null">event_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eventType != null">#{eventType},</if>
<if test="eventName != null">#{eventName},</if>
</trim>
</insert>
<update id="updateDcEventType" parameterType="DcEventType">
update dc_event_type
<trim prefix="SET" suffixOverrides=",">
<if test="eventName != null">event_name = #{eventName},</if>
</trim>
where event_type = #{eventType}
</update>
<delete id="deleteDcEventTypeByEventType" parameterType="Integer">
delete from dc_event_type where event_type = #{eventType}
</delete>
<delete id="deleteDcEventTypeByEventTypes" parameterType="String">
delete from dc_event_type where event_type in
<foreach item="eventType" collection="array" open="(" separator="," close=")">
#{eventType}
</foreach>
</delete>
</mapper>

86
zc-business/src/main/resources/mapper/business/DcProcessConfigMapper.xml

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.DcProcessConfigMapper">
<resultMap type="DcProcessConfig" id="DcProcessConfigResult">
<result property="id" column="id" />
<result property="eventType" column="event_type" />
<result property="nodeNode" column="node_node" />
<result property="processNode" column="process_node" />
<result property="commonPhrases" column="common_phrases" />
</resultMap>
<sql id="selectDcProcessConfigVo">
select id, event_type, node_node, process_node, common_phrases from dc_process_config
</sql>
<select id="selectDcProcessConfigList" parameterType="DcProcessConfig" resultMap="DcProcessConfigResult">
<include refid="selectDcProcessConfigVo"/>
<where>
<if test="nodeNode != null and nodeNode != ''"> and node_node = #{nodeNode}</if>
<if test="processNode != null and processNode != ''"> and process_node = #{processNode}</if>
<if test="commonPhrases != null and commonPhrases != ''"> and common_phrases = #{commonPhrases}</if>
</where>
</select>
<select id="selectDcProcessConfigById" parameterType="Long" resultMap="DcProcessConfigResult">
<include refid="selectDcProcessConfigVo"/>
where id = #{id}
</select>
<select id="selectDcProcessConfigByEventType" parameterType="Integer" resultMap="DcProcessConfigResult">
<include refid="selectDcProcessConfigVo"/>
where event_type = #{eventType}
</select>
<insert id="insertDcProcessConfig" parameterType="DcProcessConfig" useGeneratedKeys="true" keyProperty="id">
insert into dc_process_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="eventType != null">event_type,</if>
<if test="nodeNode != null">node_node,</if>
<if test="processNode != null and processNode != ''">process_node,</if>
<if test="commonPhrases != null">common_phrases,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eventType != null">#{eventType},</if>
<if test="nodeNode != null">#{nodeNode},</if>
<if test="processNode != null and processNode != ''">#{processNode},</if>
<if test="commonPhrases != null">#{commonPhrases},</if>
</trim>
</insert>
<insert id="insertDcProcessConfigByList">
insert into dc_process_config(event_type, node_node, process_node,common_phrases) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.eventType},#{item.nodeNode},#{item.processNode},#{item.commonPhrases})
</foreach>
</insert>
<update id="updateDcProcessConfig" parameterType="DcProcessConfig">
update dc_process_config
<trim prefix="SET" suffixOverrides=",">
<if test="eventType != null">event_type = #{eventType},</if>
<if test="nodeNode != null">node_node = #{nodeNode},</if>
<if test="processNode != null and processNode != ''">process_node = #{processNode},</if>
<if test="commonPhrases != null">common_phrases = #{commonPhrases},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcProcessConfigById" parameterType="Long">
delete from dc_process_config where id = #{id}
</delete>
<delete id="deleteDcProcessConfigByIds" parameterType="String">
delete from dc_process_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteDcProcessConfigByEventType" parameterType="Integer">
delete from dc_process_config where event_type = #{eventType}
</delete>
</mapper>
Loading…
Cancel
Save