|
|
|
@ -8,4 +8,34 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class MesLocationConfigService extends BaseMesService<MesLocationConfig> implements IMesLocationConfigService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesLocationConfig insert(MesLocationConfig bean) {
|
|
|
|
|
//插入前构造并校验数据
|
|
|
|
|
onInsertBean(bean);
|
|
|
|
|
// 检查字符串长度是否为2
|
|
|
|
|
if (bean.getDefectLocation().length() == 2) {
|
|
|
|
|
bean.setDefectLocation(bean.getDefectLocation().charAt(0) + "0" + bean.getDefectLocation().charAt(1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bean = baseRDao.insert(bean);
|
|
|
|
|
return bean;
|
|
|
|
|
}
|
|
|
|
|
protected void onInsertBean(MesLocationConfig item) {
|
|
|
|
|
// 数据校验
|
|
|
|
|
/* ValidatorBean.checkNotNull(item.getDefectLocation(), "缺陷位置代码不能为空");
|
|
|
|
|
|
|
|
|
|
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getDefectLocation(), "defectLocation", seriesPackBean);
|
|
|
|
|
boolean flg = baseRDao.isExitByHql(seriesPackBean);
|
|
|
|
|
if (flg) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】设备代码已经存在,请检查数据", item.getDefectLocation())
|
|
|
|
|
.build();
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|