¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | 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.system.base.controller.JeecgController; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentPrecisionParameters; |
| | | import org.jeecg.modules.eam.entity.EamPrecisionCheckDetail; |
| | | import org.jeecg.modules.eam.service.IEamPrecisionCheckDetailService; |
| | | 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.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤ç²¾åº¦æ£æµæç» |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-13 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="设å¤ç²¾åº¦æ£æµæç»") |
| | | @RestController |
| | | @RequestMapping("/eam/precisionCheckDetail") |
| | | public class EamPrecisionCheckDetailController extends JeecgController<EamPrecisionCheckDetail, IEamPrecisionCheckDetailService> { |
| | | @Autowired |
| | | private IEamPrecisionCheckDetailService eamPrecisionCheckDetailService; |
| | | @Autowired |
| | | private ObjectMapper objectMapper; |
| | | @Autowired |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | |
| | | /** |
| | | * å表æ¥è¯¢ |
| | | * |
| | | * @param orderId å·¥åID |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="设å¤ç²¾åº¦åæ°-å表æ¥è¯¢", notes="设å¤ç²¾åº¦åæ°-å表æ¥è¯¢") |
| | | @GetMapping(value = "/queryList") |
| | | public Result<?> queryList(@RequestParam(name="orderId") String orderId) { |
| | | List<EamPrecisionCheckDetail> list = eamPrecisionCheckDetailService.getByOrderId(orderId); |
| | | if(CollectionUtil.isEmpty(list)) { |
| | | return Result.OK(Collections.emptyList()); |
| | | } |
| | | List<JSONObject> items = new ArrayList<>(); |
| | | try { |
| | | for(EamPrecisionCheckDetail vo : list) { |
| | | String json = objectMapper.writeValueAsString(vo); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("parameterId", vo.getParameterId(), item, "eam_precision_parameters,parameter_name,id"); |
| | | translateDictTextUtils.translateField("parameterCode", vo.getParameterId(), item, "eam_precision_parameters,parameter_code,id"); |
| | | items.add(item); |
| | | } |
| | | return Result.OK(items); |
| | | }catch (Exception e) { |
| | | return Result.error("æ°æ®è½¬è¯å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | } |