From 6e7e77c1c2d5f9acf08f57f76ffb1571671f2cb7 Mon Sep 17 00:00:00 2001 From: lcode <18046109718@163.com> Date: Sun, 24 Nov 2024 15:15:56 +0800 Subject: [PATCH] =?UTF-8?q?20241124=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../产品入库详细列表.ms | 55 ++++ .../生产管理/工序报工表/修改.ms | 14 +- .../工序报工表/查询完成的列表.ms | 5 +- .../生产管理/挤压排产表/列表.ms | 2 +- .../挤压排产表/详情列表.ms | 18 +- .../生产管理/生产退料表/列表.ms | 4 +- .../生产退料表/退料详细列表.ms | 50 +++ .../生产管理/生产领料表/列表.ms | 4 +- .../生产领料详细列表.ms | 51 +++ .../生产领料表/领料物料列表.ms | 6 +- .../计划挤压排产管理/列表.ms | 4 +- .../采购管理/采购订单管理/列表.ms | 5 +- .../更新采购订单状态.ms | 33 ++ .../采购订单详情列表.ms | 24 +- .../销售出货管理/详情列表.ms | 68 ++++ .../销售管理/销售订单管理/列表.ms | 5 +- .../销售订单管理/更新销售状态.ms | 33 ++ .../销售订单管理/订单跟踪.ms | 292 ++++++++++++++++++ .../销售管理/销售订单管理/详情.ms | 11 +- .../销售订单管理/详情列表.ms | 14 +- 20 files changed, 669 insertions(+), 29 deletions(-) create mode 100644 appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/产品入库详细列表.ms create mode 100644 appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产退料表/退料详细列表.ms create mode 100644 appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/生产领料详细列表.ms create mode 100644 appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/更新采购订单状态.ms create mode 100644 appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售出货管理/详情列表.ms create mode 100644 appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/更新销售状态.ms create mode 100644 appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/订单跟踪.ms diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/产品入库详细列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/产品入库详细列表.ms new file mode 100644 index 0000000..7010f47 --- /dev/null +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/产品入库详细列表.ms @@ -0,0 +1,55 @@ +{ + "properties" : { }, + "id" : "2b4cc8f11db64e45b3c82de9e640dca4", + "script" : null, + "groupId" : "4aa6b5de02c244e2981c22bf5a95394d", + "name" : "产品入库详细列表", + "createTime" : null, + "updateTime" : 1732270231302, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/detaillist", + "method" : "POST", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null +} +================================ +import '@/common/sql' as sql + +String warehouseProductMaterial = sql("warehouseProductMaterial") +warehouseProductMaterial = warehouseProductMaterial.replace('mwp.packing_quantity,', '').replace('mwp.customer_id,', '') +String documentNumber = body.documentNumber; + +return db.page(""" + select + mpr.document_number, + date_format(receipt_date, '%Y-%m-%d %H:%i:%S') as receipt_date, + mpr.customer_id, + mci.customer_name, + mpr.workshop, + mpr.frame_number, + mpr.total_weight, + mpr.remarks, + mpr.receipt_quantity, + mpr.packing_quantity, + mpr.actual_weight, + mpr.unstocked_quantity, + mpr.stocked_quantity, + mw.warehouse_name, + ${warehouseProductMaterial} + from mini_product_receipt mpr + left join mini_customer_info mci on mci.customer_code = mpr.customer_id + left join mini_warehouse_product mwp on mwp.sales_order_code = mpr.sales_order_code + and mwp.material_code = mpr.material_code and mwp.order_no = mpr.order_no + left join mini_warehouses mw on mw.warehouse_code = mwp.warehouse + where 1=1 +?{documentNumber!=null && documentNumber!="", and mpr.document_number like concat('%', #{documentNumber} ,'%') } +"""); \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/修改.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/修改.ms index a2f22bd..19e8e04 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/修改.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/修改.ms @@ -5,7 +5,7 @@ "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "name" : "修改", "createTime" : null, - "updateTime" : 1731751291045, + "updateTime" : 1732245009288, "lock" : null, "createBy" : null, "updateBy" : null, @@ -57,7 +57,11 @@ String frameNumber = body.frameNumber; String nextProcess = body.nextProcess; String netReceipts = body.netReceipts; String isCompleted = body.isCompleted; +String machine = body.machine; +String workshop = body.workshop; +String operator = body.operator; String remarks = body.remarks; +String reportDate = body.reportDate; String remarks = body.remarks; @@ -86,7 +90,11 @@ try { net_receipts: netReceipts, next_process: nextProcess, is_completed: isCompleted, + machine: machine, + workshop: workshop, + operator: operator, remarks: remarks, + report_date: reportDate }) if (res <= 0) { tx.rollback(); @@ -132,10 +140,6 @@ try { pre_report_number: map.preReportNumber, schedule_number: map.scheduleNumber, report_number: map.reportNumber, - machine: map.machine, - operator: map.operator, - workshop: map.workshop, - report_date: map.reportDate, current_process: nextProcess, create_by: map.createBy, source_number: productionNumber, diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/查询完成的列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/查询完成的列表.ms index e9eb20e..a4dab55 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/查询完成的列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/查询完成的列表.ms @@ -5,7 +5,7 @@ "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "name" : "查询完成的列表", "createTime" : null, - "updateTime" : 1731737540782, + "updateTime" : 1732243852549, "lock" : null, "createBy" : null, "updateBy" : null, @@ -53,9 +53,10 @@ return db.page(""" mpr.stock_quantity, ${salesOrdeSelect} from mini_process_report mpr + left join mini_sales_orders mso on mso.document_number = mpr.sales_order_code left join mini_sales_order_materials msm on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code and mpr.order_no = msm.order_no - where mpr.is_completed = 1 and (mpr.production_number - mpr.stock_quantity) > 0 + where mpr.is_completed = 1 and mso.status = 0 and (mpr.production_number - mpr.stock_quantity) > 0 ?{salesOrderCode != null and salesOrderCode != '', and mpr.sales_order_code like concat('%', #{salesOrderCode}, '%')} ?{materialCode != null and materialCode != '', and mpr.material_code like concat('%', #{materialCode}, '%')} """) \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/列表.ms index 83d9e15..23fbdf6 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/列表.ms @@ -5,7 +5,7 @@ "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "name" : "列表", "createTime" : null, - "updateTime" : 1728727705064, + "updateTime" : 1732243472745, "lock" : null, "createBy" : null, "updateBy" : null, diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情列表.ms index 835ecc2..d29c49a 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情列表.ms @@ -5,7 +5,7 @@ "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "name" : "详情列表", "createTime" : null, - "updateTime" : 1731567261894, + "updateTime" : 1732271133944, "lock" : null, "createBy" : null, "updateBy" : null, @@ -546,22 +546,36 @@ String salesOrderCode = body["salesOrderCode"]; String orderNo = body["orderNo"]; String materialCode = body["materialCode"]; String profileModel = body["profileModel"]; +String salesStatus = body["salesStatus"]; return db.page(""" select + date_format(mes.extrusion_date, '%Y-%m-%d') as extrusion_date, + mes.extrusion_machine, + mpm.machine_name as extrusion_machine_name, + mes.extrusion_team, + su.user_name as extrusion_team_name, mesd.schedule_number, mesd.production_length, mesd.production_pieces, mesd.sawing_method, + su2.user_name as salesperson_name, ${salesOrdeSelect} from mini_extrusion_schedule_detail mesd + left join mini_extrusion_schedule mes on mes.schedule_number = mesd.schedule_number + left join sys_user su on su.user_id = mes.extrusion_team + left join mini_production_machines mpm on mpm.machine_code = mes.extrusion_machine + left join mini_sales_order_materials msm on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code and mesd.order_no = msm.order_no - where 1=1 + left join mini_sales_orders mso on mso.document_number = msm.sales_order_code + left join sys_user su2 on su2.user_id = mso.salesperson + where 1=1 ?{scheduleNumber != null and scheduleNumber != '', and mesd.schedule_number like concat('%', #{scheduleNumber}, '%')} ?{salesOrderCode != null and salesOrderCode != '', and msm.sales_order_code like concat('%', #{salesOrderCode}, '%')} ?{orderNo != null and orderNo != '', and msm.order_no like concat('%', #{orderNo}, '%')} ?{materialCode != null and materialCode != '', and msm.material_code like concat('%', #{materialCode}, '%')} ?{profileModel != null and profileModel != '', and msm.profile_model like concat('%', #{profileModel}, '%')} + ?{salesStatus != null and salesStatus != '', and mso.status = #{salesStatus}} """) \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产退料表/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产退料表/列表.ms index d1d7847..8f0aeb0 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产退料表/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产退料表/列表.ms @@ -5,7 +5,7 @@ "groupId" : "e95307c32dc1437e82df26a97f1f194e", "name" : "列表", "createTime" : null, - "updateTime" : 1727082831997, + "updateTime" : 1732269376384, "lock" : null, "createBy" : null, "updateBy" : null, @@ -52,7 +52,7 @@ return db.page(""" select id, document_number, - date_format(return_date,'%Y-%m-%d %H:%i:%S') as return_date, + date_format(return_date,'%Y-%m-%d') as return_date, department, recipient, warehouse, diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产退料表/退料详细列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产退料表/退料详细列表.ms new file mode 100644 index 0000000..c52199e --- /dev/null +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产退料表/退料详细列表.ms @@ -0,0 +1,50 @@ +{ + "properties" : { }, + "id" : "6d97e8a13d904f858f0c64807351f542", + "script" : null, + "groupId" : "e95307c32dc1437e82df26a97f1f194e", + "name" : "退料详细列表", + "createTime" : null, + "updateTime" : 1732270112987, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/detaillist", + "method" : "POST", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null +} +================================ +import '@/common/sql' as sql + +String warehouseMaterial = sql("warehouseMaterial") + +String documentNumber = body.documentNumber; +String warehouse = body.warehouse; + +return db.page(""" + select + mmr.id, + mmr.document_number, + date_format(mmr.return_date,'%Y-%m-%d') as return_date, + mmr.department, + mmr.recipient, + mmr.return_number, + mmr.return_weight, + mw.warehouse_name, + ${warehouseMaterial} + from mini_production_material_return mmr + inner join mini_warehouse_material mwm on mwm.warehouse = mmr.warehouse and mwm.supplier = mmr.supplier and mwm.material_code = mmr.material_code + inner join mini_warehouses mw on mw.warehouse_code = mmr.warehouse + +where 1=1 +?{documentNumber!=null && documentNumber!="", and mmr.document_number like concat('%', #{documentNumber} ,'%') } +?{warehouse!=null && warehouse!="", and mmr.warehouse like concat('%', #{warehouse} ,'%') } +"""); \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/列表.ms index 4de1f50..d1f7617 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/列表.ms @@ -5,7 +5,7 @@ "groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea", "name" : "列表", "createTime" : null, - "updateTime" : 1729072453053, + "updateTime" : 1732269382705, "lock" : null, "createBy" : null, "updateBy" : null, @@ -52,7 +52,7 @@ return db.page(""" select mmr.id, mmr.document_number, - date_format(mmr.requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date, + date_format(mmr.requisition_date,'%Y-%m-%d') as requisition_date, mmr.department, mmr.recipient, mmr.warehouse, diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/生产领料详细列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/生产领料详细列表.ms new file mode 100644 index 0000000..580645f --- /dev/null +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/生产领料详细列表.ms @@ -0,0 +1,51 @@ +{ + "properties" : { }, + "id" : "021da64fc53d4836bee36e2e8f2934fd", + "script" : null, + "groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea", + "name" : "生产领料详细列表", + "createTime" : null, + "updateTime" : 1732268769536, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/detaillist", + "method" : "POST", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null +} +================================ +import '@/common/sql' as sql + +String documentNumber = body.documentNumber; +String warehouse = body.warehouse; + +String warehouseMaterial = sql("warehouseMaterial") + +return db.page(""" + select + mmr.id, + mmr.document_number, + date_format(mmr.requisition_date,'%Y-%m-%d') as requisition_date, + mmr.department, + mmr.recipient, + mmr.requisition_number, + mmr.requisition_weight, + mw.warehouse_name, + ${warehouseMaterial} + from mini_production_material_requisition mmr + inner join mini_warehouse_material mwm on mwm.warehouse = mmr.warehouse and mwm.supplier = mmr.supplier + inner join mini_warehouses mw on mw.warehouse_code = mmr.warehouse + and mwm.material_code = mmr.material_code +where 1=1 +?{documentNumber!=null && documentNumber!="", and mmr.document_number like concat('%', #{documentNumber} ,'%') } +?{warehouse!=null && warehouse!="", and mmr.warehouse like concat('%', #{warehouse} ,'%') } +"""); +// group by mmr.document_number, mmr.warehouse, mmr.material_code, mmr.supplier diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/领料物料列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/领料物料列表.ms index ac14f89..ff155bb 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/领料物料列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/生产领料表/领料物料列表.ms @@ -5,7 +5,7 @@ "groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea", "name" : "领料物料列表", "createTime" : null, - "updateTime" : 1729136886715, + "updateTime" : 1732270091770, "lock" : null, "createBy" : null, "updateBy" : null, @@ -41,9 +41,9 @@ return db.page(""" mw.warehouse_name, ${warehouseMaterial} from mini_production_material_requisition mmr - inner join mini_warehouse_material mwm on mwm.warehouse = mmr.warehouse and mwm.supplier = mmr.supplier + inner join mini_warehouse_material mwm on mwm.warehouse = mmr.warehouse and mwm.supplier = mmr.supplier and mwm.material_code = mmr.material_code inner join mini_warehouses mw on mw.warehouse_code = mmr.warehouse - and mwm.material_code = mmr.material_code + where 1=1 ?{documentNumber!=null && documentNumber!="", and mmr.document_number like concat('%', #{documentNumber} ,'%') } ?{warehouse!=null && warehouse!="", and mmr.warehouse like concat('%', #{warehouse} ,'%') } diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/列表.ms index ed61804..3c207b4 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/列表.ms @@ -5,7 +5,7 @@ "groupId" : "06d35cc5db5f4e6681262a1648c871c3", "name" : "列表", "createTime" : null, - "updateTime" : 1731643614960, + "updateTime" : 1732243435733, "lock" : null, "createBy" : null, "updateBy" : null, @@ -190,7 +190,7 @@ String sql = """ left join mini_customer_info mci on mci.customer_code = mso.customer_id left join mini_sales_order_materials msm on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code and mps.order_no = msm.order_no - where 1=1 + where 1=1 and mso.status=0 ?{salesOrderCode != null and salesOrderCode != "", and mps.sales_order_code = #{salesOrderCode}} ?{documentNumber != null and documentNumber != "", and mps.document_number = #{documentNumber}} ?{materialName != null and materialName != "", and msm.material_name like concat('%', #{materialName}, '%')} diff --git a/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/列表.ms index 5691ed6..de52f45 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/列表.ms @@ -5,7 +5,7 @@ "groupId" : "a2b7765d540449b7bf93e070c1911ce9", "name" : "列表", "createTime" : null, - "updateTime" : 1726243288668, + "updateTime" : 1732242902193, "lock" : null, "createBy" : null, "updateBy" : null, @@ -52,6 +52,7 @@ String purchaseDate = body.purchaseDate; String purchaser = body.purchaser; String price = body.price; String deliveryDate = body.deliveryDate; +String status = body.status var sql = """ select @@ -66,6 +67,7 @@ var sql = """ date_format(mpo.delivery_date, '%Y-%m-%d') as delivery_date, mpo.remarks, mpo.is_warehouse, + mpo.status, date_format(mpo.create_time, '%Y-%m-%d %H:%i:%S') as create_time, date_format(mpo.update_time, '%Y-%m-%d %H:%i:%S') as update_time from mini_purchase_orders mpo @@ -78,6 +80,7 @@ var sql = """ ?{purchaser != null and purchaser != '', and mpo.purchaser = #{purchaser}} ?{price != null and price != '', and mpo.price = #{price}} ?{deliveryDate != null and deliveryDate != '', and mpo.delivery_date = #{deliveryDate}} + ?{status != null and status != '', and mpo.status = #{status}} """ String supplier = body.supplier; diff --git a/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/更新采购订单状态.ms b/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/更新采购订单状态.ms new file mode 100644 index 0000000..bf307cc --- /dev/null +++ b/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/更新采购订单状态.ms @@ -0,0 +1,33 @@ +{ + "properties" : { }, + "id" : "da0d50b5a2f34008a86055901f12d637", + "script" : null, + "groupId" : "a2b7765d540449b7bf93e070c1911ce9", + "name" : "更新采购订单状态", + "createTime" : null, + "updateTime" : 1732242575346, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/up/status", + "method" : "POST", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null +} +================================ +String status = body['status']; +String documentNumber = body['documentNumber']; +int res = db.table("mini_purchase_orders").where().eq('document_number', documentNumber) + .update({ + document_number: documentNumber, + status: status + }); + +return res; \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/采购订单详情列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/采购订单详情列表.ms index 241688a..fbddd5e 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/采购订单详情列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/采购管理/采购订单管理/采购订单详情列表.ms @@ -5,7 +5,7 @@ "groupId" : "a2b7765d540449b7bf93e070c1911ce9", "name" : "采购订单详情列表", "createTime" : null, - "updateTime" : 1729651279653, + "updateTime" : 1732265444981, "lock" : null, "createBy" : null, "updateBy" : null, @@ -492,10 +492,26 @@ ================================ String documentNumber = body.documentNumber String materialCode = body.materialCode +String status = body.status return db.page(""" - select * from mini_purchase_orders_materials + select + mpom.*, + mpo.supplier, + msi.supplier_name, + date_format(mpo.purchase_date, '%Y-%m-%d') as purchase_date, + mpo.purchaser, + su.user_name as purchaser_name, + mpo.price, + date_format(mpo.delivery_date, '%Y-%m-%d') as delivery_date, + mpo.is_warehouse, + mpo.status as purchase_order_status + from mini_purchase_orders_materials mpom + left join mini_purchase_orders mpo on mpom.purchase_order_number = mpo.document_number + left join mini_supplier_info msi on msi.id = mpo.supplier + left join sys_user su on su.user_id = mpo.purchaser where 1=1 - ?{documentNumber!=null && documentNumber !="", purchase_order_number = #{documentNumber}} - ?{materialCode!=null && materialCode !="", material_code = #{materialCode}} + ?{documentNumber!=null && documentNumber !="", mpom.purchase_order_number = #{documentNumber}} + ?{materialCode!=null && materialCode !="", mpom.material_code = #{materialCode}} + ?{status!=null && status !="", mpom.status = #{status}} """) \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售出货管理/详情列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售出货管理/详情列表.ms new file mode 100644 index 0000000..a5273c2 --- /dev/null +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售出货管理/详情列表.ms @@ -0,0 +1,68 @@ +{ + "properties" : { }, + "id" : "adee898ccdcb4fb6b46c64a25264260c", + "script" : null, + "groupId" : "a170047f79ab4cb1b892edc5cccd823e", + "name" : "详情列表", + "createTime" : null, + "updateTime" : 1732419716776, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/detaillist", + "method" : "POST", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "{\r\n \"page\": 1,\r\n \"size\": 30\r\n}", + "headers" : [ ], + "paths" : [ ], + "responseBody" : "{\n \"code\": 0,\n \"data\": {\n \"count\": 1420,\n \"list\": [\n {\n \"customerId\": \"C000033\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-11-14\",\n \"shipmentInspectionReport\": \"43546\",\n \"salesShipmentCode\": \"20240912003\",\n \"materialCode\": \"JK-ZL-05\",\n \"orderNo\": \"37101\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 2965,\n \"actualWeight\": 879.2,\n \"salesOrderCode\": \"GXL20240621-37101\",\n \"materialName\": \"OL-4-12代替\",\n \"profileModel\": \"JK-ZL-05\",\n \"weight\": 0.068,\n \"specification\": \"见图\",\n \"thickness\": 0.88,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 4.1,\n \"orderTotalQuantity\": 4500,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 710.94,\n \"theoreticalWeightPerPiece\": 0.2788,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000010\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706001\",\n \"salesShipmentCode\": \"20240706001\",\n \"materialCode\": \"ZJ006-001\",\n \"orderNo\": \"31501\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 829,\n \"actualWeight\": 552.26,\n \"salesOrderCode\": \"CXF20240531-31501\",\n \"materialName\": \"贴无字膜收缩\",\n \"profileModel\": \"ZJ006\",\n \"weight\": 0.196,\n \"specification\": \"37.4*30.2\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 3.3,\n \"orderTotalQuantity\": 3000,\n \"surfaceMethod\": \"琥珀亮光004\",\n \"theoreticalWeight\": 54.33,\n \"theoreticalWeightPerPiece\": 0.6468,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000010\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706002\",\n \"salesShipmentCode\": \"20240706002\",\n \"materialCode\": \"ZJ006-001\",\n \"orderNo\": \"37501\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 2632,\n \"actualWeight\": 1850.56,\n \"salesOrderCode\": \"CXF20240621-37501\",\n \"materialName\": \"贴无字膜收缩\",\n \"profileModel\": \"ZJ006\",\n \"weight\": 0.196,\n \"specification\": \"37.4*30.2\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 3.3,\n \"orderTotalQuantity\": 3000,\n \"surfaceMethod\": \"琥珀亮光004\",\n \"theoreticalWeight\": 569.18,\n \"theoreticalWeightPerPiece\": 0.6468,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000003\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706003\",\n \"salesShipmentCode\": \"20240706003\",\n \"materialCode\": \"DM171-001\",\n \"orderNo\": \"31410\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 50,\n \"actualWeight\": 39,\n \"salesOrderCode\": \"DM20240531-31410\",\n \"materialName\": \"DM171\",\n \"profileModel\": \"DM171\",\n \"weight\": 0.416,\n \"specification\": \"40*20.2\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.822,\n \"orderTotalQuantity\": 40,\n \"surfaceMethod\": \"哑黑\",\n \"theoreticalWeight\": 37.9,\n \"theoreticalWeightPerPiece\": 0.758,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000003\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706004\",\n \"salesShipmentCode\": \"20240706004\",\n \"materialCode\": \"OL-DM126-001\",\n \"orderNo\": \"34102\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 11,\n \"actualWeight\": 5.17,\n \"salesOrderCode\": \"DM20240612-34102\",\n \"materialName\": \"OL-DM126\",\n \"profileModel\": \"OL-DM126\",\n \"weight\": 0.254,\n \"specification\": \"见图\",\n \"thickness\": 0.8,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.85,\n \"orderTotalQuantity\": 270,\n \"surfaceMethod\": \"哑黑\",\n \"theoreticalWeight\": 5.17,\n \"theoreticalWeightPerPiece\": 0.4699,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000003\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706005\",\n \"salesShipmentCode\": \"20240706005\",\n \"materialCode\": \"DM82-001\",\n \"orderNo\": \"34110\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 19,\n \"actualWeight\": 14,\n \"salesOrderCode\": \"DM20240612-34110\",\n \"materialName\": \"YLM-78代替\",\n \"profileModel\": \"DM82\",\n \"weight\": 0.442,\n \"specification\": \"56.91*21.7\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.473,\n \"orderTotalQuantity\": 8,\n \"surfaceMethod\": \"哑黑\",\n \"theoreticalWeight\": 12.37,\n \"theoreticalWeightPerPiece\": 0.6511,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000003\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706006\",\n \"salesShipmentCode\": \"20240706006\",\n \"materialCode\": \"DM93-001\",\n \"orderNo\": \"34112\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 19,\n \"actualWeight\": 11.85,\n \"salesOrderCode\": \"DM20240612-34112\",\n \"materialName\": \"YLM-79代替\",\n \"profileModel\": \"DM93\",\n \"weight\": 0.425,\n \"specification\": \"见图纸\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.468,\n \"orderTotalQuantity\": 8,\n \"surfaceMethod\": \"哑黑\",\n \"theoreticalWeight\": 11.85,\n \"theoreticalWeightPerPiece\": 0.6239,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000003\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706007\",\n \"salesShipmentCode\": \"20240706007\",\n \"materialCode\": \"DM99-001\",\n \"orderNo\": \"34114\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 18,\n \"actualWeight\": 11,\n \"salesOrderCode\": \"DM20240612-34114\",\n \"materialName\": \"DM99\",\n \"profileModel\": \"DM99\",\n \"weight\": 0.374,\n \"specification\": \"见图纸\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.5,\n \"orderTotalQuantity\": 8,\n \"surfaceMethod\": \"哑黑\",\n \"theoreticalWeight\": 10.1,\n \"theoreticalWeightPerPiece\": 0.561,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000003\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706008\",\n \"salesShipmentCode\": \"20240706008\",\n \"materialCode\": \"OL-DM125-001\",\n \"orderNo\": \"34116\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 53,\n \"actualWeight\": 25.2,\n \"salesOrderCode\": \"DM20240612-34116\",\n \"materialName\": \"OL-DM125\",\n \"profileModel\": \"OL-DM125\",\n \"weight\": 0.257,\n \"specification\": \"见图\",\n \"thickness\": 0.8,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.85,\n \"orderTotalQuantity\": 466,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 25.2,\n \"theoreticalWeightPerPiece\": 0.4755,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000003\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706009\",\n \"salesShipmentCode\": \"20240706009\",\n \"materialCode\": \"OL-DM125-001\",\n \"orderNo\": \"34126\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 55,\n \"actualWeight\": 26.76,\n \"salesOrderCode\": \"DM20240612-34126\",\n \"materialName\": \"OL-DM125\",\n \"profileModel\": \"OL-DM125\",\n \"weight\": 0.257,\n \"specification\": \"见图\",\n \"thickness\": 0.8,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.85,\n \"orderTotalQuantity\": 208,\n \"surfaceMethod\": \"机抛古铜金\",\n \"theoreticalWeight\": 11.89,\n \"theoreticalWeightPerPiece\": 0.4755,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000003\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706010\",\n \"salesShipmentCode\": \"20240706010\",\n \"materialCode\": \"OL-DM126-001\",\n \"orderNo\": \"34127\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 116,\n \"actualWeight\": 54.51,\n \"salesOrderCode\": \"DM20240612-34127\",\n \"materialName\": \"OL-DM126\",\n \"profileModel\": \"OL-DM126\",\n \"weight\": 0.254,\n \"specification\": \"见图\",\n \"thickness\": 0.8,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.85,\n \"orderTotalQuantity\": 208,\n \"surfaceMethod\": \"机抛古铜金\",\n \"theoreticalWeight\": 33.36,\n \"theoreticalWeightPerPiece\": 0.4699,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000009\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706011\",\n \"salesShipmentCode\": \"20240706011\",\n \"materialCode\": \"G003-001\",\n \"orderNo\": \"32502\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 103,\n \"actualWeight\": 56.61,\n \"salesOrderCode\": \"GJL20240605-32502\",\n \"materialName\": \"贴无字膜收缩\",\n \"profileModel\": \"G003\",\n \"weight\": 0.229,\n \"specification\": \"40*3.5\",\n \"thickness\": 1,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2.4,\n \"orderTotalQuantity\": 300,\n \"surfaceMethod\": \"氧化拉丝银\",\n \"theoreticalWeight\": 56.61,\n \"theoreticalWeightPerPiece\": 0.5496,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000009\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706012\",\n \"salesShipmentCode\": \"20240706012\",\n \"materialCode\": \"G007-001\",\n \"orderNo\": \"38401\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 920,\n \"actualWeight\": 343.39,\n \"salesOrderCode\": \"GJL20240625-38401\",\n \"materialName\": \"贴膜\",\n \"profileModel\": \"G007\",\n \"weight\": 0.185,\n \"specification\": \"24*7.6\",\n \"thickness\": 2,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2,\n \"orderTotalQuantity\": 2000,\n \"surfaceMethod\": \"氧化拉丝银\",\n \"theoreticalWeight\": 340.4,\n \"theoreticalWeightPerPiece\": 0.37,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000009\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706013\",\n \"salesShipmentCode\": \"20240706013\",\n \"materialCode\": \"G007-001\",\n \"orderNo\": \"38501\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 3019,\n \"actualWeight\": 1122.36,\n \"salesOrderCode\": \"GJL20240625-38501\",\n \"materialName\": \"贴膜\",\n \"profileModel\": \"G007\",\n \"weight\": 0.185,\n \"specification\": \"24*7.6\",\n \"thickness\": 2,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2,\n \"orderTotalQuantity\": 3000,\n \"surfaceMethod\": \"氧化拉丝银\",\n \"theoreticalWeight\": 44.4,\n \"theoreticalWeightPerPiece\": 0.37,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000009\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706014\",\n \"salesShipmentCode\": \"20240706014\",\n \"materialCode\": \"G002-001\",\n \"orderNo\": \"38502\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 606,\n \"actualWeight\": 274,\n \"salesOrderCode\": \"GJL20240625-38502\",\n \"materialName\": \"ZJ030代替贴膜\",\n \"profileModel\": \"G002\",\n \"weight\": 0.225,\n \"specification\": \"35*7.5\",\n \"thickness\": 1,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2,\n \"orderTotalQuantity\": 500,\n \"surfaceMethod\": \"氧化拉丝银\",\n \"theoreticalWeight\": 260.1,\n \"theoreticalWeightPerPiece\": 0.45,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000009\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706015\",\n \"salesShipmentCode\": \"20240706015\",\n \"materialCode\": \"G003-001\",\n \"orderNo\": \"39401\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 621,\n \"actualWeight\": 398.56,\n \"salesOrderCode\": \"GJL20240628-39401\",\n \"materialName\": \"贴无字膜收缩\",\n \"profileModel\": \"G003\",\n \"weight\": 0.229,\n \"specification\": \"40*3.5\",\n \"thickness\": 0,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 2.8,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2.8,\n \"orderTotalQuantity\": 300,\n \"surfaceMethod\": \"氧化拉丝银\",\n \"theoreticalWeight\": 393.06,\n \"theoreticalWeightPerPiece\": 0.6412,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000009\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706016\",\n \"salesShipmentCode\": \"20240706016\",\n \"materialCode\": \"G003-001\",\n \"orderNo\": \"41101\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 648,\n \"actualWeight\": 356.14,\n \"salesOrderCode\": \"GJL20240706-41101\",\n \"materialName\": \"贴无字膜收缩\",\n \"profileModel\": \"G003\",\n \"weight\": 0.229,\n \"specification\": \"40*3.5\",\n \"thickness\": 0,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 2.8,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2.4,\n \"orderTotalQuantity\": 600,\n \"surfaceMethod\": \"氧化拉丝银\",\n \"theoreticalWeight\": 356.14,\n \"theoreticalWeightPerPiece\": 0.5496,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000011\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706018\",\n \"salesShipmentCode\": \"20240706018\",\n \"materialCode\": \"KDS-1404-001\",\n \"orderNo\": \"33704\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 242,\n \"actualWeight\": 382.08,\n \"salesOrderCode\": \"KDS20240612-33704\",\n \"materialName\": \"KDS-1404\",\n \"profileModel\": \"KDS-1404\",\n \"weight\": 0.355,\n \"specification\": \"53.9*31.6\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 3.9,\n \"orderTotalQuantity\": 300,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 335.05,\n \"theoreticalWeightPerPiece\": 1.3845,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000011\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706019\",\n \"salesShipmentCode\": \"20240706019\",\n \"materialCode\": \"KDS-1406-001\",\n \"orderNo\": \"33705\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 93,\n \"actualWeight\": 128.01,\n \"salesOrderCode\": \"KDS20240612-33705\",\n \"materialName\": \"KDS-1406\",\n \"profileModel\": \"KDS-1406\",\n \"weight\": 0.352,\n \"specification\": \"43.9*29.96\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 3.9,\n \"orderTotalQuantity\": 700,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 127.67,\n \"theoreticalWeightPerPiece\": 1.3728,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000004\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706020\",\n \"salesShipmentCode\": \"20240706020\",\n \"materialCode\": \"A38B-003\",\n \"orderNo\": \"36901\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 360,\n \"actualWeight\": 150.12,\n \"salesOrderCode\": \"MJ20240620-36901\",\n \"materialName\": \"OL-HD-2代/精切不打孔/10缪\",\n \"profileModel\": \"A38B\",\n \"weight\": 0.223,\n \"specification\": \"见图\",\n \"thickness\": 1.3,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.87,\n \"orderTotalQuantity\": 2000,\n \"surfaceMethod\": \"喷砂闪银\",\n \"theoreticalWeight\": 150.12,\n \"theoreticalWeightPerPiece\": 0.417,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000019\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706021\",\n \"salesShipmentCode\": \"20240706021\",\n \"materialCode\": \"OL-AI-1-001\",\n \"orderNo\": \"38601\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 106,\n \"actualWeight\": 523.53,\n \"salesOrderCode\": \"XDD20240626-38601\",\n \"materialName\": \"上轨\",\n \"profileModel\": \"OL-AI-1\",\n \"weight\": 1.575,\n \"specification\": \"59*56.6\",\n \"thickness\": 2.5,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2.95,\n \"orderTotalQuantity\": 103,\n \"surfaceMethod\": \"坯料\",\n \"theoreticalWeight\": 492.5,\n \"theoreticalWeightPerPiece\": 4.6463,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000019\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706022\",\n \"salesShipmentCode\": \"20240706022\",\n \"materialCode\": \"OL-AI-1-001\",\n \"orderNo\": \"38602\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 30,\n \"actualWeight\": 180.52,\n \"salesOrderCode\": \"XDD20240626-38602\",\n \"materialName\": \"上轨\",\n \"profileModel\": \"OL-AI-1\",\n \"weight\": 1.575,\n \"specification\": \"59*56.6\",\n \"thickness\": 2.5,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 3.6,\n \"orderTotalQuantity\": 40,\n \"surfaceMethod\": \"坯料\",\n \"theoreticalWeight\": 170.1,\n \"theoreticalWeightPerPiece\": 5.67,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000019\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706023\",\n \"salesShipmentCode\": \"20240706023\",\n \"materialCode\": \"OL-HO-4A-001\",\n \"orderNo\": \"38606\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 27,\n \"actualWeight\": 64.8,\n \"salesOrderCode\": \"XDD20240626-38606\",\n \"materialName\": \"OL-HO-4A\",\n \"profileModel\": \"OL-HO-4A\",\n \"weight\": 0.4,\n \"specification\": \"见图纸\",\n \"thickness\": 1.5,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 6,\n \"orderTotalQuantity\": 25,\n \"surfaceMethod\": \"坯料\",\n \"theoreticalWeight\": 64.8,\n \"theoreticalWeightPerPiece\": 2.4,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000019\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706024\",\n \"salesShipmentCode\": \"20240706024\",\n \"materialCode\": \"OL-HO-7-001\",\n \"orderNo\": \"38607\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 27,\n \"actualWeight\": 52.65,\n \"salesOrderCode\": \"XDD20240626-38607\",\n \"materialName\": \"中勾\",\n \"profileModel\": \"OL-HO-7\",\n \"weight\": 0.325,\n \"specification\": \"54.4*13\",\n \"thickness\": 1.7,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 6,\n \"orderTotalQuantity\": 25,\n \"surfaceMethod\": \"坯料\",\n \"theoreticalWeight\": 52.65,\n \"theoreticalWeightPerPiece\": 1.95,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000019\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706025\",\n \"salesShipmentCode\": \"20240706025\",\n \"materialCode\": \"OL-AI-2A-001\",\n \"orderNo\": \"40101\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 28,\n \"actualWeight\": 76.82,\n \"salesOrderCode\": \"XDD20240704-40101\",\n \"materialName\": \"下轨\",\n \"profileModel\": \"OL-AI-2A\",\n \"weight\": 0.93,\n \"specification\": \"42.5*57\",\n \"thickness\": 1.5,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 2.95,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2.95,\n \"orderTotalQuantity\": 25,\n \"surfaceMethod\": \"坯料\",\n \"theoreticalWeight\": 76.82,\n \"theoreticalWeightPerPiece\": 2.7435,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000085\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706026\",\n \"salesShipmentCode\": \"20240706026\",\n \"materialCode\": \"XS-0082\",\n \"orderNo\": \"35003\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 195,\n \"actualWeight\": 189.96,\n \"salesOrderCode\": \"XSWY20240614-35003\",\n \"materialName\": \"时效氧化\",\n \"profileModel\": \"XS-0082\",\n \"weight\": 0.484,\n \"specification\": \"34.4*44.3\",\n \"thickness\": 1,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.95,\n \"orderTotalQuantity\": 750,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 93.44,\n \"theoreticalWeightPerPiece\": 0.9438,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000085\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706027\",\n \"salesShipmentCode\": \"20240706027\",\n \"materialCode\": \"XS-0077\",\n \"orderNo\": \"35019\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 12,\n \"actualWeight\": 12,\n \"salesOrderCode\": \"XSWY20240614-35019\",\n \"materialName\": \"时效氧化\",\n \"profileModel\": \"XS-0077\",\n \"weight\": 0.458,\n \"specification\": \"52.3*27.6\",\n \"thickness\": 0.9,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.95,\n \"orderTotalQuantity\": 60,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 4.47,\n \"theoreticalWeightPerPiece\": 0.8931,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000012\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706028\",\n \"salesShipmentCode\": \"20240706028\",\n \"materialCode\": \"XS-0121-001\",\n \"orderNo\": \"36202\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 237,\n \"actualWeight\": 189.6,\n \"salesOrderCode\": \"XSWY20240619-36202\",\n \"materialName\": \"XS-0121\",\n \"profileModel\": \"XS-0121\",\n \"weight\": 0.4,\n \"specification\": \"25*14.5\",\n \"thickness\": 1.5,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 2,\n \"orderTotalQuantity\": 240,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 189.6,\n \"theoreticalWeightPerPiece\": 0.8,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000012\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706029\",\n \"salesShipmentCode\": \"20240706029\",\n \"materialCode\": \"XS-0124-001\",\n \"orderNo\": \"36204\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 77,\n \"actualWeight\": 33,\n \"salesOrderCode\": \"XSWY20240619-36204\",\n \"materialName\": \"XS-0124\",\n \"profileModel\": \"XS-0124\",\n \"weight\": 0.221,\n \"specification\": \"28*18.53\",\n \"thickness\": 1,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.9,\n \"orderTotalQuantity\": 50,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 32.33,\n \"theoreticalWeightPerPiece\": 0.4199,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n },\n {\n \"customerId\": \"C000012\",\n \"customerName\": null,\n \"shipmentDate\": \"2024-07-06\",\n \"shipmentInspectionReport\": \"Q20240706030\",\n \"salesShipmentCode\": \"20240706030\",\n \"materialCode\": \"XS-S018-001\",\n \"orderNo\": \"36602\",\n \"warehouse\": \"WH001\",\n \"shipmentQuantity\": 169,\n \"actualWeight\": 164.38,\n \"salesOrderCode\": \"XSWY20240620-36602\",\n \"materialName\": \"亮度300-350\",\n \"profileModel\": \"XS-S018\",\n \"weight\": 0.44,\n \"specification\": \"23.69*35\",\n \"thickness\": 1.2,\n \"piecesBundle\": null,\n \"materialCategory\": \"004\",\n \"defaultLength\": 0,\n \"packagingMethod\": null,\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"customerMaterialCode\": null,\n \"orderLength\": 1.95,\n \"orderTotalQuantity\": 1180,\n \"surfaceMethod\": \"机抛亮光\",\n \"theoreticalWeight\": 145,\n \"theoreticalWeightPerPiece\": 0.858,\n \"packingQuantity\": null,\n \"producedPieces\": 0\n }\n ]\n },\n \"message\": \"success\"\n}", + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null +} +================================ +String documentNumber = body["documentNumber"]; + +var sql = """ + select + mss.customer_id, + mci.customer_name, + date_format(mss.shipment_date,'%Y-%m-%d') as shipment_date , + mss.shipment_inspection_report, + mssm.sales_shipment_code, + mssm.material_code, + mssm.order_no, + mssm.warehouse, + mssm.shipment_quantity, + mssm.actual_weight, + mssm.sales_order_code, + mwp.material_name, + mwp.profile_model, + mwp.weight, + mwp.specification, + mwp.thickness, + mwp.pieces_bundle, + mwp.material_category, + mwp.default_length, + mwp.packaging_method, + mwp.source, + mwp.unit, + mwp.customer_material_code, + mwp.order_length, + mwp.order_total_quantity, + mwp.surface_method, + mwp.theoretical_weight, + mwp.theoretical_weight_per_piece, + mwp.packing_quantity, + mwp.produced_pieces + from mini_sales_shipment mss + left join mini_customer_info mci on mci.id = mss.customer_id + left join mini_sales_shipment_materials mssm on mssm.sales_shipment_code = mss.document_number + left join mini_warehouse_product mwp on + mwp.material_code = mssm.material_code and mwp.warehouse = mssm.warehouse and mwp.sales_order_code = mssm.sales_order_code and mwp.order_no = mssm.order_no + where 1 = 1 + ?{documentNumber != null and documentNumber != '', and mss.document_number like concat('%', #{documentNumber}, '%')} +""" + +return db.page(sql); \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/列表.ms index 5f8ddf4..381f7ea 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/列表.ms @@ -5,7 +5,7 @@ "groupId" : "e631b317606f4246ac82585a7c1f1c5b", "name" : "列表", "createTime" : null, - "updateTime" : 1731574285804, + "updateTime" : 1732242692100, "lock" : null, "createBy" : null, "updateBy" : null, @@ -52,6 +52,7 @@ String customerName = body.customerName; String deliveryDate = body.deliveryDate; String salesDate = body.salesDate; String price = body.price; +String status = body.status var sql = """ select @@ -70,6 +71,7 @@ var sql = """ mso.remarks, mso.create_by, mso.no_edit, + mso.status, date_format(mso.create_time, '%Y-%m-%d %H:%i:%S') as create_time from mini_sales_orders mso left join sys_user su on su.user_id = mso.salesperson @@ -81,6 +83,7 @@ var sql = """ ?{price != null and price != '', and mso.price = #{price}} ?{customerId != null and customerId != '', and mso.customer_id like concat('%', #{customerId}, '%')} ?{deliveryDate != null and deliveryDate != '', and mso.delivery_date = #{deliveryDate}} + ?{status != null and status != '', and mso.status = #{status}} """ return db.page(sql); diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/更新销售状态.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/更新销售状态.ms new file mode 100644 index 0000000..1f3701e --- /dev/null +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/更新销售状态.ms @@ -0,0 +1,33 @@ +{ + "properties" : { }, + "id" : "dc813a08ffb84a09bc312d387b7a0910", + "script" : null, + "groupId" : "e631b317606f4246ac82585a7c1f1c5b", + "name" : "更新销售状态", + "createTime" : null, + "updateTime" : 1732242587148, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/up/status", + "method" : "POST", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null +} +================================ +String status = body['status']; +String documentNumber = body['documentNumber']; +int res = db.table("mini_sales_orders").where().eq('document_number', documentNumber) + .update({ + document_number: documentNumber, + status: status + }); + +return res; \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/订单跟踪.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/订单跟踪.ms new file mode 100644 index 0000000..ca8eb1d --- /dev/null +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/订单跟踪.ms @@ -0,0 +1,292 @@ +{ + "properties" : { }, + "id" : "0a2cde95d9444732bb6aad8a9d08c0bd", + "script" : null, + "groupId" : "e631b317606f4246ac82585a7c1f1c5b", + "name" : "订单跟踪", + "createTime" : null, + "updateTime" : 1732420582740, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/orderTracking", + "method" : "POST", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "{\r\n \"page\": 1,\r\n \"size\": 10\r\n}", + "headers" : [ ], + "paths" : [ ], + "responseBody" : "{\n \"code\": 0,\n \"data\": {\n \"count\": 2003,\n \"list\": [\n {\n \"salesOrderCode\": \"SRJ20240702-39301\",\n \"orderNo\": \"39301\",\n \"materialCode\": \"KLS-001-001\",\n \"materialName\": \"KLS-001\",\n \"profileModel\": \"KLS-001\",\n \"specification\": \"20.9*50.2\",\n \"thickness\": 1.75,\n \"weight\": 0.735,\n \"orderLength\": 3.6,\n \"orderTotalQuantity\": 257,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 680.022,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 257,\n \"productionLength\": 3.6,\n \"productionPieces\": 259,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 265,\n \"actualWeight\": 701.19,\n \"shipmentQuantity\": 265,\n \"shipmentActualWeight\": 701.19,\n \"noShipmentQuantity\": -265,\n \"noActualWeight\": -701.19,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39302\",\n \"orderNo\": \"39302\",\n \"materialCode\": \"KLS-001-001\",\n \"materialName\": \"KLS-001\",\n \"profileModel\": \"KLS-001\",\n \"specification\": \"20.9*50.2\",\n \"thickness\": 1.75,\n \"weight\": 0.735,\n \"orderLength\": 3,\n \"orderTotalQuantity\": 61,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 134.505,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 61,\n \"productionLength\": 3,\n \"productionPieces\": 62,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 65,\n \"actualWeight\": 143.32,\n \"shipmentQuantity\": 65,\n \"shipmentActualWeight\": 143.32,\n \"noShipmentQuantity\": -65,\n \"noActualWeight\": -143.32,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39303\",\n \"orderNo\": \"39303\",\n \"materialCode\": \"KLS-001-001\",\n \"materialName\": \"KLS-001\",\n \"profileModel\": \"KLS-001\",\n \"specification\": \"20.9*50.2\",\n \"thickness\": 1.75,\n \"weight\": 0.735,\n \"orderLength\": 4.2,\n \"orderTotalQuantity\": 20,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 61.74,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 20,\n \"productionLength\": 4.2,\n \"productionPieces\": 21,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 22,\n \"actualWeight\": 67.91,\n \"shipmentQuantity\": 22,\n \"shipmentActualWeight\": 67.91,\n \"noShipmentQuantity\": -22,\n \"noActualWeight\": -67.91,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39304\",\n \"orderNo\": \"39304\",\n \"materialCode\": \"KLS-002A-001\",\n \"materialName\": \"KLS-002A\",\n \"profileModel\": \"KLS-002A\",\n \"specification\": \"55.1*54\",\n \"thickness\": 2,\n \"weight\": 1.6,\n \"orderLength\": 3,\n \"orderTotalQuantity\": 8,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 38.4,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 8,\n \"productionLength\": 3,\n \"productionPieces\": 8,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 10,\n \"actualWeight\": 52,\n \"shipmentQuantity\": 10,\n \"shipmentActualWeight\": 52,\n \"noShipmentQuantity\": -10,\n \"noActualWeight\": -52,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39305\",\n \"orderNo\": \"39305\",\n \"materialCode\": \"KLS-003-001\",\n \"materialName\": \"KLS-003\",\n \"profileModel\": \"KLS-003\",\n \"specification\": \"55.1*54\",\n \"thickness\": 2,\n \"weight\": 2.11,\n \"orderLength\": 3,\n \"orderTotalQuantity\": 8,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 50.64,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 16,\n \"productionLength\": 3,\n \"productionPieces\": 8,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 8,\n \"actualWeight\": 55,\n \"shipmentQuantity\": 8,\n \"shipmentActualWeight\": 55,\n \"noShipmentQuantity\": -8,\n \"noActualWeight\": -55,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39306\",\n \"orderNo\": \"39306\",\n \"materialCode\": \"KLS-004-001\",\n \"materialName\": \"KLS-004\",\n \"profileModel\": \"KLS-004\",\n \"specification\": \"51.23*51.03\",\n \"thickness\": 1.08,\n \"weight\": 0.316,\n \"orderLength\": 3.6,\n \"orderTotalQuantity\": 257,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 292.3632,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 257,\n \"productionLength\": 3.6,\n \"productionPieces\": 260,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 263,\n \"actualWeight\": 306,\n \"shipmentQuantity\": 263,\n \"shipmentActualWeight\": 306,\n \"noShipmentQuantity\": -263,\n \"noActualWeight\": -306,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39307\",\n \"orderNo\": \"39307\",\n \"materialCode\": \"KLS-004-001\",\n \"materialName\": \"KLS-004\",\n \"profileModel\": \"KLS-004\",\n \"specification\": \"51.23*51.03\",\n \"thickness\": 1.08,\n \"weight\": 0.316,\n \"orderLength\": 3,\n \"orderTotalQuantity\": 61,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 57.828,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 61,\n \"productionLength\": 3,\n \"productionPieces\": 62,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 60,\n \"actualWeight\": 57.99,\n \"shipmentQuantity\": 60,\n \"shipmentActualWeight\": 57.99,\n \"noShipmentQuantity\": -60,\n \"noActualWeight\": -57.99,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39308\",\n \"orderNo\": \"39308\",\n \"materialCode\": \"KLS-004-001\",\n \"materialName\": \"KLS-004\",\n \"profileModel\": \"KLS-004\",\n \"specification\": \"51.23*51.03\",\n \"thickness\": 1.08,\n \"weight\": 0.316,\n \"orderLength\": 4.2,\n \"orderTotalQuantity\": 20,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 26.544,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 20,\n \"productionLength\": 4.2,\n \"productionPieces\": 20,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 20,\n \"actualWeight\": 27,\n \"shipmentQuantity\": 20,\n \"shipmentActualWeight\": 27,\n \"noShipmentQuantity\": -20,\n \"noActualWeight\": -27,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39309\",\n \"orderNo\": \"39309\",\n \"materialCode\": \"KLS-005-001\",\n \"materialName\": \"KLS-005\",\n \"profileModel\": \"KLS-005\",\n \"specification\": \"21.85*19.7\",\n \"thickness\": 1.05,\n \"weight\": 0.274,\n \"orderLength\": 3.6,\n \"orderTotalQuantity\": 257,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 253.5048,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 257,\n \"productionLength\": 3.6,\n \"productionPieces\": 260,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 161,\n \"actualWeight\": 158.81,\n \"shipmentQuantity\": 161,\n \"shipmentActualWeight\": 158.81,\n \"noShipmentQuantity\": -161,\n \"noActualWeight\": -158.81,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n },\n {\n \"salesOrderCode\": \"SRJ20240702-39310\",\n \"orderNo\": \"39310\",\n \"materialCode\": \"KLS-005-001\",\n \"materialName\": \"KLS-005\",\n \"profileModel\": \"KLS-005\",\n \"specification\": \"21.85*19.7\",\n \"thickness\": 1.05,\n \"weight\": 0.274,\n \"orderLength\": 3,\n \"orderTotalQuantity\": 61,\n \"surfaceMethod\": \"哑银\",\n \"deliveryDate\": 1725206400000,\n \"theoreticalWeight\": 50.142,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"plannedPieces\": 61,\n \"productionLength\": 3,\n \"productionPieces\": 62,\n \"sawingMethod\": \"一开一\",\n \"longScrapNumber\": 0,\n \"longScrapWeight\": 0,\n \"shortageScrapNumber\": 0,\n \"shortageScrapWeight\": 0,\n \"jiya_actualWeight\": 0,\n \"jiya_productionNumber\": 0,\n \"jiya_productionWeight\": 0,\n \"jingpin_actualWeight\": 0,\n \"jingpin_productionNumber\": 0,\n \"jingpin_productionWeight\": 0,\n \"yanghau1_actualWeight\": 0,\n \"yanghau1_productionNumber\": 0,\n \"yanghau1_productionWeight\": 0,\n \"yanghua2_actualWeight\": 0,\n \"yanghua2_productionNumber\": 0,\n \"yanghua2_productionWeight\": 0,\n \"jingqie_actualWeight\": 0,\n \"jingqie_productionNumber\": 0,\n \"jingqie_productionWeight\": 0,\n \"dk_actualWeight\": 0,\n \"dk_productionNumber\": 0,\n \"dk_productionWeight\": 0,\n \"bz_actualWeight\": 0,\n \"bz_productionNumber\": 0,\n \"bz_productionWeight\": 0,\n \"receiptQuantity\": 62,\n \"actualWeight\": 50.96,\n \"shipmentQuantity\": 62,\n \"shipmentActualWeight\": 50.96,\n \"noShipmentQuantity\": -62,\n \"noActualWeight\": -50.96,\n \"existingInventory\": 0,\n \"existingActualWeight\": 0\n }\n ]\n },\n \"message\": \"success\"\n}", + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null +} +================================ +// ============================== +// 1.查询销售单明细 +// ============================== +var sql = """ + select + msom.sales_order_code, + msom.order_no, + msom.material_code, + msom.material_name, + msom.profile_model, + msom.specification, + msom.thickness, + msom.weight, + msom.order_length, + msom.order_total_quantity, + msom.surface_method, + msom.delivery_date, + msom.theoretical_weight, + msom.produced_pieces, + msom.produced_length + from mini_sales_order_materials msom +""" + +Map pages = db.page(sql); + +List salesOrderList = pages.list; + +// ============================== +// 2.查询生产计划数据 +// ============================== +var sql2 = """ + select + sales_order_code, + order_no, + sum(planned_pieces) as planned_pieces + from mini_production_schedule + where 1=1 and (sales_order_code, order_no) in ( + + (#{item.salesOrderCode}, #{item.orderNo}) + + ) + group by sales_order_code, order_no +""" +List productionScheduleList = db.select(sql2) + + +// ============================== +// 3.查询挤压排产数据 +// ============================== +var sql3 = """ + select + sales_order_code, + order_no, + sum(production_length) as production_length, + sum(production_pieces) as production_pieces, + max(sawing_method) as sawing_method + from mini_extrusion_schedule_detail + where 1=1 and (sales_order_code, order_no) in ( + + (#{item.salesOrderCode}, #{item.orderNo}) + + ) + group by sales_order_code, order_no +""" +List extrusionScheduleDetail = db.select(sql3) + + +// ============================== +// 4.查询报工数据 +// ============================== +var sql4 = """ + select + mpr.sales_order_code, + mpr.order_no, + mpr.current_process, + (sum(mesd.production_length) * sum(production_number) * sum(production_weight)) as actual_weight_mesd, + (sum(msom.order_length) * sum(production_number) * sum(production_weight)) as actual_weight_msom, + sum(production_number) as production_number, + max(production_weight) as production_weight + from mini_process_report mpr + left join mini_extrusion_schedule_detail mesd + on mpr.sales_order_code = mesd.sales_order_code and mpr.order_no = mesd.order_no + left join mini_sales_order_materials msom + on mpr.sales_order_code = msom.sales_order_code and mpr.order_no = msom.order_no + where 1=1 and (mpr.sales_order_code, mpr.order_no) in ( + + (#{item.salesOrderCode}, #{item.orderNo}) + + ) + group by mpr.sales_order_code, mpr.order_no, mpr.current_process +""" + + +List processReportList = db.select(sql4) + +// 处理数据 +// actualWeightMesd 排产长度计算 +// actualWeightMsom 订单长度计算 +var processReportFinalList = [] +var arr = ['jingqie','dk','bz'] +processReportList.group(it => it.salesOrderCode + "_" + it.orderNo, // 根据api_group_id 分组 + list => list.group(item => item.currentProcess, + obj => obj + ) +).each((key, value) => { + var jsonObj = {} + value.each((key1, value1) => { + var val = value1[0]; + jsonObj["salesOrderCode"] = val.salesOrderCode; + jsonObj["orderNo"] = val.orderNo; + if (arr.contains(key1)) { + jsonObj[key1 + "_actualWeight"] = val.actualWeightMsom; + } else { + jsonObj[key1 + "_actualWeight"] = val.actualWeightMesd; + } + + jsonObj[key1 + "_productionNumber"] = val.productionNumber; + jsonObj[key1 + "_productionWeight"] = val.productionWeight; + }) + processReportFinalList.push(jsonObj) +}) + + +// ============================== +// 5.查询长料报废数据 +// 挤压、精品、氧化上排、氧化下排工序 +// ============================== +var sql5 = """ + select + sales_order_code, + order_no, + sum(scrap_number) as long_scrap_number, + sum(scrap_weight) as long_scrap_weight + from mini_process_report mpr + where 1=1 and mpr.current_process in ('jiya','jinpin','yanghua1','yanghua2') + and (mpr.sales_order_code, mpr.order_no) in ( + + (#{item.salesOrderCode}, #{item.orderNo}) + + ) + group by mpr.sales_order_code, mpr.order_no +""" +List processReportLongList = db.select(sql5) + +// ============================== +// 6.查询短料报废数据 +// 精切,打孔,包装工序 +// ============================== +var sql6 = """ + select + sales_order_code, + order_no, + sum(scrap_number) as shortage_scrap_number, + sum(scrap_weight) as shortage_scrap_weight + from mini_process_report mpr + where 1=1 and mpr.current_process in ('jingqie','dk','bz') + and (mpr.sales_order_code, mpr.order_no) in ( + + (#{item.salesOrderCode}, #{item.orderNo}) + + ) + group by mpr.sales_order_code, mpr.order_no +""" +List processReportShortageList = db.select(sql6) + +// ============================== +// 7.入库状况 +// ============================== +var sql7 = """ + select + mpr.sales_order_code, + mpr.order_no, + sum(mpr.receipt_quantity) as receipt_quantity, + sum(mpr.actual_weight) as actual_weight + from + mini_product_receipt mpr + where 1=1 + and (mpr.sales_order_code, mpr.order_no) in ( + + (#{item.salesOrderCode}, #{item.orderNo}) + + ) + group by mpr.sales_order_code, mpr.order_no +""" +List productReceiptList = db.select(sql7) + +// ============================== +// 8.出库和库存数据 +// ============================== + // (sum(mwp.existing_inventory) - sum(mssm.shipment_quantity)) as no_shipment_quantity, + // (sum(mwp.actual_weight) - sum(mssm.actual_weight)) as no_actual_weight, +var sql8 = """ + select + mssm.sales_order_code, + mssm.order_no, + sum(mssm.shipment_quantity) as shipment_quantity, + sum(mssm.actual_weight) as shipment_actual_weight, + sum(mwp.existing_inventory) as no_shipment_quantity, + sum(mwp.actual_weight) as no_actual_weight, + (sum(mwp.existing_inventory) + sum(mssm.shipment_quantity)) as existing_inventory, + (sum(mwp.actual_weight) + sum(mssm.actual_weight)) as existing_actual_weight + from + mini_sales_shipment_materials mssm + left join mini_warehouse_product mwp on + mwp.order_no = mssm.order_no + and mwp.sales_order_code = mssm.sales_order_code + where 1=1 + and (mssm.sales_order_code, mssm.order_no) in ( + + (#{item.salesOrderCode}, #{item.orderNo}) + + ) + group by mssm.sales_order_code, mssm.order_no +""" +List salesShipmenList = db.select(sql8) + + +var result = select + a.*, + b.plannedPieces, + c.productionLength, + c.productionPieces, + c.sawingMethod, + ifnull(e.longScrapNumber, 0) longScrapNumber, + ifnull(e.longScrapWeight, 0) longScrapWeight, + ifnull(f.shortageScrapNumber, 0) shortageScrapNumber, + ifnull(f.shortageScrapWeight, 0) shortageScrapWeight, + ifnull(d.jiya_actualWeight, 0) jiya_actualWeight, + ifnull(d.jiya_productionNumber, 0) jiya_productionNumber, + ifnull(d.jiya_productionWeight, 0) jiya_productionWeight, + ifnull(d.jingpin_actualWeight, 0) jingpin_actualWeight, + ifnull(d.jingpin_productionNumber, 0) jingpin_productionNumber, + ifnull(d.jingpin_productionWeight, 0) jingpin_productionWeight, + ifnull(d.yanghau1_actualWeight, 0) yanghau1_actualWeight, + ifnull(d.yanghau1_productionNumber, 0) yanghau1_productionNumber, + ifnull(d.yanghau1_productionWeight, 0) yanghau1_productionWeight, + ifnull(d.yanghua2_actualWeight, 0) yanghua2_actualWeight, + ifnull(d.yanghua2_productionNumber, 0) yanghua2_productionNumber, + ifnull(d.yanghua2_productionWeight, 0) yanghua2_productionWeight, + ifnull(d.jingqie_actualWeight, 0) jingqie_actualWeight, + ifnull(d.jingqie_productionNumber, 0) jingqie_productionNumber, + ifnull(d.jingqie_productionWeight, 0) jingqie_productionWeight, + ifnull(d.dk_actualWeight, 0) dk_actualWeight, + ifnull(d.dk_productionNumber, 0) dk_productionNumber, + ifnull(d.dk_productionWeight, 0) dk_productionWeight, + ifnull(d.bz_actualWeight, 0) bz_actualWeight, + ifnull(d.bz_productionNumber, 0) bz_productionNumber, + ifnull(d.bz_productionWeight, 0) bz_productionWeight, + ifnull(g.receiptQuantity, 0) receiptQuantity, + ifnull(g.actualWeight, 0) actualWeight, + ifnull(h.shipmentQuantity, 0) shipmentQuantity, + ifnull(h.shipmentActualWeight, 0) shipmentActualWeight, + ifnull(h.noShipmentQuantity, 0) noShipmentQuantity, + ifnull(h.noActualWeight, 0) noActualWeight, + ifnull(h.existingInventory, 0) existingInventory, + ifnull(h.existingActualWeight, 0) existingActualWeight + from salesOrderList a + left join productionScheduleList b on a.salesOrderCode = b.salesOrderCode and a.orderNo = b.orderNo + left join extrusionScheduleDetail c on a.salesOrderCode = c.salesOrderCode and a.orderNo = c.orderNo + left join processReportList d on a.salesOrderCode = d.salesOrderCode and a.orderNo = d.orderNo + left join processReportLongList e on a.salesOrderCode = e.salesOrderCode and a.orderNo = e.orderNo + left join processReportShortageList f on a.salesOrderCode = f.salesOrderCode and a.orderNo = f.orderNo + left join productReceiptList g on a.salesOrderCode = g.salesOrderCode and a.orderNo = g.orderNo + left join salesShipmenList h on a.salesOrderCode = h.salesOrderCode and a.orderNo = h.orderNo +return { + count: pages.count, + list: result +} diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情.ms index f09f1d3..3666c80 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情.ms @@ -5,7 +5,7 @@ "groupId" : "e631b317606f4246ac82585a7c1f1c5b", "name" : "详情", "createTime" : null, - "updateTime" : 1726804865592, + "updateTime" : 1732247167464, "lock" : null, "createBy" : null, "updateBy" : null, @@ -42,5 +42,12 @@ return { left join sys_user su on su.user_id = mso.salesperson where mso.document_number = #{documentNumber} """), - materials: db.select("select * from mini_sales_order_materials where sales_order_code = #{documentNumber}"), + materials: db.select(""" + select + msom.*, + ifNull(msm.color_name, msom.surface_method) as surface_method_name + from mini_sales_order_materials msom + left join mini_surface_methods msm on msm.color_code = msom.surface_method + where msom.sales_order_code = #{documentNumber} + """), } \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情列表.ms index 83818ef..b1af4f7 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情列表.ms @@ -5,7 +5,7 @@ "groupId" : "e631b317606f4246ac82585a7c1f1c5b", "name" : "详情列表", "createTime" : null, - "updateTime" : 1731574904886, + "updateTime" : 1732266000158, "lock" : null, "createBy" : null, "updateBy" : null, @@ -44,6 +44,7 @@ return db.page(""" msom.order_length, msom.order_total_quantity, msom.surface_method, + ifNull(msm.color_name, msom.surface_method) as surface_method_name, msom.theoretical_weight_per_piece, msom.theoretical_weight, msom.packing_quantity, @@ -62,11 +63,20 @@ return db.page(""" msom.unit_price, msom.order_no, msom.status, - mso.customer_id, + mso.customer_id, + mci.customer_name, + mso.salesperson, + su.user_name as salesperson_name, + date_format(mso.sales_date, '%Y-%m-%d') as sales_date, + date_format(mso.pricing_date, '%Y-%m-%d') as pricing_date, + mso.processing_fee, mso.price, mso.tax_rate from mini_sales_order_materials msom left join mini_sales_orders mso on msom.sales_order_code = mso.document_number + left join mini_surface_methods msm on msm.color_code = msom.surface_method + left join sys_user su on su.user_id = mso.salesperson + left join mini_customer_info mci on mci.customer_code = mso.customer_id where 1=1 ?{salesOrderCode != null and salesOrderCode != "", and msom.sales_order_code list concat('%',#{salesOrderCode},'%') }