2024-3-11 设备看板问题修改+维修快速工单修改

master
A0010407 11 months ago
parent d62bb2fc85
commit 27a1e2bba2

@ -26,6 +26,7 @@ public interface DeviceInterfaceMapper {
* @return
*/
List<IEquipmentVO> selectEquipmentList(EquOperation equOperation);
List<IEquipmentVO> selectEquipmentVOList(EquOperation equOperation);
/**
*

@ -53,7 +53,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
/**
*
* :/
* /
* //*24
*
* @return
*/
@ -61,10 +61,10 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
@DS("#header.poolName")
public AjaxResult getEquipmentInfo(EquOperation equOperation) {
if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("dd");
equOperation.setTimeDimension("yyyy");
}
// 获取所有设备信息
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentList(equOperation);
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentVOList(equOperation);
return success(equipmentVOList);
}
@ -107,7 +107,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
// 按照raparQuantity字段进行排序并使用subList获取前10个结果
List<IEquipmentVO> top10 = equipmentVOList.stream()
.sorted(Comparator.comparing(IEquipmentVO::getRapairQuantity).reversed())// 由正序改为 反转排序 倒序
// .limit(10) // 限制结果数量为10 改为不限制结果数量
.limit(10) // 限制结果数量为10 改为不限制结果数量
.collect(Collectors.toList()); //将结果收集到List中
return success(top10);
}
@ -138,7 +138,6 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
@DS("#header.poolName")
public AjaxResult getEquipmentIntactRate(EquOperation equOperation) {
//查询所有设备(设备停用的除外)
// CAST(SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END)*100.00/COUNT(*) as decimal(18,2)) AS intactRate
EquOperation equipmentIntactRate = deviceInterfaceMapper.getEquipmentIntactRate(equOperation);
Double totalEquipment = new Double(equipmentIntactRate.getTotalEquipment());
Double operationEquipment = new Double(equipmentIntactRate.getOperationEquipment());

@ -150,7 +150,14 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
return equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
int result = equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
//2.修改设备状态
EquEquipment equEquipment = new EquEquipment();
equEquipment.setEquipmentCode(equipmentCode);
equEquipment.setEquipmentStatus("0");//0故障
equRepairWorkOrderMapper.updateEquipmentStatus(equEquipment);
return result;
}
/**

@ -42,6 +42,28 @@
and be.equipment_category = '0'
</select>
<select id="selectEquipmentVOList" parameterType="EquOperation" resultType="com.op.device.domain.vo.IEquipmentVO">
SELECT
be.equipment_code AS 'equipmentCode',
be.equipment_name AS 'equipmentName',
be.equipment_status AS 'equipmentStatus',
be.department AS 'department',
ROUND(SUM(CAST(eo.fault_time AS FLOAT)) * 100 / SUM(CAST(eo.actual_operation_time AS FLOAT)),2) AS 'failureRate',
CAST(SUM(CAST(eo.actual_operation_time AS DECIMAL(10,2)))*100 / (365*24) AS DECIMAL(18,2)) AS 'utilizationRatio'
FROM equ_operation eo
LEFT JOIN base_equipment be ON eo.equipment_code = be.equipment_code
<where>
<if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
<if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
AND eo.del_flag = '0'
AND be.del_flag = '0'
AND be.equipment_category = '0'
</where>
GROUP BY be.equipment_code,be.equipment_name,be.equipment_status,be.department
ORDER BY failureRate DESC
</select>
<select id="selectRepairEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO">
select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName'
from base_equipment be

Loading…
Cancel
Save