mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
板材编辑判断组织id更新修改
This commit is contained in:
+28
-1
@@ -100,11 +100,28 @@ public class PlateManageServiceImpl implements PlateManageService {
|
|||||||
throw exception(ErrorCodeConstants.PLATE_NOT_EXISTS);
|
throw exception(ErrorCodeConstants.PLATE_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
validatePlateExists(updateReqVO.getId(), organId);
|
validatePlateExists(updateReqVO.getId(), organId);
|
||||||
PlateGoodDO updateObj = BeanUtils.toBean(updateReqVO, PlateGoodDO.class);
|
|
||||||
// 校验板材goods_id是否相同
|
// 校验板材goods_id是否相同
|
||||||
if (plateGoodMapper.isByGoodIDAndId(updateReqVO.getGoodsId(), organId, Long.valueOf(updateReqVO.getId()))) {
|
if (plateGoodMapper.isByGoodIDAndId(updateReqVO.getGoodsId(), organId, Long.valueOf(updateReqVO.getId()))) {
|
||||||
throw exception(PLATE_GOODS_ID_NOT_SAME);
|
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()))
|
||||||
|
.organId(organId)
|
||||||
|
.build();
|
||||||
plateGoodMapper.updateById(updateObj);
|
plateGoodMapper.updateById(updateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,6 +340,16 @@ public class PlateManageServiceImpl implements PlateManageService {
|
|||||||
return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
|
return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* value为空返回0.0
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private double getZeroDouble(Double value) {
|
||||||
|
return ObjectUtil.defaultIfNull(value, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* value为空返回false
|
* value为空返回false
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user