泛微Ecology9集成接口开发案例及代码详解

ops/2024/10/20 3:33:29/

引言

在数字化转型的浪潮中,企业对于系统集成的需求日益增长。泛微Ecology9作为一款领先的协同办公软件,其强大的接口开发能力为企业信息系统的整合提供了有力支持。本文将详细介绍Ecology9的集成接口开发方法及最佳实践,帮助开发者快速上手。

1. 理解Ecology9接口

 接口类型

  • RESTful API:提供简洁的HTTP接口,支持多种数据格式(如JSON、XML)。
  • SOAP API:基于XML的协议,适用于复杂的操作和较高的安全要求。

2. 接口开发案例

2.1 后台常见接口开发-自定义节点Action

节点前:流程流转到这个节点之前触发

节点后:流程流转到这个节点之后触发

出口线 : 流程走此分支时触发

使用场景:

更改 OA 流程表单数据
流程表单数据校验
获取其他系统数据
写入数据到其他系统(webservice,dml,rfc,http
触发短信、邮件、通知等

2.2 后台常见接口开发-Action传参

action 里面需要用到的动态参数,如:第三方系统的接口地址或密码
是否是数据源 : 如果是 , 需要通过 Datasource对象去取值, 否则通过 String 变量去取值。
注意 : 对应的 url ,username ds 需要提供 get,set 方法

2.3 后台常见接口开发-操作组--外部接口

使用场景:流程节点操作组不固定

package com.zzl;
import java.util.ArrayList;
import java.util.List;
import weaver.interfaces.workflow.action.OperatorAction;
import weaver.soa.workflow.request.RequestInfo;
public class WFOperator implements OperatorAction{
@Override
public List<String> execute(RequestInfo arg0) {
System.out.println("执行了----start");
List<String> list=new ArrayList<String>();
list.add("3");
list.add("4");
list.add("5");
list.add("6");
return list;
}
}

2.4 后台常见接口开发-消息提醒

使用场景:需要触发流程提醒的地方

2.5 后台常见接口开发-字段属性

使用场景:

流程界面一加载完就执行
动态计算流程表单上的某个值
需求:统计申请人当前月的月报销总额(并且流程已经归档的数据)
doFieldSQL(" select SUM(bxje) bxje from formtable_main_2  a left join 
workflow_requestbase b on a.requestid=b.requestid
where   1=1
and DATEPART(m,sqrq)=DateName(month,GetDate())
and DATEPART(yyyy,sqrq)=DateName(year,GetDate()) 
and b.currentnodetype=3
and sqr= $currentuser$  ")

2.6 后台常见接口开发-流程提醒

SysRemindWorkflow sys=new SysRemindWorkflow();
String hrmid="1";
String remindCont="测试";
try {
sys.setSysRemindInfo("TEST", 0, 0, 0, 0, 1, hrmid, remindCont);
} catch (Exception e) {
e.printStackTrace();
}

2.7 后台常见接口开发-定时job

使用场景:

定时触发提醒 ( 邮件、短信、微信 )
定时同步数据(组织架构、基础数据)
定时清理日志、垃圾数据和文件等
定时创建 OA 审批流程

注意:1、计划任务配置好之后,需要重启OA服务

           2、如果是集群环境,计划任务默认在主服务器执行

2.8 后台常见接口开发-代码触发OA流程

使用场景:

ERP 的订单数据推送到 OA 进行审批
触发 OA 流程通知

2.9 后台常见接口开发-发布webservice接口

使用场景:跨平台调用OA系统的接口。进行数据交互

开发步骤:

1、定义接口

2、定义实现

3、修改配置

(ecology/classbean/META-INF/xfire/services.xml)

4、重启测试

(http://oa访问地址:端口/services)

2.10 后台常见接口开发-中控考勤集成

使用场景:考勤数据同步OA系统

1Access数据库或Sqlserver数据库

2E9不支持Access数据库同步,支持Sqlserver数据库

3sqlserver初始化中控的表,中控考勤机客户端软件配置连接推送数据到sqlserver中即可

4、中控客户端软件,可以配置定时作业,每天下载一次打卡数据到sqlserver

解决方案:1、中控系统Access数据迁移为Sqlserver,并在Sqlserver中提供考勤视图数据给OA

          2、需要维护好考勤表和OA用户的一一对应关系,必须存在关系列

视图脚本:

select a.USERID,name,
CONVERT(varchar(100), CHECKTIME, 23) riqi,
CONVERT(varchar(100), CHECKTIME, 24) sijian,
CHECKTYPE from USERINFO a
Right join CHECKINOUT b
on a.USERID=b.USERID

2.11 后台常见接口开发-考勤同步测试脚本

create table kaoQinView(loginId varchar(50),riqi varchar(50),sijian varchar(50)
)
select * from kaoQinViewinsert kaoQinView values
('zhao.liang','2024-08-21','09:00:33')

2.12 后台常见接口开发-微信提醒

package hj.typography;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import weaver.general.Util;
import com.weaver.formmodel.mobile.pushmsg.PushManager;
import com.weaver.formmodel.mobile.pushmsg.bean.MessageBean;
import com.weaver.formmodel.mobile.pushmsg.service.WechatPushServiceImpl;
import com.weaver.formmodel.util.StringHelper;
public class WeChatMsgPush {public static Map sendWxMsg(String receivers, String msgurl, String wechatpushkey,String content){Map msgmap = new HashMap();try {String emobileMsgType = "";if(StringHelper.isEmpty(receivers)) throw new Exception("消息接收人不能为空");if(StringHelper.isEmpty(content)) throw new Exception("推送内容不能为空");if(StringHelper.isEmpty(wechatpushkey)) throw new Exception("云桥消息模板id不能为空");String[] receiverList = receivers.split(",");List<Integer> userList = new ArrayList<Integer>();for(String r : receiverList){int userid = Util.getIntValue(r);if(userid != -1 && !userList.contains(userid)) userList.add(userid);}PushManager pushManager = new PushManager();MessageBean bean = new MessageBean();bean.setUserList(userList);bean.setContent(content);bean.setUrl(msgurl);bean.setEmobileMsgType(emobileMsgType);bean.setWechatMessageTemplateKey(wechatpushkey);pushManager.setMessage(bean);			pushManager.addPush(new WechatPushServiceImpl());			pushManager.pushMsg();msgmap.put("msgcode", "0");msgmap.put("msginfo", "");return msgmap;}catch(Exception ep){msgmap.put("msgcode", "-1");msgmap.put("msginfo", ep.getMessage());return msgmap;}}	
}

2.13 后台常见接口开发-Excel导入

使用场景:

1、数据批量导入更新OA数据库

2、历史合同、历史数据、历史考勤

package com.huijie.test;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import weaver.file.FileUploadToPath;
public class TeYouExcel {private HSSFSheet sheet;public void parseExcel(FileUploadToPath fu){String fileName = fu.uploadFiles("excelfile");System.out.println("附件服务器目录地址="+fileName);// 重复性验证字段try {HSSFWorkbook workbook = new HSSFWorkbook(new POIFSFileSystem(new FileInputStream(fileName)));this.sheet = workbook.getSheetAt(0);} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();System.out.println("上传文件不是excel文件");}catch (IndexOutOfBoundsException e) {e.printStackTrace();System.out.println("请确认第2个sheet是人员导入模板");}System.out.println("成功了");readExcel();}/*** 读取excel数据* * @return*/public void readExcel() {HSSFRow row;//行对象HSSFCell cell;//列对象int rowNum = 0; // 行号int cellNum = 0; // 列号int firstRow = 0;int lastRow = sheet.getLastRowNum();String cellValue;for (int i = firstRow; i <= lastRow; i++) {//循环所有行row = sheet.getRow(i);rowNum = row.getRowNum();for (int cellIndex = 0;cellIndex < row.getLastCellNum(); cellIndex++) {//循环所有列cell = row.getCell((short) cellIndex);cellNum =cellIndex;if(cell==null){continue;}cellValue =getCellValue(cell).trim(); System.out.println("cellValue=="+cellValue);}}}/*** 获取excel单元格值* @param cell   要读取的单元格对象* @return*/public String getCellValue(HSSFCell cell){String cellValue="";if(cell==null)return "";switch(cell.getCellType()){   case HSSFCell.CELL_TYPE_BOOLEAN:                                  //得到Boolean对象的方法   cellValue=String.valueOf(cell.getBooleanCellValue());break;   case HSSFCell.CELL_TYPE_NUMERIC:   if(HSSFDateUtil.isCellDateFormatted(cell)){//先看是否是日期格式  SimpleDateFormat sft=new SimpleDateFormat("yyyy-MM-dd");cellValue=String.valueOf(sft.format(cell.getDateCellValue()));   //读取日期格式  }else{ cellValue=String.valueOf(new Double(cell.getNumericCellValue())); //读取数字if(cellValue.endsWith(".0"))cellValue=cellValue.substring(0,cellValue.indexOf("."));}break;   case HSSFCell.CELL_TYPE_FORMULA:                               //读取公式   cellValue=cell.getCellFormula(); break;   case HSSFCell.CELL_TYPE_STRING:                              //读取String   cellValue=cell.getStringCellValue();break;}return cellValue;}
}

2.14 后台常见接口开发-Excel导出

使用场景:报表导出(人事数据、考勤数据)

2.15 后台常见接口开发-短信接口

使用场景:

相关需要短信提醒的地方
系统默认集成了很多,第三方系统的短信接口可以直接配置
可以自定义开发短信接口

2.16 后台常见接口开发-流程转建模

使用场景:

流程数据转建模。修改建模数据 + 更新或插入建模的明细表数据

2.17 后台常见接口开发-常用第三方短信接口

2.2 后台常见接口开发-自定义短信接口

使用场景:

 1、支持参数注入

 2、自定义短信接口,对接不通的接口

public class HybioSendMsg extends BaseBean implements SmsService {private String host = "";private String loginname = "";private String password = "";private String corpid ="";private int timeout = 30;private static smsSDK client;/*** 系统默认调用此接口,发送短信* @param paramString1* @param strMobile  手机号码* @param strMsg 短信内容*/public boolean sendSMS(String paramString1, String strMobile,String strMsg) {boolean bool = false;//具体接口return bool;}
}

2.18 后台常见接口开发-邮件接口

使用场景:

1、需要触发提醒的地方

       // 发送邮件SendMail sm = new SendMail();String from = "jinshan.wu@xxx"; // 邮件的发件人参数String to = "wumei.li@xxx"; // 邮件的收件人参数,多个收件人之间用逗号隔开String cc = ""; // 邮件的抄送人参数,多个抄送人之间用逗号隔开String bcc = ""; // 邮件的暗送人参数,多个暗送人之间用逗号隔开String subject = ""; // 邮件的主题参数(采用ISO8859编码格式)String body = "测试"; // 邮件的正文参数(采用ISO8859编码格式)int char_set = 1; // 编码方式 1:iso-8859-1 2:big5 3:GBKArrayList<String> filenames = new ArrayList<String>(); // 所有附件的名称,用ArrayList存放,与内容一一对应filenames.add("test.pdf");ArrayList<InputStream> filecontents = new ArrayList<InputStream>(); // 所有附件内容的输入流InputStream ,用ArrayList存放,与名称一一对应InputStream is = new FileInputStream(new File("E:/pdf/test.pdf"));filecontents.add(is);String priority = "3"; // 邮件的重要性参数 3:普通 2:重要 4:紧急sm.send(from,to,cc,bcc,subject,body,priority);boolean flag = sm.sendMiltipartHtml(from,to,cc,bcc,subject,body,char_set,filenames,filecontents,priority);return flag;

2.19 后台常见接口开发-邮件接口/pdf生成

使用场景:

1、流程自动生成pdf文件,并发送邮件

package wjs.test.service.impl;import com.itextpdf.text.*;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.itextpdf.text.pdf.draw.LineSeparator;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import weaver.conn.RecordSet;
import weaver.general.SendMail;
import weaver.general.Util;import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;public class PDFDemoImpl {public static void main(String[] args) throws IOException, DocumentException {createPDF();}public static boolean createPDF() throws IOException, DocumentException {// 1.新建document对象Document document = new Document();// 2.建立一个书写器(Writer)与document对象关联,通过书写器(Writer)可以将文档写入到磁盘中。// 创建 PdfWriter 对象 第一个参数是对文档对象的引用,第二个参数是文件的实际名称,在该名称中还会给出其输出路径。PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("C:/Users/Lenovo/Desktop/1.pdf"));//图片路径String picUrl = "C:/Users/Lenovo/Desktop/1.jpg";writer.setInitialLeading(50);// 3.打开文档document.open();//中文字体,解决中文不能显示问题BaseFont bfChinese = BaseFont.createFont("C:/WINDOWS/Fonts/SIMYOU.TTF", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);//字体Font titleFont = new Font(bfChinese, 14, Font.BOLD);Font boldFont = new Font(bfChinese, 12, Font.BOLD);Font bigFont = new Font(bfChinese, 12, Font.NORMAL);Font font = new Font(bfChinese, 10, Font.NORMAL);Font sfont = new Font(bfChinese, 8, Font.NORMAL);// 通用分隔符Chunk CHUNK = new Chunk("   ");//拼接标题Paragraph title = new Paragraph("采购订单",titleFont);title.setAlignment(Element.ALIGN_CENTER);//拼接副标题Paragraph subtitle = new Paragraph("PURCHASE ORDER",bigFont);subtitle.setAlignment(Element.ALIGN_CENTER);// 4.添加一个内容段落
//        Chunk chunkTitle = new Chunk("深圳市实益达工业有限公司", font);
//        Chunk chunkTitle2 = new Chunk("采购订单", boldFont);
//        Paragraph p1 = new Paragraph();
//        p1.add(chunkTitle);
//        p1.add(chunkTitle2);
//        document.add(new Paragraph("",blueFont));
//
//        document.add(new Paragraph("采购订单",blueFont));// 拼接台头Paragraph head = new Paragraph("深圳市实益达工业有限公司",font);Paragraph head1 = new Paragraph("ShenZhen SEASTAR Industry CO.,LTD",font);Paragraph head2 = new Paragraph("No.10, Jinlong 1st Road, Baolong Community, Longgang District, Shen Zhen, Guangdong Province, P.R.C.",font);// 画分隔线Paragraph p1 = new Paragraph();p1.add(new Chunk(new LineSeparator()));// 表单数据Paragraph formData = new Paragraph();// 供应商Chunk suppliers = new Chunk("供应商: 临时供应商", font);formData.add(suppliers);// 文件编号Chunk fileCode = new Chunk("文件编号: SSI-QOP-013-F01-R*",font);formData.add(fileCode);formData.add(Chunk.NEWLINE);//  供应商编码Chunk suppliersCode = new Chunk("供应商编码: 330011", font);formData.add(suppliersCode);//  工厂Chunk factory = new Chunk("工厂: 7888", font);formData.add(factory);//  订单号Chunk orderNum = new Chunk("订单号 PO No: 4500089200", font);formData.add(orderNum);formData.add(Chunk.NEWLINE);//  采购员Chunk buyer = new Chunk("采购员: FBDING / 丁风波", font);formData.add(buyer);//  币种Chunk currency = new Chunk("币种: CNY", font);formData.add(currency);//  订货日期Chunk orderDate = new Chunk("订货日期 Date: 2019/07/05", font);formData.add(orderDate);//  版本Chunk versions = new Chunk("版本: 0", font);formData.add(orderDate);// 明细表JSONObject object = new JSONObject();JSONArray keyArray = new JSONArray();keyArray.add("Item\n项");keyArray.add("Part No\n零件号");keyArray.add("Description\n描述");keyArray.add("Part\n制造商零件");keyArray.add("MFR\n制造商");keyArray.add("Arrival Date\n交货日期");keyArray.add("Quantity\n订单数量");keyArray.add("Unit\n单位");keyArray.add("Price\n单价");keyArray.add("Amount\n总金额");keyArray.add("Cust No\n客户编码");keyArray.add("Promise Date\n回复日期");keyArray.add("Cancel Window\n取消订单期");object.put("key",keyArray);JSONArray valueArray = new JSONArray();valueArray.add("10");valueArray.add("R_7888_02");valueArray.add("7888工厂测试原材料03");valueArray.add("");valueArray.add("");valueArray.add("2019/09/03");valueArray.add("1025");valueArray.add("EA");valueArray.add("10.000000");valueArray.add("10250.00");valueArray.add("");valueArray.add("");valueArray.add("0 / ");object.put("value",valueArray);document.add(title);document.add(subtitle);document.add(head);document.add(head1);document.add(head2);document.add(p1);document.add(formData);if(keyArray.size() > 0){Paragraph a = new Paragraph();a.add(Chunk.NEWLINE);document.add(a);PdfPTable table = new PdfPTable(keyArray.size());PdfPCell cell;for (int i = 0; i < keyArray.size(); i ++){cell = new PdfPCell(new Phrase(keyArray.get(i).toString(),font));cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);}for(int j=0;j<2;j++){for (int i = 0; i < valueArray.size(); i ++){cell = new PdfPCell(new Phrase(valueArray.get(i).toString(),font));cell.setHorizontalAlignment(Element.ALIGN_CENTER);table.addCell(cell);}}table.setWidthPercentage(100);document.add(table);}//表单剩余数据Paragraph formData1 = new Paragraph();//Chunk creditTerms = new Chunk("Credit Terms", font);formData1.add(creditTerms);//Chunk taxRate = new Chunk("Tax Rate", font);formData1.add(taxRate);//Chunk totalQty = new Chunk("Total Qty: 1025", font);formData1.add(totalQty);//Chunk totalAmt = new Chunk("Total Amt: 10250.00", font);formData1.add(totalAmt);formData1.add(Chunk.NEWLINE);// 支付方式Chunk payment = new Chunk("支付方式:月结60天 ", font);formData1.add(payment);// 税率Chunk tax = new Chunk("税率:13% 进项税,中国", font);formData1.add(tax);formData1.add(Chunk.NEWLINE);document.add(formData1);// 加粗说明英语Paragraph remarkBold = new Paragraph("Remarks: Please fill in the right PO number,Part Number and the Description on the Delivery Note.Otherwise,\n" +"Sea Star reserves the right to reject the shipment.",boldFont);remarkBold.add(Chunk.NEWLINE);document.add(remarkBold);// 说明Paragraph remark = new Paragraph("说明:请按此订单编号及描述完整无误的填写贵公司的送货单,如有不符,则拒收货物。",font);remark.add(Chunk.NEWLINE);document.add(remark);// 交货地址Paragraph shipAddress = new Paragraph("交货地址:深圳市龙岗区龙岗街道宝龙社区锦龙一路10号4楼4F",sfont);shipAddress.add(Chunk.NEWLINE);document.add(shipAddress);// 交货地址英语Paragraph shipAddressEnglish = new Paragraph("Ship Address: No.10, Jinlong 1st Road, Baolong Community, Longgang District, Shen Zhen, Guangdong Province, P.R.C.",sfont);shipAddressEnglish.add(Chunk.NEWLINE);document.add(shipAddressEnglish);// 供方地址Paragraph supplierAddress = new Paragraph("供方地址:",font);supplierAddress.add(Chunk.NEWLINE);document.add(supplierAddress);// 电话 + 联系人 + 传真 + 手机Paragraph pa1 = new Paragraph();Chunk phone = new Chunk("电话:",font);Chunk linkman = new Chunk("联系人:",font);Chunk fax = new Chunk("传真:",font);Chunk telphone = new Chunk("手机:",font);pa1.add(phone);pa1.add(linkman);pa1.add(Chunk.NEWLINE);pa1.add(fax);pa1.add(telphone);document.add(pa1);Image image = Image.getInstance(picUrl);image.setAbsolutePosition(0, 0);   Image image2 = Image.getInstance(picUrl);image2.setAbsolutePosition(400, 0);   document.add(image);document.add(image2);// 供方签字 + 需方签字Paragraph pa2 = new Paragraph();Chunk sellerSignature = new Chunk("供方签字Seller Signature: ",font);LineSeparator l = new LineSeparator();
//        l.setLineWidth(50);l.setOffset(-5);Chunk line = new Chunk(l);Chunk purchasingManager = new Chunk("需方签字Purchasing Manager: ",font);pa2.add(sellerSignature);pa2.add(line);pa2.add(purchasingManager);pa2.add(line);pa2.add(Chunk.NEWLINE);document.add(pa2);// 纪要1Paragraph summary1 = new Paragraph("1、供方应于收到本订单之日起两日内签字确认接受订单或陈述不能按本订单完成交货的原因,若供方未能于两日内以传真或电子邮件形式回复本公司,将默认贵司接受此PO及相关条款\n" +" 且本公司有权更改或取消订单。若供方未能按已确认的交期交货,给本公司所造成的停线等所有损失,将全部由供方承担。",sfont);// 纪要1英语Paragraph summary1English = new Paragraph("The Supplier shall sign and confirm the acceptance of the order or state the reason why the supplier fails to deliver the materials as per this\n" +" Purchase Order within two days after received the Purchase Order.If the Supplier fails to reply the Buyer by fax or e-mail within two days, It will\n" +" be supposed being acquiesced the supplier's acceptance for the terms Purchase Order concerned. And buyer has the right to adjust or cancel this\n" +" order.If supplier delay the committed delivery schedule to cause any cost from buyer,the buyer has to right to charge for the cost from supplier.",sfont);// 纪要2Paragraph summary2 = new Paragraph("2、供方在此确认并同意,若本公司最迟于交货日前一周以书面形式通知供方,则本公司可以取消本订单所包含的通用物料部分。",sfont);// 纪要2英语Paragraph summary2English = new Paragraph("The Supplier hereby agrees and acknowledges the buyer may cancel the common materials contained in this Purchase Order upon written notice no later\n" +" than one week before the delivery date.",sfont);// 纪要3Paragraph summary3 = new Paragraph("3、以上采购单价仅供参考,准确的价格应以交货前所确定的单价及执行日期为准。",sfont);// 纪要3英语Paragraph summary3English = new Paragraph("The purchase price in above is for reference only,accurate delivered price should be subjected to the date of delivery and price confirmed at the\n" +" time.",sfont);// 纪要4Paragraph summary4 = new Paragraph("4、供方在此确认并同意,若因供方物料品质不良导致本公司和本公司客户的所有损失,包括但不限于生产线停线损失、返工费用和客户罚款,均由供方承担。",sfont);// 纪要4英语Paragraph summary4English = new Paragraph("Thesupplier hereby agrees and acknowledges that all losses shall be borne by supplier if their defect product delivery cuased the losses of the\n" +" buyer and buyer's coustomers, inclding but not limited to the line-stop loss, rework cost and customer penalty.",sfont);// 纪要5Paragraph summary5 = new Paragraph("5、供方向本公司保证,其提供的所有物料均符合ROHS要求,并保证所有产品全部为原厂生产的原装正品,若所提供的为非原装正品或假货,供方同意承担由此产生的所有费用\n" +" 及客户赔偿。",sfont);// 纪要5英语Paragraph summary5English = new Paragraph("The Supplier warrants to the buyer that all products provided by the supplier shall comply with ROHS requirement. Also supplier makes sure all\n" +" products are come from original manufactory base on correct AVL,not fake goods! Supplier agrees to bear all additional cost which included\n" +" customer compensation if it caused by fake goods or wrong materials.",sfont);// 纪要6Paragraph summary6 = new Paragraph("6、供方在此确认并同意,双方来往的传真、邮件、电子邮件以及《供应商纠正措施预防报告》等均具有法律效力。",sfont);// 纪要6英语Paragraph summary6English = new Paragraph("The Supplier hereby agrees and acknowledges the fax,mail,e-,mail and <<Supplier Corrective Preventive Report>> etc between the parties shall\n" +" be under legally binding.",sfont);// 纪要7Paragraph summary7 = new Paragraph("7、若不良品率在1000DPPM之内,供应商应该以1:1的比例无条件换货,本订单未载明的其他事项按照本公司与供方签订的采购合同执行。",sfont);// 纪要7英语Paragraph summary7English = new Paragraph("If the reject rate is not above 1000DPPM, supplier should be 100% replaced the rejected goods without conditions. Other issues not specified in\n" +" this Purchase Order shall be subjected to the purchase order signed between the Buyer and the Supplier.",sfont);// 纪要8Paragraph summary8 = new Paragraph("8、供方承诺绝不向需方任何工作人员进行任何形式的贿赂商业行为和企图、诱导性行为,否则供方同意放弃所有未支付货款以作为给需方的赔偿款,弥补需方的一切名誉及商业损失,\n" +" 赔偿款不足以弥补需方损失的需方并保留法律诉讼的权利。",sfont);// 纪要8英语Paragraph summary8English = new Paragraph("Thesupplier promised not proceed with any commercial corruption action,behavior,intention to any the buyer staff. Otherwise, the supplier agreed to\n" +" give up all outstanding payment as the compensation to the buyer. The penalty amount includes the compensation of the reputation and commercial loss\n" +" to the buyer. Thebuyer reserves the right to take the legal action in case the penalty amount is insufficient to compensate the loss to the buyer\n" +" finally.",sfont);// 纪要9Paragraph summary9 = new Paragraph("9、供方在此确认并同意,其已经仔细阅读并自愿接受上述所有条款。",sfont);// 纪要9英语Paragraph summary9English = new Paragraph("The Supplier hereby agrees and acknowledges who has read carefully and accepted all the above clauses.",sfont);document.add(summary1);document.add(summary1English);document.add(summary2);document.add(summary2English);document.add(summary3);document.add(summary3English);document.add(summary4);document.add(summary4English);document.add(summary5);document.add(summary5English);document.add(summary6);document.add(summary6English);document.add(summary7);document.add(summary7English);document.add(summary8);document.add(summary8English);document.add(summary9);document.add(summary9English);// 5.关闭文档document.close();//        // 发送邮件
//        SendMail sm = new SendMail();
//        String from = "jinshan.wu@weaver.com.cn"; // 邮件的发件人参数
//        String to = "wumei.li@weaver.com.cn"; // 邮件的收件人参数,多个收件人之间用逗号隔开
//        String cc = ""; // 邮件的抄送人参数,多个抄送人之间用逗号隔开
//        String bcc = ""; // 邮件的暗送人参数,多个暗送人之间用逗号隔开
//        String subject = ""; // 邮件的主题参数(采用ISO8859编码格式)
//        String body = "测试"; // 邮件的正文参数(采用ISO8859编码格式)
//        int char_set = 1; // 编码方式 1:iso-8859-1 2:big5 3:GBK
//        ArrayList<String> filenames = new ArrayList<String>(); // 所有附件的名称,用ArrayList存放,与内容一一对应
//        filenames.add("test.pdf");
//        ArrayList<InputStream> filecontents = new ArrayList<InputStream>(); // 所有附件内容的输入流InputStream ,用ArrayList存放,与名称一一对应
//        InputStream is = new FileInputStream(new File("E:/pdf/test.pdf"));
//        filecontents.add(is);
//        String priority = "3"; // 邮件的重要性参数 3:普通 2:重要 4:紧急
//        sm.send(from,to,cc,bcc,subject,body,priority);
//        boolean flag = sm.sendMiltipartHtml(from,to,cc,bcc,subject,body,char_set,filenames,filecontents,priority);
//        return flag;return false;}/*** 解析主表字段* @param flowid 流程id* @param requestid 流程请求id* @return JSONObject的字符串*/public String getMainTable(String flowid,String requestid){RecordSet rs = new RecordSet();// 先获取对应的表单rs.execute("select formid from workflow_base where id = '" + flowid + "'");int billid = 0;if(rs.next()){billid = Util.getIntValue(rs.getString("formid"),0);}if(billid < 0){String tableName = "formtable_main_" + Math.abs(billid);// 获取字段名rs.execute("select w.fieldname,w.fieldhtmltype,w.type," +"(select h.labelname from htmllabelinfo h where h.indexid = w.fieldlabel and h.languageid = 7)labelname " +"from workflow_billfield w where w.billid = '" + billid + "' and w.viewtype = 0");Map<String,ArrayList<String>> map = new HashMap<String,ArrayList<String>>();
//            JSONObject object = new JSONObject();while(rs.next()){ArrayList<String> list = new ArrayList<String>();list.add(Util.null2String(rs.getString("fieldhtmltype")));list.add(Util.null2String(rs.getString("type")));list.add(Util.null2String(rs.getString("labelname")));map.put(Util.null2String(rs.getString("fieldname")),list);
//                object.put(,Util.null2String(rs.getString("labelname")));}}return "";}
}

3. 总结

通过本文的介绍,相信读者已经对泛微Ecology9的集成接口开发有了初步的了解。随着技术的不断发展,API的应用场景将更加广泛,期待大家在实际工作中不断探索与实践。


http://www.ppmy.cn/ops/126877.html

相关文章

【Linux】命令行下的增删查改之“查看”

致谢:Linux常用命令大全(手册) – 真正好用的Linux命令在线查询网站 提供的命令查询 头部内容获取(head) head命令的功能是显示文件开头的内容&#xff0c;默认值为前10行。 指令参数&#xff1a; -n 定义显示行数 -c 指定显示头部内容的字符数 -v 总是显示文件名的头信…

rabbitMQ消息重复问题怎么解决的?

RabbitMQ 消息重复的问题通常发生在消息的传递过程中&#xff0c;特别是在网络异常、生产者或消费者宕机等场景下&#xff0c;消息可能被重复消费。这种重复是由于 RabbitMQ 的 "至少一次投递" 保证机制引起的。为了解决消息重复的问题&#xff0c;可以采取以下几种常…

React 基础阶段学习计划

React 基础阶段学习计划 目标 能够创建和使用React组件。理解并使用State和Props。掌握事件处理和表单处理。 学习内容 环境搭建 安装Node.js和npm 访问 Node.js官网 下载并安装最新版本的Node.js。打开终端或命令行工具&#xff0c;输入 node -v 和 npm -v 检查是否安装…

Oracle 零宽空格问题处理

在Oracle中&#xff0c;去除字符串两端的零宽空格&#xff08;Zero Width Space&#xff0c;Unicode编码为U200B&#xff09;可以使用TRIM函数结合REGEXP_REPLACE函数来实现。由于标准的TRIM函数只能去除ASCII字符&#xff0c;对于Unicode字符如零宽空格&#xff0c;需要使用正…

机器学习:opencv--人脸检测以及微笑检测

目录 前言 一、人脸检测的原理 1.特征提取 2.分类器 二、代码实现 1.图片预处理 2.加载分类器 3.进行人脸识别 4.标注人脸及显示 三、微笑检测 前言 人脸检测是计算机视觉中的一个重要任务&#xff0c;旨在自动识别图像或视频中的人脸。它可以用于多种应用&#xff0…

案例分享-优秀蓝色系UI界面赏析

蓝色UI设计界面要提升舒适度&#xff0c;关键在于色彩搭配与对比度。选择柔和的蓝色调作为主色&#xff0c;搭配浅灰或白色作为辅助色&#xff0c;能营造清新、宁静的氛围。同时&#xff0c;确保文字与背景之间有足够的对比度&#xff0c;避免视觉疲劳&#xff0c;提升阅读体验…

力扣之接雨水(42)

刷题不在多&#xff0c;而在精。 这道题号称字节的保洁阿姨都能做出的。 方法一&#xff1a;动态规划 下面这幅图简直封神&#xff0c;看了下图我才做出来的。 两个方向遍历&#xff0c;然后取相同覆盖值-原始值&#xff08;heigth数组&#xff09; 这种方法更好理解。但是也有…

基础算法(6)——模拟

1. 替换所有的问号 题目描述&#xff1a; 算法思路&#xff1a; 从前往后遍历整个字符串&#xff0c;找到问号之后&#xff0c;尝试用 a ~ z 的每一个字符替换即可 注意点&#xff1a;需考虑数组开头和结尾是问号的边界情况 代码实现&#xff1a; class Solution {public …