|
|
|
@ -343,6 +343,18 @@ public class MesSpotCheckOrderService extends BaseMesService<MesSpotCheckOrder>
|
|
|
|
|
|
|
|
|
|
// 数据校验
|
|
|
|
|
ValidatorBean.checkNotNull(bean.getSpotCheckId(), "点检方案不能为空");
|
|
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(bean.getSpotCheckId(), "spotCheckId", packBean);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.SPOT_CHECK_ORDER_STATUS.CREATE.getValue(), "status", packBean);
|
|
|
|
|
boolean flg = baseRDao.isExitByHql(packBean);
|
|
|
|
|
if (flg) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("存在相同配置状态为【%s】的点检单 id:【%s】,请检查数据", MesExtEnumUtil.SPOT_CHECK_ORDER_STATUS.CREATE.getDescription(), bean.getSpotCheckId())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|