From 50ef8b1576ffbd5983b3776342730de32f41d0d1 Mon Sep 17 00:00:00 2001
From: lifan <2308045698@qq.com>
Date: 星期二, 25 八月 2026 18:01:41 +0800
Subject: [PATCH] update

---
 jrj/project/business/Product.list.cpp |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/jrj/project/business/Product.list.cpp b/jrj/project/business/Product.list.cpp
index 7c29d66..73226af 100644
--- a/jrj/project/business/Product.list.cpp
+++ b/jrj/project/business/Product.list.cpp
@@ -3,7 +3,7 @@
 #include <xcontrol/xtreeview.hpp>
 #include <xcontrol/xdwgrid.hpp>
 #include <xcontrol/ximageview.hpp>
-
+#include <win32/xfolder.hpp>
 #include "vbusiness/vframe/maint.vframe.vbusiness.hpp"
 #include "viewobject/view.base.hpp"
 #include "viewobject/saleorder.view.hpp"
@@ -1092,9 +1092,68 @@
 				alert(L"添加成功");
 			return 1;
 		}
+		else if (comdid == L"xmExportImage")
+		{
+			return OnExportImages(dw_list);
+			}
 		return 0;
 	}
+	int OnExportImages(xdwgrid dw_obj)
+	{
+		xstring folder = xfolder::GetFolderForSave();
+		if (folder == L"") return 1;
 
+		xstring skunos = L"";
+		for (int i = 0; i <= dw_obj.GetRowCount(); i++)
+		{
+			if (i == 1)skunos = dw_obj.GetItemString(i, L"SKUNo");
+			else skunos += L"," + dw_obj.GetItemString(i, L"SKUNo");
+		}
+		xml x;
+		xaserverarg arg;
+		
+		arg.AddArg(L"SKUNoList", skunos);
+		xstring src = L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNoList";
+
+		//trace("SKUNo="+SKUNo);//要有展示图片查询条件内必定要skuno
+		if (xurl::get(src, arg.GetString(), x) != 1)
+		{
+			trace(L"error for download skuno pic!");
+			return 1;
+		}
+
+		xstring spath = L"";
+		xstring path = folder;// GetModuleTmpPath();
+		xstring ext = L"jpg";
+
+		trace(x.xml());
+		const wchar_t* str = x.xml();
+
+		KXMLDOMNodeList items = x.selectNodes(L"*/*");
+		long len = items.length();
+		for (int i = 0; i <= len; i++)
+		{
+			KXMLDOMElement ele = items.item(i);
+			if (ele.selectSingleNode(L"FileExt[1]"))
+			{
+				ext = ele.selectSingleNode(L"FileExt[1]").text();
+			}
+			xstring SKUNo = L"";
+			if (ele.selectSingleNode(L"FullName[1]"))
+			{
+				SKUNo = ele.selectSingleNode(L"FullName[1]").text();
+				xstring filename = SKUNo + L"." + ext;
+				if (ele.selectSingleNode(L"PicPath[1]"))
+					spath = ele.selectSingleNode(L"PicPath[1]").text();
+				if (spath != L"")
+				{
+					xaserver::DownLoadFile(this->GetServerUrl(), spath, L"", path + L"/" + filename);
+				}
+			}
+		}
+		alert(L"样品图片生成完成");
+		return 1;
+	}
 	//命令处理事件
 	int OnXCommand(TEvent* evt, int param)
 	{

--
Gitblit v1.9.3