|
|
|
|
@ -352,12 +352,12 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
public Map<String, Object> selectEquipRepairCountByMonth(String deviceId) { |
|
|
|
|
String startDate = DateFormatUtils.format(CommonDateUtil.getCurrentYearStartTime(), "yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
String endDate = DateFormatUtils.format(CommonDateUtil.getCurrentYearEndTime(), "yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
List<String> monthList = CommonDateUtil.getMonthList(startDate, endDate, "yyyy-MM"); |
|
|
|
|
List<String> monthList = CommonDateUtil.getMonthList(startDate, endDate, "MM"); |
|
|
|
|
List<Map<String, Object>> list = baseMapper.selectEquipRepairCountByMonth(deviceId); |
|
|
|
|
List<String> dataList = new ArrayList<>(); |
|
|
|
|
Map<String, String> dataMap = new HashMap<>(); |
|
|
|
|
for (Map<String, Object> map1 : list) { |
|
|
|
|
dataMap.put(map1.get("month").toString(), map1.get("duration").toString()); |
|
|
|
|
dataMap.put(map1.get("month").toString(), map1.get("count").toString()); |
|
|
|
|
} |
|
|
|
|
for (String month : monthList) { |
|
|
|
|
if (null != dataMap.get(month)) { |
|
|
|
|
@ -489,7 +489,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
approvalService.save(approval); |
|
|
|
|
|
|
|
|
|
// 更新设备状态为运行中
|
|
|
|
|
deviceService.updateStatus(CommonConstant.DEVICE_RUN_STATUS_WORKING, workOrder.getDeviceId()); |
|
|
|
|
deviceService.updateStatus(CommonConstant.DEVICE_RUN_STATUS_WORKING, workOrderOld.getDeviceId()); |
|
|
|
|
//消息发送
|
|
|
|
|
String role = "1839536982874193922"; |
|
|
|
|
List<User> userList = userService.list(Wrappers.lambdaQuery(User.class).eq(User::getRoleId, role)); |
|
|
|
|
@ -551,7 +551,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
//查询每个维修人员的工单数量及满意度
|
|
|
|
|
for (User user : maintenancePersonnelList) { |
|
|
|
|
MaintenancePersonnel maintenancePersonnel = new MaintenancePersonnel(); |
|
|
|
|
maintenancePersonnel.setName(user.getName()); |
|
|
|
|
maintenancePersonnel.setName(user.getRealName()); |
|
|
|
|
//查询每个维修人员的工单数量
|
|
|
|
|
Long count = this.count(Wrappers.lambdaQuery(WorkOrder.class).eq(WorkOrder::getRepairPerson, user.getId())); |
|
|
|
|
maintenancePersonnel.setCount(count); |
|
|
|
|
@ -648,9 +648,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
map.put("faultDescribe", workOrder.getFaultDescribe()); |
|
|
|
|
map.put("faultCause", workOrder.getFaultCause()); |
|
|
|
|
map.put("total", total); |
|
|
|
|
map.put("discount", workOrder.getDiscount()); |
|
|
|
|
map.put("discountPrice", workOrder.getDiscountPrice()); |
|
|
|
|
map.put("processMethod", workOrder.getProcessMethod()); |
|
|
|
|
map.put("repairPerson", repairPerson.getRealName()); |
|
|
|
|
map.put("repairPersonPhone", repairPerson.getPhone()); |
|
|
|
|
map.put("repairPerson", repairPerson != null ? repairPerson.getRealName() : ""); |
|
|
|
|
map.put("repairPersonPhone", repairPerson != null ? repairPerson.getPhone() : ""); |
|
|
|
|
map.put("laborCost", workOrder.getLaborCost()); |
|
|
|
|
//转换日期格式
|
|
|
|
|
Optional<Date> finishTime = Optional.ofNullable(workOrder.getFinishTime()); |
|
|
|
|
@ -662,7 +664,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
if (device.isPresent()) { |
|
|
|
|
Optional<Long> limsId = Optional.ofNullable(device.get().getLimsId()); |
|
|
|
|
if (limsId.isPresent()) { |
|
|
|
|
map.put("in", total + (workOrder.getLaborCost() == null ? 0 : workOrder.getLaborCost())); |
|
|
|
|
map.put("in", String.format("%.2f",workOrder.getDiscountPrice() + (workOrder.getLaborCost() == null ? 0 : workOrder.getLaborCost()))); |
|
|
|
|
map.put("out", "--"); |
|
|
|
|
map.put("sel1", "√"); |
|
|
|
|
map.put("sel2", null); |
|
|
|
|
@ -670,7 +672,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
map.put("outTravel", "--"); |
|
|
|
|
} else { |
|
|
|
|
map.put("in", "--"); |
|
|
|
|
map.put("out", total + workOrder.getLaborCost()); |
|
|
|
|
map.put("out", String.format("%.2f",workOrder.getDiscountPrice() + (workOrder.getLaborCost() == null ? 0 : workOrder.getLaborCost()))); |
|
|
|
|
map.put("sel2", "√"); |
|
|
|
|
map.put("sel1", null); |
|
|
|
|
map.put("outTravel", workOrder.getTravelExpense()); |
|
|
|
|
@ -678,7 +680,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
map.put("in", "--"); |
|
|
|
|
map.put("out", total + workOrder.getLaborCost()); |
|
|
|
|
map.put("out", String.format("%.2f",workOrder.getDiscountPrice() + (workOrder.getLaborCost() == null ? 0 : workOrder.getLaborCost()))); |
|
|
|
|
map.put("sel2", "√"); |
|
|
|
|
map.put("sel1", null); |
|
|
|
|
map.put("outTravel", workOrder.getTravelExpense()); |
|
|
|
|
@ -764,9 +766,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
map.put("faultDescribe", workOrder.getFaultDescribe()); |
|
|
|
|
map.put("faultCause", workOrder.getFaultCause()); |
|
|
|
|
map.put("total", total); |
|
|
|
|
map.put("discount", workOrder.getDiscount()); |
|
|
|
|
map.put("discountPrice", workOrder.getDiscountPrice()); |
|
|
|
|
map.put("processMethod", workOrder.getProcessMethod()); |
|
|
|
|
map.put("repairPerson", repairPerson.getRealName()); |
|
|
|
|
map.put("repairPersonPhone", repairPerson.getPhone()); |
|
|
|
|
map.put("repairPerson",repairPerson != null ? repairPerson.getRealName() : ""); |
|
|
|
|
map.put("repairPersonPhone", repairPerson != null ? repairPerson.getPhone() : ""); |
|
|
|
|
map.put("laborCost", workOrder.getLaborCost()); |
|
|
|
|
//转换日期格式
|
|
|
|
|
Optional<Date> finishTime = Optional.ofNullable(workOrder.getFinishTime()); |
|
|
|
|
@ -778,21 +782,21 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
if (device.isPresent()) { |
|
|
|
|
Optional<Long> limsId = Optional.ofNullable(device.get().getLimsId()); |
|
|
|
|
if (limsId.isPresent()) { |
|
|
|
|
map.put("in", total + workOrder.getLaborCost()); |
|
|
|
|
map.put("in", String.format("%.2f",workOrder.getDiscountPrice() + (workOrder.getLaborCost() != null ? workOrder.getLaborCost() : 0))); |
|
|
|
|
map.put("out", "--"); |
|
|
|
|
map.put("sel1", "√"); |
|
|
|
|
map.put("sel2", null); |
|
|
|
|
map.put("inTravel", workOrder.getTravelExpense()); |
|
|
|
|
} else { |
|
|
|
|
map.put("in", "--"); |
|
|
|
|
map.put("out", total + workOrder.getLaborCost()); |
|
|
|
|
map.put("out", String.format("%.2f",total + (workOrder.getLaborCost() != null ? workOrder.getLaborCost() : 0))); |
|
|
|
|
map.put("sel2", "√"); |
|
|
|
|
map.put("sel1", null); |
|
|
|
|
map.put("outTravel", workOrder.getTravelExpense()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
map.put("in", "--"); |
|
|
|
|
map.put("out", total + workOrder.getLaborCost()); |
|
|
|
|
map.put("out", String.format("%.2f",total + (workOrder.getLaborCost() != null ? workOrder.getLaborCost() : 0))); |
|
|
|
|
map.put("sel2", "√"); |
|
|
|
|
map.put("sel1", null); |
|
|
|
|
map.put("outTravel", workOrder.getTravelExpense()); |
|
|
|
|
|