加入购物车添加耗材控制
This commit is contained in:
@@ -35,6 +35,8 @@ public class TbConsInfo implements Serializable {
|
|||||||
|
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
private String isCheck;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
@@ -156,4 +158,12 @@ public class TbConsInfo implements Serializable {
|
|||||||
public void setPrice(BigDecimal price) {
|
public void setPrice(BigDecimal price) {
|
||||||
this.price = price;
|
this.price = price;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIsCheck() {
|
||||||
|
return isCheck;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsCheck(String isCheck) {
|
||||||
|
this.isCheck = isCheck;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -134,12 +134,14 @@ public class OrderService {
|
|||||||
for (TbProskuCon proskuCon : proskuConList) {
|
for (TbProskuCon proskuCon : proskuConList) {
|
||||||
if("1".equals(proskuCon.getStatus())){
|
if("1".equals(proskuCon.getStatus())){
|
||||||
TbConsInfo consInfo= tbConsInfoMapper.selectByPrimaryKey(proskuCon.getConInfoId());
|
TbConsInfo consInfo= tbConsInfoMapper.selectByPrimaryKey(proskuCon.getConInfoId());
|
||||||
|
if("1".equals(consInfo.getIsCheck())){
|
||||||
if(N.egt(proskuCon.getSurplusStock(),consInfo.getStockNumber().abs().subtract(consInfo.getStockConsume().abs()))){
|
if(N.egt(proskuCon.getSurplusStock(),consInfo.getStockNumber().abs().subtract(consInfo.getStockConsume().abs()))){
|
||||||
return Result.fail("商品:".concat(product.getName()).concat("对应的:").concat(consInfo.getConName()).concat("耗材不足"));
|
return Result.fail("商品:".concat(product.getName()).concat("对应的:").concat(consInfo.getConName()).concat("耗材不足"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,13 @@
|
|||||||
<result column="con_warning" jdbcType="DECIMAL" property="conWarning" />
|
<result column="con_warning" jdbcType="DECIMAL" property="conWarning" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="is_check" jdbcType="VARCHAR" property="isCheck" />
|
||||||
|
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<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,
|
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>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
|
|||||||
Reference in New Issue
Block a user