| | |
| | | import com.ruoyi.production.dto.ProductInspectionRecordDto; |
| | | import com.ruoyi.production.pojo.ProductInspectionRecord; |
| | | import com.ruoyi.production.service.ProductInspectionRecordService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.service.ISysUserService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public class ProductInspectionRecordController { |
| | | @Autowired |
| | | private ProductInspectionRecordService productInspectionRecordService; |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @ApiOperation("巡检记录 分页查询") |
| | | @GetMapping("listPage") |
| | |
| | | .between(Objects.nonNull(productInspectionRecord.getStartTime()) && Objects.nonNull(productInspectionRecord.getEndTime()), |
| | | ProductInspectionRecord::getInspectionTime, productInspectionRecord.getStartTime(), |
| | | productInspectionRecord.getEndTime()); |
| | | return AjaxResult.success(productInspectionRecordService.page(page, ew)); |
| | | // 查询分页数据 |
| | | Page<ProductInspectionRecord> resultPage = productInspectionRecordService.page(page, ew); |
| | | |
| | | List<ProductInspectionRecord> records = resultPage.getRecords(); |
| | | for (ProductInspectionRecord record : records) { |
| | | if (record.getCreateUser() != null) { |
| | | Long userId = record.getCreateUser().longValue(); |
| | | SysUser user = sysUserService.selectUserById(userId); |
| | | if (user != null) { |
| | | record.setCreateUserName(user.getNickName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success(resultPage); |
| | | } |
| | | |
| | | @ApiOperation("巡检记录 新增") |