|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cn.iocoder.yudao.module.iot.service.recipeplandetail;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
@ -29,12 +30,20 @@ public class RecipePlanDetailServiceImpl implements RecipePlanDetailService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Long createRecipePlanDetail(RecipePlanDetailSaveReqVO createReqVO) {
|
|
|
|
|
// 校验编码是否存在
|
|
|
|
|
validateCodeOnly(createReqVO.getCode());
|
|
|
|
|
// 插入
|
|
|
|
|
RecipePlanDetailDO recipePlanDetail = BeanUtils.toBean(createReqVO, RecipePlanDetailDO.class);
|
|
|
|
|
recipePlanDetailMapper.insert(recipePlanDetail);
|
|
|
|
|
// 返回
|
|
|
|
|
return recipePlanDetail.getId();
|
|
|
|
|
}
|
|
|
|
|
private void validateCodeOnly(String code) {
|
|
|
|
|
if (recipePlanDetailMapper.exists(Wrappers.<RecipePlanDetailDO>lambdaQuery()
|
|
|
|
|
.eq(RecipePlanDetailDO::getCode, code))) {
|
|
|
|
|
throw exception(RECIPE_PLAN_DETAIL_CODE_EXISTS);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateRecipePlanDetail(RecipePlanDetailSaveReqVO updateReqVO) {
|
|
|
|
|
|