This commit is contained in:
zds
2022-11-09 11:31:41 +08:00
parent 305f6942ee
commit a9417c3800
3 changed files with 64 additions and 33 deletions

View File

@@ -113,21 +113,26 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
jo8.put("1", "采购缺口");
rows.add(jo8);
//汇总所有配方明细物料
HashMap<String,Double> dtlJa_map = new HashMap<String,Double>();
JSONArray dtlJa = WQL.getWO("statistical_report_query_01").addParam("flag", "5").process().getResultJSONArray(0);
for (int i = 0; i < dtlJa.size(); i++) {
JSONObject form_qty = dtlJa.getJSONObject(i);
dtlJa_map.put(form_qty.getString("material_id"),form_qty.getDouble("qty"));
}
for (int i = 0; i < mater_rows.size(); i++) {
JSONObject mater = mater_rows.getJSONObject(i);
String material_id = mater.getString("material_id");
//1、库存现存量现有库存 - 开单领料重量
JSONObject mater_ivt = WQL.getWO("statistical_report_query_01").addParam("flag", "4").addParam("material_id", material_id).process().uniqueResult(0);
//查询开单领料重量
JSONObject form_qty = WQL.getWO("statistical_report_query_01").addParam("flag", "5").addParam("material_id", material_id).process().uniqueResult(0);
double now_ivt = 0;
double need_qty = 0;
if (ObjectUtil.isNotEmpty(mater_ivt)) {
now_ivt = mater_ivt.getDoubleValue("qty");
}
if (ObjectUtil.isNotEmpty(form_qty)) {
need_qty = form_qty.getDoubleValue("qty");
if (dtlJa_map.containsKey(material_id)) {
need_qty = dtlJa_map.get(material_id);
}
double canuse_num = NumberUtil.sub(now_ivt - need_qty).doubleValue();
jo1.put(material_id, String.format("%.3f", canuse_num));

View File

@@ -245,43 +245,40 @@
IF 输入.flag = "5"
QUERY
SELECT
dtl.material_id,
SUM(ROUND((b.qty*dtl.standard_rate*0.01),3)) AS qty
SELECT
FormulaDtl.material_id,
SUM( FormulaDtl.formula_qty ) AS qty
FROM
(
SELECT
material_id,
SUM( qty ) AS qty
FROM
(
SELECT
material_id,
workorder_qty AS qty
SELECT
wo.workorder_id
FROM
pdm_bi_workorder wo
WHERE
wo.`status` = '40'
AND is_delete = '0'
OPTION 输入.begin_time <> ""
wo.planstart_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
wo.planstart_time <= 输入.end_time
ENDOPTION
AND wo.is_delete = '0'
UNION ALL
SELECT
workorder.workorder_id
FROM
pdm_bi_workorder workorder
INNER JOIN PDM_BI_WorkTask WorkTask ON WorkTask.workorder_id = workorder.workorder_id
WHERE
workorder.`status` IN ( '50', '69', '97', '98' )
AND workorder.is_delete = '0'
AND WorkTask.STATUS <> '99'
) a
GROUP BY
a.material_id
) b
LEFT JOIN md_pd_productbom mst ON mst.material_id = b.material_id
LEFT JOIN md_pd_productbomdtl dtl ON mst.bom_id = dtl.bom_id
WHERE
LEFT JOIN PDM_BI_Formula Formula ON Formula.workorder_id = a.workorder_id
LEFT JOIN PDM_BI_FormulaDtl FormulaDtl ON FormulaDtl.formula_id = Formula.formula_id and FormulaDtl.status<>'99'
where
1=1
OPTION 输入.material_id <> ""
dtl.material_id = 输入.material_id
ENDOPTION
GROUP BY
dtl.material_id
and Formula.is_delete='0'
and Formula.status<>'99'
OPTION 输入.material_id <> ""
FormulaDtl.material_id = 输入.material_id
ENDOPTION
GROUP BY
FormulaDtl.material_id
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -122,6 +122,16 @@
>
仓位同步
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-printer"
size="mini"
@click="print"
>
打印
</el-button>
</crudOperation>
<!--表单组件-->
<el-dialog
@@ -268,6 +278,7 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
const defaultForm = { point_id: null, point_code: null, point_name: null, area_type: null, point_type: '00', point_status: '00', lock_type: '00', vehicle_code: null, source_id: null, remark: null, is_used: null, is_delete: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null }
export default {
@@ -366,6 +377,24 @@ export default {
}).catch(() => {
})
},
print() {
const _selectData = this.$refs.table.selection
if (!_selectData || _selectData.length < 1) {
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
return
}
for (let i = 0; i < _selectData.length; i++) {
const code = _selectData[i].point_code
const LODOP = getLodop()
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
// 打印纸张大小设置https://www.it610.com/article/2094844.html
LODOP.SET_PRINT_PAGESIZE(1, '50mm', '30mm', '')
LODOP.ADD_PRINT_BARCODE('4.3mm', '8.2mm', '40mm', '20mm', '128Auto', code)
LODOP.PRINT()// 打印
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}
},
sync() {
this.syncLoading = true
crudPoint.syncStruct().then(() => {