瀏覽代碼

feature 不在更新 计划成品卷数 计划备料卷数 计划流转卷数

xiahan 11 月之前
父節點
當前提交
d68e912ecb

+ 9 - 14
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ReportCheckServiceImpl.java

@@ -538,11 +538,10 @@ public class ReportCheckServiceImpl implements ReportCheckService {
                 if (toBeAllocated > 0) {
                     log.info("开始更新备料相关数据!卷数:{},输出物料id:{}", toBeAllocated, key);
                     // 该作业明细的计划加工卷数*该作业的输出物料的计划备料卷数/该作业的计划加工卷数
-                    apsProcessOperationOutMaterDo.setPlanstockrollnum((int) Math.floor((double) (currentProcessOperationEqu.getPlanprocessrall() *
-                            apsProcessOperationOutMaterDo.getPlanstockrollnum()) / currentProcessOperationMainDo.getPlanprocessrall()));
+                    int  planeProcessedRolls=(int) Math.floor((double)
+                            (currentProcessOperationEqu.getPlanprocessrall() * apsProcessOperationOutMaterDo.getPlanstockrollnum()) / currentProcessOperationMainDo.getPlanprocessrall());
                     // 如果该作业明细输出物料的计划备料卷数≥待分配取消卷,则本次备料取消卷数=待分配取消卷 否则 本次备料取消卷数=该作业明细输出物料的计划备料卷数;
-                    cancellation = apsProcessOperationOutMaterDo.getPlanstockrollnum() >= toBeAllocated ?
-                            toBeAllocated : apsProcessOperationOutMaterDo.getPlanstockrollnum();
+                    cancellation = Math.min(planeProcessedRolls, toBeAllocated);
                     /**
                      * 备料已取消卷数=备料已取消卷数+本次备料取消卷数
                      * 备料剩余需输出卷数=备料剩余需输出卷数-本次备料取消卷数
@@ -559,12 +558,10 @@ public class ReportCheckServiceImpl implements ReportCheckService {
                 // 流转卷数相关
                 if (toBeAllocated > 0) {
                     log.info("开始更新流转卷数相关数据!卷数:{},输出物料id:{}", toBeAllocated, key);
-                    //计划流转卷数=该作业明细的计划加工卷数*该作业的输出物料的计划流转卷数/该作业的计划加工卷数
-                    apsProcessOperationOutMaterDo.setPlanmoverollnum((int) Math.floor((double) (currentProcessOperationEqu.getPlanprocessrall() *
-                            apsProcessOperationOutMaterDo.getPlanmoverollnum()) / currentProcessOperationMainDo.getPlanprocessrall()));
+                    int planCirculationRolls=(int) Math.floor((double) (currentProcessOperationEqu.getPlanprocessrall() *
+                            apsProcessOperationOutMaterDo.getPlanmoverollnum()) / currentProcessOperationMainDo.getPlanprocessrall());
                     // 如果该作业明细输出物料的计划流转卷数≥待分配取消卷,则本次流转取消卷数=待分配取消卷; 则本次成品取消卷数=该作业明细输出物料的计划流转卷数;
-                    cancellation = apsProcessOperationOutMaterDo.getPlanmoverollnum() >= toBeAllocated ?
-                            toBeAllocated : apsProcessOperationOutMaterDo.getPlanmoverollnum();
+                    cancellation = Math.min(planCirculationRolls, toBeAllocated);
                     /**
                      * 流转已取消卷数=流转已取消卷数+本次流转取消卷数
                      * 流转剩余需输出卷数=流转剩余需输出卷数-本次流转取消卷数
@@ -584,13 +581,11 @@ public class ReportCheckServiceImpl implements ReportCheckService {
                 }
                 // 成品输出卷数
                 if (toBeAllocated > 0) {
+                    int finishedProductRolls=(int) Math.floor((double) (currentProcessOperationEqu.getPlanprocessrall() *
+                            apsProcessOperationOutMaterDo.getPlanprodrollnum()) / currentProcessOperationMainDo.getPlanprocessrall());
                     log.info("开始更新成品输出卷数相关数据!卷数:{},输出物料id:{}", toBeAllocated, key);
-                    //计算该作业明细输出物料的计划成品卷数=该作业明细的计划加工卷数*该作业的输出物料的计划成品卷数/该作业的计划加工卷数
-                    apsProcessOperationOutMaterDo.setPlanprodrollnum((int) Math.floor((double) (currentProcessOperationEqu.getPlanprocessrall() *
-                            apsProcessOperationOutMaterDo.getPlanprodrollnum()) / currentProcessOperationMainDo.getPlanprocessrall()));
                     // 如果该作业明细输出物料的计划成品卷数≥待分配取消卷,则本次流转取消卷数=待分配取消卷; 则本次成品取消卷数=该作业明细输出物料的计划成品卷数;
-                    cancellation = apsProcessOperationOutMaterDo.getPlanprodrollnum() >= toBeAllocated ?
-                            toBeAllocated : apsProcessOperationOutMaterDo.getPlanprodrollnum();
+                    cancellation = Math.min(finishedProductRolls, toBeAllocated);
                     /**
                      * 成品已取消卷数=成品已取消卷数+本次成品取消卷数
                      * 成品剩余需输出卷数=成品剩余需输出卷数-本次成品取消卷数