zhangherong
13 小时以前 ee530992793ed7d0b7f16f1ce07b6c53ae265068
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package org.jeecg.modules.eam.controller;
 
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.EamTechnicalStatusChangeDetail;
import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeDetailService;
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;
 
/**
 * @Description: 技术状态变更申请明细
 * @Author: jeecg-boot
 * @Date: 2025-07-09
 * @Version: V1.0
 */
@Slf4j
@Api(tags = "技术状态变更申请明细")
@RestController
@RequestMapping("/eam/eamTechnicalStatusChangeDetail")
public class EamTechnicalStatusChangeDetailController extends JeecgController<EamTechnicalStatusChangeDetail, IEamTechnicalStatusChangeDetailService> {
    @Autowired
    private IEamTechnicalStatusChangeDetailService orderDetailService;
    @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private TranslateDictTextUtils translateDictTextUtils;
 
    /**
     * 一次加载
     *
     * @param orderId
     * @return
     */
    @ApiOperation(value = "技术状态变更申请明细-不分页列表查询", notes = "技术状态变更申请明细-不分页列表查询")
    @GetMapping(value = "/queryList")
    public Result<?> queryList(@RequestParam("orderId") String orderId) {
        List<EamTechnicalStatusChangeDetail> list = orderDetailService.queryList(orderId);
        List<JSONObject> items = new ArrayList<>();
        try {
            for(EamTechnicalStatusChangeDetail vo : list) {
                String json = objectMapper.writeValueAsString(vo);
                JSONObject item = JSONObject.parseObject(json, Feature.OrderedField);
                translateDictTextUtils.translateField("changeCategory", vo.getChangeCategory(), item, "technical_status_change_reason");
                translateDictTextUtils.translateField("changeTechnicalStatus", vo.getChangeTechnicalStatus(), item, "equipment_technology_status");
                translateDictTextUtils.translateField("acceptanceCheckResult", vo.getAcceptanceCheckResult(), item, "equipment_technology_status");
                items.add(item);
            }
            return Result.OK(items);
        }catch (Exception e) {
            return Result.error("数据转译失败!");
        }
    }
}