当前位置: 首页 > news >正文

U8产成品入库API接口 --参照生产订单/产品检验/不良品

 //第二步:构造环境上下文对象,传入login,并按需设置其它上下文参数
                U8EnvContext envContext = new U8EnvContext();
                envContext.U8Login = u8Login;


                //第三步:设置API地址标识(Url)
                //当前API:添加新单据的地址标识为:U8API/ProductIn/Add
                U8ApiAddress myApiAddress = new U8ApiAddress("U8API/ProductIn/Add");


                //第四步:构造APIBroker
                U8ApiBroker broker = new U8ApiBroker(myApiAddress, envContext);

                //第五步:API参数赋值

                //给普通参数sVouchType赋值。此参数的数据类型为System.String,此参数按值传递,表示单据类型:11
                broker.AssignNormalValue("sVouchType", "10");


                MSXML2.IXMLDOMDocument2 docHead = new DOMDocument();
                MSXML2.IXMLDOMDocument2 docBody = new DOMDocument();

  switch (iType)
                {
                    #region 生产订单
                    case 0:
                        {
                            docHead.load(Server.MapPath("./") + @"XML\rdrecord10_scdd.xml");
                            docBody.load(Server.MapPath("./") + @"XML\rdrecords10_scdd.xml");

                            MSXML2.IXMLDOMNode nodeHead = docHead.selectSingleNode("//z:row");

                            dtHead.Rows[0]["ddate"] = u8Login.CurDate;
                            dtHead.Rows[0]["cmaker"] = u8Login.cUserName;
                            IXMLDOMElement xeHead = (IXMLDOMElement)nodeHead;

                            xeHead.setAttribute("cwhcode", dtHead.Rows[0]["cwhcode"].ToString());
                            xeHead.setAttribute("ddate", dtHead.Rows[0]["ddate"].ToString());
                            //  xeHead.setAttribute("ccode", dtHead.Rows[0]["ccode"].ToString());
                            // xeHead.setAttribute("crdcode", dtHead.Rows[0]["crdcode"].ToString());
                            xeHead.setAttribute("cdepcode", dtHead.Rows[0]["cdepcode"].ToString());
                            xeHead.setAttribute("cmaker", dtHead.Rows[0]["cmaker"].ToString());
                            xeHead.setAttribute("csource", "生产订单");
                            xeHead.setAttribute("cbustype", "成品入库");
                            xeHead.setAttribute("vt_id", dtHead.Rows[0]["vt_id"].ToString());
                            // xeHead.setAttribute("imquantity", dtHead.Rows[0]["imquantity"].ToString());
                            //   xeHead.setAttribute("cpspcode", dtHead.Rows[0]["cpspcode"].ToString());
                            xeHead.setAttribute("cmpocode", dtHead.Rows[0]["cmpocode"].ToString());
                            xeHead.setAttribute("iproorderid", dtHead.Rows[0]["iproorderid"].ToString());
                            xeHead.setAttribute("crdcode", dtHead.Rows[0]["cRdCode"].ToString());//入库类别
                            xeHead.setAttribute("crdname", dtHead.Rows[0]["cRdName"].ToString());//入库类别

                            int irowno = 1;
                            MSXML2.IXMLDOMNode nodeBody = docBody.selectSingleNode("//z:row");
                            IXMLDOMElement xeBody = (IXMLDOMElement)nodeBody;
                            foreach (DataRow datarow in dtBody.Rows)
                            {
                                if (Convert.ToDouble(datarow["ihasquantity"].ToString()) <= 0) continue;

                                if (irowno != 1)
                                {
                                    IXMLDOMNode newNode = nodeBody.cloneNode(false);
                                    IXMLDOMElement xeBody1 = (IXMLDOMElement)newNode;
                                    xeBody1.setAttribute("cinvcode", datarow["cinvcode"].ToString());
                                    xeBody1.setAttribute("cinvm_unit", datarow["cinvm_unit"].ToString());
                                    xeBody1.setAttribute("cposition", datarow["cposition"].ToString());
                                    xeBody1.setAttribute("cbatch", datarow["cbatch"].ToString());
                                    xeBody1.setAttribute("iquantity", datarow["ihasquantity"].ToString());
                                    xeBody1.setAttribute("inquantity", datarow["inquantity"].ToString());
                                    xeBody1.setAttribute("impoids", datarow["impoids"].ToString());
                                    xeBody1.setAttribute("cposname", datarow["cposname"].ToString());
                                    xeBody1.setAttribute("cmocode", datarow["cmocode"].ToString());
                                    xeBody1.setAttribute("imoseq", datarow["imoseq"].ToString());
                                    xeBody1.setAttribute("isotype", datarow["isotype"].ToString());
                                    xeBody1.setAttribute("iordertype", datarow["iordertype"].ToString());
                                    xeBody1.setAttribute("iorderdid", datarow["iorderdid"].ToString());
                                    xeBody1.setAttribute("iexpiratdatecalcu", datarow["iexpiratdatecalcu"].ToString());
                                    xeBody1.setAttribute("irowno", irowno);
                                    xeBody1.setAttribute("cinvouchtype", datarow["cinvouchtype"].ToString());
                                    docBody.selectSingleNode("//rs:data").appendChild(newNode);

                                }
                                else
                                {
                                    xeBody.setAttribute("cinvcode", datarow["cinvcode"].ToString());
                                    xeBody.setAttribute("cinvm_unit", datarow["cinvm_unit"].ToString());
                                    xeBody.setAttribute("cposition", datarow["cposition"].ToString());
                                    xeBody.setAttribute("cbatch", datarow["cbatch"].ToString());
                                    xeBody.setAttribute("iquantity", datarow["ihasquantity"].ToString());
                                    xeBody.setAttribute("inquantity", datarow["inquantity"].ToString());
                                    xeBody.setAttribute("impoids", datarow["impoids"].ToString());
                                    xeBody.setAttribute("cposname", datarow["cposname"].ToString());
                                    xeBody.setAttribute("cmocode", datarow["cmocode"].ToString());
                                    xeBody.setAttribute("imoseq", datarow["imoseq"].ToString());
                                    xeBody.setAttribute("isotype", datarow["isotype"].ToString());
                                    xeBody.setAttribute("iordertype", datarow["iordertype"].ToString());
                                    xeBody.setAttribute("iorderdid", datarow["iorderdid"].ToString());
                                    xeBody.setAttribute("iexpiratdatecalcu", datarow["iexpiratdatecalcu"].ToString());
                                    xeBody.setAttribute("irowno", irowno);
                                    xeBody.setAttribute("cinvouchtype", datarow["cinvouchtype"].ToString());
                                }
                                irowno++;
                            }
                        }
                        break;
                    #endregion

                    #region 产品检验单
                    case 1:
                        {
                            docHead.load(Server.MapPath("./") + @"XML\rdrecord10_cpjyd.xml");
                            docBody.load(Server.MapPath("./") + @"XML\rdrecords10_cpjyd.xml");


                            MSXML2.IXMLDOMNode nodeHead = docHead.selectSingleNode("//z:row");

                            dtHead.Rows[0]["ddate"] = u8Login.CurDate;
                            dtHead.Rows[0]["cmaker"] = u8Login.cUserName;
                            IXMLDOMElement xeHead = (IXMLDOMElement)nodeHead;

                            xeHead.setAttribute("cwhcode", dtHead.Rows[0]["cwhcode"].ToString());
                            xeHead.setAttribute("ddate", dtHead.Rows[0]["ddate"].ToString());
                            xeHead.setAttribute("cdepcode", dtHead.Rows[0]["cdepcode"].ToString());
                            xeHead.setAttribute("cmaker", dtHead.Rows[0]["cmaker"].ToString());
                            xeHead.setAttribute("csource", "产品检验单");
                            xeHead.setAttribute("cbustype", "成品入库");
                            xeHead.setAttribute("vt_id", dtHead.Rows[0]["vt_id"].ToString());
                            xeHead.setAttribute("imquantity", dtHead.Rows[0]["imquantity"].ToString());
                            xeHead.setAttribute("cmpocode", dtHead.Rows[0]["cmpocode"].ToString());
                            xeHead.setAttribute("iproorderid", dtHead.Rows[0]["iproorderid"].ToString());
                         


                            int irowno = 1;
                            MSXML2.IXMLDOMNode nodeBody = docBody.selectSingleNode("//z:row");
                            IXMLDOMElement xeBody = (IXMLDOMElement)nodeBody;
                            foreach (DataRow datarow in dtBody.Rows)
                            {
                                if (Convert.ToDouble(datarow["ihasquantity"].ToString()) <= 0) continue;

                                if (irowno != 1)
                                {
                                    IXMLDOMNode newNode = nodeBody.cloneNode(false);
                                    IXMLDOMElement xeBody1 = (IXMLDOMElement)newNode;
                                    xeBody1.setAttribute("cinvcode", datarow["cinvcode"].ToString());
                                    xeBody1.setAttribute("cinvm_unit", datarow["cinvm_unit"].ToString());
                                    xeBody1.setAttribute("cposition", datarow["cposition"].ToString());
                                    xeBody1.setAttribute("cbatch", datarow["cbatch"].ToString());
                                    xeBody1.setAttribute("iquantity", datarow["ihasquantity"].ToString());
                                    xeBody1.setAttribute("inquantity", datarow["inquantity"].ToString());
                                    xeBody1.setAttribute("impoids", datarow["impoids"].ToString());
                                    xeBody1.setAttribute("ccheckcode", datarow["ccheckcode"].ToString());
                                    xeBody1.setAttribute("icheckidbaks", datarow["icheckidbaks"].ToString());
                                    xeBody1.setAttribute("ccheckpersoncode", datarow["ccheckpersoncode"].ToString());
                                    xeBody1.setAttribute("dcheckdate", datarow["dcheckdate"].ToString());
                                    xeBody1.setAttribute("brelated", datarow["brelated"].ToString());
                                    xeBody1.setAttribute("cmocode", datarow["cmocode"].ToString());
                                    xeBody1.setAttribute("imoseq", datarow["imoseq"].ToString());
                                    xeBody1.setAttribute("isotype", datarow["isotype"].ToString());
                                    xeBody1.setAttribute("iordertype", datarow["iordertype"].ToString());
                                    xeBody1.setAttribute("iorderdid", datarow["iorderdid"].ToString());
                                    xeBody1.setAttribute("iexpiratdatecalcu", datarow["iexpiratdatecalcu"].ToString());
                                    xeBody1.setAttribute("irowno", irowno);
                                    xeBody1.setAttribute("cinvouchtype", datarow["cinvouchtype"].ToString());
                                    xeBody1.setAttribute("imergecheckautoid", datarow["imergecheckautoid"].ToString());
                                    docBody.selectSingleNode("//rs:data").appendChild(newNode);

                                }
                                else
                                {
                                    xeBody.setAttribute("cinvcode", datarow["cinvcode"].ToString());
                                    xeBody.setAttribute("cinvm_unit", datarow["cinvm_unit"].ToString());
                                    xeBody.setAttribute("cposition", datarow["cposition"].ToString());
                                    xeBody.setAttribute("cbatch", datarow["cbatch"].ToString());
                                    xeBody.setAttribute("iquantity", datarow["ihasquantity"].ToString());
                                    xeBody.setAttribute("inquantity", datarow["inquantity"].ToString());
                                    xeBody.setAttribute("impoids", datarow["impoids"].ToString());
                                    xeBody.setAttribute("ccheckcode", datarow["ccheckcode"].ToString());
                                    xeBody.setAttribute("icheckidbaks", datarow["icheckidbaks"].ToString());
                                    xeBody.setAttribute("ccheckpersoncode", datarow["ccheckpersoncode"].ToString());
                                    xeBody.setAttribute("dcheckdate", datarow["dcheckdate"].ToString());
                                    xeBody.setAttribute("brelated", datarow["brelated"].ToString());
                                    xeBody.setAttribute("cmocode", datarow["cmocode"].ToString());
                                    xeBody.setAttribute("imoseq", datarow["imoseq"].ToString());
                                    xeBody.setAttribute("isotype", datarow["isotype"].ToString());
                                    xeBody.setAttribute("iordertype", datarow["iordertype"].ToString());
                                    xeBody.setAttribute("iorderdid", datarow["iorderdid"].ToString());
                                    xeBody.setAttribute("iexpiratdatecalcu", datarow["iexpiratdatecalcu"].ToString());
                                    xeBody.setAttribute("irowno", irowno);
                                    xeBody.setAttribute("cinvouchtype", datarow["cinvouchtype"].ToString());
                                    xeBody.setAttribute("imergecheckautoid", datarow["imergecheckautoid"].ToString());
                                }
                                irowno++;
                            }
                        }
                        break;
                    #endregion

                    #region 不良品
                    case 2:
                        {
                            docHead.load(Server.MapPath("./") + @"XML\rdrecord10_blpcl.xml");
                            docBody.load(Server.MapPath("./") + @"XML\rdrecords10_blpcl.xml");


                            MSXML2.IXMLDOMNode nodeHead = docHead.selectSingleNode("//z:row");

                            dtHead.Rows[0]["ddate"] = u8Login.CurDate;
                            dtHead.Rows[0]["cmaker"] = u8Login.cUserName;
                            IXMLDOMElement xeHead = (IXMLDOMElement)nodeHead;

                            xeHead.setAttribute("cwhcode", dtHead.Rows[0]["cwhcode"].ToString());
                            xeHead.setAttribute("ddate", dtHead.Rows[0]["ddate"].ToString());
                            //  xeHead.setAttribute("ccode", dtHead.Rows[0]["ccode"].ToString());
                            //xeHead.setAttribute("crdcode", dtHead.Rows[0]["crdcode"].ToString());
                            xeHead.setAttribute("cdepcode", dtHead.Rows[0]["cdepcode"].ToString());
                            xeHead.setAttribute("cmaker", dtHead.Rows[0]["cmaker"].ToString());
                            xeHead.setAttribute("csource", "产品不良品处理单");
                            xeHead.setAttribute("cbustype", "成品入库");
                            xeHead.setAttribute("vt_id", dtHead.Rows[0]["vt_id"].ToString());
                            xeHead.setAttribute("imquantity", dtHead.Rows[0]["imquantity"].ToString());
                            xeHead.setAttribute("cmpocode", dtHead.Rows[0]["cmpocode"].ToString());
                            xeHead.setAttribute("iproorderid", dtHead.Rows[0]["iproorderid"].ToString());
                            int irowno = 1;
                            MSXML2.IXMLDOMNode nodeBody = docBody.selectSingleNode("//z:row");
                            IXMLDOMElement xeBody = (IXMLDOMElement)nodeBody;
                            foreach (DataRow datarow in dtBody.Rows)
                            {
                                if (Convert.ToDouble(datarow["ihasquantity"].ToString()) <= 0) continue;

                                if (irowno != 1)
                                {
                                    IXMLDOMNode newNode = nodeBody.cloneNode(false);
                                    IXMLDOMElement xeBody1 = (IXMLDOMElement)newNode;
                                    xeBody1.setAttribute("cinvcode", datarow["cinvcode"].ToString());
                                    xeBody1.setAttribute("cinvm_unit", datarow["cinvm_unit"].ToString());
                                    xeBody1.setAttribute("cposition", datarow["cposition"].ToString());
                                    xeBody1.setAttribute("cbatch", datarow["cbatch"].ToString());
                                    xeBody1.setAttribute("iquantity", datarow["ihasquantity"].ToString());
                                    xeBody1.setAttribute("inquantity", datarow["inquantity"].ToString());
                                    xeBody1.setAttribute("impoids", datarow["impoids"].ToString());
                                    xeBody1.setAttribute("ccheckcode", datarow["ccheckcode"].ToString());
                                    xeBody1.setAttribute("icheckidbaks", datarow["icheckidbaks"].ToString());
                                    xeBody1.setAttribute("crejectcode", datarow["crejectcode"].ToString());
                                    xeBody1.setAttribute("irejectids", datarow["irejectids"].ToString());
                                    xeBody1.setAttribute("ccheckpersoncode", datarow["ccheckpersoncode"].ToString());
                                    xeBody1.setAttribute("dcheckdate", datarow["dcheckdate"].ToString());
                                    xeBody1.setAttribute("cmocode", datarow["cmocode"].ToString());
                                    xeBody1.setAttribute("imoseq", datarow["imoseq"].ToString());
                                    xeBody1.setAttribute("isotype", datarow["isotype"].ToString());
                                    xeBody1.setAttribute("iordertype", datarow["iordertype"].ToString());
                                    xeBody1.setAttribute("iorderdid", datarow["iorderdid"].ToString());
                                    xeBody1.setAttribute("iexpiratdatecalcu", datarow["iexpiratdatecalcu"].ToString());
                                    xeBody1.setAttribute("irowno", irowno);
                                    xeBody1.setAttribute("cinvouchtype", datarow["cinvouchtype"].ToString());
                                    docBody.selectSingleNode("//rs:data").appendChild(newNode);

                                }
                                else
                                {
                                    xeBody.setAttribute("cinvcode", datarow["cinvcode"].ToString());
                                    xeBody.setAttribute("cinvm_unit", datarow["cinvm_unit"].ToString());
                                    xeBody.setAttribute("cposition", datarow["cposition"].ToString());
                                    xeBody.setAttribute("cbatch", datarow["cbatch"].ToString());
                                    xeBody.setAttribute("iquantity", datarow["ihasquantity"].ToString());
                                    xeBody.setAttribute("inquantity", datarow["inquantity"].ToString());
                                    xeBody.setAttribute("impoids", datarow["impoids"].ToString());
                                    xeBody.setAttribute("ccheckcode", datarow["ccheckcode"].ToString());
                                    xeBody.setAttribute("icheckidbaks", datarow["icheckidbaks"].ToString());
                                    xeBody.setAttribute("crejectcode", datarow["crejectcode"].ToString());
                                    xeBody.setAttribute("irejectids", datarow["irejectids"].ToString());
                                    xeBody.setAttribute("ccheckpersoncode", datarow["ccheckpersoncode"].ToString());
                                    xeBody.setAttribute("dcheckdate", datarow["dcheckdate"].ToString());
                                    xeBody.setAttribute("cmocode", datarow["cmocode"].ToString());
                                    xeBody.setAttribute("imoseq", datarow["imoseq"].ToString());
                                    xeBody.setAttribute("isotype", datarow["isotype"].ToString());
                                    xeBody.setAttribute("iordertype", datarow["iordertype"].ToString());
                                    xeBody.setAttribute("iorderdid", datarow["iorderdid"].ToString());
                                    xeBody.setAttribute("iexpiratdatecalcu", datarow["iexpiratdatecalcu"].ToString());
                                    xeBody.setAttribute("irowno", irowno);
                                    xeBody.setAttribute("cinvouchtype", datarow["cinvouchtype"].ToString());
                                }
                                irowno++;
                            }
                        }
                        break;
                    #endregion

                    default:
                        throw new Exception("无效的type类型:" + iType);
                        break;
                }


                //传入表头的MSXML2.DOMDocumentClass对象
                broker.AssignNormalValue("DomHead", docHead);

                //传入表体的MSXML2.DOMDocumentClass对象
                broker.AssignNormalValue("domBody", docBody);

                //给普通参数domPosition赋值。此参数的数据类型为System.Object,此参数按引用传递,表示货位:传空
                broker.AssignNormalValue("domPosition", null);

                //该参数errMsg为OUT型参数,由于其数据类型为System.String,为一般值类型,因此不必传入一个参数变量。在API调用返回时,可以通过GetResult("errMsg")获取其值

                //给普通参数cnnFrom赋值。此参数的数据类型为ADODB.Connection,此参数按引用传递,表示连接对象,如果由调用方控制事务,则需要设置此连接对象,否则传空
                broker.AssignNormalValue("cnnFrom", null);

                //该参数VouchId为INOUT型普通参数。此参数的数据类型为System.String,此参数按值传递。在API调用返回时,可以通过GetResult("VouchId")获取其值
                string reVouchId = "";
                broker.AssignNormalValue("VouchId", reVouchId);

                //该参数domMsg为OUT型参数,由于其数据类型为MSXML2.IXMLDOMDocument2,非一般值类型,因此必须传入一个参数变量。在API调用返回时,可以直接使用该参数
                MSXML2.IXMLDOMDocument2 domMsg = new DOMDocument();
                broker.AssignNormalValue("domMsg", domMsg);

                //给普通参数bCheck赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示是否控制可用量。
                broker.AssignNormalValue("bCheck", false);

                //给普通参数bBeforCheckStock赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示检查可用量
                broker.AssignNormalValue("bBeforCheckStock", true);

                //给普通参数bIsRedVouch赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示是否红字单据
                broker.AssignNormalValue("bIsRedVouch", false);

                //给普通参数sAddedState赋值。此参数的数据类型为System.String,此参数按值传递,表示传空字符串
                broker.AssignNormalValue("sAddedState", "");

                //给普通参数bReMote赋值。此参数的数据类型为System.Boolean,此参数按值传递,表示是否远程:转入false
                broker.AssignNormalValue("bReMote", false);

                //第六步:调用API
                if (!broker.Invoke())
                {
                    //错误处理
                    Exception apiEx = broker.GetException();
                    if (apiEx != null)
                    {
                        if (apiEx is MomSysException)
                        {
                            MomSysException sysEx = apiEx as MomSysException;
                            //Console.WriteLine("系统异常:" + sysEx.Message);
                            dr["cError"] = "系统异常:" + sysEx.Message;
                        }
                        else if (apiEx is MomBizException)
                        {
                            MomBizException bizEx = apiEx as MomBizException;
                            //Console.WriteLine("API异常:" + bizEx.Message);
                            dr["cError"] = "API异常:" + bizEx.Message;
                            //todo:异常处理
                        }
                        //异常原因
                        String exReason = broker.GetExceptionString();
                        if (exReason.Length != 0)
                        {
                            dr["cError"] = "异常原因:" + exReason;
                            //Console.WriteLine("异常原因:" + exReason);
                        }
                    }
                    //结束本次调用,释放API资源
                    broker.Release();

                    return dtRetrun;
                    //return "-1";
                }


                //第七步:获取返回结果

                //获取返回值
                //获取普通返回值。此返回值数据类型为System.Boolean,此参数按值传递,表示返回值:true:成功,false:失败
                System.Boolean result = Convert.ToBoolean(broker.GetReturnValue());

                //获取out/inout参数值

                //获取普通OUT参数errMsg。此返回值数据类型为System.String,在使用该参数之前,请判断是否为空
                System.String errMsgRet = broker.GetResult("errMsg") as System.String;

                //获取普通INOUT参数VouchId。此返回值数据类型为System.String,在使用该参数之前,请判断是否为空
                System.String VouchIdRet = broker.GetResult("VouchId") as System.String;
                //System.String cCodeRet = broker.GetResult("cCode") as System.String;

                //获取普通OUT参数domMsg。此返回值数据类型为MSXML2.IXMLDOMDocument2,在使用该参数之前,请判断是否为空
                MSXML2.IXMLDOMDocument2 domMsgRet = (MSXML2.IXMLDOMDocument2)broker.GetResult("domMsg");


                //结束本次调用,释放API资源
                broker.Release();

                if (!result)
                {
                    if (errMsgRet != null)
                    {
                        dr["cError"] = errMsgRet;
                    }
                    else
                    {
                        dr["cError"] = "库存可用量不足。";
                    }
                }

相关文章:

U8产成品入库API接口 --参照生产订单/产品检验/不良品

//第二步&#xff1a;构造环境上下文对象&#xff0c;传入login&#xff0c;并按需设置其它上下文参数 U8EnvContext envContext new U8EnvContext(); envContext.U8Login u8Login; //第三步&#xff1a;设置API地址标识(Url) …...

gdb打印的堆栈有些函数是??()是什么

当 gdb 打印的堆栈中出现 ??() 格式的函数名时&#xff0c;通常表示对应的函数名无法被解析&#xff0c;这可能是由以下几种原因导致的&#xff1a; 缺少符号表信息&#xff1a;如果程序的可执行文件没有包含符号表信息&#xff0c;或者 gdb 没有加载符号表信息&#xff0c;就…...

【Jmeter第三章】Jmeter给请求添加请求头

给请求加上请求头最常见的场景就是在请求头上添加token了&#xff0c;这里也拿添加token来举例 1、添加某个请求的请求头 1、选中HTTP请求&#xff0c;右键添加 2、添加请求头 2、添加公共的请求头信息 其实步骤和上面是一样的&#xff0c;只不过是选择&#xff1a;线程组…...

WebApi必须知道的RestFul,Swagger,OAuth2.0

什么是RestFul RestFul是一种软件架构风格&#xff0c;它是基于HTTP协议设计的。它是一种轻量级的、简单易懂、易于维护的架构风格&#xff0c;主要用于Web服务的设计。它的设计原则是面向资源&#xff0c;每个资源都有唯一的标识符&#xff0c;客户端通过HTTP协议对这些资源进…...

【网络编程】demo版UDP网络服务器实现

文章目录 一、引入二、服务端实现2.1 创建套接字socket2.2 绑定bind2.3 启动服务器2.4 IP的绑定2.5 读取数据recvfrom 三、用户端实现3.1 绑定问题3.2 发送数据sendto 四、源码 一、引入 在上一章【网络编程】socket套接字中我们讲述了TCP/UDP协议&#xff0c;这一篇就是简单实…...

C++的stack和queue

stack和queue 1.stackstack的模拟实现 2.queuequeue的模拟实现 3.容器适配器3.1. 什么是容器适配器3.2. STL标准库中stack和queue的底层结构3.3. deque的简单介绍3.3.1. deque原理介绍3.3.2. deque的缺陷3.3.3. 为什么选择deque作为stack和queue的底层默认容器 1.stack stack的…...

C++ RAII机制

C RAII机制 1. 介绍2. 示例2.1 示例一2.2 示例二 3. 使用 Reference&#xff1a; C RAII 浅析ChatGPT 相关文章&#xff1a; 3. C 并行编程(thread) 1. 介绍 RAII 的全称是 Resource Acquisition Is Initialization&#xff0c;它是一种编程技术&#xff0c;用于管理资源的…...

AI模型部署概述

心口如一&#xff0c;犹不失为光明磊落丈夫之行也。——梁启超 文章目录 :smirk:1. AI模型部署方法:blush:2. AI模型部署框架ONNXNCNNOpenVINOTensorRTMediapipe如何选择 :satisfied:3. AI模型部署平台 &#x1f60f;1. AI模型部署方法 在AI深度学习模型的训练中&#xff0c;…...

【Rust 日报】2023-05-17 pgx -- 用于在 Rust 中开发 PostgreSQL 扩展的框架

pgx -- 用于在 Rust 中开发 PostgreSQL 扩展的框架 pgx是一个用于在 Rust 中开发 PostgreSQL 扩展的框架&#xff0c;并力求尽可能地惯用和安全。pgx 支持 Postgres v10-v14。 主要特征: 带有 cargo-pgx 的完全托管的开发环境; # 快速创建新的扩展 cargo pgx new# 安装新的&…...

二十、Zipkin持久化链路跟踪

目录 Zipkin持久化 使用mysql数据库持久化 1、创建zipkin数据库 2、启动zipkin使用以下脚本 3、访问接口&#xff08;配置了sleuth链路跟踪&#xff09; 使用ElasticSearch持久化 zipkin启动脚本 Zipkin持久化 Zipkin server默认会将追踪数据信息保存在内存中&#xff0…...

大学毕业设计这样做可以吗

前言&#xff1a;相信看到这篇文章的小伙伴都或多或少有一些编程基础&#xff0c;懂得一些linux的基本命令了吧&#xff0c;本篇文章将带领大家服务器如何部署一个使用django框架开发的一个网站进行云服务器端的部署。 文章使用到的的工具 Python&#xff1a;一种编程语言&…...

NSUserDefaults

目录 1. 简介2. 基本使用2.1 步骤2.2 对应接口2.2 示例代码 3. 常用接口及属性3.1 存储3.2 获取 4. 注意点4.1 NSUserDefaults 存储的对象全是不可变的4.2 将自定义类型数据读写 NSUserDefaults4.3 非即时写入 5.参考链接 1. 简介 NSUserDefaults是一个单例&#xff0c;在整个程…...

Windows下通过cwRsync备份到服务器服务器之间使用rsync备份传输

Windows下通过cwRsync备份到服务器&服务器之间使用rsync备份传输 Linux服务器配置Rsync服务端1、安装Rsync2、配置rsyncd.conf3、创建目录、密码文件并修改权限4、启动rsync服务 Windows配置cwRsync客户端1、下载并解压cwRsync客户端2、打开cmd&#xff0c;执行同步命令 Wi…...

IS420UCSBH4A 用于高速应用中的Mark VIe系列

控制器IS420UCSBH4A由通用电气公司设计&#xff0c;用于高速应用中的Mark VIe系列&#xff0c;采用1066 MHz EP80579英特尔处理器。该控制器可与Mark VIe系列一起用于EX2100e和LS2100e应用。 IS420UCSBH4A技术规格 系列马克维处理机类型1066兆赫EP80579英特尔型号IS420UCSBH4A…...

将JSON写入文件

首先需要引入fastjson的依赖文件&#xff0c;以下是maven的依赖&#xff1a; <dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.2.73</version></dependency> 然后是将json字符串写到…...

effective c++ 35 考虑virtual函数以外的其他选择

effective c 35 考虑virtual函数以外的其他选择 在本节中&#xff0c;作者给出了一些可以替代调用virtual函数的方法。下面就一一进行介绍。 分析 1.考虑NVI的实现方式(模板方法设计模式) 父类和子类都调用healthValue同一接口&#xff0c;但是返回值不同。这是一种public非…...

Akura Medica:新型静脉血栓切除系统,完成首次人体试验

Akura Medical公司宣布&#xff0c;其机械血栓切除平台在人体首次使用成功&#xff0c;这是一项具有突破性的技术&#xff0c;可以有效地治疗肺栓塞、深静脉血栓等血栓栓塞疾病。该平台使用了一种与众不同的方法&#xff0c;可以高效地清除血管内的血栓&#xff0c;同时保护血管…...

大型央企集团财务经营分析框架系列(三)

01集团经营管理分析的切入点 集团经营管理分析的切入点往往是从财务分析开始。 往往在一家企业里面&#xff0c;财务方面的信息化建设是要早于其它方面的信息化建设的&#xff0c;业务标准化程度比较高&#xff0c;数据标准化程度也比较高&#xff0c;分析框架也相对成熟。 …...

C++并发编程:std::future、std::async、std::packaged_task与std::promise的深度探索

C并发编程&#xff1a;std::future、std::async、std::packaged_task与std::promise的深度探索 一、引言 (Introduction)1.1 并发编程的概念 (Concept of Concurrent Programming)1.2 C并发编程的重要性 (Importance of Concurrent Programming in C)1.3 关于std::future、std:…...

测牛学堂:2023软件测试学习教程之sql的单表查询排序和模糊查询

单表查询的排序 关键字&#xff1a;order by 排序的类型&#xff0c;升序字段&#xff1a;ASC &#xff0c;省略的话默认就是升序。 降序的字段&#xff1a;DESC 语法&#xff1a; order by 字段名 ASC| DESC返回的表则会按照给定的字段排序 例子&#xff1a;查询学生的考试成…...

变量 varablie 声明- Rust 变量 let mut 声明与 C/C++ 变量声明对比分析

一、变量声明设计&#xff1a;let 与 mut 的哲学解析 Rust 采用 let 声明变量并通过 mut 显式标记可变性&#xff0c;这种设计体现了语言的核心哲学。以下是深度解析&#xff1a; 1.1 设计理念剖析 安全优先原则&#xff1a;默认不可变强制开发者明确声明意图 let x 5; …...

业务系统对接大模型的基础方案:架构设计与关键步骤

业务系统对接大模型&#xff1a;架构设计与关键步骤 在当今数字化转型的浪潮中&#xff0c;大语言模型&#xff08;LLM&#xff09;已成为企业提升业务效率和创新能力的关键技术之一。将大模型集成到业务系统中&#xff0c;不仅可以优化用户体验&#xff0c;还能为业务决策提供…...

Java 语言特性(面试系列2)

一、SQL 基础 1. 复杂查询 &#xff08;1&#xff09;连接查询&#xff08;JOIN&#xff09; 内连接&#xff08;INNER JOIN&#xff09;&#xff1a;返回两表匹配的记录。 SELECT e.name, d.dept_name FROM employees e INNER JOIN departments d ON e.dept_id d.dept_id; 左…...

C++初阶-list的底层

目录 1.std::list实现的所有代码 2.list的简单介绍 2.1实现list的类 2.2_list_iterator的实现 2.2.1_list_iterator实现的原因和好处 2.2.2_list_iterator实现 2.3_list_node的实现 2.3.1. 避免递归的模板依赖 2.3.2. 内存布局一致性 2.3.3. 类型安全的替代方案 2.3.…...

Go 语言接口详解

Go 语言接口详解 核心概念 接口定义 在 Go 语言中&#xff0c;接口是一种抽象类型&#xff0c;它定义了一组方法的集合&#xff1a; // 定义接口 type Shape interface {Area() float64Perimeter() float64 } 接口实现 Go 接口的实现是隐式的&#xff1a; // 矩形结构体…...

React Native在HarmonyOS 5.0阅读类应用开发中的实践

一、技术选型背景 随着HarmonyOS 5.0对Web兼容层的增强&#xff0c;React Native作为跨平台框架可通过重新编译ArkTS组件实现85%以上的代码复用率。阅读类应用具有UI复杂度低、数据流清晰的特点。 二、核心实现方案 1. 环境配置 &#xff08;1&#xff09;使用React Native…...

cf2117E

原题链接&#xff1a;https://codeforces.com/contest/2117/problem/E 题目背景&#xff1a; 给定两个数组a,b&#xff0c;可以执行多次以下操作&#xff1a;选择 i (1 < i < n - 1)&#xff0c;并设置 或&#xff0c;也可以在执行上述操作前执行一次删除任意 和 。求…...

【算法训练营Day07】字符串part1

文章目录 反转字符串反转字符串II替换数字 反转字符串 题目链接&#xff1a;344. 反转字符串 双指针法&#xff0c;两个指针的元素直接调转即可 class Solution {public void reverseString(char[] s) {int head 0;int end s.length - 1;while(head < end) {char temp …...

如何将联系人从 iPhone 转移到 Android

从 iPhone 换到 Android 手机时&#xff0c;你可能需要保留重要的数据&#xff0c;例如通讯录。好在&#xff0c;将通讯录从 iPhone 转移到 Android 手机非常简单&#xff0c;你可以从本文中学习 6 种可靠的方法&#xff0c;确保随时保持连接&#xff0c;不错过任何信息。 第 1…...

OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别

OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别 直接训练提示词嵌入向量的核心区别 您提到的代码: prompt_embedding = initial_embedding.clone().requires_grad_(True) optimizer = torch.optim.Adam([prompt_embedding...