辊道设备配置基础数据

tags/yfai-mes-ext-v2.3
pzj 8 months ago
parent 6162899689
commit 45395bd4d6

@ -0,0 +1,13 @@
package cn.estsh.i3plus.ext.mes.api.base;
import cn.estsh.i3plus.pojo.mes.bean.MesBallTrackRule;
/**
* @Description :
* @Reference :
* @Author : PZJ
* @CreateDate : 2024/9/24 15:36
* @Modify:
**/
public interface IMesBallTrackRuleService extends IBaseMesService<MesBallTrackRule>{
}

@ -0,0 +1,20 @@
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.pojo.mes.bean.MesBallTrackRule;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description :
* @Reference :
* @Author : PZJ
* @CreateDate : 2024/9/24 15:35
* @Modify:
**/
@Api("辊道设备配置接口")
@RestController
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesBallTrackRule")
public class MesBallTrackRuleController extends BaseMesController<MesBallTrackRule>{
}

@ -0,0 +1,54 @@
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesBallTrackRuleService;
import cn.estsh.i3plus.ext.mes.apiservice.utils.MesException;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesBallTrackRule;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Description :
* @Reference :
* @Author : PZJ
* @CreateDate : 2024/9/24 15:37
* @Modify:
**/
@Service
@Slf4j
public class MesBallTrackRuleServiceImpl extends BaseMesService<MesBallTrackRule> implements IMesBallTrackRuleService {
@Override
protected void setPackQueryBean(MesBallTrackRule bean, DdlPackBean packBean) {
DdlPreparedPack.getStringEqualPack(bean.getEquipmentCode(), "equipmentCode", packBean);
DdlPreparedPack.getStringLikerPack(bean.getBallTrackName(), "ballTrackName", packBean);
}
@Override
protected void onInsertBean(MesBallTrackRule item) {
ValidatorBean.checkNotNull(item.getBallTrackName(), "轨道名称不能为空");
ValidatorBean.checkNotNull(item.getEquipmentCode(), "设备代码不能为空");
ValidatorBean.checkNotNull(item.getEquipVariableValue(), "轨道变量值不能为空");
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(item.getEquipmentCode(), "equipmentCode", ddlPackBean);
if (baseRDao.isExitByHql(ddlPackBean)){
MesException.throwBusiException("轨道编码已存在");
}
}
@Override
protected void onUpdateBean(MesBallTrackRule item) {
ValidatorBean.checkNotNull(item.getId(), "id不能为空");
ValidatorBean.checkNotNull(item.getBallTrackName(), "轨道名称不能为空");
ValidatorBean.checkNotNull(item.getEquipmentCode(), "设备代码不能为空");
ValidatorBean.checkNotNull(item.getEquipVariableValue(), "轨道变量值不能为空");
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(item.getEquipmentCode(), "equipmentCode", ddlPackBean);
DdlPreparedPack.getNumNOEqualPack(item.getId(), "id", ddlPackBean);
if (baseRDao.isExitByHql(ddlPackBean)){
MesException.throwBusiException("轨道编码已存在");
}
}
}
Loading…
Cancel
Save