半成品成品价格于BOM表关联

This commit is contained in:
dxc
2026-03-02 13:39:52 +08:00
parent 16350842f8
commit cf75b80e13
4 changed files with 55 additions and 3 deletions

View File

@ -162,6 +162,23 @@ def get_manager_history():
try:
data = SemiInboundService.get_history_managers(keyword)
return jsonify({"code": 200, "msg": "success", "data": data})
except Exception as e:
traceback.print_exc()
return jsonify({"code": 500, "msg": str(e)}), 500
# ------------------------------------------------------------------
# 9. BOM 原材料成本自动核算 (新增)
# ------------------------------------------------------------------
@inbound_semi_bp.route('/calculate-bom-cost', methods=['GET'])
@permission_required('inbound_semi')
def calculate_bom_cost():
try:
bom_code = request.args.get('bom_code')
bom_version = request.args.get('bom_version')
if not bom_code or not bom_version:
return jsonify({"code": 400, "msg": "bom_code和bom_version不能为空"}), 400
cost = SemiInboundService.calculate_bom_cost(bom_code, bom_version)
return jsonify({"code": 200, "msg": "success", "data": cost})
except Exception as e:
traceback.print_exc()
return jsonify({"code": 500, "msg": str(e)}), 500