20241017更新

main
lcode 3 weeks ago
parent 8c5bf9b7fc
commit 7542075a54

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

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

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

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "修改", "name" : "修改",
"createTime" : null, "createTime" : null,
"updateTime" : 1726813026913, "updateTime" : 1729144854213,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -77,6 +77,11 @@ try {
exit -1, "失败" exit -1, "失败"
} }
if ((Objects.isNull(nextProcess) || nextProcess == "")) { if ((Objects.isNull(nextProcess) || nextProcess == "")) {
if (isCompleted == 1) {
// 完成更新
}
tx.commit() tx.commit()
return; 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", "groupId" : "e95307c32dc1437e82df26a97f1f194e",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1726384890138, "updateTime" : 1729137432095,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -70,10 +70,20 @@ try{
material_code: marerial.materialCode, material_code: marerial.materialCode,
create_by: createBy 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) res = db.table("mini_production_material_return").batchInsert(list)

@ -5,7 +5,7 @@
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea", "groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1727082824379, "updateTime" : 1729072453053,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -50,14 +50,16 @@ String documentNumber = body.documentNumber;
return db.page(""" return db.page("""
select select
id, mmr.id,
document_number, mmr.document_number,
date_format(requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date, date_format(mmr.requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date,
department, mmr.department,
recipient, mmr.recipient,
warehouse, mmr.warehouse,
remarks mmr.remarks,
from mini_production_material_requisition mw.warehouse_name
from mini_production_material_requisition mmr
left join mini_warehouses mw on mw.warehouse_code = mmr.warehouse
where 1=1 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", "groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1726384895519, "updateTime" : 1729137249722,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -55,7 +55,10 @@ String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id =
var tx = db.transaction(); //开启事务 var tx = db.transaction(); //开启事务
try{ try{
// 记录领料数据
List list = new ArrayList(); List list = new ArrayList();
Map map = new HashMap();
materialsList.map(marerial => { materialsList.map(marerial => {
list.add({ list.add({
document_number: orderInfo.documentNumber, document_number: orderInfo.documentNumber,
@ -70,11 +73,20 @@ try{
material_code: marerial.materialCode, material_code: marerial.materialCode,
create_by: createBy 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) res = db.table("mini_production_material_requisition").batchInsert(list)
if (res > 0) { if (res > 0) {

@ -5,7 +5,7 @@
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea", "groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "详情", "name" : "详情",
"createTime" : null, "createTime" : null,
"updateTime" : 1726385662770, "updateTime" : 1729134803236,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -45,14 +45,15 @@ return {
date_format(mmr.requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date, date_format(mmr.requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date,
mmr.department, mmr.department,
mmr.recipient, mmr.recipient,
mmr.remarks,
mmr.requisition_number, mmr.requisition_number,
mmr.requisition_weight, mmr.requisition_weight,
mw.warehouse_name,
${warehouseMaterial} ${warehouseMaterial}
from mini_production_material_requisition mmr 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 and mwm.material_code = mmr.material_code
where 1=1 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", "groupId" : "d3ae9fbe810f4d999f198de3ccd42577",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1726306995415, "updateTime" : 1729131826109,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -210,6 +210,12 @@ try{
WHEN #{item.materialCode} THEN pieces + #{item.pieces} WHEN #{item.materialCode} THEN pieces + #{item.pieces}
</foreach> </foreach>
ELSE pieces 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 END
""") """)

@ -5,7 +5,7 @@
"groupId" : "a170047f79ab4cb1b892edc5cccd823e", "groupId" : "a170047f79ab4cb1b892edc5cccd823e",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1727078859438, "updateTime" : 1729160792624,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -47,7 +47,6 @@
} }
================================ ================================
Map orderInfo = body.orderInfo; Map orderInfo = body.orderInfo;
Map purchInfo = body.purchInfo;
var materialsList = body.materials var materialsList = body.materials
String userId = StringUtil.objectToString(request.get().getAttribute("openid")); String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
@ -60,7 +59,6 @@ try{
document_number: orderInfo.documentNumber, document_number: orderInfo.documentNumber,
customer_id: orderInfo.customerId, customer_id: orderInfo.customerId,
shipment_date: orderInfo.shipmentDate, shipment_date: orderInfo.shipmentDate,
sales_order_code: purchInfo.documentNumber,
shipment_inspection_report: orderInfo.shipmentInspectionReport, shipment_inspection_report: orderInfo.shipmentInspectionReport,
remarks: orderInfo.remarks, remarks: orderInfo.remarks,
create_by: createBy, create_by: createBy,
@ -79,8 +77,21 @@ try{
warehouse: marerial.warehouse, warehouse: marerial.warehouse,
shipment_quantity: marerial.shipmentQuantity, shipment_quantity: marerial.shipmentQuantity,
actual_weight: marerial.actualWeight, actual_weight: marerial.actualWeight,
sales_order_code: marerial.salesOrderCode,
create_by: createBy, 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) res = db.table("mini_sales_shipment_materials").batchInsert(list)

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

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

Loading…
Cancel
Save