mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 20:39:37 +08:00
Merge remote-tracking branch 'origin/shoot-hand' into shoot-hand
This commit is contained in:
commit
98c57ab65b
@ -1,7 +1,9 @@
|
|||||||
package com.ics.admin.controller;
|
package com.ics.admin.controller;
|
||||||
|
|
||||||
import com.ics.admin.domain.RepairFloorStatsVo;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ics.admin.domain.RepairWorkerStatsVo;
|
import com.ics.admin.vo.RepairAdminStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairFloorStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairWorkerStatsVo;
|
||||||
import com.ics.admin.service.IRepairService;
|
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;
|
||||||
@ -68,4 +70,23 @@ public class RepairStatsController extends BaseController {
|
|||||||
return result(repairService.floorRepairList(floorerId));
|
return result(repairService.floorRepairList(floorerId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第一行 管理员 工单与 通知统计
|
||||||
|
*/
|
||||||
|
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||||
|
@RequestMapping("repairAdminStats")
|
||||||
|
public R repairAdminStats() {
|
||||||
|
RepairAdminStatsVo repairAdminStatsVo = repairWorkerStatsService.repairAdminStats();
|
||||||
|
return R.ok().put("repairAdminStats", repairAdminStatsVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第二、三行 工单统计、工单完成情况、评价情况
|
||||||
|
*/
|
||||||
|
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||||
|
@RequestMapping("repairStats")
|
||||||
|
public R repairStats() {
|
||||||
|
return R.ok().put("currentMonth", repairWorkerStatsService.repairStats(true))
|
||||||
|
.put("currentYear", repairWorkerStatsService.repairStats(false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,12 +166,11 @@ public class Repair extends BaseEntity<Repair> {
|
|||||||
|
|
||||||
//--超时
|
//--超时
|
||||||
/**
|
/**
|
||||||
* 设置超时时间
|
* 超时告警 0 无状态 ;默认 1 绿色 (未达告警状态值) 3橙色告警 5红色告警;根据 预计完成时间 判断
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
private Integer timeout = 0;
|
||||||
private Date timeout;
|
|
||||||
|
|
||||||
/** 预警状态, 默认0 没有预警;设置时间后 1 绿色 3橙色 5红色 */
|
/** 预警状态, 0 没有预警; 默认 1 绿色 3橙色 5红色;根据 预计完成时间 判断*/
|
||||||
private Integer warn = 0;
|
private Integer warn = 0;
|
||||||
|
|
||||||
//工单状态,流程相关
|
//工单状态,流程相关
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
package com.ics.admin.domain;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* created at 2024-8-15 21:46
|
|
||||||
*
|
|
||||||
* @author lujiang
|
|
||||||
* @version 1.0.0
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public class RepairStatsByTimeVo implements Serializable {
|
|
||||||
private static final long serialVersionUID = -202408152311L;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -77,19 +77,33 @@ public interface RepairMapper {
|
|||||||
*/
|
*/
|
||||||
int deleteRepairByIds(String[] ids);
|
int deleteRepairByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 红色告警
|
||||||
|
*
|
||||||
|
* @param day 超时大于day天红色预警
|
||||||
|
*/
|
||||||
|
int repairTimeoutRed(Integer day);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 橙色预警
|
||||||
|
*
|
||||||
|
* @param day 超时大于day天橙色预警
|
||||||
|
*/
|
||||||
|
int repairTimeoutOrange(Integer day);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 红色预警
|
* 红色预警
|
||||||
*
|
*
|
||||||
* @param day 小于day天红色预警
|
* @param day 小于day天红色预警
|
||||||
*/
|
*/
|
||||||
int repairTimeOutRed(Integer day);
|
int repairForewarnRed(Integer day);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 橙色预警
|
* 橙色预警
|
||||||
*
|
*
|
||||||
* @param day 小于day天橙色预警
|
* @param day 小于day天橙色预警
|
||||||
*/
|
*/
|
||||||
int repairTimeOutOrange(Integer day);
|
int repairForewarnOrange(Integer day);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单结束后解除预警
|
* 工单结束后解除预警
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
package com.ics.admin.mapper;
|
package com.ics.admin.mapper;
|
||||||
|
|
||||||
import com.ics.admin.domain.RepairFloorStatsVo;
|
import com.ics.admin.vo.RepairAdminStatsVo;
|
||||||
import com.ics.admin.domain.RepairWorkerStatsVo;
|
import com.ics.admin.vo.RepairFloorStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairWorkerStatsVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,4 +34,16 @@ public interface RepairStatsMapper {
|
|||||||
* @return VIEW集合
|
* @return VIEW集合
|
||||||
*/
|
*/
|
||||||
List<RepairFloorStatsVo> selectRepairFloorStatsVoList(RepairFloorStatsVo repairFloorStatsVo);
|
List<RepairFloorStatsVo> selectRepairFloorStatsVoList(RepairFloorStatsVo repairFloorStatsVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第一行 管理员 工单与 通知统计
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RepairAdminStatsVo> repairAdminStats();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第二、三行 工单统计、工单完成情况、评价情况
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RepairStatsVo> repairStats(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||||
}
|
}
|
||||||
|
@ -77,10 +77,16 @@ public interface IRepairService {
|
|||||||
*/
|
*/
|
||||||
int deleteRepairById(Long id);
|
int deleteRepairById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单超时告警
|
||||||
|
*/
|
||||||
|
int repairTimeOut();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单超时预警
|
* 工单超时预警
|
||||||
*/
|
*/
|
||||||
int repairTimeOutWarn();
|
int repairForewarnWarn();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单结束后解除预警
|
* 工单结束后解除预警
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
package com.ics.admin.service;
|
package com.ics.admin.service;
|
||||||
|
|
||||||
import com.ics.admin.domain.RepairFloorStatsVo;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ics.admin.domain.RepairWorkerStatsVo;
|
import com.ics.admin.vo.RepairAdminStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairFloorStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairWorkerStatsVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修人员统计接口
|
* 维修人员统计接口
|
||||||
@ -27,4 +31,15 @@ public interface IRepairStatsService {
|
|||||||
* @return VIEW集合
|
* @return VIEW集合
|
||||||
*/
|
*/
|
||||||
List<RepairFloorStatsVo> selectRepairFloorStatsVoList(RepairFloorStatsVo repairFloorStatsVo);
|
List<RepairFloorStatsVo> selectRepairFloorStatsVoList(RepairFloorStatsVo repairFloorStatsVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第一行 管理员 工单与 通知统计
|
||||||
|
*/
|
||||||
|
RepairAdminStatsVo repairAdminStats();
|
||||||
|
/**
|
||||||
|
* 第二、三行 工单统计、工单完成情况、评价情况
|
||||||
|
* @param isMonth true 本月,false 本年
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> repairStats(boolean isMonth);
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ public class RepairServiceImpl implements IRepairService {
|
|||||||
Integer from = -1, to = -1;
|
Integer from = -1, to = -1;
|
||||||
Repair newRepair = repair.getId() == null || repair.getId() == 0L ? repair : repairMapper.selectRepairById(repair.getId());//使用数据库中的表单
|
Repair newRepair = repair.getId() == null || repair.getId() == 0L ? repair : repairMapper.selectRepairById(repair.getId());//使用数据库中的表单
|
||||||
from = repair.getId() == null || repair.getId() == 0L ? 0 : newRepair.getStatus();
|
from = repair.getId() == null || repair.getId() == 0L ? 0 : newRepair.getStatus();
|
||||||
//保修
|
//报修
|
||||||
if (from == 0) {
|
if (from == 0) {
|
||||||
//没有设置维修人员则到派单环节,否则到“修理工是否接收”环节
|
//没有设置维修人员则到派单环节,否则到“修理工是否接收”环节
|
||||||
to = repair.getRepairUserId() == null ? 1 : 5;
|
to = repair.getRepairUserId() == null ? 1 : 5;
|
||||||
@ -101,7 +101,8 @@ public class RepairServiceImpl implements IRepairService {
|
|||||||
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());//设置派单员
|
||||||
repair.setWarn(0);
|
repair.setTimeout(1);//告警默认绿色
|
||||||
|
repair.setWarn(1);//预警默认绿色
|
||||||
repair.setDeleteFlag(0);
|
repair.setDeleteFlag(0);
|
||||||
repair.setCreateBy(currentUserId.toString());
|
repair.setCreateBy(currentUserId.toString());
|
||||||
repair.setCreateTime(new Date());
|
repair.setCreateTime(new Date());
|
||||||
@ -328,18 +329,32 @@ public class RepairServiceImpl implements IRepairService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int repairTimeOutWarn() {
|
public int repairTimeOut() {
|
||||||
List<DictData> list = dictDataService.selectDictDataByType("repair_timeout");
|
List<DictData> list = dictDataService.selectDictDataByType("repair_timeout");
|
||||||
if (list.size() == 2) {
|
if (list.size() == 4) {
|
||||||
Integer orange = Integer.valueOf(list.get(0).getDictValue());
|
Integer orange = Integer.valueOf(list.get(2).getDictValue());
|
||||||
Integer red = Integer.valueOf(list.get(1).getDictValue());
|
Integer red = Integer.valueOf(list.get(3).getDictValue());
|
||||||
int r = repairMapper.repairTimeOutRed(red);
|
int r = repairMapper.repairTimeoutRed(red);
|
||||||
int o = repairMapper.repairTimeOutOrange(orange);
|
int o = repairMapper.repairTimeoutOrange(orange);
|
||||||
return r + o;
|
return r + o;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int repairForewarnWarn() {
|
||||||
|
List<DictData> list = dictDataService.selectDictDataByType("repair_timeout");
|
||||||
|
if (list.size() == 4) {
|
||||||
|
Integer orange = Integer.valueOf(list.get(0).getDictValue());
|
||||||
|
Integer red = Integer.valueOf(list.get(1).getDictValue());
|
||||||
|
int r = repairMapper.repairForewarnRed(red);
|
||||||
|
int o = repairMapper.repairForewarnOrange(orange);
|
||||||
|
return r + o;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int removeWarn() {
|
public int removeWarn() {
|
||||||
return repairMapper.removeWarn();
|
return repairMapper.removeWarn();
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
package com.ics.admin.service.impl;
|
package com.ics.admin.service.impl;
|
||||||
|
|
||||||
import com.ics.admin.domain.RepairFloorStatsVo;
|
|
||||||
import com.ics.admin.domain.RepairWorkerStatsVo;
|
|
||||||
import com.ics.admin.mapper.RepairStatsMapper;
|
import com.ics.admin.mapper.RepairStatsMapper;
|
||||||
import com.ics.admin.service.IRepairStatsService;
|
import com.ics.admin.service.IRepairStatsService;
|
||||||
|
import com.ics.admin.vo.RepairAdminStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairFloorStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairStatsVo;
|
||||||
|
import com.ics.admin.vo.RepairWorkerStatsVo;
|
||||||
import com.ics.common.utils.DateUtils;
|
import com.ics.common.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* created at 2024-8-15 20:34
|
* created at 2024-8-15 20:34
|
||||||
@ -46,23 +51,50 @@ public class RepairStatsServiceImpl implements IRepairStatsService {
|
|||||||
return repairStatsMapper.selectRepairFloorStatsVoList(repairFloorStatsVo);
|
return repairStatsMapper.selectRepairFloorStatsVoList(repairFloorStatsVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RepairAdminStatsVo repairAdminStats() {
|
||||||
|
List<RepairAdminStatsVo> list = repairStatsMapper.repairAdminStats();
|
||||||
|
if (list != null && list.size() > 0) return list.get(0);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
@Override
|
||||||
// public void tt() {
|
public Map<String, Object> repairStats(boolean isMonth) {
|
||||||
//// Calendar c = getCalendar(2024, 9);
|
List<RepairStatsVo> list = isMonth ?
|
||||||
////
|
repairStatsMapper.repairStats(getDate(null, 2, true), getDate(null, 2, false)) :
|
||||||
////
|
repairStatsMapper.repairStats(getDate(null, 3, true), getDate(null, 3, false));
|
||||||
//// System.out.println(getDate(c, 1, true));
|
|
||||||
//// System.out.println(getDate(c, 1, false));
|
|
||||||
//// System.out.println(getDate(c, 2, true));
|
|
||||||
//// System.out.println(getDate(c, 2, false));
|
|
||||||
//// System.out.println(getDate(c, 3, true));
|
|
||||||
//// System.out.println(getDate(c, 3, false));
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
if (list == null || list.size() == 0) return null;
|
||||||
|
RepairStatsVo repairStatsVo = list.get(0);
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("status", 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);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> getMap(String name, Object value) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("name", name);
|
||||||
|
map.put("value", value);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取指定年月的日历
|
* 获取指定年月的日历 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();
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.ics.admin.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created at 2024-8-16 22:30
|
||||||
|
*
|
||||||
|
* @author lujiang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RepairAdminStatsVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = -202408162231L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待派工单
|
||||||
|
*/
|
||||||
|
private Integer wait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已重新派单
|
||||||
|
*/
|
||||||
|
private Integer anew;
|
||||||
|
/**
|
||||||
|
* 未查看通知
|
||||||
|
*/
|
||||||
|
private Integer newnotice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已查看通知
|
||||||
|
*/
|
||||||
|
private Integer oldnotice;
|
||||||
|
}
|
@ -1,7 +1,9 @@
|
|||||||
package com.ics.admin.domain;
|
package com.ics.admin.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对应视图floor_stats
|
* 对应视图floor_stats
|
||||||
* created at 2024-8-15 21:18
|
* created at 2024-8-15 21:18
|
||||||
@ -11,7 +13,7 @@ import lombok.Data;
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class RepairFloorStatsVo {
|
public class RepairFloorStatsVo implements Serializable {
|
||||||
private static final long serialVersionUID = -202408152119L;
|
private static final long serialVersionUID = -202408152119L;
|
||||||
/**
|
/**
|
||||||
* 用户id
|
* 用户id
|
@ -0,0 +1,79 @@
|
|||||||
|
package com.ics.admin.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created at 2024-8-15 21:46
|
||||||
|
*
|
||||||
|
* @author lujiang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RepairStatsVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = -202408152311L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单总数
|
||||||
|
*/
|
||||||
|
private Integer zs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待维修工单
|
||||||
|
*/
|
||||||
|
private Integer wait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 超时量
|
||||||
|
*/
|
||||||
|
private Integer timeout;
|
||||||
|
/**
|
||||||
|
* 评价总数
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
private Integer pj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 好评
|
||||||
|
*/
|
||||||
|
private Integer h;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中评
|
||||||
|
*/
|
||||||
|
private Integer m;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差评
|
||||||
|
*/
|
||||||
|
private Integer l;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已完成
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
private Integer wc;
|
||||||
|
/**
|
||||||
|
* 严重超时
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
private Integer htimeout;
|
||||||
|
/**
|
||||||
|
* 超时
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
private Integer mtimeout;
|
||||||
|
/**
|
||||||
|
* 轻微超时
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
private Integer ltimeout;
|
||||||
|
/**
|
||||||
|
* 未超时
|
||||||
|
*/
|
||||||
|
@JsonIgnore
|
||||||
|
private Integer ntimeout;
|
||||||
|
}
|
@ -1,197 +0,0 @@
|
|||||||
package com.ics.admin.vo;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.ics.admin.domain.BannerImage;
|
|
||||||
import com.ics.admin.domain.RepairLog;
|
|
||||||
import com.ics.admin.handler.BannerImageHandler;
|
|
||||||
import com.ics.system.domain.vo.UserVO;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修VO
|
|
||||||
*
|
|
||||||
* @author jack
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class RepairVO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最大Banner图片数量
|
|
||||||
*/
|
|
||||||
public static final int MAX_REPAIR_IMAGE_SIZE = 4;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Id
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修单号
|
|
||||||
*/
|
|
||||||
private String sn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修人
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String repairName;
|
|
||||||
|
|
||||||
private String repairLevel;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话
|
|
||||||
*/
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修区域
|
|
||||||
*/
|
|
||||||
private String area;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*/
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态名称
|
|
||||||
*/
|
|
||||||
private String statusName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修时间
|
|
||||||
*/
|
|
||||||
private Date repairTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修费
|
|
||||||
*/
|
|
||||||
private Long repairFee;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 评价
|
|
||||||
*/
|
|
||||||
private Long repairScore;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修材料
|
|
||||||
*/
|
|
||||||
private String repairMateriel;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始时间
|
|
||||||
*/
|
|
||||||
private Date beginDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束时间
|
|
||||||
*/
|
|
||||||
private Date endDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 评价工人
|
|
||||||
*/
|
|
||||||
private Long workerScore;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工人ID
|
|
||||||
*/
|
|
||||||
private Long workerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公司ID
|
|
||||||
*/
|
|
||||||
private Long customerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公司
|
|
||||||
*/
|
|
||||||
private CustomerVO customerVO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 园区ID
|
|
||||||
*/
|
|
||||||
private Long parkId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 园区
|
|
||||||
*/
|
|
||||||
private ParkVO parkVO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户
|
|
||||||
*/
|
|
||||||
private UserVO userVO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date failureDate;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工单记录
|
|
||||||
*/
|
|
||||||
private List<RepairLog> repairLogs = new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修图片
|
|
||||||
*/
|
|
||||||
private String repairImages;
|
|
||||||
|
|
||||||
|
|
||||||
private String typeName;
|
|
||||||
|
|
||||||
private String repairDeviceName;
|
|
||||||
|
|
||||||
private String failureTypeName;
|
|
||||||
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
private String workerName;
|
|
||||||
|
|
||||||
//评分
|
|
||||||
private Integer speed;
|
|
||||||
|
|
||||||
private Integer serve;
|
|
||||||
|
|
||||||
private Integer effect;
|
|
||||||
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.ics.admin.domain;
|
package com.ics.admin.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -267,25 +267,39 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<!-- 预警 -->
|
||||||
<update id="repairTimeOutRed" parameterType="Integer">
|
<update id="repairForewarnRed" parameterType="Integer">
|
||||||
update ics_repair set warn=5 where delete_flag=0 and status <![CDATA[ < ]]> 9 and timeout is not null and warn <![CDATA[ <> ]]> 5 and TIMESTAMPDIFF(DAY,NOW(),timeout) <![CDATA[ <= ]]> #{day}
|
update ics_repair set warn=5 where delete_flag=0 and status <![CDATA[ < ]]> 9 and preDate is not null and warn <![CDATA[ <> ]]> 5 and TIMESTAMPDIFF(DAY,NOW(),preDate) <![CDATA[ <= ]]> #{day}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="repairTimeOutOrange" parameterType="Integer">
|
<update id="repairForewarnOrange" parameterType="Integer">
|
||||||
update ics_repair set warn=3 where delete_flag=0 and status <![CDATA[ < ]]> 9 and timeout is not null and warn <![CDATA[ <= ]]> 1 and TIMESTAMPDIFF(DAY,NOW(),timeout) <![CDATA[ <= ]]> #{day}
|
update ics_repair set warn=3 where delete_flag=0 and status <![CDATA[ < ]]> 9 and preDate is not null and warn <![CDATA[ <= ]]> 1 and TIMESTAMPDIFF(DAY,NOW(),preDate) <![CDATA[ <= ]]> #{day}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="removeWarn">
|
<update id="removeWarn">
|
||||||
update ics_repair set warn=0 where delete_flag=0 and status <![CDATA[ >= ]]> 9 and warn <![CDATA[ > ]]> 0
|
update ics_repair set warn=0 where delete_flag=0 and status <![CDATA[ >= ]]> 9 and warn <![CDATA[ > ]]> 0
|
||||||
</update>
|
</update>
|
||||||
|
<!-- 自动好评 -->
|
||||||
<update id="repairGoodEval">
|
<update id="repairGoodEval">
|
||||||
update ics_repair set eval_service=5,eval_time=NOW(),eval_user_id=-1,status=13
|
update ics_repair set eval_service=5,eval_time=NOW(),eval_user_id=-1,status=13
|
||||||
where delete_flag=0 and status=9 and end_date is not null and TIMESTAMPDIFF(DAY,end_date,NOW()) <![CDATA[ >= ]]> 7
|
where delete_flag=0 and status=9 and end_date is not null and TIMESTAMPDIFF(DAY,end_date,NOW()) <![CDATA[ >= ]]> 7
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 防止刷单 -->
|
||||||
<select id="submitCheck" parameterType="String" resultType="Integer">
|
<select id="submitCheck" parameterType="String" resultType="Integer">
|
||||||
select count(id) from ics_repair where delete_flag=0 and create_by= #{userId} and TIMESTAMPDIFF(MINUTE,create_time,NOW()) <![CDATA[ <= ]]> 3
|
select count(id) from ics_repair where delete_flag=0 and create_by= #{userId} and TIMESTAMPDIFF(MINUTE,create_time,NOW()) <![CDATA[ <= ]]> 3
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 超时告警,按顺序执行 -->
|
||||||
|
<update id="repairTimeoutRed" parameterType="Integer">
|
||||||
|
update ics_repair set timeout=5 where delete_flag=0 and status <![CDATA[ < ]]> 9 and preDate is not null and timeout <![CDATA[ <> ]]> 5 and TIMESTAMPDIFF(DAY,preDate,now()) <![CDATA[ >= ]]> #{day}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="repairTimeoutOrange" parameterType="Integer">
|
||||||
|
update ics_repair set timeout=3 where delete_flag=0 and status <![CDATA[ < ]]> 9 and preDate is not null and timeout <![CDATA[ <= ]]> 1 and TIMESTAMPDIFF(DAY,preDate,now()) <![CDATA[ >= ]]> #{day}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -4,23 +4,7 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ics.admin.mapper.RepairStatsMapper">
|
<mapper namespace="com.ics.admin.mapper.RepairStatsMapper">
|
||||||
|
|
||||||
<resultMap type="com.ics.admin.domain.RepairWorkerStatsVo" id="RepairWorkerStatsVoResult">
|
<select id="selectRepairWorkerStatsList" parameterType="com.ics.admin.vo.RepairWorkerStatsVo" resultType="com.ics.admin.vo.RepairWorkerStatsVo">
|
||||||
<result property="id" column="id"/>
|
|
||||||
<result property="username" column="username"/>
|
|
||||||
<result property="mobile" column="mobile"/>
|
|
||||||
<result property="typeid" column="typeid"/>
|
|
||||||
<result property="typename" column="typename"/>
|
|
||||||
<result property="zs" column="zs"/>
|
|
||||||
<result property="process" column="process"/>
|
|
||||||
<result property="closed" column="closed"/>
|
|
||||||
<result property="unresolved" column="Unresolved"/>
|
|
||||||
<result property="pj" column="pj"/>
|
|
||||||
<result property="h" column="h"/>
|
|
||||||
<result property="m" column="m"/>
|
|
||||||
<result property="l" column="l"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<select id="selectRepairWorkerStatsList" parameterType="RepairWorkerStatsVo" resultMap="RepairWorkerStatsVoResult">
|
|
||||||
SELECT id, username, mobile, typeid, typename, zs, process, closed, Unresolved, pj,
|
SELECT id, username, mobile, typeid, typename, zs, process, closed, Unresolved, pj,
|
||||||
case when pj>0 then CONCAT(h,',',ROUND(h/pj*100,1),'%') else '0,0%' end as h,
|
case when pj>0 then CONCAT(h,',',ROUND(h/pj*100,1),'%') else '0,0%' end as h,
|
||||||
case when pj>0 then CONCAT(m,',',ROUND(m/pj*100,1),'%') else '0,0%' end as m,
|
case when pj>0 then CONCAT(m,',',ROUND(m/pj*100,1),'%') else '0,0%' end as m,
|
||||||
@ -33,22 +17,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<resultMap type="com.ics.admin.domain.RepairFloorStatsVo" id="RepairFloorStatsVoResult">
|
<select id="selectRepairFloorStatsVoList" parameterType="com.ics.admin.vo.RepairFloorStatsVo" resultType="com.ics.admin.vo.RepairFloorStatsVo">
|
||||||
<result property="id" column="id"/>
|
|
||||||
<result property="name" column="name"/>
|
|
||||||
<result property="mobile" column="mobile"/>
|
|
||||||
<result property="adr" column="adr"/>
|
|
||||||
<result property="zs" column="zs"/>
|
|
||||||
<result property="process" column="process"/>
|
|
||||||
<result property="closed" column="closed"/>
|
|
||||||
<result property="unresolved" column="Unresolved"/>
|
|
||||||
<result property="pj" column="pj"/>
|
|
||||||
<result property="h" column="h"/>
|
|
||||||
<result property="m" column="m"/>
|
|
||||||
<result property="l" column="l"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<select id="selectRepairFloorStatsVoList" parameterType="RepairFloorStatsVo" resultMap="RepairFloorStatsVoResult">
|
|
||||||
SELECT id, name, mobile, adr, zs, process, closed, Unresolved, pj,
|
SELECT id, name, mobile, adr, zs, process, closed, Unresolved, pj,
|
||||||
case when pj>0 then CONCAT(h,',',ROUND(h/pj*100,1),'%') else '0,0%' end as h,
|
case when pj>0 then CONCAT(h,',',ROUND(h/pj*100,1),'%') else '0,0%' end as h,
|
||||||
case when pj>0 then CONCAT(m,',',ROUND(m/pj*100,1),'%') else '0,0%' end as m,
|
case when pj>0 then CONCAT(m,',',ROUND(m/pj*100,1),'%') else '0,0%' end as m,
|
||||||
@ -61,21 +30,37 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="statsRepairByTime">
|
<!-- 第一行 管理员 工单与 通知统计 -->
|
||||||
|
<select id="repairAdminStats" resultType="com.ics.admin.vo.RepairAdminStatsVo">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
SELECT
|
SELECT `wait`,`anew`,0 as newnotice,0 as oldnotice FROM
|
||||||
count(id) zs,
|
(SELECT count(id) as `wait` FROM ics_repair where delete_flag=0 and status=3) as A,
|
||||||
sum(case when status < 7 then 1 else 0 end) wait,
|
(SELECT count(DISTINCT repair_id) as `anew` FROM ics_repair_log where delete_flag=0 and node_form=3) as B
|
||||||
sum(case when timeout is not null and timeout < now() and status < 9 then 1 else 0 end) timeout,
|
|
||||||
SUM(case when eval_service is not null then 1 else 0 end) as pj,
|
|
||||||
SUM(case when eval_service is not null and eval_service >=4 then 1 else 0 end) as h,
|
|
||||||
SUM(case when eval_service is not null and eval_service =3 then 1 else 0 end) as m,
|
|
||||||
SUM(case when eval_service is not null and eval_service <=2 then 1 else 0 end) as l
|
|
||||||
FROM
|
|
||||||
ics_repair
|
|
||||||
WHERE
|
|
||||||
delete_flag = 0 and creat_time between #{startTime} and #{endTime}
|
|
||||||
]]>
|
]]>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 第二、三行 工单统计、工单完成情况、评价情况 -->
|
||||||
|
<select id="repairStats" resultType="com.ics.admin.vo.RepairStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
count(id) zs,
|
||||||
|
sum(case when status < 9 then 1 else 0 end) `wait`,
|
||||||
|
sum(case when predate is not null and predate < now() and status < 9 then 1 else 0 end) timeout,
|
||||||
|
sum(case when eval_service is not null then 1 else 0 end) as pj,
|
||||||
|
sum(case when eval_service is not null and eval_service >=4 then 1 else 0 end) as h,
|
||||||
|
sum(case when eval_service is not null and eval_service =3 then 1 else 0 end) as m,
|
||||||
|
sum(case when eval_service is not null and eval_service <=2 then 1 else 0 end) as l,
|
||||||
|
sum(case when status > 7 then 1 else 0 end) wc,
|
||||||
|
sum(case when timeout =5 and status>=9 then 1 else 0 end) htimeout,
|
||||||
|
sum(case when timeout =3 and status>=9 then 1 else 0 end) mtimeout,
|
||||||
|
sum(case when predate < end_date and timeout=1 and status>=9 then 1 else 0 end) ltimeout,
|
||||||
|
sum(case when predate > end_date and timeout=1 and status>=9 then 1 else 0 end) ntimeout
|
||||||
|
FROM
|
||||||
|
ics_repair
|
||||||
|
WHERE
|
||||||
|
delete_flag = 0 and create_time between #{startTime} and #{endTime}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -17,16 +17,26 @@ import org.springframework.stereotype.Service;
|
|||||||
public class RepairTask {
|
public class RepairTask {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单超时预警
|
* 工单超时预警;还未超时
|
||||||
*/
|
*/
|
||||||
public void repairTimeOut() {
|
public void repairForewarn() {
|
||||||
IRepairService repairService = SpringUtils.getBean(IRepairService.class);
|
IRepairService repairService = SpringUtils.getBean(IRepairService.class);
|
||||||
int num = repairService.repairTimeOutWarn();
|
int num = repairService.repairForewarnWarn();
|
||||||
log.info("已对" + num + "个工单超时预警");
|
log.info("已对" + num + "个工单超时预警");
|
||||||
num = repairService.removeWarn();
|
num = repairService.removeWarn();
|
||||||
log.info("已对" + num + "个工单解除预警");
|
log.info("已对" + num + "个工单解除预警");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单超时告警;已经超时
|
||||||
|
*/
|
||||||
|
public void repairTimeOut() {
|
||||||
|
IRepairService repairService = SpringUtils.getBean(IRepairService.class);
|
||||||
|
int num = repairService.repairTimeOut();
|
||||||
|
log.info("已对" + num + "个工单超时告警");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单完成7天后未评价 则 自动好评
|
* 工单完成7天后未评价 则 自动好评
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user