From a4d2315ee4ca3f6177b4fb2526bed2feff3d89be Mon Sep 17 00:00:00 2001
From: lifan <2308045698@qq.com>
Date: 星期三, 22 十月 2025 16:52:58 +0800
Subject: [PATCH] update
---
jrj/project/business/SO3.maint.cpp | 89 ++++++++++++++++++++++++++++++--------------
1 files changed, 60 insertions(+), 29 deletions(-)
diff --git a/jrj/project/business/SO3.maint.cpp b/jrj/project/business/SO3.maint.cpp
index 53b8fa6..9d831f5 100644
--- a/jrj/project/business/SO3.maint.cpp
+++ b/jrj/project/business/SO3.maint.cpp
@@ -9,6 +9,11 @@
#include "viewobject/saleorder.view.hpp"
#include "viewobject/quote.view.hpp"
+#include "jstring.hpp"
+#include "JFactory.hpp"
+#include "jobjectsvr.hpp"
+#include <memory>
+#include "JPtr.hpp"
class __declspec(dllexport) BaseMaintSOWin : public maint
{
xdwtable dw_props;
@@ -223,17 +228,34 @@
xstring colname = hdr->colname;
if (value == L"支付条款")
{
- //int p1 = vc.xdoc.getNativePointer();
- //openUrl(L"/sale/view/SaleOrder/xpage/payment", p1);
+ xaserverarg arg;
+ xml x;
+ dw_base.DwUpdateAllTo(x);
+ arg.SetArg(L"content", x.xml());
+ openUrl(L"/sale/view/SaleOrder/xpage/payment", (LPARAM)arg);
+ if (arg.GetArgString(L"process") == L"ok")
+ {
+ x.loadXML(arg.GetArgString(L"content"));
+ dw_base.Retrieve(x);
+ }
dw_base.AcceptText();
+ dw_base.Redraw();
return 1;
}
//交货期维护
if (value == L"交货期")
{
- //int p2 = vc.xdoc.getNativePointer();
- //openUrl(L"/sale/view/SaleOrder/xpage/delivery1", p2);
+ xaserverarg arg;
+ xml x;
+ dw_base.DwUpdateAllTo(x);
+ arg.SetArg(L"content", x.xml());
+ openUrl(L"/sale/view/SaleOrder/xpage/delivery1", (LPARAM)arg);
+ if (arg.GetArgString(L"process") == L"ok")
+ {
+ x.loadXML(arg.GetArgString(L"content"));
+ dw_base.Retrieve(x);
+ }
dw_base.AcceptText();
dw_base.Redraw();
return 1;
@@ -355,7 +377,7 @@
{
xstring CustomerID = dw_base.GetItemString(1, L"CustomerID");
//KXMLDOMDocument x = QuoteView::LookupProductsByText(str,CustomerID);
- //trace(str+L"--" + CustomerID);
+ //alert(str+L"--" + CustomerID);
KXMLDOMDocument x = ViewObject::RetrieveData(GetServerUrl(),L"/sale/data/SaleOrder/lookup/productsex", L"str", str, L"CustomerID", CustomerID);
if (!x) return 1;
KXMLDOMNodeList items = x.selectNodes(L"/Items/Item");
@@ -545,7 +567,7 @@
{
xstring sSalespersonID = dw_base.GetItemString(1, L"SalespersonID");
//alert(sSalespersonID);
- hdr->data = sSalespersonID;
+ hdr->data = sSalespersonID.c_str(true);
}
@@ -570,7 +592,7 @@
if (skunos == L"")
skunos = dw_item.GetItemString(i, L"SKUNo");
else
- skunos += L",L" + dw_item.GetItemString(i, L"SKUNo");
+ skunos += L"," + dw_item.GetItemString(i, L"SKUNo");
}
}
xaserverarg& arg = *new xaserverarg();
@@ -609,11 +631,10 @@
//str = str.trim();
//if(str==L"")
//{
- xaserverarg& arg = *new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
- arg.AddArg(L"HWND", xstring((__int64)GetHWND()));
+ xaserverarg arg;
+ arg.SetParam(L"HWND", GetHWND());
arg.AddArg(L"CustomerID", dw_base.GetItemString(1, L"CustomerID"));
- OpenWindow(L"dev:xpage[Product.Select.SO.vx]", (LPARAM)&arg);
+ OpenWindow(L"dev:xpage[Product.Select.SO.vx]", arg);
//OpenWindow(L"dev:xpage[Product.Select.vx]",cast(arg1 as int));
//}
//else
@@ -703,12 +724,12 @@
alert(L"请先保存数据!");
return 1;
}
- xaserverarg& arg = * new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
+
arg.AddArg(L"EntityName", L"SaleOrder", L"");
arg.AddArg(L"EntityID", dw_base.GetItemString(1, L"SOID"), L"");
arg.AddArg(L"EntityNo", dw_base.GetItemString(1, L"SONo"), L"");
- openUrl(L"/sale/view/view.base/xpage/Template/PrintViewEx", &arg);
+ openUrl(L"/sale/view/view.base/xpage/Template/PrintViewEx", arg);
return 1;
}
else if (comdid == L"xmSaveEx" && bupdate)
@@ -831,7 +852,7 @@
return 1;
}
- int OnImgDBClicked(TEvent* evt, int pr)
+ int OnImgDBClicked(TEvent* evt, LPARAM pr)
{
IMGNNMHDR* nmtv = (IMGNNMHDR *)evt->notify.pnmh;
xstring src = nmtv->path;
@@ -840,13 +861,13 @@
else
src=src.mid(src.find(L"Thumbs", 0)+6, 50);
*/
- xaserverarg& arg = * new xaserverarg;
+ xaserverarg arg;
//arg.AddArg(L"src",L"/business/products/chanpin"+src);
arg.AddArg(L"src", src);
//win::OpenWindow(L"dev:xpage[BigPicture.vx]",arg);
- int h = openUrl(L"/sale/view/ProductLibrary/xpage/bigpictureview", &arg);
+ openUrl(L"/sale/view/ProductLibrary/xpage/bigpictureview", arg);
/*
xwin x = new xwin;
x.setNativePointer(h);
@@ -864,8 +885,8 @@
ximageview im = GetControl(L"im1");
KXMLDOMDocument xp;
- xaserverarg& arg_pic = *new xaserverarg;
- arg_pic.setNativePointer(arg_pic.CreateInstance());
+ xaserverarg arg_pic ;
+
arg_pic.AddArg(L"SKUNo", skuno);
xstring res = L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo";
@@ -915,7 +936,7 @@
for (int ip = 0; ip < lenp; ip++)
{
auto xitem = nlistp.item(ip);
- string picname = xitem.selectSingleNode(L"PicPath").text();
+ xstring picname = xitem.selectSingleNode(L"PicPath").text();
string goodno = xitem.selectSingleNode(L"GoodsNo").text();
if (picname == L"/business/products/Thumbs//")
picname = L"/business/products/Thumbs/00/00000000-0000-0000-0000-000000000000.jpg";
@@ -940,8 +961,16 @@
return 1;
}
+
int onload()
{
+ /*
+ using JFString = JFactory<JString>;
+ JPtr<JFString> jfString(JObjectSvr::CreateInstance<JFString>(L"JFactoryString"));
+ //auto jfString = JObjectSvr::CreateInstance<JFString>(L"JFactoryString");
+ JPtr<JString> pStr(jfString->make());
+ */
+
dw_props = GetControl(L"dw_props");
/*KXMLDOMDocument x = SaleOrderView::GetMaintFormForBase();
dw_props.SetDataObject(x);
@@ -1001,22 +1030,24 @@
}*/
xstring SONo;
xstring CustomerID;
- xaserverarg* arg = 0;
- if (GetParam())
+ xaserverarg arg;
+ if (GetWinParam())
{
- arg = (xaserverarg *)GetParam();
- SONo = arg->GetArgString(L"SONo");
- if (SONo == L"") SONo = arg->GetArgString(L"EntityNo");
+ arg = GetArg();
+ SONo = arg.GetArgString(L"SONo");
+ if (SONo == L"") SONo = arg.GetArgString(L"EntityNo");
}
if (SONo != L"")
{
KXMLDOMDocument x = SaleOrderView::GetMaintDataForBase(SONo);
+ BSTR str = (BSTR)x.xml();
dw_base.Retrieve(x);
dw_item.Retrieve(x);
}
else
{
KXMLDOMDocument x = ViewObject::RetrieveData(GetServerUrl(),L"/sale/data/SaleOrder/newinitial");
+ BSTR str = (BSTR)x.xml();
dw_base.Retrieve(x);
xstring sdate = publiccode::GetCurrentDate();
@@ -1046,8 +1077,8 @@
if (CustomerID != L"")
{
- dw_base.ItemChangeTo(1, L"CustomerID", arg->GetArgString(L"CustomerID"));
- dw_base.SetItemDisplayString(1, L"CustomerID", arg->GetArgString(L"CustomerName"));
+ dw_base.ItemChangeTo(1, L"CustomerID", arg.GetArgString(L"CustomerID"));
+ dw_base.SetItemDisplayString(1, L"CustomerID", arg.GetArgString(L"CustomerName"));
xstring dwname = L"dw_base";
xstring colname = L"CustomerID";
xstring value = CustomerID;
@@ -1065,9 +1096,9 @@
{
SetAgent();
- if (GetParam())
+ if (GetWinParam())
{
- xaserverarg& arg = *(xaserverarg * )GetParam();
+ xaserverarg arg = GetArg();
HCURSOR hCursor = xutil::SetCursorWait();
xstring SONo = arg.GetArgString(L"SONo");
if (SONo == L"") SONo = arg.GetArgString(L"EntityNo");
--
Gitblit v1.9.3