js加签一般都没有问题,我就是加签之后上传的问题弄了两个礼拜,最后弄清楚了。
以下是数据上报海关方法,我用的是.net的web方式:1.添加三个引用,见dll文件夹。
2.加载我写的类:两个cs文件(放到web目录下)3.组织上报数据实体格式如下publicclasspayExchangeInfoLists{publicstringorderNo{get;set;}//String订单编号publicListgoodsInfo{get;set;}//List商品信息publicstringrecpAccount{get;set;}//String收款账号publicstringrecpCode{get;set;}//String收款企业代码publicstringrecpName{get;set;}//String收款企业名称}publicclassgoodsInfo{publicstringgname{get;set;}//String商品名称publicstringitemLink{get;set;}//String商品展示链接地址}publicclasspayExchangeInfoHead{publicstringguid{get;set;}//String系统唯一序号publicstringinitalRequest{get;set;}//String原始请求publicstringinitalResponse{get;set;}//String原始响应publicstringebpCode{get;set;}//String电商平台代码publicstringpayCode{get;set;}//String支付企业代码publicstringpayTransactionId{get;set;}//String交易流水号publicdoubletotalAmount{get;set;}//double交易金额publicstringcurrency{get;set;}//String币制publicstringverDept{get;set;}//String验核机构publicstringpayType{get;set;}//String支付类型publicstringtradingTime{get;set;}//String交易成功时间publicstringnote{get;set;}//String备注}publicclasspayExInfoStr{publicstringsessionID{get;set;}//stringYIn海关发起请求时,平台接收的会话ID。
publicpayExchangeInfoHeadpayExchangeInfoHead{get;set;}//StringYIn支付原始数据表头publicListpayExchangeInfoLists{get;set;}//ListYIn支付原始数据表体publicstringserviceTime{get;set;}//LongYIn返回时的系统时间publicstringcertNo{get;set;
2025/1/22 6:08:02 74KB 179海关上
1
录入=newJButton("录入");查询=newJButton("查询");删除=newJButton("删除");修改=newJButton("修改");显示=newJButton("显示");录入.addActionListener(newInputAct());查询.addActionListener(newInquestAct());修改.addActionListener(newModifyAct());删除.addActionListener(newDeleteAct());显示.addActionListener(newShowAct());修改.setEnabled(false);p1=newJPanel();p1.add(newJLabel("学号:",JLabel.CENTER));p1.add(学号);p2=newJPanel();p2.add(newJLabel("姓名:",JLabel.CENTER));p2.add(姓名);p3=newJPanel();p3.add(newJLabel("性别:",JLabel.CENTER));p3.add(男);p3.add(女);p4=newJPanel();p4.add(newJLabel("专业:",JLabel.CENTER));p4.add(专业);p5=newJPanel();p5.add(newJLabel("年级:",JLabel.CENTER));p5.add(年级);p6=newJPanel();p6.add(newJLabel("出生:",JLabel.CENTER));p6.add(出生);pv=newJPanel();pv.setLayout(newGridLayout(6,1));pv.add(p1);pv.add(p2);pv.add(p3);pv.add(p4);pv.add(p5);pv.add(p6);ph=newJPanel();ph.add(录入);ph.add(查询);ph.add(修改);ph.add(删除);ph.add(显示);file=newFile("学生信息.txt");学生散列表=newHashtable();if(!file.exists()){try{FileOutputStreamout=newFileOutputStream(file);ObjectOutputStreamobjectOut=newObjectOutputStream(out);objectOut.writeObject(学生散列表);objectOut.close();out.close();}catch(IOExceptione){}}Containercon=getContentPane();con.setLayout(newBorderLayout());con.add(lb,BorderLayout.WEST);con.add(pv,BorderLayout.CENTER);con.add(ph,BorderLayout.SOUTH);setDefaultCloseOperation(EXIT_ON_CLOSE);setBounds(100,100,600,300);setVisible(true);Statementstmt; ResultSetrs;}publicstaticvoidmain(String[]args){StudentManagerff=newStudentManag
1
根据调用系统广播实现,先保存到本地文件管理中,完美运行,可以根据后台返回的String类型图片地址来保存给个好评噢~
2025/1/14 4:14:24 10.29MB studio 保存图片 网络地址保存
1
C#开发webservice接口,对客户端post服务的Json数据进行接收反馈接收到的数据流转换成string类型,有其他需求对json解析,自己写个解析去查询下.然后反馈json发送给请求端。
2025/1/7 7:35:28 3KB post json http webservice
1
oil这是用于使用现代Web工具构建基于Spring的整体应用程序的入门模板。
入门测试将使用测试容器启动其自己的独立容器。
发展我建议安装。
请注意,在github页面上有该插件的安装后说明。
您可以键入var并按Crtl+Space使其自动完成文件顶部的类型提示,例如:{#@pebvariablename="email"type="java.lang.String"#}这使插件知道对电子邮件的任何引用都应使用intellij自动完成功能来处理字符串。
迈向伟大的开发流程的另一步是将pebble文件的基本语言标记为HTML。
您可以通过以下方式做到这一点:打开设置Ctrl+Alt+S导航到Languages&Frameworks打开TemplateDataLanguages添加src/main/resources/templa
2025/1/1 22:31:33 9.38MB Kotlin
1
实验内容:从键盘输入一行字符,以‘$’结束,查找输入的字符串是否包含‘computer’字符串,如果包含,计算包含’computer’字符串的个数,并以十进制输出个数。
原理:输入一个字符串到定义好的空间string中,以’$’结束,同时获得字符的个数;
将computer单词放在keyword里,以computer的个数作为内循环的次数(8次),循环比较,相同则计数器加1,否则不加,string的指针后移一位,keyword指针清零,继续比较,直到遇到规定的符号,结束操作。
2024/12/25 9:46:31 9KB 汇编语言
1
Excel源代码,导入导出各种工具类org.apache.poipoiorg.apache.poipoi-scratchpad代码实例:Stringpath="";byte[]bytes;vo.setCurrentPage(0);vo.setPageSize(Integer.MAX_VALUE);Listlist=stockOrderController.exportShOutOrderDetail(vo);Mapempinfo=newTreeMap();intindex=1;empinfo.put(index++,newObject[]{"销售单号","销售时间","会员","商品总额","来源","商品名称/属性","数量","单价"});for(ShOutOrderDetailitem:list){empinfo.put(index++,newObject[]{item.getOutOrderNo(),DateUtil.SDF.format(item.getOutTime()),item.getNickName()+"/"+item.getMobile(),String.valueOf(item.getStockPrice().multiply(newBigDecimal(item.getStockAmount()))),"01".equals(item.getSalesSource())?"线上订单":"线下订单",item.getGoodsNameAttrs(),String.valueOf(item.getStockAmount()),String.valueOf(item.getStockPrice())});}try{bytes=ExcelUtils.simpleExcel(empinfo,"销售单信息");MultipartFilemultipartFile=newMultipartFile();multipartFile.setData(bytes);multipartFile.setOriginalFilename("ShOutOrderDetailExport.xls");path=fastDFSClientController.uploadFile(multipartFile);}catch(Exceptione){logger.error("出库单信息导出失败:{}",e.getMessage(),e);return"fail";}logger.info("出库单信息导出结束,path:{}",path);returnpath;
2024/12/12 19:46:39 6KB Java 下拉框 Excel导入 Excel导出
1
实现本地电脑监控服务器端电脑监控功能publicclassClient{ //入口 publicstaticvoidmain(String[]args){ try{ intchoice=JOptionPane.showConfirmDialog(null,"请求控制对方电脑","远程控制系统-Charles",JOptionPane.YES_NO_OPTION); if(choice==JOptionPane.NO_OPTION){ return; } Stringinput=JOptionPane.showInputDialog("请输入要连接电脑的ip(包括端口号)","127.0.0.1:10000"); //获取服务器的主机 Stringhost=input.substring(0,input.indexOf(":")); //获取服务器的端口号 Stringpost=input.substring(input.indexOf(":")+1); System.out.println("服务器的主机:"+host+""+"端口号:"+post); Socketclient=newSocket(host,Integer.parseInt(post)); DataInputStreamdis=newDataInputStream(client.getInputStream()); JFramejframe=newJFrame("本地监控系统-Charles"); jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//默认关闭进程 jframe.setSize(1024,768);//设置窗体大小 doubleheight=dis.readDouble(); doublewidth=dis.readDouble(); Dimensionds=newDimension((int)width,(int)height); //设置 jframe.setSize(ds); //将服务器图片作为背景 JLabelbackImage=newJLabel(); JPanelpanel=newJPanel(); //设置滚动条 JScrollPanescrollPane=newJScrollPane(panel); panel.setLayout(newFlowLayout()); panel.add(backImage); jframe.add(scrollPane); jframe.setAlwaysOnTop(true); jframe.setVisible(true); while(true){ intlen=dis.readInt(); byte[]imageData=newbyte[len]; dis.readFully(imageData); ImageIconimage=newImageIcon(imageData); backImage.setIcon(image); jframe.repaint(); } }catch(Exceptione){ e.printStackTrace(); } }}
2024/12/9 15:25:48 13KB java 远程监控
1
对即将找工作的大学生,研究生都爱刷leetcode的题目,但是刚刚接受无法适从,或是一时半会儿想不到解法,没关系,leetcode题解PDF可一带你慢慢了解思路过程。
目录3.4Addbinary615.1.5BinaryTreeLevelOr-3.5LongestPalindromicSubstring.62dertraversalil3.6RegularExpressionMatching665.1.6BinaryTreeZigzag3.7WildcardMatching67LevelOrdertraversal.963.8LongestCommonPrefix5.1.7RecoverBinarySearch3.9ValidNumber70Tree983.10Integertoroman725.1.8SameTree3.11RomantoInteger5.1.9SymmetricTree1013.12CountandSay745.1.10BalancedBinaryTree..1023.13Anagrams755.1.11FlattenBinaryTreeto3.14SimplifyPath76LinkedList1033.15LengthofLastWord775.1.12PopulatingNextRightPointersineachnodeii105第4章栈和队列7952二叉树的构建1074.1栈795.2.1ConstructBinaryTree4ValidParentheses79fromPreorderandIn4.1.2LongestvalidParenorderTraversatheses805.2.2ConstructBinaryTree4.1.3LargestRectangleinfromInorderandposHistogram82torderTraversal1084.14Evaluatereversepol-53二叉查找树109ishnotation845.3.1UniqueBinarySearch4,2队列85Trees5.3.2UniqueBinarySearch第5章树86Treesli.1105.1二叉树的遍历865.3.3ValidateBinarySearch5.1.1BinaryTreePreorderTreeTraversal865.3.4ConvertSortedarrayto5.1.2BinaryTreeInorderBinarySearchTreel12Traversal885.3.5ConvertSortedListto5.1.3BinaryTreePostorderBinarysearchtree113Traversal9054二叉树的递归1155.1.4BinaryTreeLevelOr5.4.1MinimumDepthofBidertraversalnarylree115目录5.4.2MaximumDepthofBi8.32重新实现nextpermunaryTree116tation1425.4.3PathSum117833递归.1435.44PathSumil1188.4PermutationsII1445.4.5BinaryTreeMaximum8.4.1nextpermutation...144PathSuum119842重新实现nextpermu5.4.6PopulatingNextRighttation144Pointersineachnode12084.3递归1445.4.7SumRoottoLeafNum8.5Combinations146bers122851递归146852迭代147第6章排序1238.6LetterCombinationsofaphone6.1MergeSortedArray123umber1476.2MergeTwoSortedLists12486.1递归1486.3MergekSortedLists124862迭代96.4InsertionSortList125第9章广度优先搜索1506.5Sortlist1269.1WordLadder1506.6FirstMissingPositive1279.2WordLadderil..1526.7SortColors289.3Surroundedregions154第7章查找94小结15613194.1适用场景1567.1Searchforarange131942思考的步骤.1567.2SearchInsertPosition.13294.3代码模板1577.3Searcha2DMatrix133第10章深度优先搜索162第8章暴力枚举法13510.1PalindromePartitioning..1628.1Subsets13510.2UniquePaths1658.1.1递归1350.2.1深搜1658.1.2迭代.13710.22备忘录法.1658.2Subsetsil13810.23动规166821递归1381024数学公式167822迭代.14110.3UniquePathsIl1688.3Permutations14210.3.1备忘录法1688.3.1nextpermutation14210.3.2动规.169目录10.4N-Queens16913.4Maximalrectangle19910.5N-QueensII17213.5BestTimetoBuyandSellStock10.6Restoreipaddresses17320010.7CombinationSum17413.6InterleavingString20110.8CombinationSumIl17513.7ScrambleString20310.9GenerateParentheses.17713.8MinimumPathSum20810.10Sudokusolver17813.9EditDistance21010.11WordSearch.18013.10DecodeWays.21210.12小结18113.11DistinctSubsequences21310.12.1适用场景1813.12WordBreak21410.122思考的步骤1811313WordBreakil21610.12.3代码模板183第14章图21810.12.4深拽与回溯法的区别.18414.1CloneGraph10.12.5深搜与递归的区别..184第15章细节实现题221第11章分治法18515.1ReverseInteger2211.1Pow(x,n)18515.2PalindromeNumber222qrt(x18615.3InsertInterval223第12章贪心法18715.4MergeIntervals22412.1Jumpgame18715.5MinimumWindowSubstring..22512.2JumpgameIl18815.6MultiplyStrings22712.3BestTimetobuyandsellstock19015.7SubstringwithConcatenation12.4BestTimetobuyandsellstock191ofallwords23012.5LongestSubstringWithoutre15.8Pascal,sTrianglepeatingCharacters19215.9PascalsTriangleIl23212.6ContainerwithmostWater.19315.10Spiralmatrix23315.11SpiralmatrixII234第13章动态规划19515.12ZigZagConversion23613.1Triangle19515.13DivideTwoIntegers23713.2MaximumSubarray19615.14TextJustification23813.3PalindromePartitioningII19815.15MaxPointsonaline目录第1章编程技巧在判断两个浮点数a和b是否相等时,不要用a=-b,应该判断二者之差的绝对值fabs(a-b)是否小于某个阈值,例如1e-9。
判断一个整数是否是为奇数,用x%2!=0,不要用x%2==1,因为x可能是负数用char的值作为数组下标(例如,统计字符串中每个字符出现的次数),要考虑到char可能是负数。
有的人考虑到了,先强制转型为unsignedint再用作下标,这仍然是错的。
正确的做法是,先强制转型为unsignedchar,再用作下标。
这涉及C++整型提升的规则,就不详述了。
以下是关于STL使用技巧的,很多条款来自《EffectiⅤveStL》这本书。
vector和string优先于动态分配的数组首先,在性能上,由于vector能够保证连续内存,因此一旦分配了后,它的性能跟原始数组相当其次,如果用new,意味着你要确保后面进行了delete,一旦忘记了,就会岀现BUG,且这样需要都写一行delete,代码不够短再次,声明多维数组的话,只能一个一个new,例如:int**ary=newint*[row_num];for(inti=0:i<rownum;++1)ary[i]newint[col_num]用vector的话一行代码搞定,vector<vector<int>>ary(row_num,vector<int>(col_num,0))使用reserve来避免不必要的重新分配第2章线性表这类题目考察线性表的操作,例如,数组,单链表,双向链表等。
21数组2.1.1RemoveDuplicatesfromSortedarray描述Givenasortedarray,removetheduplicatesinplacesuchthateachelementappearonlyonceandreturnthenewlengthDonotallocateextraspaceforanotherarray,youmustdothisinplacewithconstantmemoryForexample,GiveninputarrayA=[1,1,2Yourfunctionshouldreturnlength=2,andaisnow[1,2]分析无代码1/LeetCode,RemoveDuplicatesfromSortedArray/时间复杂度0(n),空间复杂度0(1)classSolutiontublicintremoveDuplicates(intA[],intn)tlf(n==oreturnointindex=0:for(inti=1:i<n:i++iif(Alindex!alidA[++index]=Alireturnindex12.1数组代码2//LeetCode,RemoveDuplicatesfromSortedArray//使用STL,时间复杂度0(n),空间复杂度0(1)classSolutionipublicintremoveDuplicates(intA[,intn)treturndistance(A,unique(A,An))代码3/LeetCode,RemoveDuplicatesfromSortedArray/使用STL,时间复杂度0(n),空间复杂度0(1)lassSolutionfublicintremoveDuplicates(intA[],intn)treturnremoveDuplicates(A,A+n,A)-A;template<typenameInIt,typenameoutit>OutItremoveDuplicates(InItfirst,InItlast,OutItoutput)thile(firstlast)i*output++=*firstfirstupper_bound(first,last,*firstreturnoutput相关题目RemoveduplicatesfromSortedArrayIl,见§2.1.22.1.2RemoveDuplicatesfromSortedArrayII描述Followupfor"RemoveDuplicates"Whatifduplicatesareallowedatmosttwice?Forexample,Givensortedarraya=[1,1,1,2,2,3]Yourfunctionshouldreturnlength=5,andAisnow[1,1,2,2,3分析加一个变量记录一下元素出现的次数即可。
这题因为是已经排序的数组,所以一个变量即可解决。
如果是没有排序的数组,则需要引入一个hashmap来记录出现次数4第2章线性表代码1//LeetCode,RemoveDuplicatesfromSortedArrayII/时间复杂度0(n),空间复杂度0(1)//qauthorhex108(https://github.com/hex108)classSolutiontublicintremoveDuplicates(intA[],intn)tlf(n<=2returnnintindex=2for(inti=2:in:1++)if(all]!Alindex-2])ALindex++]=Ali]returnindex;代码2下面是一个更简洁的版本。
上面的代码略长,不过扩展性好一些,例如将occur<2改为ocur<3,就变成了允许重复最多3次。
//LeetCode,RemoveDuplicatesfromSortedArrayII//@author虞航仲(http://weibo.com/u/1666779725)//时间复杂度0(n),空间复杂度0(1)classSolutionipublicintremoveDuplicates(intA[],intn)tmtindex=ofor(intif(i>0&&i<1&&A[i]==A[i-1]&&A[i]==A[i+1])continueAlindex++]=Alireturnindex;相关题目RemoveDuplicatesfromSortedArray,见§2.1.12.1.3SearchinRotatedSortedArray描述Supposeasortedarrayisrotatedatsomepivotunknowntoyoubeforehand
2024/12/7 0:08:16 1.03MB leetcode题解
1
加密算法在信息技术领域中起着至关重要的作用,用于保护数据的安全性和隐私性。
SHA(SecureHashAlgorithm)是一种广泛使用的散列函数,它将任意长度的数据转换为固定长度的摘要值。
SHA512是SHA家族中的一员,提供更强大的安全性能,尤其适合大数据量的处理。
本文将深入探讨SHA512加密算法的原理、C++实现以及其在实际应用中的重要性。
SHA512算法基于密码学中的消息摘要思想,通过一系列复杂的数学运算(如位操作、异或、循环左移等),将输入数据转化为一个512位的二进制数字,通常以16进制形式表示,即64个字符。
这个过程是不可逆的,意味着无法从摘要值推导出原始数据,因此被广泛应用于数据完整性验证和密码存储。
在C++中实现SHA512算法,首先需要理解其基本步骤:1.**初始化**:设置一组初始哈希值(也称为中间结果)。
2.**预处理**:在输入数据前添加特殊位和填充,确保数据长度是512位的倍数。
3.**主循环**:将处理后的数据分成512位块,对每个块进行多次迭代计算,每次迭代包括四个步骤:扩展、混合、压缩和更新中间结果。
4.**结束**:将最后一个中间结果转换为16进制字符串,即为SHA512的摘要值。
C++代码实现时,可以使用位操作、数组和循环来完成这些计算。
为了简化,可以使用`#include`中的`uint64_t`类型表示64位整数,因为SHA512处理的是64位的数据块。
同时,可以利用`#include`中的`memcpy`和`memset`函数来处理内存操作。
此外,`#include`和`#include`库可用于将二进制数据转换成16进制字符串。
以下是一个简化的C++SHA512实现框架:```cpp#include#include#include#include#include//定义常量和初始化哈希值conststd::arraykInitialHashValues{...};std::arrayhashes=kInitialHashValues;//主循环函数voidProcessBlock(constuint8_t*data){//扩展、混合、压缩和更新中间结果}//输入数据的处理voidPreprocess(conststd::string&input){//添加填充和特殊位}//将摘要转换为16进制字符串std::stringDigestToHex(){//转换并返回16进制字符串}//使用示例std::stringmessage="Hello,World!";Preprocess(message);constuint8_t*data=reinterpret_cast(message.c_str());size_tdataSize=message.size();while(dataSize>0){if(dataSize>=128){ProcessBlock(data);dataSize-=128;data+=128;}else{//处理剩余数据}}std::stringresult=DigestToHex();```这个框架只是一个起点,实际的SHA512实现需要填充完整的扩展、混合和压缩步骤,以及处理边界条件。
此外,为了提高效率,可能还需要使用SIMD(SingleInstructionMultipleData)指令集或其他优化技术。
SHA512算法在多种场景下具有广泛的应用,如:-**文件校验**:通过计算文件的SHA512摘要,可以验证文件在传输或存储过程中是否被篡改。
-**密码存储**:在存储用户密码时,不应直接保存明文,而是保存SHA512加密后的哈希值。
当用户输入密码时,同样计算其SHA512值并与存储的哈希值比较,不匹配则表明密码错误。
-**数字签名**:在公钥加密体系中,SHA512可以与非对称加密算法结合,生成数字签名,确保数据的完整性和发送者的身份验证。
了解并掌握SHA512加密算法及其C++实现,对于信息安全专业人员来说至关重要,它不仅有助于提升系统的安全性,也有助于应对不断发展的网络安全威胁。
通过深入学习和实践,我们可以更好地理解和利用这一强大的工具。
2024/11/12 20:26:46 2.14MB 加密算法
1
共 134 条记录 首页 上一页 下一页 尾页
在日常工作中,钉钉打卡成了我生活中不可或缺的一部分。然而,有时候这个看似简单的任务却给我带来了不少烦恼。 每天早晚,我总是得牢记打开钉钉应用,点击"工作台",再找到"考勤打卡"进行签到。有时候因为工作忙碌,会忘记打卡,导致考勤异常,影响当月的工作评价。而且,由于我使用的是苹果手机,有时候系统更新后,钉钉的某些功能会出现异常,使得打卡变得更加麻烦。 另外,我的家人使用的是安卓手机,他们也经常抱怨钉钉打卡的繁琐。尤其是对于那些不太熟悉手机操作的长辈来说,每次打卡都是一次挑战。他们总是担心自己会操作失误,导致打卡失败。 为了解决这些烦恼,我开始思考是否可以通过编写一个全自动化脚本来实现钉钉打卡。经过一段时间的摸索和学习,我终于成功编写出了一个适用于苹果和安卓系统的钉钉打卡脚本。
2024-04-09 15:03 15KB 钉钉 钉钉打卡