修改
This commit is contained in:
@@ -79,6 +79,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
public Map<String, Object> materPlanQuery(Map whereJson) {
|
public Map<String, Object> materPlanQuery(Map whereJson) {
|
||||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||||
|
String org_id = MapUtil.getStr(whereJson, "org_id");
|
||||||
Date date1 = DateUtil.parse(begin_time);
|
Date date1 = DateUtil.parse(begin_time);
|
||||||
Date date2 = DateUtil.parse(end_time);
|
Date date2 = DateUtil.parse(end_time);
|
||||||
long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY);
|
long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY);
|
||||||
@@ -129,7 +130,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
jo1.put(material_id, String.format("%.3f", 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).addParam("begin_time", begin_time).addParam("end_time", end_time).process().uniqueResult(0);
|
JSONObject nedd_mater = WQL.getWO("statistical_report_query_01").addParam("flag", "6").addParam("material_id", material_id).addParam("begin_time", begin_time).addParam("end_time", end_time).addParam("org_id", org_id).process().uniqueResult(0);
|
||||||
double bom_qty = 0;
|
double bom_qty = 0;
|
||||||
if (ObjectUtil.isNotEmpty(nedd_mater)) {
|
if (ObjectUtil.isNotEmpty(nedd_mater)) {
|
||||||
bom_qty = nedd_mater.getDoubleValue("qty");
|
bom_qty = nedd_mater.getDoubleValue("qty");
|
||||||
|
|||||||
@@ -311,6 +311,9 @@
|
|||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.end_time <> ""
|
OPTION 输入.end_time <> ""
|
||||||
wo.planstart_time <= 输入.end_time
|
wo.planstart_time <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.org_id <> ""
|
||||||
|
wo.org_id = 输入.org_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT
|
SELECT
|
||||||
@@ -318,6 +321,7 @@
|
|||||||
product_weight AS qty
|
product_weight AS qty
|
||||||
FROM
|
FROM
|
||||||
MPS_BD_ProductDailyPlan plan
|
MPS_BD_ProductDailyPlan plan
|
||||||
|
LEFT JOIN sys_dept dept ON dept.`code` = plan.plan_org_code
|
||||||
WHERE
|
WHERE
|
||||||
plan.`status` = '01'
|
plan.`status` = '01'
|
||||||
OPTION 输入.begin_time <> ""
|
OPTION 输入.begin_time <> ""
|
||||||
@@ -326,6 +330,9 @@
|
|||||||
OPTION 输入.end_time <> ""
|
OPTION 输入.end_time <> ""
|
||||||
plan.planstart_date <= 输入.end_time
|
plan.planstart_date <= 输入.end_time
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
OPTION 输入.org_id <> ""
|
||||||
|
dept.dept_id = 输入.org_id
|
||||||
|
ENDOPTION
|
||||||
) a
|
) a
|
||||||
GROUP BY
|
GROUP BY
|
||||||
a.material_id
|
a.material_id
|
||||||
|
|||||||
Reference in New Issue
Block a user