mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
xml数据验证
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ public class RemainPlateRespVO {
|
||||
|
||||
@Schema(description = "纹理 有 无", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("纹理 有 无")
|
||||
private String texture;
|
||||
private Boolean texture;
|
||||
|
||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("宽度")
|
||||
|
||||
+7
@@ -71,4 +71,11 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
}
|
||||
|
||||
PlateDO selectOneById(@Param("id") Long id, @Param("organId") Long organId);
|
||||
|
||||
default Boolean isByGoodID(String goodId , Long organId) {
|
||||
if (selectOne(PlateDO::getGoodsId, goodId, PlateDO::getOrganId, organId) != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,6 +25,7 @@ import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.PLATE_GOODS_ID_NOT_SAME;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.REMAIN_PLATE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@@ -73,6 +74,10 @@ public class PlateServiceImpl implements PlateService {
|
||||
validatePlateExists(updateReqVO.getId(),
|
||||
getOrganId(BASE_PLATE_UPDATE_PERMISSION, getLoginUser().getId(), updateReqVO.getOrganId()));
|
||||
PlateDO updateObj = BeanUtils.toBean(updateReqVO, PlateDO.class);
|
||||
// 校验板材goods_id是否相同
|
||||
if (!plateMapper.isByGoodID(updateReqVO.getGoodsId(), getLoginUser().getId())) {
|
||||
throw exception(PLATE_GOODS_ID_NOT_SAME);
|
||||
}
|
||||
plateMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user