| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.dto.EamReportAccidentsRegisterDto; |
| | |
| | | private IEamReportAccidentsRegisterService eamReportAccidentsRegisterService; |
| | | @Autowired |
| | | private IEamReportRepairService eamReportRepairService; |
| | | @Autowired |
| | | private ObjectMapper objectMapper; |
| | | @Autowired |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | //@AutoLog(value = "设备事故登记表-通过id查询") |
| | | @ApiOperation(value="设备事故登记表-通过id查询", notes="设备事故登记表-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<EamReportAccidentsRegister> queryById(@RequestParam(name="id",required=true) String id) { |
| | | public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
| | | EamReportAccidentsRegister eamReportAccidentsRegister = eamReportAccidentsRegisterService.getById(id); |
| | | if(eamReportAccidentsRegister==null) { |
| | | return Result.error("未找到对应数据"); |
| | |
| | | eamReportAccidentsRegister.setScrapPartNumber(eamReportRepair.getScrapPartNumber()); |
| | | eamReportAccidentsRegister.setScrapPartValue(eamReportRepair.getScrapPartValue()); |
| | | eamReportAccidentsRegister.setScrapPartQuantity(eamReportRepair.getScrapPartQuantity()); |
| | | return Result.OK(eamReportAccidentsRegister); |
| | | try { |
| | | String json = objectMapper.writeValueAsString(eamReportAccidentsRegister); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("variableFactorsValue", eamReportAccidentsRegister.getVariableFactorsValue(), item, "variable_factors_value"); |
| | | return Result.OK(item); |
| | | } catch (JsonProcessingException e) { |
| | | return Result.error("数据转译失败!"); |
| | | } |
| | | } |
| | | |
| | | /** |