mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 22:59:36 +08:00
工单填充数据,维修人员工单统计
This commit is contained in:
parent
083539e894
commit
c3523508ed
@ -78,7 +78,7 @@ public class RepairController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单列表
|
* 工单列表
|
||||||
* menu:1.保修查询,3派单入口,5维修入口, 7 管理员
|
* menu:1.报修查询,3派单入口,5维修入口, 7 管理员
|
||||||
* <p>
|
* <p>
|
||||||
* 报修查询:全部、处理中、待评价、已评价 type对应值:all、process、evaling、evaled
|
* 报修查询:全部、处理中、待评价、已评价 type对应值:all、process、evaling、evaled
|
||||||
* 派单入口:重新派单、待派单、已派单、已关闭 type对应值:anew、wait、already、close
|
* 派单入口:重新派单、待派单、已派单、已关闭 type对应值:anew、wait、already、close
|
||||||
@ -97,11 +97,23 @@ public class RepairController extends BaseController {
|
|||||||
return result(repairService.repairList(menu, userId.toString(), type));
|
return result(repairService.repairList(menu, userId.toString(), type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取维修人员工单数量统计
|
||||||
|
* 待完成、进行中、已完成 对应:wait、working、close
|
||||||
|
*/
|
||||||
|
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
|
||||||
|
@RequestMapping("workerRepairNumber")
|
||||||
|
public R workerRepairNumber() {
|
||||||
|
Long userId = getLoginStaffId();
|
||||||
|
Map<String, Integer> map = repairService.workerRepairNumber(userId.toString());
|
||||||
|
return R.ok().put("workerRepairNumber", map);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取一个工单的详细信息
|
* 获取一个工单的详细信息
|
||||||
*
|
* <p>
|
||||||
* id 工单id
|
* id 工单id
|
||||||
*
|
* </p>
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
|
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
|
||||||
@RequestMapping("get")
|
@RequestMapping("get")
|
||||||
|
@ -156,13 +156,13 @@ public class Repair extends BaseEntity<Repair> {
|
|||||||
/**
|
/**
|
||||||
* 评价人id
|
* 评价人id
|
||||||
*/
|
*/
|
||||||
private long evalUserId;
|
private Long evalUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 评价人姓名
|
* 评价人姓名
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private long evalUserName;
|
private String evalUserName;
|
||||||
|
|
||||||
//--超时
|
//--超时
|
||||||
/**
|
/**
|
||||||
|
@ -32,6 +32,13 @@ public interface RepairAttachMapper {
|
|||||||
*/
|
*/
|
||||||
List<RepairAttach> selectRepairAttachList(@Param("repairId") Long repairId);
|
List<RepairAttach> selectRepairAttachList(@Param("repairId") Long repairId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工单报修的第一张图片url
|
||||||
|
* @param repairId 工单id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getRepairFirstImg(@Param("repairId") Long repairId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增附件
|
* 新增附件
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,13 @@ public interface RepairMapper {
|
|||||||
|
|
||||||
List<Repair> adminRepairList(@Param("userId") String userId, @Param("type") String type);
|
List<Repair> adminRepairList(@Param("userId") String userId, @Param("type") String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工 工单 数量统计
|
||||||
|
* @param userId
|
||||||
|
* @param type 待完成、进行中、已完成 type对应值:wait、working、close
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer workerRepairNumber(@Param("userId") String userId, @Param("type") String type);
|
||||||
/**
|
/**
|
||||||
* 新增工单
|
* 新增工单
|
||||||
*
|
*
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package com.ics.admin.service;
|
package com.ics.admin.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.ics.admin.domain.Repair;
|
import com.ics.admin.domain.Repair;
|
||||||
import com.ics.admin.utils.FlowOperate;
|
import com.ics.admin.utils.FlowOperate;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单管理Service接口
|
* 工单管理Service接口
|
||||||
@ -41,6 +41,12 @@ public interface IRepairService {
|
|||||||
*/
|
*/
|
||||||
List<Repair> repairList(String menu, String userId, String type);
|
List<Repair> repairList(String menu, String userId, String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取维修人员工单数量
|
||||||
|
* @param userId 用户id
|
||||||
|
*/
|
||||||
|
Map<String,Integer> workerRepairNumber(String userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增工单
|
* 新增工单
|
||||||
*
|
*
|
||||||
|
@ -24,7 +24,9 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单管理Service业务层处理
|
* 工单管理Service业务层处理
|
||||||
@ -226,11 +228,45 @@ public class RepairServiceImpl implements IRepairService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Repair> repairList(String menu, String userId, String type) {
|
public List<Repair> repairList(String menu, String userId, String type) {
|
||||||
|
List<Repair> list = null;
|
||||||
//1.普通用户,3派单员,5维修人, 7管理员
|
//1.普通用户,3派单员,5维修人, 7管理员
|
||||||
if ("7".equals(menu)) return repairMapper.adminRepairList(userId, type);
|
if ("7".equals(menu)) list = repairMapper.adminRepairList(userId, type);
|
||||||
if ("5".equals(menu)) return repairMapper.workRepairList(userId, type);
|
if ("5".equals(menu)) list = repairMapper.workRepairList(userId, type);
|
||||||
if ("3".equals(menu)) return repairMapper.preRepairList(userId, type);
|
if ("3".equals(menu)) list = repairMapper.preRepairList(userId, type);
|
||||||
return repairMapper.normalRepairList(userId, type);//普通用户或者没有角色时都使用普通用户列表
|
if ("1".equals(menu)) list = repairMapper.normalRepairList(userId, type);
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
for (Repair repair : list) {
|
||||||
|
if (repair.getPerUserId() != null && repair.getPerUserId() > 0) {
|
||||||
|
IcsCustomerStaff perUser = customerStaffMapper.selectIcsCustomerStaffById(repair.getPerUserId());
|
||||||
|
repair.setPerUserName(perUser.getUsername());
|
||||||
|
}
|
||||||
|
if (repair.getRepairUserId() != null && repair.getRepairUserId() > 0) {
|
||||||
|
IcsCustomerStaff repairUser = customerStaffMapper.selectIcsCustomerStaffById(repair.getRepairUserId());
|
||||||
|
repair.setRepairUserName(repairUser.getUsername());
|
||||||
|
}
|
||||||
|
if (repair.getEvalUserId() != null && repair.getEvalUserId() > 0) {
|
||||||
|
IcsCustomerStaff evalUser = customerStaffMapper.selectIcsCustomerStaffById(repair.getEvalUserId());
|
||||||
|
repair.setEvalUserName(evalUser.getUsername());
|
||||||
|
}
|
||||||
|
String url = repairAttachMapper.getRepairFirstImg(repair.getId());
|
||||||
|
repair.setExt1(url);
|
||||||
|
IcsCustomerStaff createUser = customerStaffMapper.selectIcsCustomerStaffById(Long.valueOf(repair.getCreateBy()));
|
||||||
|
repair.setExt2(createUser.getUsername());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> workerRepairNumber(String userId) {
|
||||||
|
Map<String, Integer> map = new HashMap<>();
|
||||||
|
Integer wait = repairMapper.workerRepairNumber(userId, "wait");
|
||||||
|
Integer working = repairMapper.workerRepairNumber(userId, "working");
|
||||||
|
Integer close = repairMapper.workerRepairNumber(userId, "close");
|
||||||
|
map.put("wait", wait);
|
||||||
|
map.put("working", working);
|
||||||
|
map.put("close", close);
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,6 +55,10 @@
|
|||||||
where repair_id= #{repairId} and delete_flag = 0
|
where repair_id= #{repairId} and delete_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getRepairFirstImg" parameterType="Long" resultType="String">
|
||||||
|
select url from ics_repair_attach where repair_id=#{repairId} and node_id=1 and delete_flag=0 and ext1='img/video' order by id limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertRepairAttach" parameterType="com.ics.admin.domain.RepairAttach">
|
<insert id="insertRepairAttach" parameterType="com.ics.admin.domain.RepairAttach">
|
||||||
INSERT INTO ics_repair_attach
|
INSERT INTO ics_repair_attach
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
@ -239,6 +239,13 @@
|
|||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="workerRepairNumber" resultType="Integer">
|
||||||
|
select count(id) from ics_repair where delete_flag=0 and repair_user_id = #{userId}
|
||||||
|
<if test="type == 'wait'">and status = 5</if>
|
||||||
|
<if test="type == 'working'">and status = 7</if>
|
||||||
|
<if test="type == 'close'">and (status = 9 or status = 13)</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<delete id="deleteRepairById" parameterType="Long">
|
<delete id="deleteRepairById" parameterType="Long">
|
||||||
DELETE FROM ics_repair WHERE id = #{id}
|
DELETE FROM ics_repair WHERE id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user