20241205更新

main
lcode 2 months ago
parent 2e6d71c92e
commit a7518db69c

@ -71,6 +71,18 @@ public class ExtrusionScheduleExport {
private String sawingMethod;
@Excel(name = "排产理论重量", width = 40)
private BigDecimal productionTheoreticalWeight;
@Excel(name = "完工支数", width = 40)
private BigDecimal productionNumber;
@Excel(name = "未完工支数", width = 40)
private BigDecimal noProductionNumber;
@Excel(name = "完工重量", width = 40)
private BigDecimal productionWeight;
@Excel(name = "未完工重量", width = 40)
private BigDecimal noProductionWeight;
}

@ -5,7 +5,7 @@
"groupId" : "a2b7765d540449b7bf93e070c1911ce9",
"name" : "列表",
"createTime" : null,
"updateTime" : 1732242902193,
"updateTime" : 1733368094450,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -54,6 +54,9 @@ String price = body.price;
String deliveryDate = body.deliveryDate;
String status = body.status
List purchaseDateRang = body.purchaseDateRang;
List deliveryDateRang = body.deliveryDateRang;
var sql = """
select
mpo.id,
@ -74,15 +77,16 @@ var sql = """
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 and documentNumber != '', and mpo.document_number = #{documentNumber}}
?{documentNumber != null and documentNumber != '', and mpo.document_number like concat('%', #{documentNumber} ,'%')}
?{supplier != null and supplier != '', and mpo.supplier = #{supplier}}
?{purchaseDate != null and purchaseDate != '', and mpo.purchase_date = #{purchaseDate}}
?{purchaseDateRang != null and purchaseDateRang != '' and purchaseDateRang.size() > 0, and date(mpo.purchase_date) between #{purchaseDateRang[0]} and #{purchaseDateRang[1]}}
?{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}}
?{deliveryDateRang != null and deliveryDateRang != '' and deliveryDateRang.size() > 0, and date(mpo.delivery_date) between #{deliveryDateRang[0]} and #{deliveryDateRang[1]}}
?{status != null and status != '', and mpo.status = #{status}}
"""
// ?{purchaseDate != null and purchaseDate != '', and mpo.purchase_date = #{purchaseDate}}
// ?{deliveryDate != null and deliveryDate != '', and mpo.delivery_date = #{deliveryDate}}
String supplier = body.supplier;
String purchaseDate = body.purchaseDate;
String purchaser = body.purchaser;

@ -5,7 +5,7 @@
"groupId" : "e631b317606f4246ac82585a7c1f1c5b",
"name" : "列表",
"createTime" : null,
"updateTime" : 1732242692100,
"updateTime" : 1733370728955,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -47,13 +47,20 @@
}
================================
String documentNumber = body.documentNumber;
String salesperson = body.salesperson;
String customerName = body.customerName;
String deliveryDate = body.deliveryDate;
String salesDate = body.salesDate;
String price = body.price;
String status = body.status
String customerId = body.customerId; // 客户
String salesperson = body.salesperson; // 销售员
String remarks = body.remarks; // 备注
List salesDateRang = body.salesDateRang; // 销售日期范围
List deliveryDateRang = body.deliveryDateRang; // 交货日期范围
var sql = """
select
mso.id,
@ -78,12 +85,17 @@ var sql = """
left join mini_customer_info mci on mci.customer_code = mso.customer_id
where 1 = 1
?{documentNumber != null and documentNumber != '', and mso.document_number like concat('%', #{documentNumber}, '%')}
?{salesperson != null and salesperson != '', and mso.salesperson like concat('%', #{salesperson}, '%')}
?{salesDate != null and salesDate != '', and mso.sales_date like concat('%', #{salesDate}, '%')}
?{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}}
?{salesperson != null and salesperson != '', and mso.salesperson = #{salesperson}}
?{remarks != null and remarks != '', and mso.remarks like concat('%', #{remarks}, '%')}
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
?{salesDateRang != null and salesDateRang != '' and salesDateRang.size() > 0, and date(mso.sales_date) between #{salesDateRang[0]} and #{salesDateRang[1]}}
?{deliveryDateRang != null and deliveryDateRang != '' and deliveryDateRang.size() > 0, and date(mso.delivery_date) between #{deliveryDateRang[0]} and #{deliveryDateRang[1]}}
"""
return db.page(sql);

@ -5,7 +5,7 @@
"groupId" : "e631b317606f4246ac82585a7c1f1c5b",
"name" : "详情列表",
"createTime" : null,
"updateTime" : 1732591664784,
"updateTime" : 1733380763524,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -22,14 +22,24 @@
"responseBodyDefinition" : null
}
================================
String salesOrderCode = body.salesOrderCode;
String salesOrderCode = body.salesOrderCode; // 销售单号
String status = body.status;
String orderNo = body['orderNo'];
String materialCode = body['materialCode'];
String profileModel = body['profileModel'];
String customerId = body['customerId'];
String surfaceMethod = body['surfaceMethod'];
String orderNo = body['orderNo']; // 订单号
String materialCode = body['materialCode']; // 物料编码
String profileModel = body['profileModel']; // 型材型号
String customerId = body['customerId']; // 客户
String surfaceMethod = body['surfaceMethod']; // 表面方式
String salesperson = body['salesperson']; // 销售员
String materialName = body['materialName']; // 物料名称
String specification = body['specification']; // 规格型号
String orderLength = body['orderLength']; // 订单长度
List salesDateRang = body['salesDateRang']; // 销售日期范围
List deliveryDateRang = body['deliveryDateRang']; // 交货日期范围
String deliveryFg = body['deliveryFg']; // 是否完成交货
return db.page("""
select
@ -77,12 +87,20 @@ return db.page("""
date_format(mso.pricing_date, '%Y-%m-%d') as pricing_date,
mso.processing_fee,
mso.price,
mso.tax_rate
mso.tax_rate,
mwp.existing_inventory,
mwp.actual_weight,
(msom.order_total_quantity - mwp.existing_inventory) as completed_inventor,
((msom.order_length * msom.order_total_quantity * msom.weight) - mwp.actual_weight) as completed_weight,
if((msom.order_total_quantity - msom.shipmentsed_number) <= 0 , 1, 2) deliveryFg
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
left join mini_warehouse_product mwp on
mwp.order_no = msom.order_no
and mwp.sales_order_code = msom.sales_order_code
where 1=1
?{salesOrderCode != null and salesOrderCode != "", and msom.sales_order_code list concat('%',#{salesOrderCode},'%') }
?{status != null and status != "", and msom.status = #{status} }
@ -91,4 +109,15 @@ return db.page("""
?{profileModel != null and profileModel != '', and msom.profile_model like concat('%', #{profileModel}, '%')}
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
?{surfaceMethod != null and surfaceMethod != '', and msom.surface_method = #{surfaceMethod}}
?{salesperson != null and salesperson != '', and mso.salesperson = #{salesperson}}
?{salesDateRang != null and salesDateRang != '' and salesDateRang.size() > 0, and date(mso.sales_date) between #{salesDateRang[0]} and #{salesDateRang[1]}}
?{deliveryDateRang != null and deliveryDateRang != '' and deliveryDateRang.size() > 0, and date(mso.delivery_date) between #{deliveryDateRang[0]} and #{deliveryDateRang[1]}}
?{materialName != null and materialName != '', and msom.material_name like concat('%', #{materialName}, '%')}
?{specification != null and specification != '', and msom.specification like concat('%', #{specification}, '%')}
?{orderLength != null and orderLength != '', and msom.order_length = #{orderLength}}
?{deliveryFg!=null && deliveryFg !="" && deliveryFg == 1, and (msom.order_total_quantity - msom.shipmentsed_number) <= 0 }
?{deliveryFg!=null && deliveryFg !="" && deliveryFg == 2, and (msom.order_total_quantity - msom.shipmentsed_number) > 0 }
""")

@ -5,7 +5,7 @@
"groupId" : "388106ae8a6c473093fbfd5473f6a755",
"name" : "新增",
"createTime" : null,
"updateTime" : 1731566854289,
"updateTime" : 1733381195085,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -68,7 +68,7 @@ try{
})
if (res > 0) {
println("采购入库单插入成功")
println("销售退货插入成功")
// 更新采购订单状态
res = db.update("""
@ -81,21 +81,21 @@ try{
}
// 更新退货数量
res = db.update("""
update mini_sales_order_materials
SET returned_number = CASE order_no
<foreach collection="materialsList" item="item" separator=" ">
WHEN #{item.orderNo} THEN returned_number + #{item.returnQuantity}
</foreach>
ELSE returned_number
END
WHERE sales_order_code = #{purchInfo.documentNumber};
""")
// res = db.update("""
// update mini_sales_order_materials
// SET returned_number = CASE order_no
// <foreach collection="materialsList" item="item" separator=" ">
// WHEN #{item.orderNo} THEN returned_number + #{item.returnQuantity}
// </foreach>
// ELSE returned_number
// END
// WHERE sales_order_code = #{purchInfo.documentNumber};
// """)
if (res <= 0) {
tx.rollback();
exit -1, "提交失败";
}
// if (res <= 0) {
// tx.rollback();
// exit -1, "提交失败";
// }
List list = new ArrayList();
List list2 = new ArrayList();
@ -129,6 +129,39 @@ try{
remark: marerial.remark,
create_by: createBy
})
String whSql = ""
if (Objects.nonNull(marerial.warehouse)) {
whSql = "and warehouse=#{marerial.warehouse}"
} else {
whSql = "and warehouse is null"
}
// 库存增加
var res2 = db.update("""
update mini_warehouse_product set
existing_inventory = existing_inventory + #{marerial.returnQuantity} ,
actual_weight = actual_weight + #{marerial.actualWeight}
where order_no = #{marerial.orderNo}
and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode}
""" + whSql)
if (res2 <= 0) {
tx.rollback();
exit -1, "提交失败";
}
// 更新销售单
var res3 = db.update("""
update mini_sales_order_materials set
returned_number = returned_number + #{marerial.returnQuantity}
where order_no = #{marerial.orderNo}
and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode}
""")
if (res3 <= 0) {
tx.rollback();
exit -1, "提交失败";
}
})
res = db.table("mini_sales_returns_materials").batchInsert(list)

@ -5,7 +5,7 @@
"groupId" : "753fe736c4d7438090c366180c352d95",
"name" : "挤压排产列表",
"createTime" : null,
"updateTime" : 1732611845401,
"updateTime" : 1733381822225,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -30,6 +30,13 @@ String extrusionDate = body['extrusionDate'];
String customerId = body['customerId'];
String surfaceMethod = body['surfaceMethod'];
String extrusionDateRang = body['extrusionDateRang']; // 排挤日期范围
String extrusionMachine = body['extrusionMachine']; // 挤压机台
String extrusionTeam = body['extrusionTeam']; // 挤压班组
String materialName = body['materialName']; // 物料名称
String specification = body['specification']; // 规格型号
String orderLength = body['orderLength']; // 订单长度
var list = db.page("""
select
date_format(mes.extrusion_date, '%Y-%m-%d') as extrusion_date,
@ -42,6 +49,11 @@ var list = db.page("""
mesd.production_pieces,
mesd.sawing_method,
su2.user_name as salesperson_name,
round((mesd.production_pieces * mesd.production_length * msm.weight), 4) as production_theoretical_weight,
mpr.production_number,
round((mpr.production_weight * mesd.production_length * mpr.production_number), 4) as production_weight,
round((mesd.production_pieces - mpr.production_number), 4) as no_production_number,
round(((mesd.production_pieces * mesd.production_length * msm.weight) - (mpr.production_weight * mesd.production_length * mpr.production_number)), 4) as no_production_weight,
${salesOrdeSelect}
from
mini_extrusion_schedule_detail mesd
@ -53,6 +65,10 @@ var list = db.page("""
on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code and mesd.order_no = msm.order_no
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
left join (select schedule_number, sales_order_code, material_code, order_no, sum(production_number) as production_number, sum(production_weight) as production_weight
from mini_process_report where is_completed = 1 group by schedule_number, sales_order_code, material_code, order_no) mpr
on mesd.schedule_number = mpr.schedule_number and mesd.sales_order_code = mpr.sales_order_code
and mesd.material_code = mpr.material_code and mesd.order_no = mpr.order_no
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}, '%')}
@ -64,6 +80,14 @@ var list = db.page("""
?{extrusionDate!=null && extrusionDate!="", and date(mes.extrusion_date) = #{extrusionDate} }
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
?{surfaceMethod != null and surfaceMethod != '', and msm.surface_method = #{surfaceMethod}}
?{extrusionDateRang != null and extrusionDateRang != '' and extrusionDateRang.size() > 0,
and date(mes.extrusion_date) between #{extrusionDateRang[0]} and #{extrusionDateRang[1]}}
?{extrusionMachine != null and extrusionMachine != '', and mes.extrusion_machine = #{extrusionMachine}}
?{extrusionTeam != null and extrusionTeam != '', and mes.extrusion_team = #{extrusionTeam}}
?{materialName != null and materialName != '', and msm.material_name like concat('%', #{materialName}, '%')}
?{specification != null and specification != '', and msm.specification like concat('%', #{specification}, '%')}
?{orderLength != null and orderLength != '', and msm.order_length = #{orderLength}}
""")
return list.list

@ -5,7 +5,7 @@
"groupId" : "753fe736c4d7438090c366180c352d95",
"name" : "挤压排产总数",
"createTime" : null,
"updateTime" : 1732611825930,
"updateTime" : 1733380095789,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -42,6 +42,13 @@ String extrusionDate = body['extrusionDate'];
String customerId = body['customerId'];
String surfaceMethod = body['surfaceMethod'];
String extrusionDateRang = body['extrusionDateRang']; // 排挤日期范围
String extrusionMachine = body['extrusionMachine']; // 挤压机台
String extrusionTeam = body['extrusionTeam']; // 挤压班组
String materialName = body['materialName']; // 物料名称
String specification = body['specification']; // 规格型号
String orderLength = body['orderLength']; // 订单长度
return db.selectInt("""
select
count(1)
@ -55,6 +62,10 @@ return db.selectInt("""
on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code and mesd.order_no = msm.order_no
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
left join (select schedule_number, sales_order_code, material_code, order_no, sum(production_number) as production_number, sum(production_weight) as production_weight
from mini_process_report where is_completed = 1 group by schedule_number, sales_order_code, material_code, order_no) mpr
on mesd.schedule_number = mpr.schedule_number and mesd.sales_order_code = mpr.sales_order_code
and mesd.material_code = mpr.material_code and mesd.order_no = mpr.order_no
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}, '%')}
@ -66,4 +77,12 @@ return db.selectInt("""
?{extrusionDate!=null && extrusionDate!="", and date(mes.extrusion_date) = #{extrusionDate} }
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
?{surfaceMethod != null and surfaceMethod != '', and msm.surface_method = #{surfaceMethod}}
?{extrusionDateRang != null and extrusionDateRang != '' and extrusionDateRang.size() > 0,
and date(mes.extrusion_date) between #{extrusionDateRang[0]} and #{extrusionDateRang[1]}}
?{extrusionMachine != null and extrusionMachine != '', and mes.extrusion_machine = #{extrusionMachine}}
?{extrusionTeam != null and extrusionTeam != '', and mes.extrusion_team = #{extrusionTeam}}
?{materialName != null and materialName != '', and msm.material_name like concat('%', #{materialName}, '%')}
?{specification != null and specification != '', and msm.specification like concat('%', #{specification}, '%')}
?{orderLength != null and orderLength != '', and msm.order_length = #{orderLength}}
""")

@ -5,7 +5,7 @@
"groupId" : "ac6602436d574b049dcf80eee3ff5d8d",
"name" : "订单跟踪列表",
"createTime" : null,
"updateTime" : 1732609621796,
"updateTime" : 1733381771955,
"lock" : null,
"createBy" : null,
"updateBy" : null,

Loading…
Cancel
Save