Merge remote-tracking branch 'origin/shoot-hand' into shoot-hand

# Conflicts:
#	shoot-hand/ics-admin/src/main/java/com/ics/admin/controller/RepairController.java
#	shoot-hand/ics-admin/src/main/java/com/ics/admin/controller/RepairStatsController.java
#	shoot-hand/ics-admin/src/main/java/com/ics/admin/mapper/RepairMapper.java
#	shoot-hand/ics-admin/src/main/java/com/ics/admin/service/IRepairService.java
#	shoot-hand/ics-admin/src/main/java/com/ics/admin/service/impl/RepairServiceImpl.java
#	shoot-hand/ics-admin/src/main/resources/mapper/admin/RepairMapper.xml
This commit is contained in:
chenze 2024-08-25 15:55:44 +08:00
commit 335eeadd13
14 changed files with 395 additions and 226 deletions

View File

@ -3,13 +3,17 @@ package com.ics.admin.controller;
import com.ics.admin.domain.Repair; import com.ics.admin.domain.Repair;
import com.ics.admin.domain.RepairAttach; import com.ics.admin.domain.RepairAttach;
import com.ics.admin.domain.RepairLog; import com.ics.admin.domain.RepairLog;
import com.ics.admin.service.IIcsCustomerStaffService;
import com.ics.admin.service.IRepairAttachService; import com.ics.admin.service.IRepairAttachService;
import com.ics.admin.service.IRepairLogService; import com.ics.admin.service.IRepairLogService;
import com.ics.admin.service.IRepairService; import com.ics.admin.service.IRepairService;
import com.ics.admin.utils.RepairDTO; import com.ics.admin.utils.RepairDTO;
import com.ics.admin.utils.RepairListDTO;
import com.ics.admin.vo.RepairAttachVO; import com.ics.admin.vo.RepairAttachVO;
import com.ics.common.core.controller.BaseController; import com.ics.common.core.controller.BaseController;
import com.ics.common.core.domain.IcsCustomerStaff;
import com.ics.common.core.domain.R; import com.ics.common.core.domain.R;
import com.ics.common.utils.DateUtils;
import com.ics.common.utils.StringUtils; import com.ics.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -20,6 +24,7 @@ import org.wf.jwtp.annotation.Logical;
import org.wf.jwtp.annotation.RequiresPermissions; import org.wf.jwtp.annotation.RequiresPermissions;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -43,15 +48,17 @@ public class RepairController extends BaseController {
@Autowired @Autowired
private IRepairAttachService repairAttachService; private IRepairAttachService repairAttachService;
@Autowired
private IIcsCustomerStaffService customerStaffService;
/** /**
* 报修 * 报修
*/ */
@RequiresPermissions(value = {"repair:manage:operator", "member:center:view"}, logical = Logical.OR) @RequiresPermissions(value = {"repair:manage:operator", "member:center:view"}, logical = Logical.OR)
@PostMapping("flow/start") @PostMapping("flow/start")
public R startFlow(@RequestBody RepairDTO repairDTO) { public R startFlow(@RequestBody RepairDTO repairDTO) {
System.out.println("1111111111"+getLoginStaffId());
Long userId = getLoginStaffId(); Long userId = getLoginStaffId();
// if (!repairService.submitCheck(userId.toString())) return R.error("报修过于频繁,请稍后再试."); if (!repairService.submitCheck(userId.toString())) return R.error("报修过于频繁,请稍后再试.");
String result = repairService.handleFlow(repairDTO.getRepair(), userId, repairDTO.getFiles(), null, null); String result = repairService.handleFlow(repairDTO.getRepair(), userId, repairDTO.getFiles(), null, null);
return IRepairService.OK.equals(result) ? R.ok() : R.error(result); return IRepairService.OK.equals(result) ? R.ok() : R.error(result);
} }
@ -79,31 +86,93 @@ public class RepairController extends BaseController {
/** /**
* 工单列表 * 工单列表
* menu:1.报修查询3派单入口5维修入口, 7 管理员,9 楼层管理员 * role 1.普通用户3派单员5维修人员, 7管理员, 9 楼层管理员
* <p>
* 报修查询全部处理中待评价已评价无效申请 type对应值allprocessevalingevaledinvalid
* 派单入口重新派单待派单已派单已关闭无效申请 type对应值anewwaitalreadyclose
* 维修入口待完成进行中已完成 type对应值waitworkingclose
* 管理员重派单全部无效申请 type对应值anewallinvalid 小程序暂时用不到
* 楼层管理员全部无效申请 type对应值allinvalid
* *
* name : 工单名称搜索关键字 * 报修查询 普通用户,管理员, 楼层管理员
* </p> * 全部处理中待评价已评价无效申请
* type值allprocessevalingevaledinvalid
* 派单入口
* 管理员
* 重新派单待派单已派单无效申请
* type值anewwaitalreadyinvalid
* 派单员
* 待派单已派单无效申请
* type值waitalreadyinvalid
* 维修入口
* 待完成进行中已完成
* type对应值waitprocessend
* 查询条件
* repair
* sn 单号模糊查询
* repairLevel故障等级模糊查询
* typeId设备类别id精确查询
* deviceId设备id精确查询
* name报修人模糊查询
* phone联系电话模糊查询
* addressId报修地点id精确查询
* floorId报修楼层id精确查询
* room门牌号模糊查询
* explain描述模糊查询
* failureTypeId故障类型id精确查询
* beginTime : 工单创建日期范围开始时间;格式示例 2024-08-22成对出现
* endTime : 工单创建日期范围结束时间;格式示例 2024-08-25成对出现
*
* ========================================================================
*
* 普通用户:
* 全部处理中待评价已评价无效申请
* type值allprocess-1357evaling-9evaled-13invalid-11
*
* 派单员
* 待派单已派单无效申请
* type值wait-1already-57913invalid-11
*
* 维修人员
* 待完成进行中已完成
* type值wait-5process-7end-913
*
* 管理员
* 全部重新派单待派单已派单处理中待评价已评价无效申请
* type值allanew-3wait-1already-57913process-1357evaling-9evaled-13invalid-11
*
* 楼层管理员
* type值allprocess-1357evaling-9evaled-13invalid-11
* ========================================================================
*/ */
@RequiresPermissions(value = {"repair:manage:operator", "member:center:view"}, logical = Logical.OR) @RequiresPermissions(value = {"repair:manage:operator", "member:center:view"}, logical = Logical.OR)
@RequestMapping("list") @RequestMapping("list")
public R list(@RequestBody Map<String, String> map) { public R list(@RequestBody RepairListDTO repairListDTO) {
String type = map.get("type"); Repair repair = repairListDTO.getRepair();
String menu = map.get("menu"); if (repair == null) repair = new Repair();
String repairName = map.get("name"); String role = repairListDTO.getRole();
String sn = map.get("sn"); String type = repairListDTO.getType();
String typeName = map.get("typeName"); if (StringUtils.isBlank(type) || StringUtils.isBlank(role)) return R.error();
String deviceName = map.get("deviceName");
String status = map.get("status");
if (StringUtils.isBlank(type) || StringUtils.isBlank(menu)) return R.error();
startPage();
Long userId = getLoginStaffId(); Long userId = getLoginStaffId();
return result(repairService.repairList(menu, userId.toString(), type, repairName,sn,typeName,deviceName,status)); if ("7".equals(role)) { //管理员认证角色
IcsCustomerStaff customerStaff = customerStaffService.selectIcsCustomerStaffById(userId);
if (!"7".equals(customerStaff.getDataType())) return R.error("权限不足!");
}
Map<String, Object> params = new HashMap<>();
params.put("role", role);
params.put("type", type);
params.put("userId", userId);
//时间范围处理
String beginTime = repair.getBeginTime(), endTime = repair.getEndTime();
if (beginTime != null && endTime != null && beginTime.length() == 10 && endTime.length() == 10) {
try {
Date s = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, beginTime + " 00:00:00");
Date e = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endTime + " 23:59:59");
if (s.getTime() <= e.getTime()) {
params.put("beginTime", s);
params.put("endTime", e);
}
} catch (Exception e) {
//时间格式处理失败则放弃时间搜索条件
}
}
repair.setParams(params);
startPage();
return result(repairService.repairList(repair));
} }
/** /**

View File

@ -1,6 +1,7 @@
package com.ics.admin.controller; package com.ics.admin.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ics.admin.domain.Repair;
import com.ics.admin.vo.RepairAdminStatsVo; import com.ics.admin.vo.RepairAdminStatsVo;
import com.ics.admin.vo.RepairFloorStatsVo; import com.ics.admin.vo.RepairFloorStatsVo;
import com.ics.admin.vo.RepairWorkerStatsVo; import com.ics.admin.vo.RepairWorkerStatsVo;
@ -8,11 +9,16 @@ import com.ics.admin.service.IRepairService;
import com.ics.admin.service.IRepairStatsService; import com.ics.admin.service.IRepairStatsService;
import com.ics.common.core.controller.BaseController; import com.ics.common.core.controller.BaseController;
import com.ics.common.core.domain.R; import com.ics.common.core.domain.R;
import com.ics.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.wf.jwtp.annotation.RequiresPermissions; import org.wf.jwtp.annotation.RequiresPermissions;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/** /**
* 工单各种统计接口 * 工单各种统计接口
* created at 2024-8-15 20:36 * created at 2024-8-15 20:36
@ -46,8 +52,14 @@ public class RepairStatsController extends BaseController {
@RequiresPermissions(value = {"repair:manage:operator"}) @RequiresPermissions(value = {"repair:manage:operator"})
@RequestMapping("oneWorkerList") @RequestMapping("oneWorkerList")
public R oneWorkerList(String workerId) { public R oneWorkerList(String workerId) {
Repair repair = new Repair();
Map<String, Object> params = new HashMap<>();
params.put("role", "5");
params.put("type", "all");
params.put("userId", workerId);
repair.setParams(params);
startPage(); startPage();
return result(repairService.repairList("5", workerId, "", null,null,null,null,null)); return result(repairService.repairList(repair));
} }
/** /**
@ -66,8 +78,14 @@ public class RepairStatsController extends BaseController {
@RequiresPermissions(value = {"repair:manage:operator"}) @RequiresPermissions(value = {"repair:manage:operator"})
@RequestMapping("oneFloorList") @RequestMapping("oneFloorList")
public R oneFloorList(String floorerId) { public R oneFloorList(String floorerId) {
Repair repair = new Repair();
Map<String, Object> params = new HashMap<>();
params.put("role", "9");
params.put("userId", floorerId);
params.put("type", "all");
repair.setParams(params);
startPage(); startPage();
return result(repairService.floorRepairList(floorerId)); return result(repairService.repairList(repair));
} }
/** /**
@ -83,49 +101,89 @@ public class RepairStatsController extends BaseController {
/** /**
* 第二三行 工单统计工单完成情况评价情况 * 第二三行 工单统计工单完成情况评价情况
* 日期格式示例2024-08-23
* @param type repair 工单统计 end 工单完成情况 eval 评价情况
*/ */
@RequiresPermissions(value = {"repair:manage:operator"}) @RequiresPermissions(value = {"repair:manage:operator"})
@RequestMapping("repairStats") @RequestMapping("repairStats")
public R repairStats() { public R repairStats(String startDate, String endDate, String type) {
return R.ok().put("currentMonth", repairWorkerStatsService.repairStats(true)) Date start, end;
.put("currentYear", repairWorkerStatsService.repairStats(false)); try {
start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate + " 00:00:00");
end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate + " 23:59:59");
} catch (Exception e) {
return R.error("参数错误");
}
return R.ok().put("data", repairWorkerStatsService.repairStats(start, end, type));
} }
/** /**
* 第四行 左侧 楼层负责人情况统计 * 第四行 左侧 楼层负责人情况统计
* 日期格式示例2024-08-23
*/ */
@RequiresPermissions(value = {"repair:manage:operator"}) @RequiresPermissions(value = {"repair:manage:operator"})
@RequestMapping("floorStats") @RequestMapping("floorStats")
public R floorStats(String date) { public R floorStats(String startDate, String endDate) {
return R.ok().put("data", repairWorkerStatsService.floorStats(date)); Date start, end;
try {
start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate + " 00:00:00");
end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate + " 23:59:59");
} catch (Exception e) {
return R.error("参数错误");
}
return R.ok().put("data", repairWorkerStatsService.floorStats(start, end));
} }
/** /**
* 第四行 右上 设备故障统计 * 第四行 右上 设备故障统计
* 日期格式示例2024-08-23
*/ */
@RequiresPermissions(value = {"repair:manage:operator"}) @RequiresPermissions(value = {"repair:manage:operator"})
@RequestMapping("deviceStats") @RequestMapping("deviceStats")
public R deviceStats(String date) { public R deviceStats(String startDate, String endDate) {
return R.ok().put("data", repairWorkerStatsService.deviceStats(date)); Date start, end;
try {
start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate + " 00:00:00");
end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate + " 23:59:59");
} catch (Exception e) {
return R.error("参数错误");
}
return R.ok().put("data", repairWorkerStatsService.deviceStats(start, end));
} }
/** /**
* 第四行 右下 故障类型统计 * 第四行 右下 故障类型统计
* 日期格式示例2024-08-23
*/ */
@RequiresPermissions(value = {"repair:manage:operator"}) @RequiresPermissions(value = {"repair:manage:operator"})
@RequestMapping("failureStats") @RequestMapping("failureStats")
public R failureStats(String date) { public R failureStats(String startDate, String endDate) {
return R.ok().put("data", repairWorkerStatsService.failureStats(date)); Date start, end;
try {
start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate + " 00:00:00");
end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate + " 23:59:59");
} catch (Exception e) {
return R.error("参数错误");
}
return R.ok().put("data", repairWorkerStatsService.failureStats(start, end));
} }
/** /**
* 第五行 设备品牌评价 统计 * 第五行 设备品牌评价 统计
* 日期格式示例2024-08-23
*/ */
@RequiresPermissions(value = {"repair:manage:operator"}) @RequiresPermissions(value = {"repair:manage:operator"})
@RequestMapping("deviceTypeStats") @RequestMapping("deviceTypeStats")
public R deviceTypeStats(String date) { public R deviceTypeStats(String startDate, String endDate) {
Date start, end;
try {
start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate + " 00:00:00");
end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate + " 23:59:59");
} catch (Exception e) {
return R.error("参数错误");
}
startPage(); startPage();
return result(repairWorkerStatsService.deviceTypeStats(date)); return result(repairWorkerStatsService.deviceTypeStats(start, end));
} }
} }

View File

@ -64,7 +64,7 @@ public class Repair extends BaseEntity<Repair> {
/** /**
* 报修地点id * 报修地点id
*/ */
private String addressId; private Long addressId;
/** /**
* 报修地点名称 * 报修地点名称
*/ */
@ -72,7 +72,7 @@ public class Repair extends BaseEntity<Repair> {
/** /**
* 报修楼层id * 报修楼层id
*/ */
private String floorId; private Long floorId;
/** /**
* 报修楼层名称 * 报修楼层名称
*/ */

View File

@ -23,6 +23,10 @@ public class RepairAddressFloor extends BaseEntity<RepairAddressFloor> {
* 楼层名称 * 楼层名称
*/ */
private String name; private String name;
/**
* 楼层编码
*/
private String bm;
/** 楼层管理员id */ /** 楼层管理员id */
private Long adminId; private Long adminId;
@ -33,7 +37,9 @@ public class RepairAddressFloor extends BaseEntity<RepairAddressFloor> {
/** 备注 */ /** 备注 */
private String remark; private String remark;
private String ext1;
private String ext2;
private String ext3;

View File

@ -22,6 +22,11 @@ public class RepairDeviceType extends BaseEntity<RepairDeviceType> {
/** 名称 */ /** 名称 */
private String name; private String name;
/**
* 该设备类型预计需要完成的天数
*/
private Integer days;
@TableField(exist = false) @TableField(exist = false)
private Long staffId; private Long staffId;
@ -42,5 +47,9 @@ public class RepairDeviceType extends BaseEntity<RepairDeviceType> {
/** 备注 */ /** 备注 */
private String remark; private String remark;
private String ext1;
private String ext2;
private String ext3;
} }

View File

@ -22,13 +22,12 @@ public interface RepairMapper {
*/ */
Repair selectRepairById(Long id); Repair selectRepairById(Long id);
List<Repair> normalRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName); /**
* 查询工单列表
List<Repair> preRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName); * @param repairParam
* @return
List<Repair> workRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName); */
List<Repair> repairList(Repair repairParam);
List<Repair> adminRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName,@Param("sn") String sn,@Param("typeName") String typeName,@Param("deviceName") String deviceName,@Param("status") String status);
/** /**
* 维修工 工单 数量统计 * 维修工 工单 数量统计
@ -38,12 +37,6 @@ public interface RepairMapper {
*/ */
Integer workerRepairNumber(@Param("userId") String userId, @Param("type") String type); Integer workerRepairNumber(@Param("userId") String userId, @Param("type") String type);
/**
* 楼层管理管工单列表
* @param floorerId 楼层管理员id
* @return
*/
List<Repair> floorRepairList(@Param("floorerId") String floorerId, @Param("type") String type, @Param("repairName") String repairName);
/** /**
* 新增工单 * 新增工单
* *

View File

@ -36,24 +36,17 @@ public interface IRepairService {
Repair selectRepairById(Long id); Repair selectRepairById(Long id);
/** /**
* @param menu 1.普通用户3派单员5维修人, 7管理员
* 查询工单列表 * 查询工单列表
* role 1.普通用户3派单员5维修人, 7管理员, 9 楼层管理员
* @param repairParam 工单查询参数
*/ */
List<Repair> repairList(String menu, String userId, String type ,String repairName,String sn,String typeName,String deviceName,String status); List<Repair> repairList(Repair repairParam);
/** /**
* 获取维修人员工单数量 * 获取维修人员工单数量
* @param userId 用户id * @param userId 用户id
*/ */
Map<String,Integer> workerRepairNumber(String userId); Map<String,Integer> workerRepairNumber(String userId);
/**
* 楼层管理管工单列表
* @param floorerId 管理员id
* @return
*/
List<Repair> floorRepairList(String floorerId);
/** /**
* 新增工单 * 新增工单
* *

View File

@ -43,28 +43,28 @@ public interface IRepairStatsService {
/** /**
* 第二三行 工单统计工单完成情况评价情况 * 第二三行 工单统计工单完成情况评价情况
* *
* @param isMonth true 本月false 本年 * @param type repair 工单统计 end 工单完成情况 eval 评价情况
* @return * @return
*/ */
Map<String, Object> repairStats(boolean isMonth); Map<String, Object> repairStats(Date start, Date end, String type);
/** /**
* 第四行 左侧 楼层负责人情况统计 * 第四行 左侧 楼层负责人情况统计
*/ */
Map<String, Object> floorStats(String date); Map<String, Object> floorStats(Date start, Date end);
/** /**
* 第四行 右上 设备故障统计 * 第四行 右上 设备故障统计
*/ */
Map<String, Object> deviceStats(String date); Map<String, Object> deviceStats(Date start, Date end);
/** /**
* 第四行 右下 故障类型统计 * 第四行 右下 故障类型统计
*/ */
List<Map<String, Object>> failureStats(String date); List<Map<String, Object>> failureStats(Date start, Date end);
/** /**
* 第五行 设备品牌评价 统计 * 第五行 设备品牌评价 统计
*/ */
List<RepairDivceTypeStatsVo> deviceTypeStats(String date); List<RepairDivceTypeStatsVo> deviceTypeStats(Date start, Date end);
} }

View File

@ -1,11 +1,13 @@
package com.ics.admin.service.impl; package com.ics.admin.service.impl;
import com.ics.admin.domain.Repair; import com.ics.admin.domain.Repair;
import com.ics.admin.domain.RepairDeviceType;
import com.ics.admin.domain.RepairLog; import com.ics.admin.domain.RepairLog;
import com.ics.admin.domain.RepairRelational; import com.ics.admin.domain.RepairRelational;
import com.ics.admin.domain.RepairRemind; import com.ics.admin.domain.RepairRemind;
import com.ics.admin.mapper.IcsCustomerStaffMapper; import com.ics.admin.mapper.IcsCustomerStaffMapper;
import com.ics.admin.mapper.RepairAttachMapper; import com.ics.admin.mapper.RepairAttachMapper;
import com.ics.admin.mapper.RepairDeviceTypeMapper;
import com.ics.admin.mapper.RepairLogMapper; import com.ics.admin.mapper.RepairLogMapper;
import com.ics.admin.mapper.RepairMapper; import com.ics.admin.mapper.RepairMapper;
import com.ics.admin.mapper.RepairRelationalMapper; import com.ics.admin.mapper.RepairRelationalMapper;
@ -45,6 +47,9 @@ public class RepairServiceImpl implements IRepairService {
@Autowired @Autowired
private ISnService snService; private ISnService snService;
@Autowired
private RepairDeviceTypeMapper repairDeviceTypeMapper;
@Autowired @Autowired
private RepairRelationalMapper repairRelationalMapper; private RepairRelationalMapper repairRelationalMapper;
@ -116,12 +121,16 @@ public class RepairServiceImpl implements IRepairService {
//没有设置维修人员则到派单环节否则到修理工是否接收环节 //没有设置维修人员则到派单环节否则到修理工是否接收环节
to = repair.getRepairUserId() == null ? 1 : 5; to = repair.getRepairUserId() == null ? 1 : 5;
if (repair.getTypeId() == null) return "表单设备类型数据为空"; if (repair.getTypeId() == null) return "表单设备类型数据为空";
RepairDeviceType repairDeviceType=repairDeviceTypeMapper.selectRepairDeviceTypeById(repair.getTypeId());
if (repairDeviceType == null) return "设备类型无效";
List<RepairRelational> listRelational = repairRelationalMapper.selectDispatcherByTypeId(repair.getTypeId()); List<RepairRelational> listRelational = repairRelationalMapper.selectDispatcherByTypeId(repair.getTypeId());
if (listRelational == null || listRelational.size() == 0) return "根据表单设备类型找不到派单员"; if (listRelational == null || listRelational.size() == 0) return "根据表单设备类型找不到派单员";
nextUser = customerStaffMapper.selectIcsCustomerStaffById(listRelational.get(0).getUserId());//查询派单员 nextUser = customerStaffMapper.selectIcsCustomerStaffById(listRelational.get(0).getUserId());//查询派单员
if (nextUser == null) return "没有找到派单员账号"; if (nextUser == null) return "没有找到派单员账号";
repair.setSn(snService.generate(Sn.Type.REPAIR));//编单号 repair.setSn(snService.generate(Sn.Type.REPAIR));//编单号
repair.setPerUserId(nextUser.getId());//设置派单员 repair.setPerUserId(nextUser.getId());//设置派单员
int days=repairDeviceType.getDays();
repair.setPreDate(new Date(now.getTime() + (days * 24 * 60 * 60 * 1000)));//设置预计完成时间
repair.setTimeout(1);//告警默认绿色 repair.setTimeout(1);//告警默认绿色
repair.setWarn(1);//预警默认绿色 repair.setWarn(1);//预警默认绿色
repair.setDeleteFlag(0); repair.setDeleteFlag(0);
@ -139,7 +148,8 @@ public class RepairServiceImpl implements IRepairService {
nextUser = customerStaffMapper.selectIcsCustomerStaffById(repair.getRepairUserId()); nextUser = customerStaffMapper.selectIcsCustomerStaffById(repair.getRepairUserId());
if (nextUser == null) return "派单没有找到下一步执行人"; if (nextUser == null) return "派单没有找到下一步执行人";
newRepair.setRepairUserId(nextUser.getId()); newRepair.setRepairUserId(nextUser.getId());
newRepair.setPreDate(repair.getPreDate());//设置预计完成时间 newRepair.setRepairLevel(repair.getRepairLevel());//设置故障等级
//newRepair.setPreDate(repair.getPreDate());//设置预计完成时间
} }
if (FlowOperate.BACK.equals(operate)) { if (FlowOperate.BACK.equals(operate)) {
to = 3; to = 3;
@ -337,14 +347,8 @@ public class RepairServiceImpl implements IRepairService {
* 查询工单列表 * 查询工单列表
*/ */
@Override @Override
public List<Repair> repairList(String menu, String userId, String type, String repairName,String sn,String typeName,String deviceName,String status) { public List<Repair> repairList(Repair repairParam) {
List<Repair> list = null; List<Repair> list = repairMapper.repairList(repairParam);
//1.普通用户3派单员5维修人, 7管理员 ,9楼层管理员
if ("9".equals(menu)) list = repairMapper.floorRepairList(userId, type, repairName);
if ("7".equals(menu)) list = repairMapper.adminRepairList(userId, type, repairName,sn,typeName,deviceName,status);
if ("5".equals(menu)) list = repairMapper.workRepairList(userId, type, repairName);
if ("3".equals(menu)) list = repairMapper.preRepairList(userId, type, repairName);
if ("1".equals(menu)) list = repairMapper.normalRepairList(userId, type, repairName);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (Repair repair : list) { for (Repair repair : list) {
if (repair.getPerUserId() != null && repair.getPerUserId() > 0) { if (repair.getPerUserId() != null && repair.getPerUserId() > 0) {
@ -380,11 +384,6 @@ public class RepairServiceImpl implements IRepairService {
return map; return map;
} }
@Override
public List<Repair> floorRepairList(String floorerId) {
return repairMapper.floorRepairList(floorerId, "all", null);
}
/** /**
* 新增工单 * 新增工单
* *

View File

@ -62,15 +62,14 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
} }
@Override @Override
public Map<String, Object> repairStats(boolean isMonth) { public Map<String, Object> repairStats(Date start, Date end, String type) {
List<RepairStatsVo> list = isMonth ? List<RepairStatsVo> list = repairStatsMapper.repairStats(start, end);
repairStatsMapper.repairStats(getDate(null, 2, true), getDate(null, 2, false)) :
repairStatsMapper.repairStats(getDate(null, 3, true), getDate(null, 3, false));
if (list == null || list.size() == 0) return null;
RepairStatsVo repairStatsVo = list.get(0);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (list == null || list.size() == 0) return map;
RepairStatsVo repairStatsVo = list.get(0);
if ("repair".equals(type)) {
map.put("stats", repairStatsVo); map.put("stats", repairStatsVo);
} else if ("end".equals(type)) {
List<Map<String, Object>> wc = new ArrayList<>(); List<Map<String, Object>> wc = new ArrayList<>();
wc.add(getMap("已完成", repairStatsVo.getWc())); wc.add(getMap("已完成", repairStatsVo.getWc()));
wc.add(getMap("未完成", repairStatsVo.getZs() - repairStatsVo.getWc())); wc.add(getMap("未完成", repairStatsVo.getZs() - repairStatsVo.getWc()));
@ -81,19 +80,20 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
timeout.add(getMap("轻微超时", repairStatsVo.getLtimeout())); timeout.add(getMap("轻微超时", repairStatsVo.getLtimeout()));
timeout.add(getMap("未超时", repairStatsVo.getNtimeout())); timeout.add(getMap("未超时", repairStatsVo.getNtimeout()));
map.put("timeout", timeout); map.put("timeout", timeout);
} else if ("eval".equals(type)) {
List<Map<String, Object>> pj = new ArrayList<>(); List<Map<String, Object>> pj = new ArrayList<>();
pj.add(getMap("好评", repairStatsVo.getH())); pj.add(getMap("好评", repairStatsVo.getH()));
pj.add(getMap("中评", repairStatsVo.getM())); pj.add(getMap("中评", repairStatsVo.getM()));
pj.add(getMap("差评", repairStatsVo.getL())); pj.add(getMap("差评", repairStatsVo.getL()));
map.put("pj", pj); map.put("pj", pj);
}
return map; return map;
} }
@Override @Override
public Map<String, Object> floorStats(String date) { public Map<String, Object> floorStats(Date start, Date end) {
Date[] dates = getStartEndTime(date); List<RepairFloorStatsVo> list = repairStatsMapper.floorStats(start, end);
if (dates == null) return null;
List<RepairFloorStatsVo> list = repairStatsMapper.floorStats(dates[0], dates[1]);
List<String> y = new ArrayList<>(); List<String> y = new ArrayList<>();
List<Long> zs = new ArrayList<>(); List<Long> zs = new ArrayList<>();
List<Long> wc = new ArrayList<>(); List<Long> wc = new ArrayList<>();
@ -110,10 +110,8 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
} }
@Override @Override
public Map<String, Object> deviceStats(String date) { public Map<String, Object> deviceStats(Date start, Date end) {
Date[] dates = getStartEndTime(date); List<RepairFloorStatsVo> list = repairStatsMapper.deviceStats(start, end);
if (dates == null) return null;
List<RepairFloorStatsVo> list = repairStatsMapper.deviceStats(dates[0], dates[1]);
List<String> x = new ArrayList<>(); List<String> x = new ArrayList<>();
List<Long> zs = new ArrayList<>(); List<Long> zs = new ArrayList<>();
List<Long> wc = new ArrayList<>(); List<Long> wc = new ArrayList<>();
@ -130,10 +128,8 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
} }
@Override @Override
public List<Map<String, Object>> failureStats(String date) { public List<Map<String, Object>> failureStats(Date start, Date end) {
Date[] dates = getStartEndTime(date); List<RepairFloorStatsVo> list = repairStatsMapper.failureStats(start, end);
if (dates == null) return null;
List<RepairFloorStatsVo> list = repairStatsMapper.failureStats(dates[0], dates[1]);
List<Map<String, Object>> data = new ArrayList<>(); List<Map<String, Object>> data = new ArrayList<>();
for (RepairFloorStatsVo repairFloorStatsVo : list) { for (RepairFloorStatsVo repairFloorStatsVo : list) {
data.add(getMap(repairFloorStatsVo.getName(), repairFloorStatsVo.getZs())); data.add(getMap(repairFloorStatsVo.getName(), repairFloorStatsVo.getZs()));
@ -142,10 +138,8 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
} }
@Override @Override
public List<RepairDivceTypeStatsVo> deviceTypeStats(String date) { public List<RepairDivceTypeStatsVo> deviceTypeStats(Date start, Date end) {
Date[] dates = getStartEndTime(date); List<RepairDivceTypeStatsVo> list = repairStatsMapper.deviceTypeStats(start, end);
if (dates == null) return null;
List<RepairDivceTypeStatsVo> list = repairStatsMapper.deviceTypeStats(dates[0], dates[1]);
for (RepairDivceTypeStatsVo rdtStatsVo : list) { for (RepairDivceTypeStatsVo rdtStatsVo : list) {
rdtStatsVo.setWcl(compute(rdtStatsVo.getClosed(), rdtStatsVo.getZs())); rdtStatsVo.setWcl(compute(rdtStatsVo.getClosed(), rdtStatsVo.getZs()));
rdtStatsVo.setHl(compute(rdtStatsVo.getH(), rdtStatsVo.getPj())); rdtStatsVo.setHl(compute(rdtStatsVo.getH(), rdtStatsVo.getPj()));
@ -169,25 +163,25 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
/** /**
* 解析开始时间和结束时间 * 解析开始时间和结束时间
*/ */
private Date[] getStartEndTime(String date) { // private Date[] getStartEndTime(String date) {
if (StringUtils.isBlank(date)) return null; // if (StringUtils.isBlank(date)) return null;
Date startTime, endTime; // Date startTime, endTime;
try { // try {
if (date.indexOf("-") > 1) {//年月 // if (date.indexOf("-") > 1) {//年月
String[] ym = date.split("-"); // String[] ym = date.split("-");
Calendar calendar = getCalendar(Integer.valueOf(ym[0]), Integer.valueOf(ym[1])); // Calendar calendar = getCalendar(Integer.valueOf(ym[0]), Integer.valueOf(ym[1]));
startTime = getDate(calendar, 2, true); // startTime = getDate(calendar, 2, true);
endTime = getDate(calendar, 2, false); // endTime = getDate(calendar, 2, false);
} else {// // } else {//
Calendar calendar = getCalendar(Integer.valueOf(date), 0); // Calendar calendar = getCalendar(Integer.valueOf(date), 0);
startTime = getDate(calendar, 3, true); // startTime = getDate(calendar, 3, true);
endTime = getDate(calendar, 3, false); // endTime = getDate(calendar, 3, false);
} // }
return new Date[]{startTime, endTime}; // return new Date[]{startTime, endTime};
} catch (NumberFormatException e) { // } catch (NumberFormatException e) {
return null; // return null;
} // }
} // }
private Map<String, Object> getMap(String name, Object value) { private Map<String, Object> getMap(String name, Object value) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
@ -199,12 +193,12 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
/** /**
* 获取指定年月的日历 Calendar c = getCalendar(2024, 9); * 获取指定年月的日历 Calendar c = getCalendar(2024, 9);
*/ */
private Calendar getCalendar(int year, int month) { // private Calendar getCalendar(int year, int month) {
Calendar calendar = Calendar.getInstance(); // Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year); // calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month > 0 ? month - 1 : month); // calendar.set(Calendar.MONTH, month > 0 ? month - 1 : month);
return calendar; // return calendar;
} // }
/** /**
* 获取边界日期 * 获取边界日期
@ -214,23 +208,23 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
* @param start ture 开始时间 false 结束时间 * @param start ture 开始时间 false 结束时间
* @return * @return
*/ */
private Date getDate(Calendar calendar, int type, boolean start) { // private Date getDate(Calendar calendar, int type, boolean start) {
if (calendar == null) calendar = Calendar.getInstance(); // if (calendar == null) calendar = Calendar.getInstance();
String time = start ? " 00:00:00" : " 23:59:59"; // String time = start ? " 00:00:00" : " 23:59:59";
if (type == 1) { // if (type == 1) {
calendar.setFirstDayOfWeek(Calendar.MONDAY); // calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.set(Calendar.DAY_OF_WEEK, calendar.getFirstDayOfWeek()); // calendar.set(Calendar.DAY_OF_WEEK, calendar.getFirstDayOfWeek());
if (!start) calendar.add(Calendar.DAY_OF_MONTH, 6); // if (!start) calendar.add(Calendar.DAY_OF_MONTH, 6);
return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.dateTime(calendar.getTime()) + time); // return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.dateTime(calendar.getTime()) + time);
} // }
if (type == 2) { // if (type == 2) {
calendar.set(Calendar.DAY_OF_MONTH, start ? calendar.getActualMinimum(Calendar.DAY_OF_MONTH) : calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); // calendar.set(Calendar.DAY_OF_MONTH, start ? calendar.getActualMinimum(Calendar.DAY_OF_MONTH) : calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.dateTime(calendar.getTime()) + time); // return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.dateTime(calendar.getTime()) + time);
} // }
if (type == 3) { // if (type == 3) {
calendar.set(Calendar.DAY_OF_YEAR, start ? calendar.getActualMinimum(Calendar.DAY_OF_YEAR) : calendar.getActualMaximum(Calendar.DAY_OF_YEAR)); // calendar.set(Calendar.DAY_OF_YEAR, start ? calendar.getActualMinimum(Calendar.DAY_OF_YEAR) : calendar.getActualMaximum(Calendar.DAY_OF_YEAR));
return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.dateTime(calendar.getTime()) + time); // return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.dateTime(calendar.getTime()) + time);
} // }
return null; // return null;
} // }
} }

View File

@ -0,0 +1,26 @@
package com.ics.admin.utils;
import com.ics.admin.domain.Repair;
import lombok.Data;
import java.io.Serializable;
/**
* 工单列表查询 传输参数体
* created at 2024-8-21 22:28
*
* @author lujiang
* @version 1.0.0
* @since 1.0.0
*/
@Data
public class RepairListDTO implements Serializable {
private static final long serialVersionUID = -202408212230L;
private String role;
private String type;
private Repair repair;
}

View File

@ -8,8 +8,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" /> <result property="id" column="id" />
<result property="addressId" column="address_id" /> <result property="addressId" column="address_id" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="bm" column="bm" />
<result property="adminId" column="admin_Id" /> <result property="adminId" column="admin_Id" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="ext1" column="ext1" />
<result property="ext2" column="ext2" />
<result property="ext3" column="ext3" />
<result property="deleteFlag" column="delete_flag" /> <result property="deleteFlag" column="delete_flag" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@ -20,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectRepairAddressFloorVo"> <sql id="selectRepairAddressFloorVo">
SELECT id, address_id, name, admin_Id, remark, delete_flag, create_by, create_time, update_by, update_time, tenant_id, park_id FROM ics_repair_address_floor SELECT id, address_id, name, bm, admin_Id, remark, ext1, ext2, ext3, delete_flag, create_by, create_time, update_by, update_time, tenant_id, park_id FROM ics_repair_address_floor
</sql> </sql>
<select id="selectRepairAddressFloorList" parameterType="RepairAddressFloor" resultMap="RepairAddressFloorResult"> <select id="selectRepairAddressFloorList" parameterType="RepairAddressFloor" resultMap="RepairAddressFloorResult">
@ -40,8 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="addressId != null ">address_id,</if> <if test="addressId != null ">address_id,</if>
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">name,</if>
<if test="bm != null and bm != ''">bm,</if>
<if test="adminId != null ">admin_Id,</if> <if test="adminId != null ">admin_Id,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="ext1 != null and ext1 != ''">ext1,</if>
<if test="ext2 != null and ext2 != ''">ext2,</if>
<if test="ext3 != null and ext3 != ''">ext3,</if>
<if test="deleteFlag != null and deleteFlag != ''">delete_flag,</if> <if test="deleteFlag != null and deleteFlag != ''">delete_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null ">create_time,</if> <if test="createTime != null ">create_time,</if>
@ -53,8 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="addressId != null ">#{addressId},</if> <if test="addressId != null ">#{addressId},</if>
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
<if test="bm != null and bm != ''">#{bm},</if>
<if test="adminId != null ">#{adminId},</if> <if test="adminId != null ">#{adminId},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="ext1 != null and ext1 != ''">#{ext1},</if>
<if test="ext2 != null and ext2 != ''">#{ext2},</if>
<if test="ext3 != null and ext3 != ''">#{ext3},</if>
<if test="deleteFlag != null and deleteFlag != ''">#{deleteFlag},</if> <if test="deleteFlag != null and deleteFlag != ''">#{deleteFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null ">#{createTime},</if> <if test="createTime != null ">#{createTime},</if>
@ -70,8 +82,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="addressId != null ">address_id = #{addressId},</if> <if test="addressId != null ">address_id = #{addressId},</if>
<if test="name != null and name != ''">name = #{name},</if> <if test="name != null and name != ''">name = #{name},</if>
<if test="bm != null and bm != ''">name = #{bm},</if>
<if test="adminId != null ">admin_Id = #{adminId},</if> <if test="adminId != null ">admin_Id = #{adminId},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if> <if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="ext1 != null and ext1 != ''">ext1 = #{ext1},</if>
<if test="ext2 != null and ext2 != ''">ext2 = #{ext2},</if>
<if test="ext3 != null and ext3 != ''">ext3 = #{ext3},</if>
<if test="deleteFlag != null and deleteFlag != ''">delete_flag = #{deleteFlag},</if> <if test="deleteFlag != null and deleteFlag != ''">delete_flag = #{deleteFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if> <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null ">create_time = #{createTime},</if> <if test="createTime != null ">create_time = #{createTime},</if>

View File

@ -7,7 +7,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.ics.admin.domain.RepairDeviceType" id="RepairDeviceTypeResult"> <resultMap type="com.ics.admin.domain.RepairDeviceType" id="RepairDeviceTypeResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="days" column="days" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="ext1" column="ext1" />
<result property="ext2" column="ext2" />
<result property="ext3" column="ext3" />
<result property="deleteFlag" column="delete_flag" /> <result property="deleteFlag" column="delete_flag" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@ -18,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectRepairDeviceTypeVo"> <sql id="selectRepairDeviceTypeVo">
SELECT id, name, remark, delete_flag, create_by, create_time, update_by, update_time, tenant_id, park_id FROM ics_repair_device_type SELECT id, name, `days`, remark, ext1, ext2, ext3, delete_flag, create_by, create_time, update_by, update_time, tenant_id, park_id FROM ics_repair_device_type
</sql> </sql>
<select id="selectRepairDeviceTypeList" parameterType="RepairDeviceType" resultMap="RepairDeviceTypeResult"> <select id="selectRepairDeviceTypeList" parameterType="RepairDeviceType" resultMap="RepairDeviceTypeResult">
@ -30,14 +34,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRepairDeviceTypeById" parameterType="Long" resultMap="RepairDeviceTypeResult"> <select id="selectRepairDeviceTypeById" parameterType="Long" resultMap="RepairDeviceTypeResult">
<include refid="selectRepairDeviceTypeVo"/> <include refid="selectRepairDeviceTypeVo"/>
WHERE id = #{id} WHERE id = #{id} and delete_flag=0
</select> </select>
<insert id="insertRepairDeviceType" parameterType="RepairDeviceType" useGeneratedKeys="true" keyProperty="id"> <insert id="insertRepairDeviceType" parameterType="RepairDeviceType" useGeneratedKeys="true" keyProperty="id">
INSERT INTO ics_repair_device_type INSERT INTO ics_repair_device_type
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">name,</if>
<if test="days != null ">`days`,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="ext1 != null and ext1 != ''">ext1,</if>
<if test="ext2 != null and ext2 != ''">ext2,</if>
<if test="ext3 != null and ext3 != ''">ext3,</if>
<if test="deleteFlag != null and deleteFlag != ''">delete_flag,</if> <if test="deleteFlag != null and deleteFlag != ''">delete_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null ">create_time,</if> <if test="createTime != null ">create_time,</if>
@ -49,6 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="ext1 != null and ext1 != ''">#{ext1},</if>
<if test="ext2 != null and ext2 != ''">#{ext2},</if>
<if test="ext3 != null and ext3 != ''">#{ext3},</if>
<if test="deleteFlag != null and deleteFlag != ''">#{deleteFlag},</if> <if test="deleteFlag != null and deleteFlag != ''">#{deleteFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null ">#{createTime},</if> <if test="createTime != null ">#{createTime},</if>
@ -63,7 +74,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UPDATE ics_repair_device_type UPDATE ics_repair_device_type
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if> <if test="name != null and name != ''">name = #{name},</if>
<if test="days != null ">`days` = #{days},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if> <if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="ext1 != null and ext1 != ''">ext1 = #{ext1},</if>
<if test="ext2 != null and ext2 != ''">ext2 = #{ext2},</if>
<if test="ext3 != null and ext3 != ''">ext3 = #{ext3},</if>
<if test="deleteFlag != null and deleteFlag != ''">delete_flag = #{deleteFlag},</if> <if test="deleteFlag != null and deleteFlag != ''">delete_flag = #{deleteFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if> <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null ">create_time = #{createTime},</if> <if test="createTime != null ">create_time = #{createTime},</if>

View File

@ -201,54 +201,59 @@
</trim> </trim>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<!--普通用户--> <!--普通用户 工单列表-->
<select id="normalRepairList" resultMap="RepairResult"> <select id="repairList" parameterType="Repair" resultMap="RepairResult">
<include refid="selectRepairVo"/> <!--1.普通用户3派单员5维修人, 7管理员 ,9楼层管理员-->
where delete_flag = 0 and create_by = #{userId} <if test="params.role == 1 or params.role == 3 or params.role == 5 or params.role == 7">
<if test="type == 'all'"></if> SELECT * FROM ics_repair rep where delete_flag = 0
<if test="type == 'process'">and status <![CDATA[ < ]]> 9 </if> </if>
<if test="type == 'evaling'">and status = 9</if> <if test="params.role == 9">
<if test="type == 'evaled'">and status = 13</if> select rep.* from ics_repair rep,ics_repair_address_floor floor where
<if test="type == 'invalid'">and status = 11</if> rep.delete_flag=0 and floor.delete_flag=0 and floor.id=rep.floor_id and floor.admin_id= #{params.userId}
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if> </if>
order by create_time desc <if test="params.role == 1"> and create_by = #{params.userId}</if>
</select> <if test="params.role == 3"> and per_userid = #{params.userId}</if>
<if test="params.role == 5"> and repair_user_id = #{params.userId}</if>
<!--普通用户、楼层管理员、管理员 都会用到以下分类-->
<if test="params.type == 'all'"></if>
<if test="params.type == 'process'"> and rep.status &lt;=7 </if>
<if test="params.type == 'evaling'"> and rep.status = 9</if>
<if test="params.type == 'evaled'"> and rep.status = 13</if>
<if test="params.type == 'invalid'"> and rep.status = 11</if>
<!--派单员--> <!--派单员-->
<select id="preRepairList" resultMap="RepairResult"> <if test="params.role == 3">
<include refid="selectRepairVo"/> <if test="params.type == 'wait'"> and status = 1</if>
where delete_flag = 0 and per_userid = #{userId} <if test="params.type == 'already'"><![CDATA[ and (status>=5 and status<=13 and status<> 11)]]></if>
<if test="type == 'anew'">and status = 3</if> </if>
<if test="type == 'wait'">and status = 1</if>
<if test="type == 'already'">and status <![CDATA[ > ]]> 3 and status <![CDATA[ <> ]]> 11</if>
<if test="type == 'close'">and status = 11</if>
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
order by create_time desc
</select>
<!--维修人员--> <!--维修人员-->
<select id="workRepairList" resultMap="RepairResult"> <if test="params.role == 5">
<include refid="selectRepairVo"/> <if test="params.type == 'wait'"> and status = 5</if>
where delete_flag = 0 and repair_user_id = #{userId} <if test="params.type == 'process'"> and status = 7</if>
<if test="type == 'wait'">and status = 5</if> <if test="params.type == 'end'"> and (status = 9 or status = 13)</if>
<if test="type == 'working'">and status = 7</if> </if>
<if test="type == 'close'">and (status = 9 or status = 13)</if>
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
order by create_time desc
</select>
<!--管理员--> <!--管理员-->
<select id="adminRepairList" resultMap="RepairResult"> <if test="params.role == 7">
<include refid="selectRepairVo"/> <if test="params.type == 'wait'"> and status = 1</if>
where delete_flag = 0 <if test="params.type == 'anew'"> and status = 3</if>
<if test="type == 'anew'">and status = 3</if> <if test="params.type == 'already'"><![CDATA[ and (status>=5 and status<=13 and status<> 11)]]></if>
<if test="type == 'invalid'">and status = 11</if> </if>
<if test="type == 'all'"></if> <if test="params.beginTime != null and params.endTime != null"> and rep.create_time between #{params.beginTime} and #{params.endTime}</if>
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if> <if test="sn != null and sn != ''"> AND rep.sn LIKE CONCAT('%', #{sn}, '%')</if>
<if test="sn != null and sn != ''"> AND sn LIKE CONCAT('%', #{sn}, '%')</if> <if test="repairLevel != null and repairLevel != ''"> AND rep.repair_level LIKE CONCAT('%', #{repairLevel}, '%')</if>
<if test="typeName != null and typeName != ''"> AND type_name LIKE CONCAT('%', #{typeName}, '%')</if> <if test="typeId != null"> AND rep.type_id = #{typeId}</if>
<if test="deviceName != null and deviceName != ''"> AND device_name LIKE CONCAT('%', #{deviceName}, '%')</if> <if test="deviceId != null"> AND rep.device_id = #{deviceId}</if>
<if test="status != null and status != ''"> AND status = #{status}</if> <if test="name != null and name != ''"> AND rep.name LIKE CONCAT('%', #{name}, '%')</if>
<if test="phone != null and phone != ''"> AND rep.phone LIKE CONCAT('%', #{phone}, '%')</if>
<if test="addressId != null"> AND rep.address_id = #{addressId}</if>
<if test="floorId != null"> AND rep.floor_id = #{floorId}</if>
<if test="room != null and room != ''"> AND rep.room LIKE CONCAT('%', #{room}, '%')</if>
<if test="explain != null and explain != ''"> AND rep.`explain` LIKE CONCAT('%', #{explain}, '%')</if>
<if test="failureTypeId != null"> AND rep.failure_type_id = #{failureTypeId}</if>
order by create_time desc order by create_time desc
</select> </select>
<select id="workerRepairNumber" resultType="Integer"> <select id="workerRepairNumber" resultType="Integer">
select count(id) from ics_repair where delete_flag=0 and repair_user_id = #{userId} 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 == 'wait'">and status = 5</if>
@ -256,20 +261,6 @@
<if test="type == 'close'">and (status = 9 or status = 13)</if> <if test="type == 'close'">and (status = 9 or status = 13)</if>
</select> </select>
<!-- 楼层管理员 工单列表 -->
<select id="floorRepairList" resultMap="RepairResult">
select
rep.*
from
ics_repair rep,ics_repair_address_floor floor
where
rep.delete_flag=0 and floor.delete_flag=0 and floor.id=rep.floor_id and floor.admin_id= #{floorerId}
<if test="type == 'invalid'">and rep.status = 11</if>
<if test="type == 'all'"></if>
<if test="repairName != null and repairName != ''"> AND rep.repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
order by create_time desc
</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>