From bcd90314646203b32f73c89c1c2f89eaa96e2c9f Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期五, 18 七月 2025 18:05:35 +0800 Subject: [PATCH] art: 设备台账-查询需要做技术状态鉴定的设备列表 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationOrderChangeController.java | 84 +++++++++++++----------------------------- 1 files changed, 26 insertions(+), 58 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationOrderChangeController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationOrderChangeController.java index b6ea5bb..8cf347e 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationOrderChangeController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationOrderChangeController.java @@ -1,14 +1,19 @@ package org.jeecg.modules.eam.controller; 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.TechnicalStatusEvaluationOrderChangeStatusEnum; import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationOrderChange; import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderChangeQuery; @@ -16,11 +21,8 @@ import org.jeecg.modules.eam.service.IEamTechnicalStatusEvaluationOrderChangeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; /** * @Description: 鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇� @@ -35,6 +37,10 @@ public class EamTechnicalStatusEvaluationOrderChangeController extends JeecgController<EamTechnicalStatusEvaluationOrderChange, IEamTechnicalStatusEvaluationOrderChangeService> { @Autowired private IEamTechnicalStatusEvaluationOrderChangeService eamTechnicalStatusEvaluationOrderChangeService; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private TranslateDictTextUtils translateDictTextUtils; /** * 鍒嗛〉鍒楄〃鏌ヨ @@ -71,9 +77,9 @@ } boolean b = eamTechnicalStatusEvaluationOrderChangeService.addTechnicalStatusEvaluationOrderChange(request); if (!b) { - return Result.error("娣诲姞澶辫触锛�"); + return Result.error("鍙樻洿澶辫触锛�"); } - return Result.OK("娣诲姞鎴愬姛锛�"); + return Result.OK("鍙樻洿鎴愬姛锛�"); } /** @@ -142,34 +148,6 @@ } /** - * 閫氳繃id鍒犻櫎 - * - * @param id - * @return - */ - @AutoLog(value = "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�-閫氳繃id鍒犻櫎") - @ApiOperation(value = "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�-閫氳繃id鍒犻櫎", notes = "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�-閫氳繃id鍒犻櫎") - @DeleteMapping(value = "/delete") - public Result<?> delete(@RequestParam(name = "id", required = true) String id) { - eamTechnicalStatusEvaluationOrderChangeService.removeById(id); - return Result.OK("鍒犻櫎鎴愬姛!"); - } - - /** - * 鎵归噺鍒犻櫎 - * - * @param ids - * @return - */ - @AutoLog(value = "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�-鎵归噺鍒犻櫎") - @ApiOperation(value = "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�-鎵归噺鍒犻櫎", notes = "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�-鎵归噺鍒犻櫎") - @DeleteMapping(value = "/deleteBatch") - public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { - this.eamTechnicalStatusEvaluationOrderChangeService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�"); - } - - /** * 閫氳繃id鏌ヨ * * @param id @@ -179,31 +157,21 @@ @ApiOperation(value = "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�-閫氳繃id鏌ヨ", notes = "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�-閫氳繃id鏌ヨ") @GetMapping(value = "/queryById") public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { - EamTechnicalStatusEvaluationOrderChange eamTechnicalStatusEvaluationOrderChange = eamTechnicalStatusEvaluationOrderChangeService.getById(id); - return Result.OK(eamTechnicalStatusEvaluationOrderChange); - } - - /** - * 瀵煎嚭excel - * - * @param request - * @param eamTechnicalStatusEvaluationOrderChange - */ - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, EamTechnicalStatusEvaluationOrderChange eamTechnicalStatusEvaluationOrderChange) { - return super.exportXls(request, eamTechnicalStatusEvaluationOrderChange, EamTechnicalStatusEvaluationOrderChange.class, "鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇�"); - } - - /** - * 閫氳繃excel瀵煎叆鏁版嵁 - * - * @param request - * @param response - * @return - */ - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, EamTechnicalStatusEvaluationOrderChange.class); + EamTechnicalStatusEvaluationOrderChange entity = eamTechnicalStatusEvaluationOrderChangeService.getById(id); + if (entity == null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + try { + String json = objectMapper.writeValueAsString(entity); + JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); + translateDictTextUtils.translateField("orderId", entity.getOrderId(), item, "eam_technical_status_evaluation_order,order_num,id"); + translateDictTextUtils.translateField("applicant", entity.getApplicant(), item, "sys_user,realname,username"); + translateDictTextUtils.translateField("factoryOrgCode", entity.getFactoryOrgCode(), item, "eam_base_factory,factory_name,org_code"); + translateDictTextUtils.translateField("applyReason", entity.getApplyReason(), item, "technical_status_evaluation_order_change_reason"); + return Result.OK(item); + } catch (JsonProcessingException e) { + return Result.error("鏁版嵁杞瘧澶辫触锛�"); + } } } -- Gitblit v1.9.3