28 changed files with 1343 additions and 211 deletions
@ -0,0 +1,129 @@ |
|||
package com.zc.business.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
import com.zc.business.domain.DcDispatch; |
|||
import com.zc.business.service.IDcDispatchService; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
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.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 调度信息记录Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-01-15 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/dc/system/dispatch") |
|||
@Api(tags = "调度信息记录") |
|||
public class DcDispatchController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IDcDispatchService dcDispatchService; |
|||
|
|||
/** |
|||
* 查询调度信息记录列表 |
|||
*/ |
|||
@ApiOperation("查询调度信息记录列表") |
|||
//@PreAuthorize("@ss.hasPermi('system:dispatch:list')")
|
|||
@GetMapping("/list") |
|||
public TableDataInfo list(DcDispatch dcDispatch) |
|||
{ |
|||
startPage(); |
|||
List<DcDispatch> list = dcDispatchService.selectDcDispatchList(dcDispatch); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出调度信息记录列表 |
|||
*/ |
|||
// @ApiOperation("查询调度信息记录列表")
|
|||
|
|||
// @PreAuthorize("@ss.hasPermi('system:dispatch:export')")
|
|||
@Log(title = "调度信息记录", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, DcDispatch dcDispatch) |
|||
{ |
|||
List<DcDispatch> list = dcDispatchService.selectDcDispatchList(dcDispatch); |
|||
ExcelUtil<DcDispatch> util = new ExcelUtil<>(DcDispatch.class); |
|||
util.exportExcel(response, list, "调度信息记录数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取调度信息记录详细信息 |
|||
*/ |
|||
@ApiOperation("获取调度信息记录详细信息") |
|||
|
|||
// @PreAuthorize("@ss.hasPermi('system:dispatch:query')")
|
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return AjaxResult.success(dcDispatchService.selectDcDispatchById(id)); |
|||
} |
|||
/** |
|||
* 根据事件id获取调度信息记录详细信息 |
|||
*/ |
|||
@ApiOperation("根据事件id获取调度信息记录详细信息") |
|||
// @PreAuthorize("@ss.hasPermi('system:dispatch:query')")
|
|||
@GetMapping(value = "/EventId/{id}") |
|||
public TableDataInfo getEventId(@PathVariable("id") String id) |
|||
{ |
|||
return getDataTable(dcDispatchService.selectDcDispatchByEventId(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增调度信息记录 |
|||
*/ |
|||
@ApiOperation("新增调度信息记录") |
|||
|
|||
//@PreAuthorize("@ss.hasPermi('system:dispatch:add')")
|
|||
@Log(title = "调度信息记录", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody DcDispatch dcDispatch) |
|||
{ |
|||
return toAjax(dcDispatchService.insertDcDispatch(dcDispatch)); |
|||
} |
|||
|
|||
/** |
|||
* 修改调度信息记录 |
|||
*/ |
|||
@ApiOperation("修改调度信息记录") |
|||
|
|||
// @PreAuthorize("@ss.hasPermi('system:dispatch:edit')")
|
|||
@Log(title = "调度信息记录", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody DcDispatch dcDispatch) |
|||
{ |
|||
return toAjax(dcDispatchService.updateDcDispatch(dcDispatch)); |
|||
} |
|||
|
|||
/** |
|||
* 删除调度信息记录 |
|||
*/ |
|||
@ApiOperation("删除调度信息记录") |
|||
|
|||
//@PreAuthorize("@ss.hasPermi('system:dispatch:remove')")
|
|||
@Log(title = "调度信息记录", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(dcDispatchService.deleteDcDispatchByIds(ids)); |
|||
} |
|||
} |
@ -0,0 +1,141 @@ |
|||
package com.zc.business.domain; |
|||
|
|||
import java.util.Date; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
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_dispatch |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-01-15 |
|||
*/ |
|||
@ApiModel(value = "DcDispatch",description = "调度信息记录") |
|||
public class DcDispatch extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
@ApiModelProperty("id") |
|||
/** $主键id */ |
|||
private Long id; |
|||
@ApiModelProperty("所属机构名称") |
|||
@TableField(exist = false) |
|||
private String organizationName; |
|||
/** 所属机构 */ |
|||
@ApiModelProperty("所属机构ID") |
|||
private Long organizationId; |
|||
@ApiModelProperty("调度事件") |
|||
|
|||
/** 调度事件 */ |
|||
private String eventId; |
|||
@ApiModelProperty("调度任务名称") |
|||
|
|||
/** 调度任务名称*/ |
|||
private String dispatchName; |
|||
|
|||
/** 调度状态 1-计划中2-进行中3-已完成 */ |
|||
|
|||
@ApiModelProperty("调度状态") |
|||
private Long dispatchStatus; |
|||
/** 调度开始时间*/ |
|||
@ApiModelProperty("调度开始时间") |
|||
|
|||
private Date startTime; |
|||
/** 调度结束时间 */ |
|||
@ApiModelProperty("调度结束时间") |
|||
|
|||
private Date endTime; |
|||
|
|||
public String getOrganizationName() { |
|||
return organizationName; |
|||
} |
|||
|
|||
public void setOrganizationName(String organizationName) { |
|||
this.organizationName = organizationName; |
|||
} |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setOrganizationId(Long organizationId) |
|||
{ |
|||
this.organizationId = organizationId; |
|||
} |
|||
|
|||
public Long getOrganizationId() |
|||
{ |
|||
return organizationId; |
|||
} |
|||
public void setEventId(String eventId) |
|||
{ |
|||
this.eventId = eventId; |
|||
} |
|||
|
|||
public String getEventId() |
|||
{ |
|||
return eventId; |
|||
} |
|||
public void setDispatchName(String dispatchName) |
|||
{ |
|||
this.dispatchName = dispatchName; |
|||
} |
|||
|
|||
public String getDispatchName() |
|||
{ |
|||
return dispatchName; |
|||
} |
|||
public void setDispatchStatus(Long dispatchStatus) |
|||
{ |
|||
this.dispatchStatus = dispatchStatus; |
|||
} |
|||
|
|||
public Long getDispatchStatus() |
|||
{ |
|||
return dispatchStatus; |
|||
} |
|||
public void setStartTime(Date startTime) |
|||
{ |
|||
this.startTime = startTime; |
|||
} |
|||
|
|||
public Date getStartTime() |
|||
{ |
|||
return startTime; |
|||
} |
|||
public void setEndTime(Date endTime) |
|||
{ |
|||
this.endTime = endTime; |
|||
} |
|||
|
|||
public Date getEndTime() |
|||
{ |
|||
return endTime; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("organizationId", getOrganizationId()) |
|||
.append("eventId", getEventId()) |
|||
.append("dispatchName", getDispatchName()) |
|||
.append("dispatchStatus", getDispatchStatus()) |
|||
.append("startTime", getStartTime()) |
|||
.append("endTime", getEndTime()) |
|||
.append("remark", getRemark()) |
|||
.append("organizationName", getOrganizationName()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,69 @@ |
|||
package com.zc.business.mapper; |
|||
|
|||
import com.zc.business.domain.DcDispatch; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 调度信息记录Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-01-15 |
|||
*/ |
|||
public interface DcDispatchMapper |
|||
{ |
|||
/** |
|||
* 查询调度信息记录 |
|||
* |
|||
* @param id 调度信息记录主键 |
|||
* @return 调度信息记录 |
|||
*/ |
|||
public DcDispatch selectDcDispatchById(Long id); |
|||
|
|||
/** |
|||
* 查询调度信息记录列表 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 调度信息记录集合 |
|||
*/ |
|||
List<DcDispatch> selectDcDispatchList(DcDispatch dcDispatch); |
|||
|
|||
/** |
|||
* 新增调度信息记录 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 结果 |
|||
*/ |
|||
int insertDcDispatch(DcDispatch dcDispatch); |
|||
|
|||
/** |
|||
* 修改调度信息记录 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 结果 |
|||
*/ |
|||
int updateDcDispatch(DcDispatch dcDispatch); |
|||
|
|||
/** |
|||
* 删除调度信息记录 |
|||
* |
|||
* @param id 调度信息记录主键 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcDispatchById(Long id); |
|||
|
|||
/** |
|||
* 批量删除调度信息记录 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcDispatchByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 根据事件id获取调度信息记录详细信息 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
String selectDcDispatchByEventId(String id); |
|||
} |
@ -0,0 +1,69 @@ |
|||
package com.zc.business.service; |
|||
|
|||
import java.util.List; |
|||
import com.zc.business.domain.DcDispatch; |
|||
import com.zc.business.domain.DcEventProcess; |
|||
|
|||
/** |
|||
* 调度信息记录Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-01-15 |
|||
*/ |
|||
public interface IDcDispatchService |
|||
{ |
|||
/** |
|||
* 查询调度信息记录 |
|||
* |
|||
* @param id 调度信息记录主键 |
|||
* @return 调度信息记录 |
|||
*/ |
|||
public DcDispatch selectDcDispatchById(Long id); |
|||
|
|||
/** |
|||
* 查询调度信息记录列表 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 调度信息记录集合 |
|||
*/ |
|||
List<DcDispatch> selectDcDispatchList(DcDispatch dcDispatch); |
|||
|
|||
/** |
|||
* 新增调度信息记录 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 结果 |
|||
*/ |
|||
int insertDcDispatch(DcDispatch dcDispatch); |
|||
|
|||
/** |
|||
* 修改调度信息记录 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 结果 |
|||
*/ |
|||
int updateDcDispatch(DcDispatch dcDispatch); |
|||
|
|||
/** |
|||
* 批量删除调度信息记录 |
|||
* |
|||
* @param ids 需要删除的调度信息记录主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcDispatchByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除调度信息记录信息 |
|||
* |
|||
* @param id 调度信息记录主键 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcDispatchById(Long id); |
|||
|
|||
/** |
|||
* 根据事件id获取调度信息记录详细信息 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
List<DcEventProcess> selectDcDispatchByEventId(String id); |
|||
} |
@ -0,0 +1,111 @@ |
|||
package com.zc.business.service.impl; |
|||
|
|||
import java.util.List; |
|||
|
|||
import com.zc.business.domain.DcDispatch; |
|||
import com.zc.business.domain.DcEventProcess; |
|||
import com.zc.business.mapper.DcDispatchMapper; |
|||
import com.zc.business.mapper.DcEventProcessMapper; |
|||
import com.zc.business.service.IDcDispatchService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 调度信息记录Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-01-15 |
|||
*/ |
|||
@Service |
|||
public class DcDispatchServiceImpl implements IDcDispatchService |
|||
{ |
|||
@Autowired |
|||
private DcDispatchMapper dcDispatchMapper; |
|||
@Autowired |
|||
private DcEventProcessMapper dcEventProcessMapper; |
|||
|
|||
/** |
|||
* 查询调度信息记录 |
|||
* |
|||
* @param id 调度信息记录主键 |
|||
* @return 调度信息记录 |
|||
*/ |
|||
@Override |
|||
public DcDispatch selectDcDispatchById(Long id) |
|||
{ |
|||
return dcDispatchMapper.selectDcDispatchById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询调度信息记录列表 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 调度信息记录 |
|||
*/ |
|||
@Override |
|||
public List<DcDispatch> selectDcDispatchList(DcDispatch dcDispatch) |
|||
{ |
|||
return dcDispatchMapper.selectDcDispatchList(dcDispatch); |
|||
} |
|||
|
|||
/** |
|||
* 新增调度信息记录 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertDcDispatch(DcDispatch dcDispatch) |
|||
{ |
|||
return dcDispatchMapper.insertDcDispatch(dcDispatch); |
|||
} |
|||
|
|||
/** |
|||
* 修改调度信息记录 |
|||
* |
|||
* @param dcDispatch 调度信息记录 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateDcDispatch(DcDispatch dcDispatch) |
|||
{ |
|||
return dcDispatchMapper.updateDcDispatch(dcDispatch); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除调度信息记录 |
|||
* |
|||
* @param ids 需要删除的调度信息记录主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteDcDispatchByIds(Long[] ids) |
|||
{ |
|||
return dcDispatchMapper.deleteDcDispatchByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除调度信息记录信息 |
|||
* |
|||
* @param id 调度信息记录主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteDcDispatchById(Long id) |
|||
{ |
|||
return dcDispatchMapper.deleteDcDispatchById(id); |
|||
} |
|||
|
|||
/** |
|||
* 根据事件id获取调度信息记录详细信息 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<DcEventProcess> selectDcDispatchByEventId(String id) { |
|||
// return dcDispatchMapper.selectDcDispatchByEventId(id);
|
|||
return dcEventProcessMapper.selectDcDispatchByEventId(id); |
|||
} |
|||
} |
@ -0,0 +1,94 @@ |
|||
<?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.DcDispatchMapper"> |
|||
|
|||
<resultMap type="com.zc.business.domain.DcDispatch" id="DcDispatchResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="organizationId" column="organization_id" /> |
|||
<result property="eventId" column="event_id" /> |
|||
<result property="dispatchName" column="dispatch_name" /> |
|||
<result property="dispatchStatus" column="dispatch_status" /> |
|||
<result property="startTime" column="start_time" /> |
|||
<result property="endTime" column="end_time" /> |
|||
<result property="remark" column="remark" /> |
|||
<result property="organizationName" column="organization_name" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectDcDispatchVo"> |
|||
select dc_dispatch.id, organization_id, event_id, dispatch_name, dispatch_status, start_time, end_time, remark,dc_organization.organization_name AS organization_name from dc_dispatch |
|||
</sql> |
|||
|
|||
<select id="selectDcDispatchList" parameterType="com.zc.business.domain.DcDispatch" resultMap="DcDispatchResult"> |
|||
<include refid="selectDcDispatchVo"/> |
|||
<where> |
|||
<if test="organizationId != null "> and organization_id = #{organizationId}</if> |
|||
<if test="eventId != null and eventId != ''"> and event_id = #{eventId}</if> |
|||
<if test="dispatchName != null and dispatchName != ''"> and dispatch_name like concat('%', #{dispatchName}, '%')</if> |
|||
<if test="dispatchStatus != null "> and dispatch_status = #{dispatchStatus}</if> |
|||
<if test="startTime != null "> and start_time = #{startTime}</if> |
|||
<if test="endTime != null "> and end_time = #{endTime}</if> |
|||
<if test="endTime != null and startTime != null"> and start_time BETWEEN #{startTime} and #{endTime} </if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectDcDispatchById" parameterType="Long" resultMap="DcDispatchResult"> |
|||
<include refid="selectDcDispatchVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
<!--根据事件id获取调度信息记录详细信息--> |
|||
<select id="selectDcDispatchByEventId" parameterType="string" resultMap="DcDispatchResult"> |
|||
<include refid="selectDcDispatchVo"/> |
|||
where event_id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertDcDispatch" parameterType="com.zc.business.domain.DcDispatch"> |
|||
insert into dc_dispatch |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id != null">id,</if> |
|||
<if test="organizationId != null">organization_id,</if> |
|||
<if test="eventId != null and eventId != ''">event_id,</if> |
|||
<if test="dispatchName != null">dispatch_name,</if> |
|||
<if test="dispatchStatus != null">dispatch_status,</if> |
|||
<if test="startTime != null">start_time,</if> |
|||
<if test="endTime != null">end_time,</if> |
|||
<if test="remark != null">remark,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="id != null">#{id},</if> |
|||
<if test="organizationId != null">#{organizationId},</if> |
|||
<if test="eventId != null and eventId != ''">#{eventId},</if> |
|||
<if test="dispatchName != null">#{dispatchName},</if> |
|||
<if test="dispatchStatus != null">#{dispatchStatus},</if> |
|||
<if test="startTime != null">#{startTime},</if> |
|||
<if test="endTime != null">#{endTime},</if> |
|||
<if test="remark != null">#{remark},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateDcDispatch" parameterType="com.zc.business.domain.DcDispatch"> |
|||
update dc_dispatch |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="organizationId != null">organization_id = #{organizationId},</if> |
|||
<if test="eventId != null and eventId != ''">event_id = #{eventId},</if> |
|||
<if test="dispatchName != null">dispatch_name = #{dispatchName},</if> |
|||
<if test="dispatchStatus != null">dispatch_status = #{dispatchStatus},</if> |
|||
<if test="startTime != null">start_time = #{startTime},</if> |
|||
<if test="endTime != null">end_time = #{endTime},</if> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteDcDispatchById" parameterType="Long"> |
|||
delete from dc_dispatch where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteDcDispatchByIds" parameterType="String"> |
|||
delete from dc_dispatch where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
Loading…
Reference in new issue