优化
This commit is contained in:
@@ -211,7 +211,9 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
JSONObject jo = tableDtl.getJSONObject(i);
|
JSONObject jo = tableDtl.getJSONObject(i);
|
||||||
String formuladtl_id = jo.getString("formuladtl_id");
|
String formuladtl_id = jo.getString("formuladtl_id");
|
||||||
jo.put("seq_no",(i+1)+"");
|
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("formula_id",formula_id);
|
||||||
jo.put("formuladtl_id",IdUtil.getSnowflake(1, 1).nextId());
|
jo.put("formuladtl_id",IdUtil.getSnowflake(1, 1).nextId());
|
||||||
jo.put("formula_code",Formula.getString("formula_code"));
|
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"))){
|
if(StrUtil.isEmpty(jo.getString("qty_unit_name"))){
|
||||||
jo.put("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{
|
}else{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -486,8 +486,13 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
mytoQuery(array1){
|
mytoQuery(array1){
|
||||||
this.crud.query.begin_time = array1[0]
|
if(array1 === null){
|
||||||
this.crud.query.end_time = array1[1]
|
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()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
querytable() {
|
querytable() {
|
||||||
|
|||||||
Reference in New Issue
Block a user