|
|
|
|
@ -12,10 +12,13 @@ import org.springblade.modules.business.pojo.entity.maintenance.MaintenancePlan; |
|
|
|
|
import org.springblade.modules.business.pojo.entity.maintenance.MaintenanceTask; |
|
|
|
|
import org.springblade.modules.business.pojo.entity.workorder.WorkOrder; |
|
|
|
|
import org.springblade.modules.business.pojo.vo.MaintenanceTaskVO; |
|
|
|
|
import org.springblade.modules.business.pojo.vo.PieStatVO; |
|
|
|
|
import org.springblade.modules.business.service.IDeviceService; |
|
|
|
|
import org.springblade.modules.business.service.IMaintenancePlanService; |
|
|
|
|
import org.springblade.modules.business.service.IMaintenanceTaskService; |
|
|
|
|
import org.springblade.modules.business.service.IWorkOrderService; |
|
|
|
|
import org.springblade.modules.system.pojo.entity.User; |
|
|
|
|
import org.springblade.modules.system.service.IUserService; |
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
|
@ -43,6 +46,7 @@ public class WorkBenchesController extends BladeController { |
|
|
|
|
private final IMaintenanceTaskService maintenanceTaskService; |
|
|
|
|
private final IWorkOrderService workOrderService; |
|
|
|
|
private final IDeviceService deviceService; |
|
|
|
|
private final IUserService userService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 工作台 |
|
|
|
|
@ -132,42 +136,9 @@ public class WorkBenchesController extends BladeController { |
|
|
|
|
@GetMapping("/pieStat") |
|
|
|
|
public R<Map<String, Object>> pieStat(String startTime, String endTime) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
List<Map<String, Object>> fault = new ArrayList<>(); |
|
|
|
|
Map<String, Object> fault1 = new HashMap<>(); |
|
|
|
|
fault1.put("name", "电气"); |
|
|
|
|
fault1.put("value", 300); |
|
|
|
|
fault.add(fault1); |
|
|
|
|
Map<String, Object> fault2 = new HashMap<>(); |
|
|
|
|
fault2.put("name", "空调"); |
|
|
|
|
fault2.put("value", 248); |
|
|
|
|
fault.add(fault2); |
|
|
|
|
Map<String, Object> fault3 = new HashMap<>(); |
|
|
|
|
fault3.put("name", "装修类"); |
|
|
|
|
fault3.put("value", 135); |
|
|
|
|
fault.add(fault3); |
|
|
|
|
Map<String, Object> fault4 = new HashMap<>(); |
|
|
|
|
fault4.put("name", "智能设备"); |
|
|
|
|
fault4.put("value", 180); |
|
|
|
|
fault.add(fault4); |
|
|
|
|
Map<String, Object> fault5 = new HashMap<>(); |
|
|
|
|
fault5.put("name", "暖通、自控"); |
|
|
|
|
fault5.put("value", 654); |
|
|
|
|
fault.add(fault5); |
|
|
|
|
List<PieStatVO> fault = deviceService.selectTypeCount(startTime, endTime); |
|
|
|
|
map.put("fault", fault); |
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> device = new ArrayList<>(); |
|
|
|
|
Map<String, Object> device1 = new HashMap<>(); |
|
|
|
|
device1.put("name", "设备1"); |
|
|
|
|
device1.put("value", 580); |
|
|
|
|
device.add(device1); |
|
|
|
|
Map<String, Object> device2 = new HashMap<>(); |
|
|
|
|
device2.put("name", "空调"); |
|
|
|
|
device2.put("value", 1048); |
|
|
|
|
device.add(device2); |
|
|
|
|
Map<String, Object> device3 = new HashMap<>(); |
|
|
|
|
device3.put("name", "通风柜"); |
|
|
|
|
device3.put("value", 735); |
|
|
|
|
device.add(device3); |
|
|
|
|
List<PieStatVO> device = deviceService.selectStatusCount(startTime, endTime); |
|
|
|
|
map.put("device", device); |
|
|
|
|
return R.data(map); |
|
|
|
|
} |
|
|
|
|
@ -178,10 +149,13 @@ public class WorkBenchesController extends BladeController { |
|
|
|
|
@GetMapping("/mapAddress") |
|
|
|
|
public R<Map<String, Object>> mapAddress(String perType) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
List<String> fault = new ArrayList<>(); |
|
|
|
|
fault.add("120.49149829538277"); |
|
|
|
|
fault.add("36.15297000628537"); |
|
|
|
|
map.put("软件创新园", fault); |
|
|
|
|
List<User> users = userService.list(Wrappers.lambdaQuery(User.class).eq(User::getStatus, 1).isNotNull(User::getAddressLon)); |
|
|
|
|
for (User user : users) { |
|
|
|
|
List<String> fault = new ArrayList<>(); |
|
|
|
|
fault.add(user.getAddressLon()); |
|
|
|
|
fault.add(user.getAddressLat()); |
|
|
|
|
map.put(user.getDeptName(), fault); |
|
|
|
|
} |
|
|
|
|
return R.data(map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -190,15 +164,15 @@ public class WorkBenchesController extends BladeController { |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/limsInspecList") |
|
|
|
|
public R<List<Map<String, Object>>> limsInspecList(String perType) { |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
List<Map<String, Object>> list = new ArrayList<>(); |
|
|
|
|
Map<String, Object> map1 = new HashMap<>(); |
|
|
|
|
map1.put("name", "水系统检查"); |
|
|
|
|
map1.put("planTime", "2024-11-11"); |
|
|
|
|
list.add(map1); |
|
|
|
|
Map<String, Object> map2 = new HashMap<>(); |
|
|
|
|
map2.put("name", "设备检查"); |
|
|
|
|
map2.put("planTime", "2024-11-11"); |
|
|
|
|
list.add(map2); |
|
|
|
|
List<MaintenanceTask> tasks = maintenanceTaskService.list(Wrappers.lambdaQuery(MaintenanceTask.class).isNotNull(MaintenanceTask::getStartTime).orderByDesc(MaintenanceTask::getStartTime)); |
|
|
|
|
for (MaintenanceTask task : tasks) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("name", task.getDeptName() + "-设备巡检"); |
|
|
|
|
map.put("planTime", format.format(task.getStartTime())); |
|
|
|
|
list.add(map); |
|
|
|
|
} |
|
|
|
|
return R.data(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -249,17 +223,13 @@ public class WorkBenchesController extends BladeController { |
|
|
|
|
public R<Map<String, Object>> limsInspecChart(String startTime, String endTime, String perType) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
List<String> xData = new ArrayList<>(); |
|
|
|
|
if ("0".equals(perType)) { |
|
|
|
|
xData.add("安池"); |
|
|
|
|
xData.add("畜牧局"); |
|
|
|
|
} else if ("1".equals(perType)) { |
|
|
|
|
xData.add("班组1"); |
|
|
|
|
xData.add("班组2"); |
|
|
|
|
List<Integer> total = new ArrayList<>(); |
|
|
|
|
List<PieStatVO> list = workOrderService.selectDeptCount(startTime, endTime); |
|
|
|
|
for (PieStatVO pieStatVO : list) { |
|
|
|
|
xData.add(pieStatVO.getName()); |
|
|
|
|
total.add(pieStatVO.getValue()); |
|
|
|
|
} |
|
|
|
|
map.put("xData", xData); |
|
|
|
|
List<Integer> total = new ArrayList<>(); |
|
|
|
|
total.add(172); |
|
|
|
|
total.add(160); |
|
|
|
|
map.put("yData", total); |
|
|
|
|
return R.data(map); |
|
|
|
|
} |
|
|
|
|
|