xj qian
2024-07-22 34e70d896cc61ea11347662e21ba0f6b65294d23
Merge branch 'master' of http://116.62.18.175:6699/r/mis-prj
已添加1个文件
已修改5个文件
226 ■■■■■ 文件已修改
jrj/ext-jrj/ext-jrj.vcxproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/ext-jrj/ext-jrj.vcxproj.filters 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/VATNotify/import.vatnotify.cpp 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/VATNotify/maint.papercard.vatnotify.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/VATNotify/simple.maint.vatnotify.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/VATNotify/update.vatnotify.cpp 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/ext-jrj/ext-jrj.vcxproj
@@ -943,6 +943,7 @@
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\VATNotify\del.vatinvoice.cpp" />
    <ClCompile Include="..\project\business\VATNotify\import.vatnotify.cpp" />
    <ClCompile Include="..\project\business\VATNotify\list.vatinvoice.cpp" />
    <ClCompile Include="..\project\business\VATNotify\list.vatnotify.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
jrj/ext-jrj/ext-jrj.vcxproj.filters
@@ -1160,5 +1160,8 @@
    <ClCompile Include="..\project\business\AP\list.RefundSourcingLine.Entity.xarch.cpp">
      <Filter>project\business\AP</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\VATNotify\import.vatnotify.cpp">
      <Filter>project\business\VATNotify</Filter>
    </ClCompile>
  </ItemGroup>
</Project>
jrj/project/business/VATNotify/import.vatnotify.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,201 @@
#include <wobject/xstring.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
using xml = KXMLDOMDocument;
    class __declspec(dllexport) importvatnotifyWin :  public xframe
    {
    public:
        xdwgrid    dw_list;
        xdwgrid    dw_base;
        xnode    m_agentNode;    //Agent Condition
    public:
        importvatnotifyWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static importvatnotifyWin* CreateInstance(void* implPtr, void* hWnd)
        {
            importvatnotifyWin* pWin = new importvatnotifyWin(implPtr, (HWND)hWnd);
            return pWin;
        }
        int SetAgent()
        {
            xstring xfNodeAgentArea  = L"agentarea";
            xnode anode = GetAgentNode(xfNodeAgentArea);
            if(m_agentNode)
            {
                SetAgentNode (anode,m_agentNode);
            }
            else
            {
                KXMLDOMElement xframeElement =  GetElement();
                KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*");
                if(agent)
                {
                    xstring s = agent.xml();
                    m_agentNode =  SetAgentNode (anode,s);
                }
            }
            return 1;
        }
        //焦点激活处理函数
        int OnSetFocus(TEvent* evt, LPARAM param)
        {
            //重置工具条
            //SetAgent();
            return 1;
        }
        int OnImport()
        {
            xml x ;
            xaserverarg arg;
            int row = dw_list.GetRow();
            if(row < 1)  return 1;
            KXMLDOMElement ele = dw_list.GetRowElement(row);
            xstring invno = ele.selectSingleNode(L"InvoiceNo").text();
            arg.AddArg(L"InvoiceNo",invno);
            if (getUrl(L"/sale/data/VATNotify/import/invoice",arg.GetString(),x)!=1)
            {
                alert(x.text());
                return 1;
            }else
            {
                alert(x.text());
                OnRetrieve();
            }
            return 1;
        }
        int OnImport2()
        {
            xml x;
            xaserverarg arg;
            for(int row=1; row<= dw_list.GetRowCount();row++){
                KXMLDOMElement ele = dw_list.GetRowElement(row);
                xstring invno = ele.selectSingleNode(L"InvoiceNo").text();
                arg.AddArg(L"InvoiceNo",invno);
                if (getUrl(L"/sale/data/VATNotify/import/invoice",arg.GetString(),x)!=1)
                {
                    //alert(x.text());
                    return 1;
                }else
                {
                    //alert(x.text());
                    //OnRetrieve();
                }
            }
            return 1;
        }
        //命令发布函数
        int OnCmdDispatch(xstring comdid)
        {
            if(comdid==L"xmRetrieve")
            {
                OnRetrieve();
            }
            else if(comdid==L"xmOk")
            {
                return OnImport();
            }else if (comdid==L"xmClose"){
                CloseWindow();
            }
            return 0;
        }
        //命令处理事件
        int OnXCommand(TEvent* evt, LPARAM param)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
        int OnAttachEvent()
        {
            //绑定工具条点击事件
            AttachEvent(L"WM_XCOMMAND", (FEvent)&importvatnotifyWin::OnXCommand);
            //获取焦点事件,用于重置工具条
            AttachEvent(L"WM_SETFOCUS", (FEvent)&importvatnotifyWin::OnSetFocus);
            AttachEvent(L"dw_list",L"DWV_CLICKED", (FEvent)&importvatnotifyWin::OnClicked);
            return 1;
        }
        int OnClicked(TEvent* evt, LPARAM p)
        {
            DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
            int row = hdr.row;
            if(row < 1) return 1;
            KXMLDOMElement ele = dw_list.GetRowElement(row);
            xstring invno = ele.selectSingleNode(L"InvoiceNo").text();
            xml x ;
            xaserverarg arg;
            arg.AddArg(L"invoiceno",invno);
            //alert(invno);
            if (getUrl(L"/sale/data/VATNotify/pref/importbase",arg.GetString(),x)!=1)
            {
                trace(x.text());
                return -1;
            }else
            {
                dw_base.Retrieve(x);
                dw_base.Redraw();
                dw_base.SetReadOnly(true);
                dw_base.SetSelectionMode(1);
            }
            return 1;
        }
        int  OnRetrieve()
        {
            xml x ;
            xaserverarg arg ;
            xstring QueryTxt = xcontrol(GetControl(L"sle_search")).GetText();
            arg.AddArg(L"QueryTxt",QueryTxt);
            if (getUrl(L"/sale/data/VATNotify/pref/importlist",arg.GetString(),x)!=1)
            {
                trace(x.text());
                return -1;
            }else
            {
                dw_list.Retrieve(x);
                dw_list.Redraw();
                dw_list.SetReadOnly(true);
                //dw_list.SetSelectionMode(3);
            }
            return 1;
        }
        int onload()
        {
            dw_list = GetControl(L"dw_list");
            dw_list.openUrl(L"/sale/view/VATNotify/template/VATNotify/importlist");
            dw_base = GetControl(L"dw_base");
            dw_base.openUrl(L"/sale/view/VATNotify/template/VATNotify/importbase");
            OnAttachEvent();
            OnRetrieve();
            return 1;
        }
        int onloaded()
        {
            //SetAgent();
            return 1;
        }
    };
jrj/project/business/VATNotify/maint.papercard.vatnotify.cpp
@@ -689,7 +689,7 @@
            if (GetWinParam())
            {
                int pArg = GetArg();
                arg = GetArg();
            
            }
            else
@@ -763,7 +763,7 @@
            if (GetWinParam())
            {
                int pArg = GetArg();
                arg = GetArg();
                
                InvNo = arg.GetArgString(L"invoiceno");
                SetWindowText(GetHWND(), InvNo);
jrj/project/business/VATNotify/simple.maint.vatnotify.cpp
@@ -778,7 +778,7 @@
            if (GetWinParam())
            {
                int pArg = GetArg();
                arg = GetArg();
                
            }
            else
@@ -860,7 +860,7 @@
            if (GetWinParam())
            {
                int pArg = GetArg();
                arg = GetArg();
                
                InvNo = arg.GetArgString(L"invoiceno");
                SetWindowText(GetHWND(), InvNo);
jrj/project/business/VATNotify/update.vatnotify.cpp
@@ -13,6 +13,7 @@
        xdwgrid    dw_item;
        xdwgrid    dw_goods;
        xnode    m_agentNode;    //Agent Condition
        xstring        InvNo;
    public:
        UpdateVatNotifyWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
@@ -257,11 +258,11 @@
            
            if (GetWinParam())
            {
                int pArg = GetArg();
                arg = GetArg();
                InvNo = arg.GetArgString(L"invoiceno");
            }
            else
                arg.AddArg(L"invoiceno", L"15HDLD0720");
                arg.AddArg(L"invoiceno", InvNo);
            arg.AddArg(L"ClassifyID", classifyID);
            arg.AddArg(L"SupplierID", supplierID);
@@ -300,11 +301,11 @@
            
            if (GetWinParam())
            {
                int pArg = GetArg();
                arg  = GetArg();
                InvNo = arg.GetArgString(L"invoiceno");
            }
            else
                arg.AddArg(L"invoiceno", L"15HDLD0720");
                arg.AddArg(L"invoiceno", InvNo);
            if (getUrl(L"/sale/data/VATNotify/entity/base/miss", arg.GetString(), x) != 1)
            {
                trace(x.text());