This commit is contained in:
zds
2022-08-12 17:49:51 +08:00
parent d87802ba7e
commit de2d7591ee
2 changed files with 31 additions and 3 deletions

View File

@@ -211,7 +211,9 @@ public class FormulaServiceImpl implements FormulaService {
JSONObject jo = tableDtl.getJSONObject(i);
String formuladtl_id = jo.getString("formuladtl_id");
jo.put("seq_no",(i+1)+"");
if(StrUtil.isEmpty(formuladtl_id)){//新增
//新增
if(StrUtil.isEmpty(formuladtl_id)){
jo.put("put_qty","0");
jo.put("formula_id",formula_id);
jo.put("formuladtl_id",IdUtil.getSnowflake(1, 1).nextId());
jo.put("formula_code",Formula.getString("formula_code"));
@@ -228,6 +230,27 @@ public class FormulaServiceImpl implements FormulaService {
if(StrUtil.isEmpty(jo.getString("qty_unit_name"))){
jo.put("qty_unit_name","千克\\公斤");
}
//判断库存
if("1".equals(jo.getString("is_need_move"))){
//校验库存是否够
JSONObject jo_ivt = WQL.getWO("QPF_INITFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("quality_scode",jo.getString("quality_scode"))
.addParam("ivt_level",jo.getString("ivt_level"))
.addParam("is_active",jo.getString("is_active"))
.addParam("flag","3")
.process().uniqueResult(0);
if(jo_ivt!=null){
double sum_ivt_qty = jo_ivt.getDouble("sum_ivt_qty");
if(sum_ivt_qty<jo.getDouble("formula_qty")){
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"库存不足!");
}
}else{
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"库存不足!");
}
}
}else{
}

View File

@@ -486,8 +486,13 @@ export default {
})
},
mytoQuery(array1){
this.crud.query.begin_time = array1[0]
this.crud.query.end_time = array1[1]
if(array1 === null){
this.crud.query.begin_time = ''
this.crud.query.end_time = ''
}else{
this.crud.query.begin_time = array1[0]
this.crud.query.end_time = array1[1]
}
this.crud.toQuery()
},
querytable() {