优化
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@
|
||||
输入.set_type TYPEAS s_string
|
||||
输入.set_material_id TYPEAS s_string
|
||||
输入.material_type_id TYPEAS f_string
|
||||
输入.mater_ids TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -184,6 +185,9 @@
|
||||
OPTION 输入.material_id <> ""
|
||||
structivt.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
OPTION 输入.mater_ids <> ""
|
||||
structivt.material_id in 输入.mater_ids
|
||||
ENDOPTION
|
||||
OPTION 输入.is_active <> ""
|
||||
structivt.is_active = 输入.is_active
|
||||
ENDOPTION
|
||||
@@ -196,7 +200,7 @@
|
||||
OPTION 输入.is_pure <> ""
|
||||
stockmaterialext.is_pure = 输入.is_pure
|
||||
ENDOPTION
|
||||
ORDER BY structivt.material_id,structivt.ivt_level desc,structivt.pcsn, structivt.sum_qty desc
|
||||
ORDER BY structivt.material_id,structivt.ivt_level desc, structivt.pcsn, structivt.sum_qty desc
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -330,12 +334,14 @@
|
||||
QUERY
|
||||
SELECT
|
||||
ProductMaterialSet.*,
|
||||
producmaterialext.net_rate,
|
||||
producmaterialext.c_balance,
|
||||
classstandard.class_code
|
||||
FROM
|
||||
MD_PD_ProductMaterialSet ProductMaterialSet
|
||||
left join md_me_materialbase materialbase on materialbase.material_id = ProductMaterialSet.set_material_id
|
||||
LEFT JOIN md_pb_classstandard classstandard ON classstandard.class_id = materialbase.material_type_id
|
||||
LEFT JOIN md_me_producmaterialext producmaterialext ON producmaterialext.material_id = materialbase.material_id
|
||||
inner join md_me_materialbase materialbase on materialbase.material_id = ProductMaterialSet.set_material_id
|
||||
inner JOIN md_pb_classstandard classstandard ON classstandard.class_id = materialbase.material_type_id
|
||||
inner JOIN md_me_producmaterialext producmaterialext ON producmaterialext.material_id = materialbase.material_id
|
||||
WHERE
|
||||
1 = 1
|
||||
and producmaterialext.net_rate>0
|
||||
@@ -354,3 +360,128 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "8"
|
||||
QUERY
|
||||
SELECT
|
||||
ProductMaterialSet.*,
|
||||
producmaterialext.net_rate,
|
||||
producmaterialext.c_balance,
|
||||
classstandard.class_code
|
||||
FROM
|
||||
MD_PD_ProductMaterialSet ProductMaterialSet
|
||||
inner join md_me_materialbase materialbase on materialbase.material_id = ProductMaterialSet.set_material_id
|
||||
inner JOIN md_pb_classstandard classstandard ON classstandard.class_id = materialbase.material_type_id
|
||||
inner JOIN md_me_producmaterialext producmaterialext ON producmaterialext.material_id = materialbase.material_id
|
||||
WHERE
|
||||
1 = 1
|
||||
and producmaterialext.net_rate>0
|
||||
and ProductMaterialSet.add_rate>0
|
||||
OPTION 输入.material_id <> ""
|
||||
ProductMaterialSet.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
OPTION 输入.set_material_id <> ""
|
||||
ProductMaterialSet.set_material_id = 输入.set_material_id
|
||||
ENDOPTION
|
||||
OPTION 输入.set_type <> ""
|
||||
ProductMaterialSet.set_type = 输入.set_type
|
||||
ENDOPTION
|
||||
OPTION 输入.material_code <> ""
|
||||
materialbase.material_code like 输入.material_code
|
||||
ENDOPTION
|
||||
order by classstandard.class_code,materialbase.material_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "9"
|
||||
QUERY
|
||||
SELECT
|
||||
structivt.*,
|
||||
mb.material_name,
|
||||
mb.material_code,
|
||||
mb.material_type_id,
|
||||
stockmaterialext.is_need_move,
|
||||
CASE
|
||||
WHEN FormulaDtl3.used__qty > 0 THEN
|
||||
structivt.sum_qty - FormulaDtl3.used__qty ELSE structivt.sum_qty
|
||||
END AS sum_ivt_qty
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
SUM( ivt.canuse_qty ) AS sum_qty,
|
||||
ivt.qty_unit_id,
|
||||
ivt.qty_unit_name,
|
||||
ivt.material_id,
|
||||
ivt.pcsn,
|
||||
ivt.is_active,
|
||||
ivt.ivt_level,
|
||||
ivt.quality_scode
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
GROUP BY
|
||||
ivt.material_id,
|
||||
ivt.pcsn,
|
||||
ivt.is_active,
|
||||
ivt.ivt_level,
|
||||
ivt.quality_scode,
|
||||
ivt.qty_unit_id,
|
||||
ivt.qty_unit_name
|
||||
) structivt
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = structivt.material_id
|
||||
LEFT JOIN md_me_stockmaterialext stockmaterialext ON mb.material_id = stockmaterialext.material_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
SUM( FormulaDtl2.formula_qty - FormulaDtl2.put_qty ) AS used__qty,
|
||||
FormulaDtl2.material_id,
|
||||
FormulaDtl2.pcsn,
|
||||
FormulaDtl2.is_active,
|
||||
FormulaDtl2.ivt_level,
|
||||
FormulaDtl2.quality_scode
|
||||
FROM
|
||||
PDM_BI_FormulaDtl FormulaDtl2
|
||||
LEFT JOIN PDM_BI_Formula Formula2 ON FormulaDtl2.formula_id = Formula2.formula_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND FormulaDtl2.STATUS <> '99'
|
||||
OPTION 输入.workorder_id <> ""
|
||||
Formula2.workorder_id <> 输入.workorder_id
|
||||
ENDOPTION
|
||||
GROUP BY
|
||||
FormulaDtl2.material_id,
|
||||
FormulaDtl2.pcsn,
|
||||
FormulaDtl2.is_active,
|
||||
FormulaDtl2.ivt_level,
|
||||
FormulaDtl2.quality_scode
|
||||
) FormulaDtl3 ON (
|
||||
FormulaDtl3.material_id = structivt.material_id
|
||||
AND FormulaDtl3.pcsn = structivt.pcsn
|
||||
AND FormulaDtl3.is_active = structivt.is_active
|
||||
AND FormulaDtl3.ivt_level = structivt.ivt_level
|
||||
AND FormulaDtl3.quality_scode = structivt.quality_scode
|
||||
)
|
||||
WHERE
|
||||
1 = 1
|
||||
AND structivt.sum_qty > 0
|
||||
OPTION 输入.material_id <> ""
|
||||
structivt.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
OPTION 输入.mater_ids <> ""
|
||||
structivt.material_id in 输入.mater_ids
|
||||
ENDOPTION
|
||||
OPTION 输入.is_active <> ""
|
||||
structivt.is_active = 输入.is_active
|
||||
ENDOPTION
|
||||
OPTION 输入.quality_scode <> ""
|
||||
structivt.quality_scode = 输入.quality_scode
|
||||
ENDOPTION
|
||||
OPTION 输入.prior_level <> ""
|
||||
structivt.ivt_level <= 输入.prior_level
|
||||
ENDOPTION
|
||||
OPTION 输入.is_pure <> ""
|
||||
stockmaterialext.is_pure = 输入.is_pure
|
||||
ENDOPTION
|
||||
ORDER BY structivt.material_id,structivt.ivt_level desc, sum_ivt_qty
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
输入.ext_id TYPEAS s_string
|
||||
输入.material_id TYPEAS s_string
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.mater_ids TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -155,6 +156,9 @@
|
||||
OPTION 输入.material_id <> ""
|
||||
PURCHASE.ITEM_ID = 输入.material_id
|
||||
ENDOPTION
|
||||
OPTION 输入.mater_ids <> ""
|
||||
PURCHASE.ITEM_ID in 输入.mater_ids
|
||||
ENDOPTION
|
||||
GROUP BY PURCHASE.ITEM_ID,PURCHASE.VBILLCODE, PURCHASE.ITEM_CODE, PURCHASE.ITEM_NAME
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
|
||||
@@ -493,10 +493,20 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
ext_id = mater_jo.getString("ext_id");
|
||||
}
|
||||
}
|
||||
//获取物料ids
|
||||
JSONArray maters = WQL.getWO("statistical_report_query_02")
|
||||
.addParam("flag", "3")
|
||||
.process().getResultJSONArray(0);
|
||||
|
||||
String allmaterialId = " ";
|
||||
if (ObjectUtil.isNotEmpty(maters)){
|
||||
allmaterialId = "(\""+maters.stream().map(o -> ((JSONObject) o).getString("ext_id")).collect(Collectors.joining("\",\""))+"\")";
|
||||
}
|
||||
JSONArray ja = WQL.getWO("QL_ERP")
|
||||
.setDbname("dataSource1")
|
||||
.addParam("flag", "6")
|
||||
.addParam("material_id", ext_id)
|
||||
.addParam("mater_ids", allmaterialId)
|
||||
.process().getResultJSONArray(0);
|
||||
return ja;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
INNER JOIN md_me_materialbase mater ON structivt.material_id = mater.material_id
|
||||
WHERE
|
||||
structivt.quality_scode = '01'
|
||||
AND mater.material_type_id IN ( '1503644361664106496', '1503644361697660928', '1503644362192588800', '1503644362234531840', '1503644362788179968', '1503644362838511616' )
|
||||
OPTION 输入.material_id <> ""
|
||||
structivt.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
@@ -94,6 +95,7 @@
|
||||
mst.is_delete = '0'
|
||||
AND mst.STATUS <> '99'
|
||||
AND dtl.STATUS <> '99'
|
||||
AND mater.material_type_id IN ( '1503644361664106496', '1503644361697660928', '1503644362192588800', '1503644362234531840', '1503644362788179968', '1503644362838511616' )
|
||||
OPTION 输入.material_id <> ""
|
||||
dtl.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
@@ -108,6 +110,7 @@
|
||||
mb.material_id,
|
||||
mb.material_name,
|
||||
mb.material_code,
|
||||
mb.ext_id,
|
||||
class.parent_class_id,
|
||||
(
|
||||
CASE
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="1"
|
||||
disabled
|
||||
:disabled="type3"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -432,6 +432,7 @@ export default {
|
||||
structshow5: false,
|
||||
struct2type: '',
|
||||
button1: true,
|
||||
type3: true,
|
||||
button2: true,
|
||||
button3: true,
|
||||
tableDtl: [],
|
||||
@@ -647,6 +648,11 @@ export default {
|
||||
} else {
|
||||
this.button3 = true
|
||||
}
|
||||
if (row === '03') {
|
||||
this.type3 = false
|
||||
} else {
|
||||
this.type3 = true
|
||||
}
|
||||
},
|
||||
storChange2(row) {
|
||||
if (this.form.is_again_put === '1' && this.form.formula_type === '00') {
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
style="width: 100%;background: transparent;overflow:auto;"
|
||||
:max-height="590"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
@@ -104,6 +107,7 @@ export default {
|
||||
report.query4().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
this.MyQuery2()
|
||||
},
|
||||
/**
|
||||
* 接受父组件传值
|
||||
@@ -136,6 +140,43 @@ export default {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]))
|
||||
if (column.property === 'receive_qty') {
|
||||
const total = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = parseFloat(total).toFixed(3)
|
||||
sums[index]
|
||||
}
|
||||
|
||||
if (column.property === 'noin_qty') {
|
||||
const total = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = parseFloat(total).toFixed(3)
|
||||
sums[index]
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
MyQuery2() {
|
||||
this.fullscreenLoading = true
|
||||
report.query2(this.queryrow).then(res => {
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
style="width: 100%;background: transparent;overflow:auto;"
|
||||
:max-height="590"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
@@ -103,6 +106,7 @@ export default {
|
||||
report.query4().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
this.MyQuery2()
|
||||
},
|
||||
/**
|
||||
* 接受父组件传值
|
||||
@@ -135,6 +139,43 @@ export default {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]))
|
||||
if (column.property === 'sumqty') {
|
||||
const total = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = parseFloat(total).toFixed(3)
|
||||
sums[index]
|
||||
}
|
||||
|
||||
if (column.property === 'notqty') {
|
||||
const total = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = parseFloat(total).toFixed(3)
|
||||
sums[index]
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
MyQuery2() {
|
||||
this.fullscreenLoading = true
|
||||
report.query3(this.queryrow).then(res => {
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
<el-table
|
||||
ref="dragTable"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
style="width: 100%;background: transparent;overflow:auto;"
|
||||
:max-height="590"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
@@ -100,6 +103,7 @@ export default {
|
||||
report.query4().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
this.MyQuery2()
|
||||
},
|
||||
/**
|
||||
* 接受父组件传值
|
||||
@@ -132,6 +136,30 @@ export default {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]))
|
||||
if (column.property === 'qty') {
|
||||
const total = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = parseFloat(total).toFixed(3)
|
||||
sums[index]
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
MyQuery2() {
|
||||
this.fullscreenLoading = true
|
||||
report.query1(this.queryrow).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user