Merge remote-tracking branch 'origin/master'

This commit is contained in:
gaowdong 2025-07-04 14:35:52 +08:00
commit d14ccd5773
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,8 @@
package com.bonus.canteen.core.cook.service.impl; package com.bonus.canteen.core.cook.service.impl;
import java.util.List; import java.util.List;
import java.util.Objects;
import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.utils.StringUtils;
@ -71,6 +73,8 @@ public class CookMaterialServiceImpl implements ICookMaterialService {
if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), null) > 0) { if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), null) > 0) {
throw new ServiceException("该原料名称已存在"); 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); return cookMaterialMapper.insertCookMaterial(cookMaterial);
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException(e.getMessage()); throw new ServiceException(e.getMessage());
@ -108,6 +112,8 @@ public class CookMaterialServiceImpl implements ICookMaterialService {
if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), cookMaterial.getMaterialId()) > 0) { if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), cookMaterial.getMaterialId()) > 0) {
throw new ServiceException("该原料名称已存在"); 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); return cookMaterialMapper.updateCookMaterial(cookMaterial);
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException(e.getMessage()); throw new ServiceException(e.getMessage());