20241124更新

main
lcode 1 day ago
parent dee61ba798
commit 6e7e77c1c2

@ -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} ,'%') }
""");

@ -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,

@ -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}, '%')}
""")

@ -5,7 +5,7 @@
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "列表",
"createTime" : null,
"updateTime" : 1728727705064,
"updateTime" : 1732243472745,
"lock" : null,
"createBy" : null,
"updateBy" : null,

@ -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}}
""")

@ -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,

@ -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} ,'%') }
""");

@ -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,

@ -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

@ -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} ,'%') }

@ -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}, '%')}

@ -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;

@ -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;

@ -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}}
""")

@ -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);

@ -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;

@ -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}
"""),
}

@ -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},'%') }

Loading…
Cancel
Save