修改
This commit is contained in:
@@ -126,7 +126,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
need_qty = form_qty.getDoubleValue("qty");
|
need_qty = form_qty.getDoubleValue("qty");
|
||||||
}
|
}
|
||||||
BigDecimal canuse_num = NumberUtil.sub(now_ivt - need_qty);
|
BigDecimal canuse_num = NumberUtil.sub(now_ivt - need_qty);
|
||||||
jo1.put(material_id, canuse_num + "");
|
jo1.put(material_id, String.format("%.3f",canuse_num));
|
||||||
|
|
||||||
//2、排产需求量(未开工的工令重量+排产未生成工令日计划重量)根据bom计算需要多少原料库存重量:
|
//2、排产需求量(未开工的工令重量+排产未生成工令日计划重量)根据bom计算需要多少原料库存重量:
|
||||||
JSONObject nedd_mater = WQL.getWO("statistical_report_query_01").addParam("flag", "6").addParam("material_id", material_id).process().uniqueResult(0);
|
JSONObject nedd_mater = WQL.getWO("statistical_report_query_01").addParam("flag", "6").addParam("material_id", material_id).process().uniqueResult(0);
|
||||||
@@ -134,7 +134,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
if (ObjectUtil.isNotEmpty(nedd_mater)) {
|
if (ObjectUtil.isNotEmpty(nedd_mater)) {
|
||||||
bom_qty = nedd_mater.getDoubleValue("qty");
|
bom_qty = nedd_mater.getDoubleValue("qty");
|
||||||
}
|
}
|
||||||
jo2.put(material_id, bom_qty + "");
|
jo2.put(material_id, String.format("%.3f",bom_qty));
|
||||||
|
|
||||||
//3、待检入库量:已经到货还未入库+待检重量
|
//3、待检入库量:已经到货还未入库+待检重量
|
||||||
JSONObject num_jo = WQL.getWO("statistical_report_query_01").addParam("flag", "7").addParam("material_id", material_id).process().uniqueResult(0);
|
JSONObject num_jo = WQL.getWO("statistical_report_query_01").addParam("flag", "7").addParam("material_id", material_id).process().uniqueResult(0);
|
||||||
@@ -158,13 +158,13 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
notqty = 0;
|
notqty = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jo4.put(material_id, noin_qty);
|
jo4.put(material_id, String.format("%.3f",noin_qty));
|
||||||
|
|
||||||
//4、合同在途:订单量-到货量
|
//4、合同在途:订单量-到货量
|
||||||
jo6.put(material_id, notqty);
|
jo6.put(material_id, String.format("%.3f",notqty));
|
||||||
|
|
||||||
//5、库/需差额量 :库存现存量-排产需求量
|
//5、库/需差额量 :库存现存量-排产需求量
|
||||||
jo3.put(material_id, Double.parseDouble(canuse_num + "") - bom_qty);
|
jo3.put(material_id, String.format("%.3f",(Double.parseDouble(canuse_num + "") - bom_qty)));
|
||||||
|
|
||||||
//7、最低储备定额:物料的安全库存量下限
|
//7、最低储备定额:物料的安全库存量下限
|
||||||
JSONObject safe_jo = WQLObject.getWQLObject("ST_IVT_MaterialSafeIvt").query("material_id = '" + material_id + "'").uniqueResult(0);
|
JSONObject safe_jo = WQLObject.getWQLObject("ST_IVT_MaterialSafeIvt").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||||
@@ -172,10 +172,10 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
if (ObjectUtil.isNotEmpty(safe_jo)) {
|
if (ObjectUtil.isNotEmpty(safe_jo)) {
|
||||||
safe_qty = safe_jo.getDoubleValue("safe_ivt_down");
|
safe_qty = safe_jo.getDoubleValue("safe_ivt_down");
|
||||||
}
|
}
|
||||||
jo7.put(material_id, safe_qty);
|
jo7.put(material_id, String.format("%.3f",safe_qty));
|
||||||
|
|
||||||
//8、采购缺口:库存+待检+在途+最低储备-排产量
|
//8、采购缺口:库存+待检+在途+最低储备-排产量
|
||||||
double buy_qty = now_ivt + noqty + notqty + safe_qty - bom_qty;
|
double buy_qty = bom_qty - (now_ivt + noqty + notqty + safe_qty);
|
||||||
jo8.put(material_id, String.format("%.3f",buy_qty));
|
jo8.put(material_id, String.format("%.3f",buy_qty));
|
||||||
|
|
||||||
//6、覆盖日期:物料库存可坚持到哪一天:库存现存量减每天需求量,哪天<0,取前一天
|
//6、覆盖日期:物料库存可坚持到哪一天:库存现存量减每天需求量,哪天<0,取前一天
|
||||||
|
|||||||
@@ -182,6 +182,7 @@
|
|||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
mb.material_id,
|
mb.material_id,
|
||||||
mb.material_name,
|
mb.material_name,
|
||||||
|
mb.material_code,
|
||||||
class.parent_class_id,
|
class.parent_class_id,
|
||||||
(case when class.class_id = '1503644362192588800' then 1
|
(case when class.class_id = '1503644362192588800' then 1
|
||||||
when class.class_id = '1503644361664106496' then 2
|
when class.class_id = '1503644361664106496' then 2
|
||||||
@@ -208,7 +209,7 @@
|
|||||||
LEFT JOIN md_pd_productbomdtl dtl ON dtl.bom_id = dtl.bom_id
|
LEFT JOIN md_pd_productbomdtl dtl ON dtl.bom_id = dtl.bom_id
|
||||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
|
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
|
||||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||||
ORDER BY order_no
|
ORDER BY order_no,material_code
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
@@ -303,11 +304,11 @@
|
|||||||
a.material_id
|
a.material_id
|
||||||
) b
|
) b
|
||||||
LEFT JOIN md_pd_productbom mst ON mst.material_id = b.material_id
|
LEFT JOIN md_pd_productbom mst ON mst.material_id = b.material_id
|
||||||
LEFT JOIN md_pd_productbomdtl dtl ON dtl.bom_id = dtl.bom_id
|
LEFT JOIN md_pd_productbomdtl dtl ON mst.bom_id = dtl.bom_id
|
||||||
WHERE
|
WHERE
|
||||||
1=1
|
1=1
|
||||||
OPTION 输入.material_id <> ""
|
OPTION 输入.material_id <> ""
|
||||||
b.material_id = 输入.material_id
|
dtl.material_id = 输入.material_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
@@ -320,6 +321,7 @@
|
|||||||
ROUND(SUM(a.allqty),3) AS allqty,
|
ROUND(SUM(a.allqty),3) AS allqty,
|
||||||
ROUND(SUM(a.ivt_qty),3) AS noqty,
|
ROUND(SUM(a.ivt_qty),3) AS noqty,
|
||||||
ROUND(SUM(a.notqty),3) AS notqty,
|
ROUND(SUM(a.notqty),3) AS notqty,
|
||||||
|
ROUND(SUM(a.noin_qty),3) AS noin_qty,
|
||||||
material_id
|
material_id
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user