| | |
| | | import liquibase.pro.packaged.S; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | 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.modules.msi.utils.JsonMapper; |
| | |
| | | @AutoLog(value = "自动化线数据接收") |
| | | @ApiOperation(value = "自动化线数据接收 ", notes = "自动化线数据接收") |
| | | @PostMapping(value = "/receiveAutomation") |
| | | public void receiveSaveMsiWebApiJson(String data) { |
| | | public Result<?> receiveSaveMsiWebApiJson(String data) { |
| | | MsiWebapiJsonEntity entity = new MsiWebapiJsonEntity(); |
| | | if (StringUtils.isBlank(data)) { |
| | | return; |
| | | return Result.error("数据为空",""); |
| | | } |
| | | entity.setModuleType("MDC"); |
| | | entity.setWebapiInfo(data); |
| | |
| | | } |
| | | } catch (IOException e) { |
| | | log.error("JSON parsing error: {}", e.getMessage()); |
| | | throw new RuntimeException("Invalid data format", e); |
| | | return Result.error("数据异常", e.getMessage()); |
| | | |
| | | } |
| | | |
| | | service.save(entity); |
| | | return Result.OK("接收成功"); |
| | | } |
| | | |
| | | } |