xml数据验证

This commit is contained in:
lym
2024-09-23 15:44:36 +08:00
parent 7493703f34
commit 79f011c2df
41 changed files with 1845 additions and 566 deletions
@@ -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("宽度")
@@ -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;
}
}
@@ -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);
}