禅道#1439问题修复 & 基础、系统配置非必填字段无法重置问题修复

This commit is contained in:
gaoqr
2025-03-28 15:07:55 +08:00
parent c3368a65b0
commit d72d6961aa
14 changed files with 88 additions and 21 deletions
@@ -47,14 +47,17 @@ public class PlateGoodDO extends BaseDO {
/**
* 纹路
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Boolean texture;
/**
* 宽度
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Double width;
/**
* 高度
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Double height;
/**
* 厚度
@@ -63,18 +66,22 @@ public class PlateGoodDO extends BaseDO {
/**
* 价格
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Double price;
/**
* 品牌
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String brand;
/**
* 规格
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String spec;
/**
* 备注
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String remark;
/**
@@ -100,26 +100,11 @@ public class PlateManageServiceImpl implements PlateManageService {
throw exception(ErrorCodeConstants.PLATE_NOT_EXISTS);
}
validatePlateExists(updateReqVO.getId(), organId);
PlateGoodDO updateObj = BeanUtils.toBean(updateReqVO, PlateGoodDO.class);
// 校验板材goods_id是否相同
if (plateGoodMapper.isByGoodIDAndId(updateReqVO.getGoodsId(), organId, Long.valueOf(updateReqVO.getId()))) {
throw exception(PLATE_GOODS_ID_NOT_SAME);
}
PlateGoodDO updateObj = PlateGoodDO.builder()
.id(updateReqVO.getId())
.goodsId(updateReqVO.getGoodsId())
.goodsName(updateReqVO.getGoodsName())
.material(updateReqVO.getMaterial())
.color(updateReqVO.getColor())
.texture(ObjectUtil.isNull(updateReqVO.getTexture()) ? false : updateReqVO.getTexture())
.width(getZeroDouble(updateReqVO.getWidth()))
.height(getZeroDouble(updateReqVO.getHeight()))
.thickness(getZeroDouble(updateReqVO.getThickness()))
.price(getZeroDouble(updateReqVO.getPrice()))
.brand(getEmpty(updateReqVO.getBrand()))
.spec(getEmpty(updateReqVO.getSpec()))
.remark(getEmpty(updateReqVO.getRemark()))
.build();
plateGoodMapper.updateById(updateObj);
}