Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d14ccd5773
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.canteen.core.cook.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
|
|
@ -71,6 +73,8 @@ public class CookMaterialServiceImpl implements ICookMaterialService {
|
|||
if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), null) > 0) {
|
||||
throw new ServiceException("该原料名称已存在");
|
||||
}
|
||||
cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? 0L : cookMaterial.getSalePrice() * 100);
|
||||
cookMaterial.setUnitPrice(Objects.isNull(cookMaterial.getUnitPrice()) ? 0L : cookMaterial.getUnitPrice() * 100);
|
||||
return cookMaterialMapper.insertCookMaterial(cookMaterial);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
|
|
@ -108,6 +112,8 @@ public class CookMaterialServiceImpl implements ICookMaterialService {
|
|||
if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), cookMaterial.getMaterialId()) > 0) {
|
||||
throw new ServiceException("该原料名称已存在");
|
||||
}
|
||||
cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? 0L : cookMaterial.getSalePrice() * 100);
|
||||
cookMaterial.setUnitPrice(Objects.isNull(cookMaterial.getUnitPrice()) ? 0L : cookMaterial.getUnitPrice() * 100);
|
||||
return cookMaterialMapper.updateCookMaterial(cookMaterial);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
|
|
|
|||
Loading…
Reference in New Issue