|
@@ -26,7 +26,12 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.LocalTime;
|
|
|
+import java.time.YearMonth;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -207,4 +212,30 @@ public class BilletHotsendChangeShiftController extends JeecgController<BilletHo
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
return super.importExcel(request, response, BilletHotsendChangeShift.class);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="钢坯交班历史记录查询", notes="钢坯交班历史记录查询")
|
|
|
+ @GetMapping(value = "/changeShiftList")
|
|
|
+ public Result<List<BilletHotsendChangeShift>> queryChangeShiftList(@RequestParam(name="ccmNo") String ccmNo,
|
|
|
+ @RequestParam(name="dateMonth") String dateMonth) {
|
|
|
+ // 根据前端传递dateMonth 例如:2025-03 获取2025-03-01 00:00:00 至2025-03-31 23:59:59的时间,startTime endTime
|
|
|
+ // 解析输入的年月字符串
|
|
|
+ YearMonth yearMonth = YearMonth.parse(dateMonth, DateTimeFormatter.ofPattern("yyyy-MM"));
|
|
|
+
|
|
|
+ // 获取该月的第一天的开始时间
|
|
|
+ LocalDateTime startTime = yearMonth.atDay(1).atStartOfDay();
|
|
|
+ // 获取该月的最后一天的结束时间
|
|
|
+ LocalDateTime endTime = yearMonth.atEndOfMonth().atTime(LocalTime.MAX);
|
|
|
+
|
|
|
+ Date startDate = DateUtils.convertToDate(startTime);
|
|
|
+ Date endDate = DateUtils.convertToDate(endTime);
|
|
|
+
|
|
|
+ // 根据铸机号、开始时间、结束时间查询对应的交班信息
|
|
|
+ LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
|
|
|
+ .between(BilletHotsendChangeShift::getCreateTime, startDate, endDate)
|
|
|
+ .orderByDesc(BilletHotsendChangeShift::getCreateTime);
|
|
|
+ List<BilletHotsendChangeShift> pageList = billetHotsendChangeShiftService.list(queryWrapper);
|
|
|
+
|
|
|
+ return Result.OK(pageList);
|
|
|
+ }
|
|
|
}
|