看板接口更改

master
Yangwl 2 months ago
parent e486f8b0c1
commit 5ae3401253

@ -207,7 +207,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
everys = mesMapper.getEveryNum(boardDTO);
// 计算所有 TotalNum 的总和
int totalSum = everys.stream().mapToInt(BoardDTO::getTotalNum).sum();
int totalSum = totals.get(0).getTotalNum();
// 保留前 7 条数据
if (everys.size() > 7) {
everys = everys.subList(0, 7);
@ -1120,34 +1120,16 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
/**烘房耗电数据**/
private List<EnergyExpend> EnergyExpend(){
DynamicDataSourceContextHolder.push("ds_" + "1000");// 这是数据源的key
LocalDateTime now = LocalDateTime.now();
LocalTime startTime1 = LocalTime.of(7, 30); // 7:30
LocalTime endTime1 = LocalTime.of(19, 30); // 19:30
LocalTime endTime2 = LocalTime.of(7, 30); // 第二天的 7:30
LocalDate startDate=null;
LocalDate endDate=null;
// 当前时间在 7:30 到 19:30 之间
if (now.toLocalTime().isAfter(startTime1) && now.toLocalTime().isBefore(endTime1)) {
startDate = now.toLocalDate();
endDate = now.toLocalDate();
endTime1 = LocalTime.of(19, 30); // 结束时间为当天的 19:30
}
// 当前时间在 19:30 到第二天 7:30 之间
else if (now.toLocalTime().isAfter(endTime1) || now.toLocalTime().isBefore(endTime2)) {
startDate = now.toLocalDate();
endDate = now.toLocalDate().plusDays(1); // 结束时间为第二天的 7:30
startTime1=endTime1;
endTime1 = LocalTime.of(7, 30);
} else {
// 不在指定时间范围内
System.out.println("当前时间不在指定范围内。");
}
LocalDateTime startDateTime = startDate.atTime(startTime1); // 开始时间
LocalDateTime endDateTime = endDate.atTime(endTime1); // 结束时间
// 格式化输出
LocalDate today = LocalDate.now(); // Get today's date
// Start time set to 00:00 (midnight) on today's date
LocalDateTime startDateTime = today.atTime(LocalTime.MIDNIGHT); // 00:00
// End time set to 23:59:59.999999999 on today's date
LocalDateTime endDateTime = today.atTime(LocalTime.MAX); // 23:59:59.999999999
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
return h5ApiMapper.EnergyExpend(startDateTime.format(formatter),endDateTime.format(formatter));
}

@ -1042,46 +1042,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getHFDailyProduction" resultType="java.util.Map" parameterType="String">
SELECT
mt.equipmentCode,
COUNT(*) AS RecordCount
SELECT
mt.equipmentCode,
COUNT(*) AS RecordCount
FROM
mes_material_transfer_result mt
LEFT JOIN base_equipment equ ON mt.equipmentCode = equ.equipment_code
WHERE
mt.rfid_status = '1'
AND equ.equipment_type_code = 'equ_type_hf'
AND CONVERT ( DATE, mt.update_time ) = CONVERT ( DATE, GETDATE( ) )
AND mt.shift_id=#{shiftId}
GROUP BY
mt.equipmentCode;
FROM
mes_material_transfer_result mt
LEFT JOIN base_equipment equ ON mt.equipmentCode = equ.equipment_code
WHERE
mt.rfid_status = '1'
AND equ.equipment_type_code = 'equ_type_hf'
AND CONVERT ( DATE, mt.update_time ) = CONVERT ( DATE, GETDATE( ) )
GROUP BY
mt.equipmentCode;
</select>
<select id="getPlanNumber" resultType="java.util.Map" parameterType="String">
SELECT
c.workorder_code,
c.product_code,
c.product_name,
c.quantity_split,
T.car_num_unit,
(c.quantity_split/ T.car_num_unit ) as che
FROM
pro_order_workorder c
LEFT JOIN (
SELECT
b.item_code,
b.item_name,
a.car_num_unit
FROM
pro_route a
LEFT JOIN pro_route_product b ON a.route_id= b.route_id
WHERE
b.item_code IS NOT NULL
) T ON c.product_code= T.item_code
WHERE
CONVERT ( DATE, product_date ) = CONVERT ( DATE, GETDATE( ) )
AND c.shift_id=#{shiftId}
SELECT
c.workorder_code,
c.product_code,
c.product_name,
c.quantity_split,
T.car_num_unit,
(c.quantity_split/ T.car_num_unit ) as che
FROM
pro_order_workorder c
LEFT JOIN (
SELECT
b.item_code,
b.item_name,
a.car_num_unit
FROM
pro_route a
LEFT JOIN pro_route_product b ON a.route_id= b.route_id
WHERE
b.item_code IS NOT NULL
) T ON c.product_code= T.item_code
WHERE
CONVERT ( DATE, product_date ) = CONVERT ( DATE, GETDATE( ) )
</select>
<select id="getUnionRemark" resultType="java.lang.String">
select remark from mes_report_work where workorder_code = #{workorderCode} and del_flag = '0' and remark is not null

Loading…
Cancel
Save