20241017更新

main
lcode 1 month ago
parent 8c5bf9b7fc
commit 7542075a54

@ -5,7 +5,7 @@
"groupId" : "40879f3a602c40e493f0b273de9fc01e",
"name" : "列表仓库产品",
"createTime" : null,
"updateTime" : 1728714345936,
"updateTime" : 1729160968286,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -87,6 +87,7 @@ return db.page("""
mwp.unit_price,
mwp.order_no,
mwp.existing_inventory,
mwp.actual_weight,
mwp.customer_id,
mwp.warehouse,
mci.customer_name

@ -5,7 +5,7 @@
"groupId" : "4aa6b5de02c244e2981c22bf5a95394d",
"name" : "新增",
"createTime" : null,
"updateTime" : 1728712359983,
"updateTime" : 1729160184169,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -103,6 +103,7 @@ try{
theoretical_weight_per_piece,
theoretical_weight,
packing_quantity,
actual_weight,
delivery_date,
customer_material_code,
produced_pieces,
@ -140,6 +141,7 @@ try{
#{item.theoreticalWeightPerPiece},
#{item.theoreticalWeight},
#{orderInfo.packingQuantity},
#{item.actualWeight},
#{item.deliveryDate},
#{item.customerMaterialCode},
#{item.producedPieces},
@ -151,24 +153,30 @@ try{
#{item.returnedNumber},
#{item.unitPrice},
#{item.orderNo},
#{orderInfo.existingInventory},
#{item.receiptQuantity},
#{item.customerId},
#{item.warehouse},
#{createBy}
)
</foreach>
ON DUPLICATE KEY UPDATE
packing_quantity = CASE material_code
packing_quantity = CASE
<foreach collection="materialsList" item="item" separator=" ">
WHEN #{item.materialCode} THEN packing_quantity + #{item.warehouseQuantity}
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN packing_quantity + #{item.warehouseQuantity}
</foreach>
ELSE packing_quantity
END,
existing_inventory = CASE material_code
existing_inventory = CASE
<foreach collection="materialsList" item="item" separator=" ">
WHEN #{item.materialCode} THEN existing_inventory + #{item.pieces}
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN existing_inventory + #{item.receiptQuantity}
</foreach>
ELSE existing_inventory
END,
actual_weight = CASE
<foreach collection="materialsList" item="item" separator=" ">
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN actual_weight + #{item.actualWeight}
</foreach>
ELSE actual_weight
END
""")

@ -5,7 +5,7 @@
"groupId" : "4aa6b5de02c244e2981c22bf5a95394d",
"name" : "详情",
"createTime" : null,
"updateTime" : 1728712748680,
"updateTime" : 1729153406281,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -24,7 +24,7 @@
================================
import '@/common/sql' as sql
String salesOrder = sql("salesOrder")
String warehouseProductMaterial = sql("warehouseProductMaterial")
String documentNumber = body.documentNumber;
return {
@ -49,10 +49,10 @@ return {
mpr.actual_weight,
mpr.unstocked_quantity,
mpr.stocked_quantity,
${salesOrder}
${warehouseProductMaterial}
from mini_product_receipt mpr
left join mini_sales_order_materials msm on msm.sales_order_code = mpr.sales_order_code
and msm.material_code = mpr.material_code
left join mini_warehouse_product mwp on mwp.sales_order_code = mpr.sales_order_code
and mwp.material_code = mpr.material_code
where 1=1
and mpr.document_number = #{documentNumber}
"""),

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "修改",
"createTime" : null,
"updateTime" : 1726813026913,
"updateTime" : 1729144854213,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -77,6 +77,11 @@ try {
exit -1, "失败"
}
if ((Objects.isNull(nextProcess) || nextProcess == "")) {
if (isCompleted == 1) {
// 完成更新
}
tx.commit()
return;
}

@ -0,0 +1,60 @@
{
"properties" : { },
"id" : "2e42d1d8f15d4f318a69886c79055c24",
"script" : null,
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "查询完成的列表",
"createTime" : null,
"updateTime" : 1729148530659,
"lock" : null,
"createBy" : null,
"updateBy" : null,
"path" : "/completed/list",
"method" : "POST",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null
}
================================
import '@/common/sql' as sql
String salesOrdeSelect = sql("salesOrder")
String salesOrderCode = body.salesOrderCode;
String materialCode = body.materialCode;
return db.page("""
select
mpr.schedule_number,
mpr.report_number,
mpr.machine,
mpr.operator,
mpr.workshop,
mpr.report_date,
mpr.current_process,
mpr.create_by,
mpr.create_time,
mpr.is_completed,
mpr.source_number,
mpr.net_receipts,
mpr.production_number,
mpr.production_weight,
mpr.scrap_number,
mpr.scrap_weight,
mpr.next_process,
mpr.frame_number,
mpr.scrap_reason,
mpr.remarks ,
${salesOrdeSelect}
from mini_process_report mpr
left join mini_sales_order_materials msm
on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code
where mpr.is_completed = 1
?{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" : "e95307c32dc1437e82df26a97f1f194e",
"name" : "新增",
"createTime" : null,
"updateTime" : 1726384890138,
"updateTime" : 1729137432095,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -70,10 +70,20 @@ try{
material_code: marerial.materialCode,
create_by: createBy
})
})
// 库存添加
var res2 = db.update("""
update mini_warehouse_material set
existing_inventory = existing_inventory + #{marerial.returnNumber} ,
actual_weight = actual_weight + #{marerial.returnWeight}
where warehouse=#{orderInfo.warehouse} and material_code = #{marerial.materialCode} and supplier = #{marerial.supplier}
""")
if (res2 <= 0) {
tx.rollback();
exit -1, "提交失败";
}
})
res = db.table("mini_production_material_return").batchInsert(list)

@ -5,7 +5,7 @@
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "列表",
"createTime" : null,
"updateTime" : 1727082824379,
"updateTime" : 1729072453053,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -50,14 +50,16 @@ String documentNumber = body.documentNumber;
return db.page("""
select
id,
document_number,
date_format(requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date,
department,
recipient,
warehouse,
remarks
from mini_production_material_requisition
mmr.id,
mmr.document_number,
date_format(mmr.requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date,
mmr.department,
mmr.recipient,
mmr.warehouse,
mmr.remarks,
mw.warehouse_name
from mini_production_material_requisition mmr
left join mini_warehouses mw on mw.warehouse_code = mmr.warehouse
where 1=1
?{documentNumber!=null && documentNumber!="", and document_number like concat('%', #{documentNumber} ,'%') } group by document_number
?{documentNumber!=null && documentNumber!="", and mmr.document_number like concat('%', #{documentNumber} ,'%') } group by mmr.document_number
""");

@ -5,7 +5,7 @@
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "新增",
"createTime" : null,
"updateTime" : 1726384895519,
"updateTime" : 1729137249722,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -55,7 +55,10 @@ String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id =
var tx = db.transaction(); //开启事务
try{
// 记录领料数据
List list = new ArrayList();
Map map = new HashMap();
materialsList.map(marerial => {
list.add({
document_number: orderInfo.documentNumber,
@ -70,11 +73,20 @@ try{
material_code: marerial.materialCode,
create_by: createBy
})
})
// 库存扣除
var res2 = db.update("""
update mini_warehouse_material set
existing_inventory = existing_inventory - #{marerial.requisitionNumber} ,
actual_weight = actual_weight - #{marerial.requisitionWeight}
where warehouse=#{orderInfo.warehouse} and material_code = #{marerial.materialCode} and supplier = #{marerial.supplier}
""")
if (res2 <= 0) {
tx.rollback();
exit -1, "提交失败";
}
})
res = db.table("mini_production_material_requisition").batchInsert(list)
if (res > 0) {

@ -5,7 +5,7 @@
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "详情",
"createTime" : null,
"updateTime" : 1726385662770,
"updateTime" : 1729134803236,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -45,14 +45,15 @@ return {
date_format(mmr.requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date,
mmr.department,
mmr.recipient,
mmr.remarks,
mmr.requisition_number,
mmr.requisition_weight,
mw.warehouse_name,
${warehouseMaterial}
from mini_production_material_requisition mmr
left 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
inner join mini_warehouses mw on mw.warehouse_code = mmr.warehouse
and mwm.material_code = mmr.material_code
where 1=1
and document_number = #{documentNumber}
and mmr.document_number = #{documentNumber}
""")
}

@ -0,0 +1,51 @@
{
"properties" : { },
"id" : "11e7ff78870642c089d681befeda91db",
"script" : null,
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "领料物料列表",
"createTime" : null,
"updateTime" : 1729136886715,
"lock" : null,
"createBy" : null,
"updateBy" : null,
"path" : "/material/list",
"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 %H:%i:%S') as requisition_date,
mmr.department,
mmr.recipient,
sum(mmr.requisition_number) as requisition_number,
sum(mmr.requisition_weight) as 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.warehouse, mmr.material_code, mmr.supplier
""");

@ -5,7 +5,7 @@
"groupId" : "d3ae9fbe810f4d999f198de3ccd42577",
"name" : "新增",
"createTime" : null,
"updateTime" : 1726306995415,
"updateTime" : 1729131826109,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -210,6 +210,12 @@ try{
WHEN #{item.materialCode} THEN pieces + #{item.pieces}
</foreach>
ELSE pieces
END,
actual_weight = CASE material_code
<foreach collection="materialsList" item="item" separator=" ">
WHEN #{item.materialCode} THEN actual_weight + #{item.actualWeight}
</foreach>
ELSE actual_weight
END
""")

@ -5,7 +5,7 @@
"groupId" : "a170047f79ab4cb1b892edc5cccd823e",
"name" : "新增",
"createTime" : null,
"updateTime" : 1727078859438,
"updateTime" : 1729160792624,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -47,7 +47,6 @@
}
================================
Map orderInfo = body.orderInfo;
Map purchInfo = body.purchInfo;
var materialsList = body.materials
String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
@ -60,7 +59,6 @@ try{
document_number: orderInfo.documentNumber,
customer_id: orderInfo.customerId,
shipment_date: orderInfo.shipmentDate,
sales_order_code: purchInfo.documentNumber,
shipment_inspection_report: orderInfo.shipmentInspectionReport,
remarks: orderInfo.remarks,
create_by: createBy,
@ -79,8 +77,21 @@ try{
warehouse: marerial.warehouse,
shipment_quantity: marerial.shipmentQuantity,
actual_weight: marerial.actualWeight,
sales_order_code: marerial.salesOrderCode,
create_by: createBy,
})
// 库存扣除
var res2 = db.update("""
update mini_warehouse_product set
existing_inventory = existing_inventory - #{marerial.shipmentQuantity} ,
actual_weight = actual_weight - #{marerial.actualWeight}
where warehouse=#{marerial.warehouse} and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode}
""")
if (res2 <= 0) {
tx.rollback();
exit -1, "提交失败";
}
})
res = db.table("mini_sales_shipment_materials").batchInsert(list)

@ -5,7 +5,7 @@
"groupId" : "a170047f79ab4cb1b892edc5cccd823e",
"name" : "详情",
"createTime" : null,
"updateTime" : 1728728439695,
"updateTime" : 1729160684286,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -33,7 +33,6 @@ Map orderInfo = db.selectOne("""select
mci.customer_name,
mss.shipment_inspection_report,
mss.remarks,
mss.sales_order_code,
date_format(mss.shipment_date,'%Y-%m-%d') as shipment_date
from mini_sales_shipment mss
left join mini_customer_info mci on mci.id = mss.customer_id
@ -46,46 +45,29 @@ return {
materials: db.select("""
select
mssm.* ,
msom.material_name,
msom.profile_model,
msom.weight,
msom.specification,
msom.thickness,
msom.pieces_bundle,
msom.material_category,
msom.default_length,
msom.packaging_method,
msom.source,
msom.unit,
msom.customer_material_code,
msom.order_length,
msom.order_total_quantity,
msom.surface_method,
msom.theoretical_weight,
msom.theoretical_weight_per_piece,
msom.packing_quantity,
msom.packaging_method,
msom.produced_pieces,
'${salesOrderCode}' as sales_order_code
from mini_sales_shipment_materials mssm
left join mini_sales_order_materials msom on msom.material_code = mssm.material_code
where mssm.sales_shipment_code = #{documentNumber} and msom.sales_order_code=#{salesOrderCode}
"""),
purchInfo: db.selectOne("""
select
mso.document_number,
mso.customer_id,
mso.sales_date,
mso.salesperson,
su.user_name as salesperson_name,
mso.price,
date_format(mso.pricing_date, '%Y-%m-%d') as pricing_date,
date_format(mso.delivery_date, '%Y-%m-%d') as delivery_date,
mso.tax_rate,
mso.processing_fee,
mso.remarks
from mini_sales_orders mso
left join sys_user su on su.user_id = mso.salesperson
where mso.document_number = #{salesOrderCode}
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.packaging_method,
mwp.produced_pieces
from mini_sales_shipment_materials mssm
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
where mssm.sales_shipment_code = #{documentNumber}
""")
}

@ -1,7 +1,7 @@
spring:
profiles:
# active: local # test 本地
# active: dev # test 测试
# active: local # test 本地
# active: dev # test 测试
active: pro # pro 生产
# 通用配置

Loading…
Cancel
Save