forked from I3-YF/i3plus-mes-yfai
maximo仪表主数据+设备主数据接口
parent
320c620333
commit
6463468513
@ -0,0 +1,27 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.model.MaximoParamModel;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : IMaximoService
|
||||||
|
* @Author :gsz
|
||||||
|
* @Date 2024/5/15 13:16
|
||||||
|
* @Modify
|
||||||
|
**/
|
||||||
|
public interface IMaximoService {
|
||||||
|
|
||||||
|
/** Maximo仪表主数据
|
||||||
|
* @param paramModel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ResultBean doMeterMainData(MaximoParamModel paramModel);
|
||||||
|
|
||||||
|
/** Maximo设备主数据
|
||||||
|
* @param paramModel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ResultBean doAssetMainData(MaximoParamModel paramModel);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.busi.IMaximoService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.model.MaximoParamModel;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||||
|
import cn.estsh.impp.framework.base.controller.MesBaseController;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/white/maximo")
|
||||||
|
@Api(description = "白名单接口maximo")
|
||||||
|
public class MesWhiteListController extends MesBaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMaximoService maximoService;
|
||||||
|
|
||||||
|
@PostMapping(value = "/meter/main-data")
|
||||||
|
@ApiOperation(value = "Maximo仪表主数据", notes = "Maximo仪表主数据")
|
||||||
|
public ResultBean doMeterMainData(@RequestBody MaximoParamModel paramModel) {
|
||||||
|
// 数据校验
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getMeterName(), "meterName不能为空");
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getAssetNum(), "assetNum不能为空");
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getBaseMeasureUnitId(), "baseMeasureUnitId不能为空");
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getSiteId(), "siteId不能为空");
|
||||||
|
ResultBean resultMap = maximoService.doMeterMainData(paramModel);
|
||||||
|
|
||||||
|
LOGGER.info("Maximo仪表主数据 返回 resultMap:{}", resultMap);
|
||||||
|
|
||||||
|
return resultMap.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/asset/main-data")
|
||||||
|
@ApiOperation(value = "Maximo设备主数据", notes = "Maximo设备主数据")
|
||||||
|
public ResultBean doAssetMainData(@RequestBody MaximoParamModel paramModel) {
|
||||||
|
// 数据校验
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getAssetNum(), "assetNum不能为空");
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getDescription(), "description不能为空");
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getSiteId(), "siteId不能为空");
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getStatus(), "status不能为空");
|
||||||
|
ValidatorBean.checkNotNull(paramModel.getFailureCode(), "failureCode不能为空");
|
||||||
|
ResultBean resultMap = maximoService.doAssetMainData(paramModel);
|
||||||
|
|
||||||
|
LOGGER.info("Maximo设备主数据 返回 resultMap:{}", resultMap);
|
||||||
|
|
||||||
|
return resultMap.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pojo.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author gsz
|
||||||
|
* @description
|
||||||
|
* @date 2024/5/15 13:53
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("maximo主数据参数")
|
||||||
|
public class MaximoParamModel {
|
||||||
|
private static final long serialVersionUID = 4235227045174076286L;
|
||||||
|
|
||||||
|
@ApiParam(value = "仪表编号")
|
||||||
|
private String meterName;
|
||||||
|
|
||||||
|
@ApiParam(value = "设备编号")
|
||||||
|
private String assetNum;
|
||||||
|
|
||||||
|
@ApiParam(value = "设备名称")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiParam(value = "计量单位")
|
||||||
|
private String baseMeasureUnitId;
|
||||||
|
|
||||||
|
@ApiParam(value = "工厂")
|
||||||
|
private String siteId;
|
||||||
|
|
||||||
|
@ApiParam(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiParam(value = "故障类别")
|
||||||
|
private String failureCode;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue