| | |
| | | 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.extension.plugins.pagination.Page; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.entity.EamSecondMaintenanceOrderDetail; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrderDetail; |
| | | import org.jeecg.modules.eam.service.IEamThirdMaintenanceOrderDetailService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | 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<EamThirdMaintenanceOrderDetail> list = eamThirdMaintenanceOrderDetailService.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<EamThirdMaintenanceOrderDetail> details = new ArrayList<>(); |
| | | List<EamThirdMaintenanceOrderDetail> list = eamThirdMaintenanceOrderDetailService.lambdaQuery() |
| | | .eq(EamThirdMaintenanceOrderDetail::getOrderId, orderId) |
| | | .eq(EamThirdMaintenanceOrderDetail::getMaintenanceResult, "2") |
| | | .list(); |
| | | EamThirdMaintenanceOrderDetail detail = new EamThirdMaintenanceOrderDetail(); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | int index = 1; |
| | | for (EamThirdMaintenanceOrderDetail 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; |
| | | } |
| | | } |