sucheng 7 mesiacov pred
rodič
commit
c45366d3bf

+ 12 - 12
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductionOrderServiceImpl.java

@@ -1610,14 +1610,14 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
                     && new BigDecimal(item.getActualordernumyear()).compareTo(BigDecimal.ZERO) != 0) {
                 //计算比例,保留4位小数,以便百分比保留两位小数
                 item.setPlanordernumyearpercent(
-                        new BigDecimal(item.getActualordernumyear()).divide(new BigDecimal(item.getPlanordernumyear()), 4, RoundingMode.HALF_UP).toString());
+                        new BigDecimal(item.getActualordernumyear()).multiply(new BigDecimal(100)).divide(new BigDecimal(item.getPlanordernumyear()), 2, RoundingMode.HALF_UP).toString());
             } else if (new BigDecimal(item.getActualordernumyear()).compareTo(BigDecimal.ZERO) == 0) {
                 item.setPlanordernumyearpercent("0");
             } else {
-                item.setPlanordernumyearpercent("1");
+                item.setPlanordernumyearpercent("100");
             }
             //拼接展示字段
-            String pre = new BigDecimal(item.getPlanordernumyearpercent()).multiply(BigDecimal.valueOf(100)).toString();
+            String pre = item.getPlanordernumyearpercent();
             item.setActualordernumyearshow(
                     item.getActualordernumyear() + "(" + pre + "%)");
         });
@@ -1629,14 +1629,14 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
                     && new BigDecimal(item.getActualfinishnumyear()).compareTo(BigDecimal.ZERO) != 0) {
                 //计算比例,保留4位小数,以便百分比保留两位小数
                 item.setActualfinishnumyearpercent(
-                        new BigDecimal(item.getActualfinishnumyear()).divide(new BigDecimal(item.getActualordernumyear()), 4, RoundingMode.HALF_UP).toString());
+                        new BigDecimal(item.getActualfinishnumyear()).multiply(BigDecimal.valueOf(100)).divide(new BigDecimal(item.getActualordernumyear()), 2, RoundingMode.HALF_UP).toString());
             } else if (new BigDecimal(item.getActualfinishnumyear()).compareTo(BigDecimal.ZERO) == 0) {
                 item.setActualfinishnumyearpercent("0");
             } else {
-                item.setActualfinishnumyearpercent("1");
+                item.setActualfinishnumyearpercent("100");
             }
             //拼接展示字段
-            String pre = new BigDecimal(item.getActualfinishnumyearpercent()).multiply(BigDecimal.valueOf(100)).toString();
+            String pre = item.getActualfinishnumyearpercent();
             item.setActualfinishnumyearshow(
                     item.getActualfinishnumyear() + "(" + pre + "%)");
         });
@@ -1684,14 +1684,14 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
                     && new BigDecimal(item.getActualordernummonth()).compareTo(BigDecimal.ZERO) != 0) {
                 //计算比例,保留4位小数,以便百分比保留两位小数
                 item.setPlanordernummonthpercent(
-                        new BigDecimal(item.getActualordernummonth()).divide(new BigDecimal(item.getPlanordernummonth()), 4, RoundingMode.HALF_UP).toString());
+                        new BigDecimal(item.getActualordernummonth()).multiply(BigDecimal.valueOf(100)).divide(new BigDecimal(item.getPlanordernummonth()), 2, RoundingMode.HALF_UP).toString());
             } else if (new BigDecimal(item.getActualordernummonth()).compareTo(BigDecimal.ZERO) == 0) {
                 item.setPlanordernummonthpercent("0");
             } else {
-                item.setPlanordernummonthpercent("1");
+                item.setPlanordernummonthpercent("100");
             }
             //拼接展示字段
-            String pre = new BigDecimal(item.getPlanordernummonthpercent()).multiply(BigDecimal.valueOf(100)).toString();
+            String pre = item.getPlanordernummonthpercent();
             item.setActualordernummonthshow(
                     item.getActualordernummonth() + "(" + pre + "%)");
         });
@@ -1703,14 +1703,14 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
                     && new BigDecimal(item.getActualfinishnummonth()).compareTo(BigDecimal.ZERO) != 0) {
                 //计算比例,保留4位小数,以便百分比保留两位小数
                 item.setActualfinishnummonthpercent(
-                        new BigDecimal(item.getActualfinishnummonth()).divide(new BigDecimal(item.getActualordernummonth()), 4, RoundingMode.HALF_UP).toString());
+                        new BigDecimal(item.getActualfinishnummonth()).multiply(BigDecimal.valueOf(100)).divide(new BigDecimal(item.getActualordernummonth()), 2, RoundingMode.HALF_UP).toString());
             } else if (new BigDecimal(item.getActualfinishnummonth()).compareTo(BigDecimal.ZERO) == 0) {
                 item.setActualfinishnummonthpercent("0");
             } else {
-                item.setActualfinishnummonthpercent("1");
+                item.setActualfinishnummonthpercent("100");
             }
             //拼接展示字段
-            String pre = new BigDecimal(item.getActualfinishnummonthpercent()).multiply(BigDecimal.valueOf(100)).toString();
+            String pre = item.getActualfinishnummonthpercent();
             item.setActualfinishnummonthshow(
                     item.getActualfinishnummonth() + "(" + pre + "%)");
         });

+ 15 - 15
cx-aps/cx-aps-common/src/main/resources/mybatis/ApsProductionOrderDao.xml

@@ -351,7 +351,7 @@
     </select>
     <select id="selectNowYearPlanGetOrderNum" resultType="com.rongwei.bsentity.domain.ApsReportYearAndMonth">
         select
-            aop.TENANTID AS 'tenantid',IFNULL(sum(PLANACCEPTORDERSUM),0) AS 'planordernumyear'
+            aop.TENANTID AS 'tenantid',IFNULL(ROUND(sum(PLANACCEPTORDERSUM),2),0) AS 'planordernumyear'
         from
             aps_accept_order_plan aop
                 join aps_accept_order_plan_detail aopd on aop.id=aopd.MAINID
@@ -363,7 +363,7 @@
     <select id="selectNowYearActualGetOrderNum" resultType="com.rongwei.bsentity.domain.ApsReportYearAndMonth">
         select
         apro.TENANTID AS 'tenantid',
-        IFNULL(sum((apope.PLANPROCESSRALL-apope.CANCELROLL)*apoom.PLANPRODROLLNUM/apo.PLANPROCESSRALL*apoom.SINGLEROLLWEIGHT),0) AS 'actualordernumyear' -- 实际接单量
+        IFNULL(ROUND(sum((apope.PLANPROCESSRALL-apope.CANCELROLL)*apoom.PLANPRODROLLNUM/apo.PLANPROCESSRALL*apoom.SINGLEROLLWEIGHT),2),0) AS 'actualordernumyear' -- 实际接单量
         from
         aps_process_operation_process_equ apope
         join aps_process_operation apo on apo.ID = apope.PROCESSID
@@ -371,11 +371,11 @@
         join aps_blank_order abo on apo.BLANKID = abo.id
         join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
         join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
-        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND
+        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND and aps.DELETED='0'
         left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
         where
         apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
-        and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
+        and apd.DELETED='0' and apoom.DELETED='0'
         and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
         and abo.PRODUCTSTATUS in ('30','40','50')
         and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
@@ -386,7 +386,7 @@
     <select id="selectNowYearActualProduceNum" resultType="com.rongwei.bsentity.domain.ApsReportYearAndMonth">
         select
             apro.TENANTID AS 'tenantid',
-            IFNULL(sum(aro.WEIGHT),0) AS 'actualfinishnumyear'
+            IFNULL(ROUND(sum(aro.WEIGHT),2),0) AS 'actualfinishnumyear'
         from
             aps_process_operation_process_equ apope
                 join aps_process_operation apo on apo.ID = apope.PROCESSID
@@ -410,7 +410,7 @@
     <select id="selectNowMonthPlanGetOrderNum" resultType="com.rongwei.bsentity.domain.ApsReportYearAndMonth">
         select
             aop.TENANTID AS 'tenantid',
-            ifnull(sum(
+            ifnull(ROUND(sum(
                            CASE MONTH(CURRENT_DATE)
                                WHEN '1' THEN ONEM
                                WHEN '2' THEN TWOM
@@ -426,7 +426,7 @@
                                WHEN '12' THEN TWELVEM
                                ELSE null
                                END
-                   ),0) AS 'planordernummonth'
+                   ),2),0) AS 'planordernummonth'
         from
             aps_accept_order_plan aop
                 join aps_accept_order_plan_detail aopd on aop.id=aopd.MAINID
@@ -447,11 +447,11 @@
         join aps_blank_order abo on apo.BLANKID = abo.id
         join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
         join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
-        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND
+        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND and aps.DELETED='0'
         left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
         where
         apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
-        and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
+        and apd.DELETED='0' and apoom.DELETED='0'
         and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
         and abo.PRODUCTSTATUS in ('30','40','50')
         and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
@@ -499,11 +499,11 @@
         join aps_blank_order abo on apo.BLANKID = abo.id
         join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
         join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
-        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND
+        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND and aps.DELETED='0'
         left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
         where
         apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
-        and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
+        and apd.DELETED='0' and apoom.DELETED='0'
         and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
         and abo.PRODUCTSTATUS in ('30','40','50')
         and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
@@ -585,11 +585,11 @@
         join aps_blank_order abo on apo.BLANKID = abo.id
         join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
         join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
-        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND
+        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND and aps.DELETED='0'
         left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
         where
         apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
-        and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
+        and apd.DELETED='0' and apoom.DELETED='0'
         and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
         and abo.PRODUCTSTATUS in ('30','40','50')
         and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
@@ -653,11 +653,11 @@
         join aps_blank_order abo on apo.BLANKID = abo.id
         join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
         join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
-        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND
+        left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS &lt;= aps.THICKEND and aps.DELETED='0'
         left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
         where
         apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
-        and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
+        and apd.DELETED='0' and apoom.DELETED='0'
         and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
         and abo.PRODUCTSTATUS in ('30','40','50')
         and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0