jsk
This commit is contained in:
parent
cbcf51b576
commit
be5c5a8b86
|
|
@ -93,11 +93,11 @@ public class CookMaterial extends BaseEntity {
|
||||||
|
|
||||||
/** 销售价 */
|
/** 销售价 */
|
||||||
@ApiModelProperty(value = "销售价")
|
@ApiModelProperty(value = "销售价")
|
||||||
private Long salePrice;
|
private BigDecimal salePrice;
|
||||||
|
|
||||||
/** 进价 */
|
/** 进价 */
|
||||||
@ApiModelProperty(value = "进价")
|
@ApiModelProperty(value = "进价")
|
||||||
private Long unitPrice;
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
/** 售卖类型(1计量2散称) */
|
/** 售卖类型(1计量2散称) */
|
||||||
@ApiModelProperty(value = "售卖类型(1计量2散称)")
|
@ApiModelProperty(value = "售卖类型(1计量2散称)")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.canteen.core.cook.service.impl;
|
package com.bonus.canteen.core.cook.service.impl;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
@ -96,8 +97,8 @@ public class CookMaterialServiceImpl implements ICookMaterialService {
|
||||||
String name = cookMaterial.getGoodsType() == 1 ? "原料" : "商品";
|
String name = cookMaterial.getGoodsType() == 1 ? "原料" : "商品";
|
||||||
throw new ServiceException("该" + name + "名称已存在");
|
throw new ServiceException("该" + name + "名称已存在");
|
||||||
}
|
}
|
||||||
cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? 0L : cookMaterial.getSalePrice() * 100);
|
cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? new BigDecimal("0") : cookMaterial.getSalePrice().multiply(new BigDecimal("100")) );
|
||||||
cookMaterial.setUnitPrice(Objects.isNull(cookMaterial.getUnitPrice()) ? 0L : cookMaterial.getUnitPrice() * 100);
|
cookMaterial.setUnitPrice(Objects.isNull(cookMaterial.getUnitPrice()) ? new BigDecimal("0") : cookMaterial.getUnitPrice() .multiply(new BigDecimal("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());
|
||||||
|
|
@ -137,8 +138,8 @@ public class CookMaterialServiceImpl implements ICookMaterialService {
|
||||||
String name = cookMaterial.getGoodsType() == 1 ? "原料" : "商品";
|
String name = cookMaterial.getGoodsType() == 1 ? "原料" : "商品";
|
||||||
throw new ServiceException("该" + name + "名称已存在");
|
throw new ServiceException("该" + name + "名称已存在");
|
||||||
}
|
}
|
||||||
cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? 0L : cookMaterial.getSalePrice() * 100);
|
cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? new BigDecimal("0") : cookMaterial.getSalePrice().multiply(new BigDecimal("100")) );
|
||||||
cookMaterial.setUnitPrice(Objects.isNull(cookMaterial.getUnitPrice()) ? 0L : cookMaterial.getUnitPrice() * 100);
|
cookMaterial.setUnitPrice(Objects.isNull(cookMaterial.getUnitPrice()) ? new BigDecimal("0") : cookMaterial.getUnitPrice() .multiply(new BigDecimal("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());
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ public class InquiryServiceImpl implements IInquiryService {
|
||||||
}
|
}
|
||||||
return inquiry;
|
return inquiry;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
throw new ServiceException(e.getMessage());
|
throw new ServiceException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="size != null and size != ''"> and cm.size = #{size}</if>
|
<if test="size != null and size != ''"> and cm.size = #{size}</if>
|
||||||
<if test="description != null and description != ''"> and cm.description = #{description}</if>
|
<if test="description != null and description != ''"> and cm.description = #{description}</if>
|
||||||
</where>
|
</where>
|
||||||
|
group by material_id
|
||||||
order by cm.create_time desc
|
order by cm.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -140,7 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkIsUse" resultType="java.lang.Integer">
|
<select id="checkIsUse" resultType="java.lang.Integer">
|
||||||
select count(1) from cook_dishes_material
|
select count(1) from (
|
||||||
|
select material_id from cook_dishes_material
|
||||||
|
union
|
||||||
|
select material_id from ims_inventory where del_flag='0'
|
||||||
|
) a
|
||||||
<where>
|
<where>
|
||||||
material_id in
|
material_id in
|
||||||
<foreach item="materialId" collection="materialIds" open="(" separator="," close=")">
|
<foreach item="materialId" collection="materialIds" open="(" separator="," close=")">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue