| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | 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.system.base.controller.JeecgController; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.constant.TechnicalStatusDeactivateStatusEnum; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivate; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusDeactivateQuery; |
| | |
| | | public class EamTechnicalStatusDeactivateController extends JeecgController<EamTechnicalStatusDeactivate, IEamTechnicalStatusDeactivateService> { |
| | | @Autowired |
| | | private IEamTechnicalStatusDeactivateService eamTechnicalStatusDeactivateService; |
| | | @Autowired |
| | | private ObjectMapper objectMapper; |
| | | @Autowired |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | EamTechnicalStatusDeactivate eamTechnicalStatusDeactivate = eamTechnicalStatusDeactivateService.getById(id); |
| | | return Result.OK(eamTechnicalStatusDeactivate); |
| | | if (eamTechnicalStatusDeactivate == null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | try { |
| | | String json = objectMapper.writeValueAsString(eamTechnicalStatusDeactivate); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("applicant", eamTechnicalStatusDeactivate.getApplicant(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("factoryOrgCode", eamTechnicalStatusDeactivate.getFactoryOrgCode(), item, "eam_base_factory,factory_name,org_code"); |
| | | return Result.OK(item); |
| | | } catch (JsonProcessingException e) { |
| | | return Result.error("数据转译失败!"); |
| | | } |
| | | } |
| | | } |