Merge remote-tracking branch 'origin/master'

master
mengjiao 2 months ago
commit fc48d69276

@ -207,7 +207,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
} }
everys = mesMapper.getEveryNum(boardDTO); everys = mesMapper.getEveryNum(boardDTO);
// 计算所有 TotalNum 的总和 // 计算所有 TotalNum 的总和
int totalSum = everys.stream().mapToInt(BoardDTO::getTotalNum).sum(); int totalSum = totals.get(0).getTotalNum();
// 保留前 7 条数据 // 保留前 7 条数据
if (everys.size() > 7) { if (everys.size() > 7) {
everys = everys.subList(0, 7); everys = everys.subList(0, 7);
@ -1120,34 +1120,16 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
/**烘房耗电数据**/ /**烘房耗电数据**/
private List<EnergyExpend> EnergyExpend(){ private List<EnergyExpend> EnergyExpend(){
DynamicDataSourceContextHolder.push("ds_" + "1000");// 这是数据源的key 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"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
return h5ApiMapper.EnergyExpend(startDateTime.format(formatter),endDateTime.format(formatter)); return h5ApiMapper.EnergyExpend(startDateTime.format(formatter),endDateTime.format(formatter));
} }

@ -1053,7 +1053,6 @@ WHERE
mt.rfid_status = '1' mt.rfid_status = '1'
AND equ.equipment_type_code = 'equ_type_hf' AND equ.equipment_type_code = 'equ_type_hf'
AND CONVERT ( DATE, mt.update_time ) = CONVERT ( DATE, GETDATE( ) ) AND CONVERT ( DATE, mt.update_time ) = CONVERT ( DATE, GETDATE( ) )
AND mt.shift_id=#{shiftId}
GROUP BY GROUP BY
mt.equipmentCode; mt.equipmentCode;
</select> </select>
@ -1080,8 +1079,6 @@ FROM
) T ON c.product_code= T.item_code ) T ON c.product_code= T.item_code
WHERE WHERE
CONVERT ( DATE, product_date ) = CONVERT ( DATE, GETDATE( ) ) CONVERT ( DATE, product_date ) = CONVERT ( DATE, GETDATE( ) )
AND c.shift_id=#{shiftId}
</select> </select>
<select id="getUnionRemark" resultType="java.lang.String"> <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 select remark from mes_report_work where workorder_code = #{workorderCode} and del_flag = '0' and remark is not null

Loading…
Cancel
Save