| | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.ExceptionCast; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.util.FileUtil; |
| | |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandard; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandardDetail; |
| | | import org.jeecg.modules.eam.entity.EamSysFiles; |
| | | import org.jeecg.modules.eam.request.EamMaintenanceStandardRequest; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEamMaintenanceStandardService; |
| | |
| | | public Result<?> queryPageList(EamMaintenanceStandard eamMaintenanceStandard, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | HttpServletRequest req) throws JsonProcessingException { |
| | | // QueryWrapper<EamMaintenanceStandard> queryWrapper = QueryGenerator.initQueryWrapper(eamMaintenanceStandard, req.getParameterMap()); |
| | | Page<EamMaintenanceStandard> page = new Page<EamMaintenanceStandard>(pageNo, pageSize); |
| | | IPage<EamMaintenanceStandard> pageList = eamMaintenanceStandardService.queryPageList(page, eamMaintenanceStandard); |
| | | for (EamMaintenanceStandard record : pageList.getRecords()) { |
| | | String json = record.getReferenceFile(); |
| | | if(StringUtils.isNotBlank(json)){ |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | Map<String, Object> map = mapper.readValue(json, Map.class); |
| | | String fileName = (String) map.get("fileName"); |
| | | record.setFileName(fileName); |
| | | } |
| | | } |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | log.error("读取Excel信息失败:{}", e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/downloadFile") |
| | | public void downloadFile(@RequestParam("id") String id, HttpServletResponse response) throws JsonProcessingException { |
| | | |
| | | eamMaintenanceStandardService.downloadFile(response, eamMaintenanceStandardService.getById(id)); |
| | | } |
| | | } |