work init
This commit is contained in:
@ -0,0 +1,105 @@
|
|||||||
|
package com.xzzn.web.controller.ems;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.xzzn.common.utils.poi.ExcelUtil;
|
||||||
|
import com.xzzn.ems.domain.EmsTicket;
|
||||||
|
import com.xzzn.ems.service.IEmsTicketService;
|
||||||
|
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.xzzn.common.annotation.Log;
|
||||||
|
import com.xzzn.common.core.controller.BaseController;
|
||||||
|
import com.xzzn.common.core.domain.AjaxResult;
|
||||||
|
import com.xzzn.common.enums.BusinessType;
|
||||||
|
import com.xzzn.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单主Controller
|
||||||
|
*
|
||||||
|
* @author xzzn
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ticket")
|
||||||
|
public class EmsTicketController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IEmsTicketService emsTicketService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单主列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:ticket:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(EmsTicket emsTicket)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EmsTicket> list = emsTicketService.selectEmsTicketList(emsTicket);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出工单主列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:ticket:export')")
|
||||||
|
@Log(title = "工单主", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, EmsTicket emsTicket)
|
||||||
|
{
|
||||||
|
List<EmsTicket> list = emsTicketService.selectEmsTicketList(emsTicket);
|
||||||
|
ExcelUtil<EmsTicket> util = new ExcelUtil<EmsTicket>(EmsTicket.class);
|
||||||
|
util.exportExcel(response, list, "工单主数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工单主详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:ticket:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(emsTicketService.selectEmsTicketById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工单主
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:ticket:add')")
|
||||||
|
@Log(title = "工单主", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody EmsTicket emsTicket)
|
||||||
|
{
|
||||||
|
return toAjax(emsTicketService.insertEmsTicket(emsTicket));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工单主
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:ticket:edit')")
|
||||||
|
@Log(title = "工单主", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody EmsTicket emsTicket)
|
||||||
|
{
|
||||||
|
return toAjax(emsTicketService.updateEmsTicket(emsTicket));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工单主
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:ticket:remove')")
|
||||||
|
@Log(title = "工单主", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(emsTicketService.deleteEmsTicketByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
164
ems-system/src/main/java/com/xzzn/ems/domain/EmsTicket.java
Normal file
164
ems-system/src/main/java/com/xzzn/ems/domain/EmsTicket.java
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
package com.xzzn.ems.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.xzzn.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.xzzn.common.annotation.Excel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单主对象 ems_ticket
|
||||||
|
*
|
||||||
|
* @author xzzn
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
public class EmsTicket extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 工单号(规则:T+日期+6位随机) */
|
||||||
|
@Excel(name = "工单号", readConverterExp = "规=则:T+日期+6位随机")
|
||||||
|
private String ticketNo;
|
||||||
|
|
||||||
|
/** 提交用户ID */
|
||||||
|
@Excel(name = "提交用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/** 工单标题 */
|
||||||
|
@Excel(name = "工单标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/** 问题描述 */
|
||||||
|
@Excel(name = "问题描述")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/** 图片URL数组 */
|
||||||
|
@Excel(name = "图片URL数组")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
/** 1待处理 2处理中 3已完成 */
|
||||||
|
@Excel(name = "1待处理 2处理中 3已完成")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
/** 完成时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date completeTime;
|
||||||
|
|
||||||
|
/** 处理人ID */
|
||||||
|
@Excel(name = "处理人ID")
|
||||||
|
private Long workUserId;
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTicketNo(String ticketNo)
|
||||||
|
{
|
||||||
|
this.ticketNo = ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTicketNo()
|
||||||
|
{
|
||||||
|
return ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(String userId)
|
||||||
|
{
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserId()
|
||||||
|
{
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content)
|
||||||
|
{
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent()
|
||||||
|
{
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImages(String images)
|
||||||
|
{
|
||||||
|
this.images = images;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImages()
|
||||||
|
{
|
||||||
|
return images;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Long status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getStatus()
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompleteTime(Date completeTime)
|
||||||
|
{
|
||||||
|
this.completeTime = completeTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCompleteTime()
|
||||||
|
{
|
||||||
|
return completeTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkUserId(Long workUserId)
|
||||||
|
{
|
||||||
|
this.workUserId = workUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getWorkUserId()
|
||||||
|
{
|
||||||
|
return workUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("ticketNo", getTicketNo())
|
||||||
|
.append("userId", getUserId())
|
||||||
|
.append("title", getTitle())
|
||||||
|
.append("content", getContent())
|
||||||
|
.append("images", getImages())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("completeTime", getCompleteTime())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("workUserId", getWorkUserId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.xzzn.ems.mapper;
|
||||||
|
|
||||||
|
import com.xzzn.ems.domain.EmsTicket;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单主Mapper接口
|
||||||
|
*
|
||||||
|
* @author xzzn
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
public interface EmsTicketMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询工单主
|
||||||
|
*
|
||||||
|
* @param id 工单主主键
|
||||||
|
* @return 工单主
|
||||||
|
*/
|
||||||
|
public EmsTicket selectEmsTicketById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单主列表
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 工单主集合
|
||||||
|
*/
|
||||||
|
public List<EmsTicket> selectEmsTicketList(EmsTicket emsTicket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工单主
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsTicket(EmsTicket emsTicket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工单主
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsTicket(EmsTicket emsTicket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工单主
|
||||||
|
*
|
||||||
|
* @param id 工单主主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsTicketById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除工单主
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsTicketByIds(String[] ids);
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.xzzn.ems.service;
|
||||||
|
|
||||||
|
import com.xzzn.ems.domain.EmsTicket;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单主Service接口
|
||||||
|
*
|
||||||
|
* @author xzzn
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
public interface IEmsTicketService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询工单主
|
||||||
|
*
|
||||||
|
* @param id 工单主主键
|
||||||
|
* @return 工单主
|
||||||
|
*/
|
||||||
|
public EmsTicket selectEmsTicketById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单主列表
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 工单主集合
|
||||||
|
*/
|
||||||
|
public List<EmsTicket> selectEmsTicketList(EmsTicket emsTicket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工单主
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsTicket(EmsTicket emsTicket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工单主
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsTicket(EmsTicket emsTicket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除工单主
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的工单主主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsTicketByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工单主信息
|
||||||
|
*
|
||||||
|
* @param id 工单主主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsTicketById(String id);
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.xzzn.ems.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.xzzn.common.utils.DateUtils;
|
||||||
|
import com.xzzn.ems.domain.EmsTicket;
|
||||||
|
import com.xzzn.ems.mapper.EmsTicketMapper;
|
||||||
|
import com.xzzn.ems.service.IEmsTicketService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单主Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xzzn
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EmsTicketServiceImpl implements IEmsTicketService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private EmsTicketMapper emsTicketMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单主
|
||||||
|
*
|
||||||
|
* @param id 工单主主键
|
||||||
|
* @return 工单主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EmsTicket selectEmsTicketById(String id)
|
||||||
|
{
|
||||||
|
return emsTicketMapper.selectEmsTicketById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单主列表
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 工单主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EmsTicket> selectEmsTicketList(EmsTicket emsTicket)
|
||||||
|
{
|
||||||
|
return emsTicketMapper.selectEmsTicketList(emsTicket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工单主
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertEmsTicket(EmsTicket emsTicket)
|
||||||
|
{
|
||||||
|
emsTicket.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return emsTicketMapper.insertEmsTicket(emsTicket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工单主
|
||||||
|
*
|
||||||
|
* @param emsTicket 工单主
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateEmsTicket(EmsTicket emsTicket)
|
||||||
|
{
|
||||||
|
emsTicket.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return emsTicketMapper.updateEmsTicket(emsTicket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除工单主
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的工单主主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsTicketByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return emsTicketMapper.deleteEmsTicketByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工单主信息
|
||||||
|
*
|
||||||
|
* @param id 工单主主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsTicketById(String id)
|
||||||
|
{
|
||||||
|
return emsTicketMapper.deleteEmsTicketById(id);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user