| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.entity.EamSecondMaintenanceOrderDetail; |
| | | import org.jeecg.modules.eam.service.IEamSecondMaintenanceOrderDetailService; |
| | | import org.jeecg.modules.eam.vo.InspectionVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 设备二级保养明细 |
| | |
| | | List<EamSecondMaintenanceOrderDetail> list = eamSecondMaintenanceOrderDetailService.list(queryWrapper); |
| | | return Result.OK(list); |
| | | } |
| | | |
| | | /** |
| | | * 报表使用 qsw |
| | | * 2025-6-19 |
| | | */ |
| | | @GetMapping("/findExceptionDescriptionAll") |
| | | public JSONObject findInspectionUser(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | |
| | | String orderId = (String)params.get("id"); |
| | | |
| | | List<EamSecondMaintenanceOrderDetail> details = new ArrayList<>(); |
| | | List<EamSecondMaintenanceOrderDetail> list = eamSecondMaintenanceOrderDetailService.lambdaQuery() |
| | | .eq(EamSecondMaintenanceOrderDetail::getOrderId, orderId) |
| | | .eq(EamSecondMaintenanceOrderDetail::getMaintenanceResult, "2") |
| | | .list(); |
| | | EamSecondMaintenanceOrderDetail detail = new EamSecondMaintenanceOrderDetail(); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | int index = 1; |
| | | for (EamSecondMaintenanceOrderDetail item : list) { |
| | | String value = item.getExceptionDescription(); |
| | | if (value != null && !value.isEmpty()) { // 跳过null和空字符串 |
| | | sb.append(index).append(". ").append(value).append(System.lineSeparator()); |
| | | index++; |
| | | } |
| | | } |
| | | // 移除最后一个多余的换行符(可选) |
| | | if (sb.length() > 0) { |
| | | sb.setLength(sb.length() - System.lineSeparator().length()); |
| | | } |
| | | |
| | | String s = sb.toString(); |
| | | detail.setExceptionDescription(s); |
| | | details.add(detail); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("data",details); |
| | | return jsonObject; |
| | | } |
| | | } |