| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.api.ISysBaseAPI; |
| | | import org.jeecg.common.system.base.entity.SysUpload; |
| | |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.StrUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.CalibrationOrder; |
| | | import org.jeecg.modules.eam.entity.CalibrationOrderReport; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.EquipmentDocument; |
| | | import org.jeecg.modules.eam.service.ICalibrationOrderReportService; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.jeecg.modules.eam.service.ICalibrationOrderService; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | |
| | | /** |
| | | /** |
| | | * @Description: mom_eam_calibration_order_report |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-07-20 |
| | | * @Date: 2023-07-20 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="mom_eam_calibration_order_report") |
| | | @Api(tags = "mom_eam_calibration_order_report") |
| | | @RestController |
| | | @RequestMapping("/eam/calibrationOrderReport") |
| | | @Slf4j |
| | | public class CalibrationOrderReportController extends JeecgController<CalibrationOrderReport, ICalibrationOrderReportService> { |
| | | @Autowired |
| | | private ICalibrationOrderReportService calibrationOrderReportService; |
| | | @Autowired |
| | | private ICalibrationOrderReportService calibrationOrderReportService; |
| | | |
| | | @Autowired |
| | | private ISysBaseAPI sysBaseApi; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param calibrationOrderReport |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_calibration_order_report-分页列表查询") |
| | | @ApiOperation(value="mom_eam_calibration_order_report-分页列表查询", notes="mom_eam_calibration_order_report-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CalibrationOrderReport>> queryPageList(CalibrationOrderReport calibrationOrderReport, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<CalibrationOrderReport> queryWrapper = QueryGenerator.initQueryWrapper(calibrationOrderReport, req.getParameterMap()); |
| | | Page<CalibrationOrderReport> page = new Page<CalibrationOrderReport>(pageNo, pageSize); |
| | | IPage<CalibrationOrderReport> pageList = calibrationOrderReportService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | @Autowired |
| | | private ICalibrationOrderService calibrationOrderService; |
| | | @Autowired |
| | | private ISysBaseAPI sysBaseApi; |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> add(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | String str = request.getParameter("data"); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | |
| | | boolean isFileChange = true; |
| | | String uploadId = json.getString("uploadId"); |
| | | String fileType = json.getString("fileType"); |
| | | String description = json.getString("remark"); |
| | | String type = json.getString("type"); |
| | | |
| | | CalibrationOrderReport calibrationOrderReport = json.toJavaObject(CalibrationOrderReport.class); |
| | | calibrationOrderReport.setType(fileType); |
| | | calibrationOrderReportService.save(calibrationOrderReport); |
| | | // 文件变更 |
| | | if (isFileChange) { |
| | | if (StrUtils.isNotBlankOrNull(uploadId)) { |
| | | // 情形一、从文件管理中选择 |
| | | // uploadRelaService.saveOrUpdateUploadRale(partRouteFile.getId(), partRouteFile.getType(), uploadId); |
| | | } else { |
| | | // 情形二、重新上传 |
| | | // 1、持久upload |
| | | MultipartFile multipartFile = request.getFile("file"); |
| | | List<MultipartFile> multipartFileList = new ArrayList<>(); |
| | | multipartFileList.add(multipartFile); |
| | | // List<SysUpload> sysUploads = uploadService.batchUploadFile(fileType, multipartFileList, description); |
| | | // // 2、创建/修改 uploadRela |
| | | // // 注:当前视为单文件上传控制,后续可能会有单个产品工艺文件对应多个上传文件的升级调整,修改后注意更细此段注释 |
| | | // uploadRelaService.saveOrUpdateUploadRale(equipmentDocument.getId(), type, sysUploads.get(0).getId()); |
| | | List<SysUpload> sysUploads = sysBaseApi.batchUploadFile(fileType, multipartFileList, description); |
| | | // 2、创建/修改 uploadRela |
| | | // 注:当前视为单文件上传控制,后续可能会有单个产品工艺文件对应多个上传文件的升级调整,修改后注意更细此段注释 |
| | | sysBaseApi.saveOrUpdateUploadRale(calibrationOrderReport.getId(), type, sysUploads.get(0).getId()); |
| | | } |
| | | } |
| | | |
| | | return Result.ok("上传成功!"); |
| | | } |
| | | |
| | | @PostMapping(value = "/edit") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> edit(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | String str = request.getParameter("data"); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | |
| | | boolean isFileChange = json.getBoolean("isFileChange"); |
| | | String uploadId = json.getString("uploadId"); |
| | | String fileType = json.getString("fileType"); |
| | | String description = json.getString("remark"); |
| | | String type = json.getString("type"); |
| | | |
| | | CalibrationOrderReport calibrationOrderReport = json.toJavaObject(CalibrationOrderReport.class); |
| | | calibrationOrderReport.setType(fileType); |
| | | calibrationOrderReportService.saveOrUpdate(calibrationOrderReport); |
| | | // 文件变更 |
| | | if (isFileChange) { |
| | | if (StrUtils.isNotBlankOrNull(uploadId)) { |
| | | // 情形一、从文件管理中选择 |
| | | // uploadRelaService.saveOrUpdateUploadRale(partRouteFile.getId(), partRouteFile.getType(), uploadId); |
| | | } else { |
| | | // 情形二、重新上传 |
| | | // 1、持久upload |
| | | MultipartFile multipartFile = request.getFile("file"); |
| | | List<MultipartFile> multipartFileList = new ArrayList<>(); |
| | | multipartFileList.add(multipartFile); |
| | | // List<SysUpload> sysUploads = uploadService.batchUploadFile(fileType, multipartFileList, description); |
| | | // // 2、创建/修改 uploadRela |
| | | // // 注:当前视为单文件上传控制,后续可能会有单个产品工艺文件对应多个上传文件的升级调整,修改后注意更细此段注释 |
| | | // uploadRelaService.saveOrUpdateUploadRale(equipmentDocument.getId(), type, sysUploads.get(0).getId()); |
| | | List<SysUpload> sysUploads = sysBaseApi.batchUploadFile(fileType, multipartFileList, description); |
| | | // 2、创建/修改 uploadRela |
| | | // 注:当前视为单文件上传控制,后续可能会有单个产品工艺文件对应多个上传文件的升级调整,修改后注意更细此段注释 |
| | | sysBaseApi.saveOrUpdateUploadRale(calibrationOrderReport.getId(), type, sysUploads.get(0).getId()); |
| | | } |
| | | } |
| | | |
| | | return Result.ok("上传成功!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "mom_eam_calibration_order_report-通过id删除") |
| | | @ApiOperation(value="mom_eam_calibration_order_report-通过id删除", notes="mom_eam_calibration_order_report-通过id删除") |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | //删除文件管理与业务数据关系 |
| | | // List<SysUploadRela> sysUploadRelas = uploadRelaService.lambdaQuery().eq(SysUploadRela::getBusId, id).eq(SysUploadRela::getDelFlag, 0).list(); |
| | | List<SysUploadRela> sysUploadRelas = sysBaseApi.listByBusIdAndBusType(id, null); |
| | | for (SysUploadRela sysUploadRela : sysUploadRelas) { |
| | | String uploadId = sysUploadRela.getUploadId(); |
| | | // uploadService.removeById(uploadId); |
| | | // uploadRelaService.removeById(sysUploadRela); |
| | | sysBaseApi.removeUploadById(uploadId); |
| | | sysBaseApi.removeUploadRelaById(sysUploadRela.getId()); |
| | | } |
| | | calibrationOrderReportService.removeById(id); |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "mom_eam_calibration_order_report-批量删除") |
| | | @ApiOperation(value="mom_eam_calibration_order_report-批量删除", notes="mom_eam_calibration_order_report-批量删除") |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.calibrationOrderReportService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("批量删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_calibration_order_report-通过id查询") |
| | | @ApiOperation(value="mom_eam_calibration_order_report-通过id查询", notes="mom_eam_calibration_order_report-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<CalibrationOrderReport> queryById(@RequestParam(name="id",required=true) String id) { |
| | | CalibrationOrderReport calibrationOrderReport = calibrationOrderReportService.getById(id); |
| | | if(calibrationOrderReport==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | return Result.OK(calibrationOrderReport); |
| | | } |
| | | @Autowired |
| | | private IEamEquipmentService eamEquipmentService; |
| | | |
| | | /** |
| | | * 导出excel |
| | | * |
| | | * @param request |
| | | * @param calibrationOrderReport |
| | | */ |
| | | * 分页列表查询 |
| | | * |
| | | * @param calibrationOrderReport |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_calibration_order_report-分页列表查询") |
| | | @ApiOperation(value = "mom_eam_calibration_order_report-分页列表查询", notes = "mom_eam_calibration_order_report-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CalibrationOrderReport>> queryPageList(CalibrationOrderReport calibrationOrderReport, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
| | | QueryWrapper<CalibrationOrderReport> queryWrapper = QueryGenerator.initQueryWrapper(calibrationOrderReport, req.getParameterMap()); |
| | | Page<CalibrationOrderReport> page = new Page<CalibrationOrderReport>(pageNo, pageSize); |
| | | IPage<CalibrationOrderReport> pageList = calibrationOrderReportService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> add(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | String str = request.getParameter("data"); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | |
| | | boolean isFileChange = true; |
| | | String uploadId = json.getString("uploadId"); |
| | | String fileType = json.getString("fileType"); |
| | | String description = json.getString("remark"); |
| | | String type = json.getString("type"); |
| | | |
| | | CalibrationOrderReport calibrationOrderReport = json.toJavaObject(CalibrationOrderReport.class); |
| | | calibrationOrderReport.setType(fileType); |
| | | calibrationOrderReportService.save(calibrationOrderReport); |
| | | |
| | | // 文件变更 |
| | | if (isFileChange) { |
| | | if (StrUtils.isNotBlankOrNull(uploadId)) { |
| | | // 情形一、从文件管理中选择 |
| | | // uploadRelaService.saveOrUpdateUploadRale(partRouteFile.getId(), partRouteFile.getType(), uploadId); |
| | | } else { |
| | | // 情形二、重新上传 |
| | | // 1、持久upload |
| | | MultipartFile multipartFile = request.getFile("file"); |
| | | List<MultipartFile> multipartFileList = new ArrayList<>(); |
| | | multipartFileList.add(multipartFile); |
| | | // List<SysUpload> sysUploads = uploadService.batchUploadFile(fileType, multipartFileList, description); |
| | | // // 2、创建/修改 uploadRela |
| | | // // 注:当前视为单文件上传控制,后续可能会有单个产品工艺文件对应多个上传文件的升级调整,修改后注意更细此段注释 |
| | | // uploadRelaService.saveOrUpdateUploadRale(equipmentDocument.getId(), type, sysUploads.get(0).getId()); |
| | | List<SysUpload> sysUploads = sysBaseApi.batchUploadFile(fileType, multipartFileList, description); |
| | | // 2、创建/修改 uploadRela |
| | | // 注:当前视为单文件上传控制,后续可能会有单个产品工艺文件对应多个上传文件的升级调整,修改后注意更细此段注释 |
| | | sysBaseApi.saveOrUpdateUploadRale(calibrationOrderReport.getId(), type, sysUploads.get(0).getId()); |
| | | } |
| | | } |
| | | // 更新主表为已完成 |
| | | CalibrationOrder calibrationOrder = calibrationOrderService.getById(calibrationOrderReport.getCalibrationOrderId()); |
| | | // status 已完成 |
| | | calibrationOrder.setStatus("4"); |
| | | calibrationOrder.setCalibrationResult(calibrationOrderReport.getJudgmentResult()); |
| | | calibrationOrder.setCalibrationTime(new Date()); |
| | | calibrationOrderService.updateById(calibrationOrder); |
| | | // 更新设备技术状态 |
| | | Equipment equipment = eamEquipmentService.getById(calibrationOrder.getEquipmentId()); |
| | | |
| | | if (StringUtils.isNotBlank(equipment.getId())) { |
| | | equipment.setTechnologyStatus(calibrationOrderReport.getJudgmentResult()); |
| | | eamEquipmentService.updateById(equipment); |
| | | } |
| | | |
| | | return Result.ok("上传成功!"); |
| | | } |
| | | |
| | | @PostMapping(value = "/edit") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> edit(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | String str = request.getParameter("data"); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | |
| | | boolean isFileChange = json.getBoolean("isFileChange"); |
| | | String uploadId = json.getString("uploadId"); |
| | | String fileType = json.getString("fileType"); |
| | | String description = json.getString("remark"); |
| | | String type = json.getString("type"); |
| | | |
| | | CalibrationOrderReport calibrationOrderReport = json.toJavaObject(CalibrationOrderReport.class); |
| | | calibrationOrderReport.setType(fileType); |
| | | calibrationOrderReportService.saveOrUpdate(calibrationOrderReport); |
| | | // 文件变更 |
| | | if (isFileChange) { |
| | | if (StrUtils.isNotBlankOrNull(uploadId)) { |
| | | // 情形一、从文件管理中选择 |
| | | // uploadRelaService.saveOrUpdateUploadRale(partRouteFile.getId(), partRouteFile.getType(), uploadId); |
| | | } else { |
| | | // 情形二、重新上传 |
| | | // 1、持久upload |
| | | MultipartFile multipartFile = request.getFile("file"); |
| | | List<MultipartFile> multipartFileList = new ArrayList<>(); |
| | | multipartFileList.add(multipartFile); |
| | | // List<SysUpload> sysUploads = uploadService.batchUploadFile(fileType, multipartFileList, description); |
| | | // // 2、创建/修改 uploadRela |
| | | // // 注:当前视为单文件上传控制,后续可能会有单个产品工艺文件对应多个上传文件的升级调整,修改后注意更细此段注释 |
| | | // uploadRelaService.saveOrUpdateUploadRale(equipmentDocument.getId(), type, sysUploads.get(0).getId()); |
| | | List<SysUpload> sysUploads = sysBaseApi.batchUploadFile(fileType, multipartFileList, description); |
| | | // 2、创建/修改 uploadRela |
| | | // 注:当前视为单文件上传控制,后续可能会有单个产品工艺文件对应多个上传文件的升级调整,修改后注意更细此段注释 |
| | | sysBaseApi.saveOrUpdateUploadRale(calibrationOrderReport.getId(), type, sysUploads.get(0).getId()); |
| | | } |
| | | } |
| | | |
| | | return Result.ok("上传成功!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "mom_eam_calibration_order_report-通过id删除") |
| | | @ApiOperation(value = "mom_eam_calibration_order_report-通过id删除", notes = "mom_eam_calibration_order_report-通过id删除") |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | //删除文件管理与业务数据关系 |
| | | // List<SysUploadRela> sysUploadRelas = uploadRelaService.lambdaQuery().eq(SysUploadRela::getBusId, id).eq(SysUploadRela::getDelFlag, 0).list(); |
| | | List<SysUploadRela> sysUploadRelas = sysBaseApi.listByBusIdAndBusType(id, null); |
| | | for (SysUploadRela sysUploadRela : sysUploadRelas) { |
| | | String uploadId = sysUploadRela.getUploadId(); |
| | | // uploadService.removeById(uploadId); |
| | | // uploadRelaService.removeById(sysUploadRela); |
| | | sysBaseApi.removeUploadById(uploadId); |
| | | sysBaseApi.removeUploadRelaById(sysUploadRela.getId()); |
| | | } |
| | | calibrationOrderReportService.removeById(id); |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "mom_eam_calibration_order_report-批量删除") |
| | | @ApiOperation(value = "mom_eam_calibration_order_report-批量删除", notes = "mom_eam_calibration_order_report-批量删除") |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.calibrationOrderReportService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("批量删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_calibration_order_report-通过id查询") |
| | | @ApiOperation(value = "mom_eam_calibration_order_report-通过id查询", notes = "mom_eam_calibration_order_report-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<CalibrationOrderReport> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | CalibrationOrderReport calibrationOrderReport = calibrationOrderReportService.getById(id); |
| | | if (calibrationOrderReport == null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | return Result.OK(calibrationOrderReport); |
| | | } |
| | | |
| | | /** |
| | | * 导出excel |
| | | * |
| | | * @param request |
| | | * @param calibrationOrderReport |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, CalibrationOrderReport calibrationOrderReport) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过excel导入数据 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | * 通过excel导入数据 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("mom_eam_calibration_order_report:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设备检定 获取检定报告 |
| | | * qsw 2023-7-20 |
| | | */ |
| | | @GetMapping("getCalibrationOrderReportList") |
| | | public Result<?> getCalibrationOrderReportList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> calibrationOrderReports = calibrationOrderReportService.getCalibrationOrderReportById(pageNo, pageSize, params); |
| | | for (Map<String, Object> calibrationOrderReport : calibrationOrderReports.getRecords()) { |
| | | //获取是否有无异常照片数据 |
| | | /** |
| | | * 设备检定 获取检定报告 |
| | | * qsw 2023-7-20 |
| | | */ |
| | | @GetMapping("getCalibrationOrderReportList") |
| | | public Result<?> getCalibrationOrderReportList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> calibrationOrderReports = calibrationOrderReportService.getCalibrationOrderReportById(pageNo, pageSize, params); |
| | | for (Map<String, Object> calibrationOrderReport : calibrationOrderReports.getRecords()) { |
| | | //获取是否有无异常照片数据 |
| | | // List<SysUploadRela> sysUploadRelas = uploadRelaService.lambdaQuery().eq(SysUploadRela::getBusId, (String) calibrationOrderReport.get("id")).eq(SysUploadRela::getDelFlag, 0).list(); |
| | | List<SysUploadRela> sysUploadRelas =sysBaseApi.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), null); |
| | | if (sysUploadRelas.size() > 0) { |
| | | List<SysUploadRela> sysUploadRelas = sysBaseApi.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), null); |
| | | if (sysUploadRelas.size() > 0) { |
| | | |
| | | // List<SysUploadRela> uploadRelas = uploadRelaService.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), "calibration_order_report"); |
| | | List<SysUploadRela> uploadRelas = sysBaseApi.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), "calibration_order_report"); |
| | | SysUpload upload = new SysUpload(); |
| | | if (CollectionUtils.isNotEmpty(uploadRelas)) { |
| | | //upload = uploadService.getById(uploadRelas.get(0).getUploadId()); |
| | | upload = sysBaseApi.getUploadById(uploadRelas.get(0).getUploadId()); |
| | | } |
| | | calibrationOrderReport.put("upload", upload); |
| | | } else { |
| | | List<SysUploadRela> uploadRelas = sysBaseApi.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), "calibration_order_report"); |
| | | SysUpload upload = new SysUpload(); |
| | | if (CollectionUtils.isNotEmpty(uploadRelas)) { |
| | | //upload = uploadService.getById(uploadRelas.get(0).getUploadId()); |
| | | upload = sysBaseApi.getUploadById(uploadRelas.get(0).getUploadId()); |
| | | } |
| | | calibrationOrderReport.put("upload", upload); |
| | | } else { |
| | | |
| | | SysUpload upload = new SysUpload(); |
| | | calibrationOrderReport.put("upload", upload); |
| | | } |
| | | } |
| | | return Result.ok(calibrationOrderReports); |
| | | } |
| | | SysUpload upload = new SysUpload(); |
| | | calibrationOrderReport.put("upload", upload); |
| | | } |
| | | } |
| | | return Result.ok(calibrationOrderReports); |
| | | } |
| | | |
| | | } |