|
|
|
|
@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@ -59,6 +60,8 @@ public class FeedingRecordController {
|
|
|
|
|
public CommonResult<Long> createFeedingRecord(@Valid @RequestBody FeedingRecordSaveReqVO createReqVO) {
|
|
|
|
|
Long userId = getLoginUserId();
|
|
|
|
|
createReqVO.setUserId(userId);
|
|
|
|
|
if(createReqVO.getFeedingTime()==null)
|
|
|
|
|
createReqVO.setFeedingTime(LocalDateTime.now());
|
|
|
|
|
return success(feedingRecordService.createFeedingRecord(createReqVO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -108,7 +111,18 @@ public class FeedingRecordController {
|
|
|
|
|
ExcelUtils.write(response, "投料记录.xls", "数据", FeedingRecordRespVO.class,
|
|
|
|
|
list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getRecordList")
|
|
|
|
|
@Operation(summary = "投料记录 ")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:feeding-record:query')")
|
|
|
|
|
public CommonResult<List<FeedingRecordRespVO>> getRecordList(@Valid FeedingRecordPageReqVO pageReqVO) throws IOException {
|
|
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
if(pageReqVO.getFeedingTime()==null || pageReqVO.getFeedingTime().length==0){
|
|
|
|
|
LocalDateTime[] dateTimes={LocalDateTime.now().plusDays(-3),LocalDateTime.now()};
|
|
|
|
|
pageReqVO.setFeedingTime(dateTimes);
|
|
|
|
|
}
|
|
|
|
|
List<FeedingRecordRespVO> list = feedingRecordService.getFeedingRecordPage(pageReqVO).getList();
|
|
|
|
|
return success(list);
|
|
|
|
|
}
|
|
|
|
|
// ==================== 子表(投料记录明细) ====================
|
|
|
|
|
|
|
|
|
|
@GetMapping("/feeding-record-detail/list-by-record-id")
|
|
|
|
|
|