This commit is contained in:
2022-06-28 08:56:16 +08:00
parent bcf2da5305
commit 5e8af632cb
3 changed files with 56 additions and 34 deletions

View File

@@ -2551,6 +2551,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
} }
if(left_qty<ivt_qty){ if(left_qty<ivt_qty){
flag = true; flag = true;
now_ivt.put("is_flag","1");
now_ivt.put("formula_qty",left_qty); now_ivt.put("formula_qty",left_qty);
now_ivt.put("bom_ivt_qty",left_qty); now_ivt.put("bom_ivt_qty",left_qty);
now_ivt.put("seqno",bomdlt.getString("seqno")); now_ivt.put("seqno",bomdlt.getString("seqno"));
@@ -2567,6 +2568,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
break; break;
}else{ }else{
flag = true; flag = true;
now_ivt.put("is_flag","1");
now_ivt.put("formula_qty",ivt_qty); now_ivt.put("formula_qty",ivt_qty);
now_ivt.put("bom_ivt_qty",ivt_qty); now_ivt.put("bom_ivt_qty",ivt_qty);
now_ivt.put("seqno",bomdlt.getString("seqno")); now_ivt.put("seqno",bomdlt.getString("seqno"));
@@ -2588,12 +2590,15 @@ public class AutoformulaServiceImpl implements AutoformulaService {
if(flag){ if(flag){
bomdlt.put("is_flag","1"); bomdlt.put("is_flag","1");
} }
//bomdlt.put("need_qty", bomdlt.getDouble("left_qty")); bomdlt.put("need_qty", bomdlt.getDouble("left_qty"));
bomdlt.put("formula_qty", bomdlt.getDouble("left_qty"));
bomdlts_need_map.put(bomdlt.getString("material_id"),bomdlt); bomdlts_need_map.put(bomdlt.getString("material_id"),bomdlt);
}else{ }else{
bomdlt.put("need_qty", bomdlt.getDouble("left_qty"));
bomdlt.put("formula_qty", bomdlt.getDouble("left_qty")); bomdlt.put("formula_qty", bomdlt.getDouble("left_qty"));
bomdlt.put("is_need_manage","1"); bomdlt.put("is_need_manage","1");
bomdlt.put("ivt_level","01"); bomdlt.put("ivt_level","01");
bomdlt.put("is_flag","1");
bomdlt.put("is_active","1"); bomdlt.put("is_active","1");
bomdlt.put("quality_scode","01"); bomdlt.put("quality_scode","01");
bomdlts_need_map.put(bomdlt.getString("material_id"),bomdlt); bomdlts_need_map.put(bomdlt.getString("material_id"),bomdlt);
@@ -2628,7 +2633,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
CT1 = CT1 + bom_ivt_qty*value/100.0; CT1 = CT1 + bom_ivt_qty*value/100.0;
//更新含碳比 //更新含碳比
bomdlt_Cr3C2.put("is_tan",value); bomdlt_Cr3C2.put("is_tan",value);
bomdlts_need_map.put(bomdlt_Cr3C2.getString("stockrecord_id"),bomdlt_Cr3C2); bomdlts_need_map.put(bomdlt_Cr3C2.getString("material_id"),bomdlt_Cr3C2);
} }
//软废总碳 //软废总碳
for(int i=0;i<rf_list.size();i++){ for(int i=0;i<rf_list.size();i++){
@@ -2658,7 +2663,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
for(int i=0;i<xl_list.size();i++){ for(int i=0;i<xl_list.size();i++){
JSONObject bomdlt = xl_list.getJSONObject(i); JSONObject bomdlt = xl_list.getJSONObject(i);
//Y1p+X1p+X2p //Y1p+X1p+X2p
double need_qty = bomdlt.getDouble("need_qty"); double need_qty = bomdlt.getDouble("formula_qty");
W = NumberUtil.round(W - need_qty,3).doubleValue(); W = NumberUtil.round(W - need_qty,3).doubleValue();
} }
if(W<0){ if(W<0){
@@ -2695,7 +2700,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
for(int i=0;i<xl_list.size();i++){ for(int i=0;i<xl_list.size();i++){
JSONObject bomdlt = xl_list.getJSONObject(i); JSONObject bomdlt = xl_list.getJSONObject(i);
//Y1p+X1p+X2p //Y1p+X1p+X2p
double need_qty = bomdlt.getDouble("need_qty"); double need_qty = bomdlt.getDouble("formula_qty");
W = NumberUtil.round(W - need_qty,3).doubleValue(); W = NumberUtil.round(W - need_qty,3).doubleValue();
} }
if(W<0){ if(W<0){
@@ -2858,9 +2863,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
double Y1_bu = finalR3p_jian *standard_rate; double Y1_bu = finalR3p_jian *standard_rate;
//Y12p=Y12p+Y1补 //Y12p=Y12p+Y1补
Y1p = Y1p + Y1_bu; Y1p = Y1p + Y1_bu;
now_bomdtl.put("need_qty",Y1p); now_bomdtl.put("formula_qty",Y1p+now_bomdtl.getDouble("need_qty"));
now_bomdtl.put("need_qty",Y1p+now_bomdtl.getDouble("need_qty"));
now_bomdtl.put("is_flag","-1"); now_bomdtl.put("is_flag","-1");
now_bomdtl.put("formula_qty",Y1p);
bomdlts_need_map.put(key,now_bomdtl); bomdlts_need_map.put(key,now_bomdtl);
} }
} }
@@ -2978,9 +2983,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
//Y12p=Y12p+Y1补 //Y12p=Y12p+Y1补
Y1p = Y1p + Y1_bu; Y1p = Y1p + Y1_bu;
} }
now_bomdtl.put("need_qty",Y1p); now_bomdtl.put("formula_qty",Y1p+now_bomdtl.getDouble("need_qty"));
now_bomdtl.put("need_qty",Y1p+now_bomdtl.getDouble("need_qty"));
now_bomdtl.put("is_flag","-1"); now_bomdtl.put("is_flag","-1");
now_bomdtl.put("formula_qty",Y1p);
bomdlts_need_map.put(key,now_bomdtl); bomdlts_need_map.put(key,now_bomdtl);
} }
}); });
@@ -3065,7 +3070,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
for(int i=0;i<xl_list.size();i++){ for(int i=0;i<xl_list.size();i++){
JSONObject bomdlt = xl_list.getJSONObject(i); JSONObject bomdlt = xl_list.getJSONObject(i);
//Y1p+X1p+X2p //Y1p+X1p+X2p
double need_qty = bomdlt.getDouble("need_qty"); double need_qty = bomdlt.getDouble("formula_qty");
W = NumberUtil.round(W - need_qty,3).doubleValue(); W = NumberUtil.round(W - need_qty,3).doubleValue();
} }
@@ -3200,9 +3205,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
double Y1_bu = R3p_jian *(standard_rate/100.0); double Y1_bu = R3p_jian *(standard_rate/100.0);
//Y12p=Y12p+Y1补 //Y12p=Y12p+Y1补
Y1p = Y1p + Y1_bu; Y1p = Y1p + Y1_bu;
now_bomdtl.put("need_qty",Y1p); now_bomdtl.put("formula_qty",Y1p+now_bomdtl.getDouble("need_qty"));
now_bomdtl.put("need_qty",Y1p+now_bomdtl.getDouble("need_qty"));
now_bomdtl.put("is_flag","-1"); now_bomdtl.put("is_flag","-1");
now_bomdtl.put("formula_qty",Y1p);
bomdlts_need_map.put(key,now_bomdtl); bomdlts_need_map.put(key,now_bomdtl);
} }
} }
@@ -3272,9 +3277,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
//Y12p=Y12p+Y1补 //Y12p=Y12p+Y1补
Y1p = Y1p + Y1_bu; Y1p = Y1p + Y1_bu;
} }
now_bomdtl.put("need_qty",Y1p); now_bomdtl.put("formula_qty",Y1p+now_bomdtl.getDouble("need_qty"));
now_bomdtl.put("need_qty",Y1p+now_bomdtl.getDouble("need_qty"));
now_bomdtl.put("is_flag","-1"); now_bomdtl.put("is_flag","-1");
now_bomdtl.put("formula_qty",Y1p);
bomdlts_need_map.put(key,now_bomdtl); bomdlts_need_map.put(key,now_bomdtl);
} }
}); });
@@ -3398,6 +3403,15 @@ public class AutoformulaServiceImpl implements AutoformulaService {
cxj_list.add(bomdlts2_now); cxj_list.add(bomdlts2_now);
} }
}); });
//处理新料
JSONArray xl_list3 = new JSONArray();
for(int i=0;i<xl_list.size();i++){
JSONObject jo_now = xl_list.getJSONObject(i);
JSONObject bomdlts_jo = bomdlts_need_map.get(jo_now.getString("material_id"));
if(!bomdlts_jo.getString("is_flag").equals("-1")){
xl_list3.add(jo_now);
}
}
bomdlts_need_map.forEach((key,bomdlts_plan)->{ bomdlts_need_map.forEach((key,bomdlts_plan)->{
if(bomdlts_plan.getString("is_flag").equals("0")){ if(bomdlts_plan.getString("is_flag").equals("0")){
bomdlts_plan.put("formula_qty","0"); bomdlts_plan.put("formula_qty","0");
@@ -3407,7 +3421,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
//bomdlts_plan.put("ivt_level","01"); //bomdlts_plan.put("ivt_level","01");
//bomdlts_plan.put("is_active","1"); //bomdlts_plan.put("is_active","1");
//bomdlts_plan.put("quality_scode","01"); //bomdlts_plan.put("quality_scode","01");
xl_list.add(bomdlts_plan); xl_list3.add(bomdlts_plan);
}else if(bomdlts_plan.getString("is_flag").equals("-1")){ }else if(bomdlts_plan.getString("is_flag").equals("-1")){
String bomdtl_material_id = bomdlts_plan.getString("material_id"); String bomdtl_material_id = bomdlts_plan.getString("material_id");
double left_qty = bomdlts_plan.getDouble("formula_qty"); double left_qty = bomdlts_plan.getDouble("formula_qty");
@@ -3444,7 +3458,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
now_ivt.put("material_type","01"); now_ivt.put("material_type","01");
now_ivt.put("is_need_move",bomdlts_plan.getString("is_need_move")); now_ivt.put("is_need_move",bomdlts_plan.getString("is_need_move"));
now_ivt.put("is_need_manage","1"); now_ivt.put("is_need_manage","1");
xl_list.add(now_ivt); xl_list3.add(now_ivt);
left_qty = 0; left_qty = 0;
break; break;
}else{ }else{
@@ -3456,7 +3470,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
now_ivt.put("is_need_move",bomdlts_plan.getString("is_need_move")); now_ivt.put("is_need_move",bomdlts_plan.getString("is_need_move"));
now_ivt.put("is_need_manage","1"); now_ivt.put("is_need_manage","1");
left_qty = NumberUtil.round(left_qty - ivt_qty,3).doubleValue(); left_qty = NumberUtil.round(left_qty - ivt_qty,3).doubleValue();
xl_list.add(now_ivt); xl_list3.add(now_ivt);
} }
} }
if(left_qty>0){ if(left_qty>0){
@@ -3468,7 +3482,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
bomdlts_plan.put("ivt_level","01"); bomdlts_plan.put("ivt_level","01");
bomdlts_plan.put("is_active","1"); bomdlts_plan.put("is_active","1");
bomdlts_plan.put("quality_scode","01"); bomdlts_plan.put("quality_scode","01");
xl_list.add(bomdlts_plan); xl_list3.add(bomdlts_plan);
} }
} }
}); });
@@ -3476,8 +3490,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
//汇总新料库存 //汇总新料库存
HashMap<String,JSONObject> xl_list_map = new HashMap<String,JSONObject>(); HashMap<String,JSONObject> xl_list_map = new HashMap<String,JSONObject>();
for(int i=0;i<xl_list.size();i++){ for(int i=0;i<xl_list3.size();i++){
JSONObject jo_xl = xl_list.getJSONObject(i); JSONObject jo_xl = xl_list3.getJSONObject(i);
String key = jo_xl.getString("material_id")+"__" String key = jo_xl.getString("material_id")+"__"
+jo_xl.getString("pcsn")+"__" +jo_xl.getString("pcsn")+"__"
+jo_xl.getString("ivt_level")+"__" +jo_xl.getString("ivt_level")+"__"

View File

@@ -89,7 +89,7 @@
:disabled="sub_flag" :disabled="sub_flag"
@click="submit('20')" @click="submit('20')"
> >
提交 提交
</el-button> </el-button>
<el-button <el-button
slot="right" slot="right"
@@ -122,7 +122,7 @@
size="mini" size="mini"
@click="openWork" @click="openWork"
> >
开工 开工
</el-button> </el-button>
<el-button <el-button
slot="right" slot="right"
@@ -219,12 +219,14 @@ import ViewDialog from '@/views/wms/pdm/produce/workorder/ViewDialog'
import ChangeDialog from '@/views/wms/pdm/produce/workorder/ChangeDialog' import ChangeDialog from '@/views/wms/pdm/produce/workorder/ChangeDialog'
import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute"; import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute";
import {getLodop} from "@/assets/js/lodop/LodopFuncs"; import {getLodop} from "@/assets/js/lodop/LodopFuncs";
import Date from "@/utils/datetime";
export default { export default {
name: 'workorder', name: 'workorder',
components: { ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination }, components: { ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
cruds() { cruds() {
return CRUD({ title: '工令', idField: 'workorder_id', url: 'api/workorder', crudMethod: { ...workorder }, return CRUD({ title: '工令', idField: 'workorder_id', url: 'api/workorder', crudMethod: { ...workorder },
//query:{createTime:[new Date(), new Date().daysLater(2)]},
optShow: { optShow: {
add: true, add: true,
edit: false, edit: false,
@@ -268,6 +270,8 @@ export default {
crudseriesProcessRoute.getXLlist2().then(res => { crudseriesProcessRoute.getXLlist2().then(res => {
this.XLList = res this.XLList = res
}) })
this.crud.query.createTime= [new Date(), new Date().daysLater(2)]
this.crud.toQuery()
}, },
methods: { methods: {
canUd(row) { canUd(row) {

View File

@@ -107,7 +107,7 @@
:disabled="device_flag" :disabled="device_flag"
@click="deviceset" @click="deviceset"
> >
指定设备 指定设备
</el-button> </el-button>
<el-button <el-button
slot="right" slot="right"
@@ -140,7 +140,7 @@
size="mini" size="mini"
@click="confirmWork" @click="confirmWork"
> >
任务结束 任务结束
</el-button> </el-button>
<el-button <el-button
slot="right" slot="right"
@@ -153,17 +153,17 @@
> >
异常结束 异常结束
</el-button> </el-button>
<!-- <el-button <!-- <el-button
slot="right" slot="right"
class="filter-item" class="filter-item"
type="success" type="success"
:disabled="print1_flag" :disabled="print1_flag"
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
@click="print1" @click="print1"
> >
打印工艺指令卡 打印工艺指令卡
</el-button>--> </el-button>-->
<el-button <el-button
slot="right" slot="right"
class="filter-item" class="filter-item"
@@ -233,12 +233,14 @@ import ViewDialog from '@/views/wms/pdm/produce/workorder/ViewDialog'
import print2Dialog from '@/views/wms/pdm/produce/worktask/print2Dialog' import print2Dialog from '@/views/wms/pdm/produce/worktask/print2Dialog'
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure"; import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute"; import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute";
import Date from "@/utils/datetime";
export default { export default {
name: 'worktask', name: 'worktask',
components: { print2Dialog, ViewDialog, DeviceDialog, crudOperation, rrOperation, udOperation, pagination }, components: { print2Dialog, ViewDialog, DeviceDialog, crudOperation, rrOperation, udOperation, pagination },
cruds() { cruds() {
return CRUD({ title: '工令工序任务', idField: 'worktask_id', url: 'api/worktask', return CRUD({ title: '工令工序任务', idField: 'worktask_id', url: 'api/worktask',
//query:{createTime:[new Date().daysAgo(2), new Date()]},
optShow: { optShow: {
add: false, add: false,
edit: false, edit: false,
@@ -284,6 +286,8 @@ export default {
crudseriesProcessRoute.getXLlist2().then(res => { crudseriesProcessRoute.getXLlist2().then(res => {
this.XLList = res this.XLList = res
}) })
this.crud.query.createTime= [new Date().daysAgo(2), new Date()]
this.crud.toQuery()
}, },
methods: { methods: {
[CRUD.HOOK.beforeRefresh]() { [CRUD.HOOK.beforeRefresh]() {