工单管理-改动
This commit is contained in:
@ -0,0 +1,40 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 工单列表对象
|
||||
*
|
||||
*/
|
||||
public class TicketListVo extends EmsTicket
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// 提交人姓名
|
||||
private String userName;
|
||||
// 处理人姓名
|
||||
private String workName;
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getWorkName() {
|
||||
return workName;
|
||||
}
|
||||
|
||||
public void setWorkName(String workName) {
|
||||
this.workName = workName;
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xzzn.ems.mapper;
|
||||
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import com.xzzn.ems.domain.vo.TicketListVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -66,4 +67,11 @@ public interface EmsTicketMapper
|
||||
* @return
|
||||
*/
|
||||
public int dropEmsTicketById(String id);
|
||||
|
||||
/**
|
||||
* 获取工单列表
|
||||
* @param emsTicket
|
||||
* @return
|
||||
*/
|
||||
public List<TicketListVo> getAllTicketList(EmsTicket emsTicket);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import com.xzzn.ems.domain.vo.TicketListVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -66,4 +67,12 @@ public interface IEmsTicketService
|
||||
* @return
|
||||
*/
|
||||
public int dropEmsTicketById(String id);
|
||||
|
||||
/**
|
||||
* 获取工单列表
|
||||
*
|
||||
* @param emsTicket 工单主
|
||||
* @return 工单主集合
|
||||
*/
|
||||
public List<TicketListVo> getAllTicketList(EmsTicket emsTicket);
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import com.xzzn.ems.domain.vo.TicketListVo;
|
||||
import com.xzzn.ems.mapper.EmsTicketMapper;
|
||||
import com.xzzn.ems.service.IEmsTicketService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -54,6 +57,11 @@ public class EmsTicketServiceImpl implements IEmsTicketService
|
||||
@Override
|
||||
public int insertEmsTicket(EmsTicket emsTicket)
|
||||
{
|
||||
// 工单号随机生产
|
||||
String ticketNo = "";
|
||||
String nowDate = DateUtils.dateTime();
|
||||
ticketNo = "T" + nowDate + String.format("%06d", new Random().nextInt(1000000));
|
||||
emsTicket.setTicketNo(ticketNo);
|
||||
emsTicket.setCreateTime(DateUtils.getNowDate());
|
||||
return emsTicketMapper.insertEmsTicket(emsTicket);
|
||||
}
|
||||
@ -106,4 +114,9 @@ public class EmsTicketServiceImpl implements IEmsTicketService
|
||||
{
|
||||
return emsTicketMapper.dropEmsTicketById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TicketListVo> getAllTicketList(EmsTicket emsTicket) {
|
||||
return emsTicketMapper.getAllTicketList(emsTicket);
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,4 +114,19 @@
|
||||
<update id="dropEmsTicketById" parameterType="String">
|
||||
update ems_ticket set isDelete = 0 where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getAllTicketList" resultType="com.xzzn.ems.domain.vo.TicketListVo">
|
||||
SELECT t.ticket_no as ticketNo,
|
||||
t.title as title,
|
||||
t.content as content,
|
||||
t.`status` as status,
|
||||
s.user_name as userName,
|
||||
s1.user_name as workName,
|
||||
t.create_time as createTime,
|
||||
t.id
|
||||
FROM ems_ticket t
|
||||
LEFT JOIN sys_user s on t.user_id = s.user_id
|
||||
LEFT JOIN sys_user s1 on t.work_user_id = s1.user_id
|
||||
where isDelete = 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user