加入购物车添加耗材控制

This commit is contained in:
牛叉闪闪 2024-08-14 11:35:39 +08:00
parent 6c6a447a5e
commit 4a0a548565
3 changed files with 18 additions and 3 deletions

View File

@ -35,6 +35,8 @@ public class TbConsInfo implements Serializable {
private Date updateTime;
private String isCheck;
private static final long serialVersionUID = 1L;
public Integer getId() {
@ -156,4 +158,12 @@ public class TbConsInfo implements Serializable {
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getIsCheck() {
return isCheck;
}
public void setIsCheck(String isCheck) {
this.isCheck = isCheck;
}
}

View File

@ -134,8 +134,10 @@ public class OrderService {
for (TbProskuCon proskuCon : proskuConList) {
if("1".equals(proskuCon.getStatus())){
TbConsInfo consInfo= tbConsInfoMapper.selectByPrimaryKey(proskuCon.getConInfoId());
if(N.egt(proskuCon.getSurplusStock(),consInfo.getStockNumber().abs().subtract(consInfo.getStockConsume().abs()))){
return Result.fail("商品:".concat(product.getName()).concat("对应的:").concat(consInfo.getConName()).concat("耗材不足"));
if("1".equals(consInfo.getIsCheck())){
if(N.egt(proskuCon.getSurplusStock(),consInfo.getStockNumber().abs().subtract(consInfo.getStockConsume().abs()))){
return Result.fail("商品:".concat(product.getName()).concat("对应的:").concat(consInfo.getConName()).concat("耗材不足"));
}
}
}
}

View File

@ -17,10 +17,13 @@
<result column="con_warning" jdbcType="DECIMAL" property="conWarning" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_check" jdbcType="VARCHAR" property="isCheck" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, con_type_id, con_type_name, con_code, con_name, stock_number,price,stock_consume,status, con_unit,
laster_in_stock, con_warning, create_time, update_time
laster_in_stock, con_warning, create_time, update_time,is_check
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select