当前位置: 首页 > 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;查询学生的考试成…...

进程地址空间(比特课总结)

一、进程地址空间 1. 环境变量 1 &#xff09;⽤户级环境变量与系统级环境变量 全局属性&#xff1a;环境变量具有全局属性&#xff0c;会被⼦进程继承。例如当bash启动⼦进程时&#xff0c;环 境变量会⾃动传递给⼦进程。 本地变量限制&#xff1a;本地变量只在当前进程(ba…...

rknn优化教程(二)

文章目录 1. 前述2. 三方库的封装2.1 xrepo中的库2.2 xrepo之外的库2.2.1 opencv2.2.2 rknnrt2.2.3 spdlog 3. rknn_engine库 1. 前述 OK&#xff0c;开始写第二篇的内容了。这篇博客主要能写一下&#xff1a; 如何给一些三方库按照xmake方式进行封装&#xff0c;供调用如何按…...

Appium+python自动化(十六)- ADB命令

简介 Android 调试桥(adb)是多种用途的工具&#xff0c;该工具可以帮助你你管理设备或模拟器 的状态。 adb ( Android Debug Bridge)是一个通用命令行工具&#xff0c;其允许您与模拟器实例或连接的 Android 设备进行通信。它可为各种设备操作提供便利&#xff0c;如安装和调试…...

React第五十七节 Router中RouterProvider使用详解及注意事项

前言 在 React Router v6.4 中&#xff0c;RouterProvider 是一个核心组件&#xff0c;用于提供基于数据路由&#xff08;data routers&#xff09;的新型路由方案。 它替代了传统的 <BrowserRouter>&#xff0c;支持更强大的数据加载和操作功能&#xff08;如 loader 和…...

CMake基础:构建流程详解

目录 1.CMake构建过程的基本流程 2.CMake构建的具体步骤 2.1.创建构建目录 2.2.使用 CMake 生成构建文件 2.3.编译和构建 2.4.清理构建文件 2.5.重新配置和构建 3.跨平台构建示例 4.工具链与交叉编译 5.CMake构建后的项目结构解析 5.1.CMake构建后的目录结构 5.2.构…...

【HTML-16】深入理解HTML中的块元素与行内元素

HTML元素根据其显示特性可以分为两大类&#xff1a;块元素(Block-level Elements)和行内元素(Inline Elements)。理解这两者的区别对于构建良好的网页布局至关重要。本文将全面解析这两种元素的特性、区别以及实际应用场景。 1. 块元素(Block-level Elements) 1.1 基本特性 …...

laravel8+vue3.0+element-plus搭建方法

创建 laravel8 项目 composer create-project --prefer-dist laravel/laravel laravel8 8.* 安装 laravel/ui composer require laravel/ui 修改 package.json 文件 "devDependencies": {"vue/compiler-sfc": "^3.0.7","axios": …...

如何在网页里填写 PDF 表格?

有时候&#xff0c;你可能希望用户能在你的网站上填写 PDF 表单。然而&#xff0c;这件事并不简单&#xff0c;因为 PDF 并不是一种原生的网页格式。虽然浏览器可以显示 PDF 文件&#xff0c;但原生并不支持编辑或填写它们。更糟的是&#xff0c;如果你想收集表单数据&#xff…...

Angular微前端架构:Module Federation + ngx-build-plus (Webpack)

以下是一个完整的 Angular 微前端示例&#xff0c;其中使用的是 Module Federation 和 npx-build-plus 实现了主应用&#xff08;Shell&#xff09;与子应用&#xff08;Remote&#xff09;的集成。 &#x1f6e0;️ 项目结构 angular-mf/ ├── shell-app/ # 主应用&…...

【分享】推荐一些办公小工具

1、PDF 在线转换 https://smallpdf.com/cn/pdf-tools 推荐理由&#xff1a;大部分的转换软件需要收费&#xff0c;要么功能不齐全&#xff0c;而开会员又用不了几次浪费钱&#xff0c;借用别人的又不安全。 这个网站它不需要登录或下载安装。而且提供的免费功能就能满足日常…...