mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 12:29:36 +08:00
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:
commit
335eeadd13
@ -3,13 +3,17 @@ package com.ics.admin.controller;
|
||||
import com.ics.admin.domain.Repair;
|
||||
import com.ics.admin.domain.RepairAttach;
|
||||
import com.ics.admin.domain.RepairLog;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IRepairAttachService;
|
||||
import com.ics.admin.service.IRepairLogService;
|
||||
import com.ics.admin.service.IRepairService;
|
||||
import com.ics.admin.utils.RepairDTO;
|
||||
import com.ics.admin.utils.RepairListDTO;
|
||||
import com.ics.admin.vo.RepairAttachVO;
|
||||
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.utils.DateUtils;
|
||||
import com.ics.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -20,6 +24,7 @@ import org.wf.jwtp.annotation.Logical;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -43,15 +48,17 @@ public class RepairController extends BaseController {
|
||||
@Autowired
|
||||
private IRepairAttachService repairAttachService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
/**
|
||||
* 报修
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@PostMapping("flow/start")
|
||||
public R startFlow(@RequestBody RepairDTO repairDTO) {
|
||||
System.out.println("1111111111"+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);
|
||||
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 楼层管理员
|
||||
* <p>
|
||||
* 报修查询:全部、处理中、待评价、已评价、无效申请 type对应值:all、process、evaling、evaled、invalid
|
||||
* 派单入口:重新派单、待派单、已派单、已关闭(无效申请) type对应值:anew、wait、already、close
|
||||
* 维修入口:待完成、进行中、已完成 type对应值:wait、working、close
|
||||
* 管理员:重派单,全部,无效申请 type对应值:anew、all、invalid 【小程序暂时用不到】
|
||||
* 楼层管理员:全部、无效申请 type对应值:all、invalid
|
||||
* role 1.普通用户,3派单员,5维修人员, 7管理员, 9 楼层管理员
|
||||
*
|
||||
* name : 工单名称搜索关键字
|
||||
* </p>
|
||||
* 【报修查询】 普通用户,管理员, 楼层管理员
|
||||
* 全部、处理中、待评价、已评价、无效申请
|
||||
* type值:all、process、evaling、evaled、invalid
|
||||
* 【派单入口】
|
||||
* 管理员:
|
||||
* 重新派单、待派单、已派单、无效申请
|
||||
* type值:anew、wait、already、invalid
|
||||
* 派单员:
|
||||
* 待派单、已派单、无效申请
|
||||
* type值:wait、already、invalid
|
||||
* 【维修入口】
|
||||
* 待完成、进行中、已完成
|
||||
* type对应值:wait、process、end
|
||||
* 【查询条件】
|
||||
* 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值:all、process-1、3、5、7、evaling-9、evaled-13、invalid-11
|
||||
*
|
||||
* 派单员
|
||||
* 待派单、已派单、无效申请
|
||||
* type值:wait-1、already-5、7、9、13、invalid-11
|
||||
*
|
||||
* 维修人员
|
||||
* 待完成、进行中、已完成
|
||||
* type值:wait-5、process-7、end-9、13
|
||||
*
|
||||
* 管理员:
|
||||
* 全部、重新派单、待派单、已派单、处理中、待评价、已评价、无效申请
|
||||
* type值:all、anew-3、wait-1、already-5、7、9、13、process-1、3、5、7、evaling-9、evaled-13、invalid-11
|
||||
*
|
||||
* 楼层管理员
|
||||
* type值:all、process-1、3、5、7、evaling-9、evaled-13、invalid-11
|
||||
* ========================================================================
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator", "member:center:view"}, logical = Logical.OR)
|
||||
@RequestMapping("list")
|
||||
public R list(@RequestBody Map<String, String> map) {
|
||||
String type = map.get("type");
|
||||
String menu = map.get("menu");
|
||||
String repairName = map.get("name");
|
||||
String sn = map.get("sn");
|
||||
String typeName = map.get("typeName");
|
||||
String deviceName = map.get("deviceName");
|
||||
String status = map.get("status");
|
||||
if (StringUtils.isBlank(type) || StringUtils.isBlank(menu)) return R.error();
|
||||
startPage();
|
||||
public R list(@RequestBody RepairListDTO repairListDTO) {
|
||||
Repair repair = repairListDTO.getRepair();
|
||||
if (repair == null) repair = new Repair();
|
||||
String role = repairListDTO.getRole();
|
||||
String type = repairListDTO.getType();
|
||||
if (StringUtils.isBlank(type) || StringUtils.isBlank(role)) return R.error();
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ics.admin.domain.Repair;
|
||||
import com.ics.admin.vo.RepairAdminStatsVo;
|
||||
import com.ics.admin.vo.RepairFloorStatsVo;
|
||||
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.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
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
|
||||
@ -46,8 +52,14 @@ public class RepairStatsController extends BaseController {
|
||||
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||
@RequestMapping("oneWorkerList")
|
||||
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();
|
||||
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"})
|
||||
@RequestMapping("oneFloorList")
|
||||
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();
|
||||
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"})
|
||||
@RequestMapping("repairStats")
|
||||
public R repairStats() {
|
||||
return R.ok().put("currentMonth", repairWorkerStatsService.repairStats(true))
|
||||
.put("currentYear", repairWorkerStatsService.repairStats(false));
|
||||
public R repairStats(String startDate, String endDate, String type) {
|
||||
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.repairStats(start, end, type));
|
||||
}
|
||||
|
||||
/**
|
||||
* 第四行 左侧 楼层负责人情况统计
|
||||
* 日期格式示例:2024-08-23
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||
@RequestMapping("floorStats")
|
||||
public R floorStats(String date) {
|
||||
return R.ok().put("data", repairWorkerStatsService.floorStats(date));
|
||||
public R floorStats(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("参数错误");
|
||||
}
|
||||
return R.ok().put("data", repairWorkerStatsService.floorStats(start, end));
|
||||
}
|
||||
|
||||
/**
|
||||
* 第四行 右上 设备故障统计
|
||||
* 日期格式示例:2024-08-23
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||
@RequestMapping("deviceStats")
|
||||
public R deviceStats(String date) {
|
||||
return R.ok().put("data", repairWorkerStatsService.deviceStats(date));
|
||||
public R deviceStats(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("参数错误");
|
||||
}
|
||||
return R.ok().put("data", repairWorkerStatsService.deviceStats(start, end));
|
||||
}
|
||||
|
||||
/**
|
||||
* 第四行 右下 故障类型统计
|
||||
* 日期格式示例:2024-08-23
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||
@RequestMapping("failureStats")
|
||||
public R failureStats(String date) {
|
||||
return R.ok().put("data", repairWorkerStatsService.failureStats(date));
|
||||
public R failureStats(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("参数错误");
|
||||
}
|
||||
return R.ok().put("data", repairWorkerStatsService.failureStats(start, end));
|
||||
}
|
||||
|
||||
/**
|
||||
* 第五行 设备、品牌、评价 统计
|
||||
* 日期格式示例:2024-08-23
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||
@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();
|
||||
return result(repairWorkerStatsService.deviceTypeStats(date));
|
||||
return result(repairWorkerStatsService.deviceTypeStats(start, end));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class Repair extends BaseEntity<Repair> {
|
||||
/**
|
||||
* 报修地点id
|
||||
*/
|
||||
private String addressId;
|
||||
private Long addressId;
|
||||
/**
|
||||
* 报修地点名称
|
||||
*/
|
||||
@ -72,7 +72,7 @@ public class Repair extends BaseEntity<Repair> {
|
||||
/**
|
||||
* 报修楼层id
|
||||
*/
|
||||
private String floorId;
|
||||
private Long floorId;
|
||||
/**
|
||||
* 报修楼层名称
|
||||
*/
|
||||
|
@ -23,6 +23,10 @@ public class RepairAddressFloor extends BaseEntity<RepairAddressFloor> {
|
||||
* 楼层名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 楼层编码
|
||||
*/
|
||||
private String bm;
|
||||
|
||||
/** 楼层管理员id */
|
||||
private Long adminId;
|
||||
@ -33,7 +37,9 @@ public class RepairAddressFloor extends BaseEntity<RepairAddressFloor> {
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
private String ext1;
|
||||
private String ext2;
|
||||
private String ext3;
|
||||
|
||||
|
||||
|
||||
|
@ -22,6 +22,11 @@ public class RepairDeviceType extends BaseEntity<RepairDeviceType> {
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 该设备类型预计需要完成的天数
|
||||
*/
|
||||
private Integer days;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long staffId;
|
||||
|
||||
@ -42,5 +47,9 @@ public class RepairDeviceType extends BaseEntity<RepairDeviceType> {
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
private String ext1;
|
||||
private String ext2;
|
||||
private String ext3;
|
||||
|
||||
|
||||
}
|
||||
|
@ -22,13 +22,12 @@ public interface RepairMapper {
|
||||
*/
|
||||
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);
|
||||
|
||||
List<Repair> workRepairList(@Param("userId") String userId, @Param("type") String type, @Param("repairName") String repairName);
|
||||
|
||||
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);
|
||||
/**
|
||||
* 查询工单列表
|
||||
* @param repairParam
|
||||
* @return
|
||||
*/
|
||||
List<Repair> repairList(Repair repairParam);
|
||||
|
||||
/**
|
||||
* 维修工 工单 数量统计
|
||||
@ -38,12 +37,6 @@ public interface RepairMapper {
|
||||
*/
|
||||
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);
|
||||
/**
|
||||
* 新增工单
|
||||
*
|
||||
|
@ -36,24 +36,17 @@ public interface IRepairService {
|
||||
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
|
||||
*/
|
||||
Map<String,Integer> workerRepairNumber(String userId);
|
||||
|
||||
/**
|
||||
* 楼层管理管工单列表
|
||||
* @param floorerId 管理员id
|
||||
* @return
|
||||
*/
|
||||
List<Repair> floorRepairList(String floorerId);
|
||||
|
||||
/**
|
||||
* 新增工单
|
||||
*
|
||||
|
@ -43,28 +43,28 @@ public interface IRepairStatsService {
|
||||
/**
|
||||
* 第二、三行 工单统计、工单完成情况、评价情况
|
||||
*
|
||||
* @param isMonth true 本月,false 本年
|
||||
* @param type repair 工单统计 end 工单完成情况 eval 评价情况
|
||||
* @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);
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import com.ics.admin.domain.Repair;
|
||||
import com.ics.admin.domain.RepairDeviceType;
|
||||
import com.ics.admin.domain.RepairLog;
|
||||
import com.ics.admin.domain.RepairRelational;
|
||||
import com.ics.admin.domain.RepairRemind;
|
||||
import com.ics.admin.mapper.IcsCustomerStaffMapper;
|
||||
import com.ics.admin.mapper.RepairAttachMapper;
|
||||
import com.ics.admin.mapper.RepairDeviceTypeMapper;
|
||||
import com.ics.admin.mapper.RepairLogMapper;
|
||||
import com.ics.admin.mapper.RepairMapper;
|
||||
import com.ics.admin.mapper.RepairRelationalMapper;
|
||||
@ -45,6 +47,9 @@ public class RepairServiceImpl implements IRepairService {
|
||||
@Autowired
|
||||
private ISnService snService;
|
||||
|
||||
@Autowired
|
||||
private RepairDeviceTypeMapper repairDeviceTypeMapper;
|
||||
|
||||
@Autowired
|
||||
private RepairRelationalMapper repairRelationalMapper;
|
||||
|
||||
@ -116,12 +121,16 @@ public class RepairServiceImpl implements IRepairService {
|
||||
//没有设置维修人员则到派单环节,否则到“修理工是否接收”环节
|
||||
to = repair.getRepairUserId() == null ? 1 : 5;
|
||||
if (repair.getTypeId() == null) return "表单设备类型数据为空";
|
||||
RepairDeviceType repairDeviceType=repairDeviceTypeMapper.selectRepairDeviceTypeById(repair.getTypeId());
|
||||
if (repairDeviceType == null) return "设备类型无效";
|
||||
List<RepairRelational> listRelational = repairRelationalMapper.selectDispatcherByTypeId(repair.getTypeId());
|
||||
if (listRelational == null || listRelational.size() == 0) return "根据表单设备类型找不到派单员";
|
||||
nextUser = customerStaffMapper.selectIcsCustomerStaffById(listRelational.get(0).getUserId());//查询派单员
|
||||
if (nextUser == null) return "没有找到派单员账号";
|
||||
repair.setSn(snService.generate(Sn.Type.REPAIR));//编单号
|
||||
repair.setPerUserId(nextUser.getId());//设置派单员
|
||||
int days=repairDeviceType.getDays();
|
||||
repair.setPreDate(new Date(now.getTime() + (days * 24 * 60 * 60 * 1000)));//设置预计完成时间
|
||||
repair.setTimeout(1);//告警默认绿色
|
||||
repair.setWarn(1);//预警默认绿色
|
||||
repair.setDeleteFlag(0);
|
||||
@ -139,7 +148,8 @@ public class RepairServiceImpl implements IRepairService {
|
||||
nextUser = customerStaffMapper.selectIcsCustomerStaffById(repair.getRepairUserId());
|
||||
if (nextUser == null) return "派单没有找到下一步执行人";
|
||||
newRepair.setRepairUserId(nextUser.getId());
|
||||
newRepair.setPreDate(repair.getPreDate());//设置预计完成时间
|
||||
newRepair.setRepairLevel(repair.getRepairLevel());//设置故障等级
|
||||
//newRepair.setPreDate(repair.getPreDate());//设置预计完成时间
|
||||
}
|
||||
if (FlowOperate.BACK.equals(operate)) {
|
||||
to = 3;
|
||||
@ -337,14 +347,8 @@ public class RepairServiceImpl implements IRepairService {
|
||||
* 查询工单列表
|
||||
*/
|
||||
@Override
|
||||
public List<Repair> repairList(String menu, String userId, String type, String repairName,String sn,String typeName,String deviceName,String status) {
|
||||
List<Repair> list = null;
|
||||
//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);
|
||||
public List<Repair> repairList(Repair repairParam) {
|
||||
List<Repair> list = repairMapper.repairList(repairParam);
|
||||
if (list != null && list.size() > 0) {
|
||||
for (Repair repair : list) {
|
||||
if (repair.getPerUserId() != null && repair.getPerUserId() > 0) {
|
||||
@ -380,11 +384,6 @@ public class RepairServiceImpl implements IRepairService {
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Repair> floorRepairList(String floorerId) {
|
||||
return repairMapper.floorRepairList(floorerId, "all", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工单
|
||||
*
|
||||
|
@ -62,38 +62,38 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> repairStats(boolean isMonth) {
|
||||
List<RepairStatsVo> list = isMonth ?
|
||||
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);
|
||||
public Map<String, Object> repairStats(Date start, Date end, String type) {
|
||||
List<RepairStatsVo> list = repairStatsMapper.repairStats(start, end);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("stats", repairStatsVo);
|
||||
List<Map<String, Object>> wc = new ArrayList<>();
|
||||
wc.add(getMap("已完成", repairStatsVo.getWc()));
|
||||
wc.add(getMap("未完成", repairStatsVo.getZs() - repairStatsVo.getWc()));
|
||||
map.put("wc", wc);
|
||||
List<Map<String, Object>> timeout = new ArrayList<>();
|
||||
timeout.add(getMap("严重超时", repairStatsVo.getHtimeout()));
|
||||
timeout.add(getMap("超时", repairStatsVo.getMtimeout()));
|
||||
timeout.add(getMap("轻微超时", repairStatsVo.getLtimeout()));
|
||||
timeout.add(getMap("未超时", repairStatsVo.getNtimeout()));
|
||||
map.put("timeout", timeout);
|
||||
List<Map<String, Object>> pj = new ArrayList<>();
|
||||
pj.add(getMap("好评", repairStatsVo.getH()));
|
||||
pj.add(getMap("中评", repairStatsVo.getM()));
|
||||
pj.add(getMap("差评", repairStatsVo.getL()));
|
||||
map.put("pj", pj);
|
||||
if (list == null || list.size() == 0) return map;
|
||||
RepairStatsVo repairStatsVo = list.get(0);
|
||||
if ("repair".equals(type)) {
|
||||
map.put("stats", repairStatsVo);
|
||||
} else if ("end".equals(type)) {
|
||||
List<Map<String, Object>> wc = new ArrayList<>();
|
||||
wc.add(getMap("已完成", repairStatsVo.getWc()));
|
||||
wc.add(getMap("未完成", repairStatsVo.getZs() - repairStatsVo.getWc()));
|
||||
map.put("wc", wc);
|
||||
List<Map<String, Object>> timeout = new ArrayList<>();
|
||||
timeout.add(getMap("严重超时", repairStatsVo.getHtimeout()));
|
||||
timeout.add(getMap("超时", repairStatsVo.getMtimeout()));
|
||||
timeout.add(getMap("轻微超时", repairStatsVo.getLtimeout()));
|
||||
timeout.add(getMap("未超时", repairStatsVo.getNtimeout()));
|
||||
map.put("timeout", timeout);
|
||||
} else if ("eval".equals(type)) {
|
||||
List<Map<String, Object>> pj = new ArrayList<>();
|
||||
pj.add(getMap("好评", repairStatsVo.getH()));
|
||||
pj.add(getMap("中评", repairStatsVo.getM()));
|
||||
pj.add(getMap("差评", repairStatsVo.getL()));
|
||||
map.put("pj", pj);
|
||||
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> floorStats(String date) {
|
||||
Date[] dates = getStartEndTime(date);
|
||||
if (dates == null) return null;
|
||||
List<RepairFloorStatsVo> list = repairStatsMapper.floorStats(dates[0], dates[1]);
|
||||
public Map<String, Object> floorStats(Date start, Date end) {
|
||||
List<RepairFloorStatsVo> list = repairStatsMapper.floorStats(start, end);
|
||||
List<String> y = new ArrayList<>();
|
||||
List<Long> zs = new ArrayList<>();
|
||||
List<Long> wc = new ArrayList<>();
|
||||
@ -110,10 +110,8 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> deviceStats(String date) {
|
||||
Date[] dates = getStartEndTime(date);
|
||||
if (dates == null) return null;
|
||||
List<RepairFloorStatsVo> list = repairStatsMapper.deviceStats(dates[0], dates[1]);
|
||||
public Map<String, Object> deviceStats(Date start, Date end) {
|
||||
List<RepairFloorStatsVo> list = repairStatsMapper.deviceStats(start, end);
|
||||
List<String> x = new ArrayList<>();
|
||||
List<Long> zs = new ArrayList<>();
|
||||
List<Long> wc = new ArrayList<>();
|
||||
@ -130,10 +128,8 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> failureStats(String date) {
|
||||
Date[] dates = getStartEndTime(date);
|
||||
if (dates == null) return null;
|
||||
List<RepairFloorStatsVo> list = repairStatsMapper.failureStats(dates[0], dates[1]);
|
||||
public List<Map<String, Object>> failureStats(Date start, Date end) {
|
||||
List<RepairFloorStatsVo> list = repairStatsMapper.failureStats(start, end);
|
||||
List<Map<String, Object>> data = new ArrayList<>();
|
||||
for (RepairFloorStatsVo repairFloorStatsVo : list) {
|
||||
data.add(getMap(repairFloorStatsVo.getName(), repairFloorStatsVo.getZs()));
|
||||
@ -142,10 +138,8 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairDivceTypeStatsVo> deviceTypeStats(String date) {
|
||||
Date[] dates = getStartEndTime(date);
|
||||
if (dates == null) return null;
|
||||
List<RepairDivceTypeStatsVo> list = repairStatsMapper.deviceTypeStats(dates[0], dates[1]);
|
||||
public List<RepairDivceTypeStatsVo> deviceTypeStats(Date start, Date end) {
|
||||
List<RepairDivceTypeStatsVo> list = repairStatsMapper.deviceTypeStats(start, end);
|
||||
for (RepairDivceTypeStatsVo rdtStatsVo : list) {
|
||||
rdtStatsVo.setWcl(compute(rdtStatsVo.getClosed(), rdtStatsVo.getZs()));
|
||||
rdtStatsVo.setHl(compute(rdtStatsVo.getH(), rdtStatsVo.getPj()));
|
||||
@ -169,25 +163,25 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
|
||||
/**
|
||||
* 解析开始时间和结束时间
|
||||
*/
|
||||
private Date[] getStartEndTime(String date) {
|
||||
if (StringUtils.isBlank(date)) return null;
|
||||
Date startTime, endTime;
|
||||
try {
|
||||
if (date.indexOf("-") > 1) {//年月
|
||||
String[] ym = date.split("-");
|
||||
Calendar calendar = getCalendar(Integer.valueOf(ym[0]), Integer.valueOf(ym[1]));
|
||||
startTime = getDate(calendar, 2, true);
|
||||
endTime = getDate(calendar, 2, false);
|
||||
} else {//年
|
||||
Calendar calendar = getCalendar(Integer.valueOf(date), 0);
|
||||
startTime = getDate(calendar, 3, true);
|
||||
endTime = getDate(calendar, 3, false);
|
||||
}
|
||||
return new Date[]{startTime, endTime};
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// private Date[] getStartEndTime(String date) {
|
||||
// if (StringUtils.isBlank(date)) return null;
|
||||
// Date startTime, endTime;
|
||||
// try {
|
||||
// if (date.indexOf("-") > 1) {//年月
|
||||
// String[] ym = date.split("-");
|
||||
// Calendar calendar = getCalendar(Integer.valueOf(ym[0]), Integer.valueOf(ym[1]));
|
||||
// startTime = getDate(calendar, 2, true);
|
||||
// endTime = getDate(calendar, 2, false);
|
||||
// } else {//年
|
||||
// Calendar calendar = getCalendar(Integer.valueOf(date), 0);
|
||||
// startTime = getDate(calendar, 3, true);
|
||||
// endTime = getDate(calendar, 3, false);
|
||||
// }
|
||||
// return new Date[]{startTime, endTime};
|
||||
// } catch (NumberFormatException e) {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
private Map<String, Object> getMap(String name, Object value) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
@ -199,12 +193,12 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
|
||||
/**
|
||||
* 获取指定年月的日历 Calendar c = getCalendar(2024, 9);
|
||||
*/
|
||||
private Calendar getCalendar(int year, int month) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.YEAR, year);
|
||||
calendar.set(Calendar.MONTH, month > 0 ? month - 1 : month);
|
||||
return calendar;
|
||||
}
|
||||
// private Calendar getCalendar(int year, int month) {
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.set(Calendar.YEAR, year);
|
||||
// calendar.set(Calendar.MONTH, month > 0 ? month - 1 : month);
|
||||
// return calendar;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取边界日期
|
||||
@ -214,23 +208,23 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
|
||||
* @param start ture 开始时间 false 结束时间
|
||||
* @return
|
||||
*/
|
||||
private Date getDate(Calendar calendar, int type, boolean start) {
|
||||
if (calendar == null) calendar = Calendar.getInstance();
|
||||
String time = start ? " 00:00:00" : " 23:59:59";
|
||||
if (type == 1) {
|
||||
calendar.setFirstDayOfWeek(Calendar.MONDAY);
|
||||
calendar.set(Calendar.DAY_OF_WEEK, calendar.getFirstDayOfWeek());
|
||||
if (!start) calendar.add(Calendar.DAY_OF_MONTH, 6);
|
||||
return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.dateTime(calendar.getTime()) + time);
|
||||
}
|
||||
if (type == 2) {
|
||||
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);
|
||||
}
|
||||
if (type == 3) {
|
||||
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 null;
|
||||
}
|
||||
// private Date getDate(Calendar calendar, int type, boolean start) {
|
||||
// if (calendar == null) calendar = Calendar.getInstance();
|
||||
// String time = start ? " 00:00:00" : " 23:59:59";
|
||||
// if (type == 1) {
|
||||
// calendar.setFirstDayOfWeek(Calendar.MONDAY);
|
||||
// calendar.set(Calendar.DAY_OF_WEEK, calendar.getFirstDayOfWeek());
|
||||
// if (!start) calendar.add(Calendar.DAY_OF_MONTH, 6);
|
||||
// return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.dateTime(calendar.getTime()) + time);
|
||||
// }
|
||||
// if (type == 2) {
|
||||
// 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);
|
||||
// }
|
||||
// if (type == 3) {
|
||||
// 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 null;
|
||||
// }
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
}
|
@ -8,8 +8,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="id" column="id" />
|
||||
<result property="addressId" column="address_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="bm" column="bm" />
|
||||
<result property="adminId" column="admin_Id" />
|
||||
<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="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -20,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<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>
|
||||
|
||||
<select id="selectRepairAddressFloorList" parameterType="RepairAddressFloor" resultMap="RepairAddressFloorResult">
|
||||
@ -40,8 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="addressId != null ">address_id,</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="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="createBy != null and createBy != ''">create_by,</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=",">
|
||||
<if test="addressId != null ">#{addressId},</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="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="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
@ -70,8 +82,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="addressId != null ">address_id = #{addressId},</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="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="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
|
@ -7,7 +7,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="com.ics.admin.domain.RepairDeviceType" id="RepairDeviceTypeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="days" column="days" />
|
||||
<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="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -18,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<include refid="selectRepairDeviceTypeVo"/>
|
||||
WHERE id = #{id}
|
||||
WHERE id = #{id} and delete_flag=0
|
||||
</select>
|
||||
|
||||
<insert id="insertRepairDeviceType" parameterType="RepairDeviceType" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO ics_repair_device_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="days != null ">`days`,</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="createBy != null and createBy != ''">create_by,</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=",">
|
||||
<if test="name != null and name != ''">#{name},</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="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
@ -63,7 +74,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
UPDATE ics_repair_device_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<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="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="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
|
@ -201,54 +201,59 @@
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<!--普通用户-->
|
||||
<select id="normalRepairList" resultMap="RepairResult">
|
||||
<include refid="selectRepairVo"/>
|
||||
where delete_flag = 0 and create_by = #{userId}
|
||||
<if test="type == 'all'"></if>
|
||||
<if test="type == 'process'">and status <![CDATA[ < ]]> 9 </if>
|
||||
<if test="type == 'evaling'">and status = 9</if>
|
||||
<if test="type == 'evaled'">and status = 13</if>
|
||||
<if test="type == 'invalid'">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="preRepairList" resultMap="RepairResult">
|
||||
<include refid="selectRepairVo"/>
|
||||
where delete_flag = 0 and per_userid = #{userId}
|
||||
<if test="type == 'anew'">and status = 3</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">
|
||||
<include refid="selectRepairVo"/>
|
||||
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>
|
||||
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
<!--管理员-->
|
||||
<select id="adminRepairList" resultMap="RepairResult">
|
||||
<include refid="selectRepairVo"/>
|
||||
where delete_flag = 0
|
||||
<if test="type == 'anew'">and status = 3</if>
|
||||
<if test="type == 'invalid'">and status = 11</if>
|
||||
<if test="type == 'all'"></if>
|
||||
<if test="repairName != null and repairName != ''"> AND repair_name LIKE CONCAT('%', #{repairName}, '%')</if>
|
||||
<if test="sn != null and sn != ''"> AND sn LIKE CONCAT('%', #{sn}, '%')</if>
|
||||
<if test="typeName != null and typeName != ''"> AND type_name LIKE CONCAT('%', #{typeName}, '%')</if>
|
||||
<if test="deviceName != null and deviceName != ''"> AND device_name LIKE CONCAT('%', #{deviceName}, '%')</if>
|
||||
<if test="status != null and status != ''"> AND status = #{status}</if>
|
||||
<!--普通用户 工单列表-->
|
||||
<select id="repairList" parameterType="Repair" resultMap="RepairResult">
|
||||
<!--1.普通用户,3派单员,5维修人, 7管理员 ,9楼层管理员-->
|
||||
<if test="params.role == 1 or params.role == 3 or params.role == 5 or params.role == 7">
|
||||
SELECT * FROM ics_repair rep where delete_flag = 0
|
||||
</if>
|
||||
<if test="params.role == 9">
|
||||
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= #{params.userId}
|
||||
</if>
|
||||
<if test="params.role == 1"> and create_by = #{params.userId}</if>
|
||||
<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 <=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>
|
||||
<!--派单员-->
|
||||
<if test="params.role == 3">
|
||||
<if test="params.type == 'wait'"> and status = 1</if>
|
||||
<if test="params.type == 'already'"><![CDATA[ and (status>=5 and status<=13 and status<> 11)]]></if>
|
||||
</if>
|
||||
<!--维修人员-->
|
||||
<if test="params.role == 5">
|
||||
<if test="params.type == 'wait'"> and status = 5</if>
|
||||
<if test="params.type == 'process'"> and status = 7</if>
|
||||
<if test="params.type == 'end'"> and (status = 9 or status = 13)</if>
|
||||
</if>
|
||||
<!--管理员-->
|
||||
<if test="params.role == 7">
|
||||
<if test="params.type == 'wait'"> and status = 1</if>
|
||||
<if test="params.type == 'anew'"> and status = 3</if>
|
||||
<if test="params.type == 'already'"><![CDATA[ and (status>=5 and status<=13 and status<> 11)]]></if>
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.endTime != null"> and rep.create_time between #{params.beginTime} and #{params.endTime}</if>
|
||||
<if test="sn != null and sn != ''"> AND rep.sn LIKE CONCAT('%', #{sn}, '%')</if>
|
||||
<if test="repairLevel != null and repairLevel != ''"> AND rep.repair_level LIKE CONCAT('%', #{repairLevel}, '%')</if>
|
||||
<if test="typeId != null"> AND rep.type_id = #{typeId}</if>
|
||||
<if test="deviceId != null"> AND rep.device_id = #{deviceId}</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
|
||||
</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>
|
||||
@ -256,20 +261,6 @@
|
||||
<if test="type == 'close'">and (status = 9 or status = 13)</if>
|
||||
</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 FROM ics_repair WHERE id = #{id}
|
||||
</delete>
|
||||
|
Loading…
x
Reference in New Issue
Block a user