77范文网 - 专业文章范例文档资料分享平台

BOS笔记(6)

来源:网络收集 时间:2019-03-22 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

VerificationNumSum+=bjdata*jfdata; }

int VerificationNum =(int)VerificationNumSum;

int sub11 = new Integer(newBoxNum.substring(10)).intValue(); //如果计算结果与第11位数是否相等 if(VerificationNum!=sub11){ return false; }

return true; }

/**

* 从oracle数据读取图片字节码生成图片文件 * @param img_num 图片编号(参数表编号) * @param file 文件地址 \

系统参数表 -- 创建表

create table T_SYS_FUTVAN (

FNUMBER NVARCHAR2(55), FNAME NVARCHAR2(256), PARAMETER_STRING NVARCHAR2(256), PARAMETER_NUMBER NUMBER, PARAMETER_DATE DATE,

PARAMETER_TIMESTAMP TIMESTAMP(6), PARAMETER_BLOB BLOB )

-- 创建字段说明

comment on column T_SYS_FUTVAN.FNUMBER is '参数编号';

comment on column T_SYS_FUTVAN.FNAME

is '参数名称';

comment on column T_SYS_FUTVAN.PARAMETER_STRING is '文本型参数';

comment on column T_SYS_FUTVAN.PARAMETER_NUMBER is '数据型参数';

comment on column T_SYS_FUTVAN.PARAMETER_DATE is '日期型参数';

comment on column T_SYS_FUTVAN.PARAMETER_TIMESTAMP is '时间型参数';

comment on column T_SYS_FUTVAN.PARAMETER_BLOB is '字节型参数'; *

*/

public static void getImgFromOracle(String img_num,String file){ try {

IRowSet rs = executeQuery(\parameter_blob from t_sys_futvan where fnumber = '\ while(rs.next()){

java.sql.Blob blob = rs.getBlob(1);

InputStream ins = blob.getBinaryStream(); File f = new File(file);

FileOutputStream fout = new FileOutputStream(f); byte[]b = new byte[10244]; int len = 0;

while((len = ins.read(b)) != -1){ fout.write(b,0,len); }

fout.close(); ins.close(); }

} catch (Exception e) { System.out.println(); } }

/**

* BOTP单据转换

* @param botpNum 转换规则编号 * @param BillInfo 原单据 */

public static void BOTP(String botpNum,CoreBillBaseInfo BillInfo){ String error = \ try {

// 取得BOPT的映射 BOTMappingCollection botmapping = BOTMappingFactory.getRemoteInstance().getBOTMappingCollection(\* where name = '\ \

BOTMappingInfo btpMappingInfo = null;

if (botmapping !=null && botmapping.size() == 1) { btpMappingInfo = botmapping.get(0); } else {

if(botmapping==null || botmapping.size()<1){

error = \未找到转换规则 规则编号:\ }

if(botmapping.size()>1){

error = \找到多条转换规则,请删除重复规则。 规则编号:\

}

throw new Exception(); }

//执行单据转换 BTPTransformResult transformResult

BTPManagerFactory.getRemoteInstance().transform(BillInfo, btpMappingInfo);

//取得目标单据列表

IObjectCollection toBillList = transformResult.getBills();

//保存目标单据

for (int i = 0; i < toBillList.size(); i++) {

CoreBillBaseInfo destBillInfo = (CoreBillBaseInfo) toBillList.getObject(i); BTPManagerFactory.getRemoteInstance().saveRelations(destBillInfo, transformResult.getBOTRelationCollection()); }

} catch (Exception e) {

if(\

alert2(\单据转换出错\ }else{

alert2(\单据转换出错\ } } }

/**

* 分摊功能

* @param Total 总数

* @param Allocations 分摊明细 * @param newScale 小数位数 * @return 分摊分集合

String [][]Allocations = new String[3][2]; Allocations[0][0] = \ Allocations[0][1] = \ Allocations[1][0] = \ Allocations[1][1] = \ Allocations[2][0] = \ Allocations[2][1] = \

String [][] rv = UtilClass.mathAllocation(new BigDecimal(\ */

public static String[][] mathAllocation(BigDecimal Total,String[][] Allocations,int newScale){ String[][] returnvalue = new String[Allocations.length][2]; BigDecimal sum = new BigDecimal(\

=

BigDecimal Allocationsum = new BigDecimal(\ try {

//获取明细总数

for(int i=0;i

if(Allocations[i][1]!=null&&!\ sum = sum.add(new BigDecimal(Allocations[i][1])); } }

//按比例分摊

for(int i=0;i

if(Allocations[i][1]!=null&&!\ BigDecimal thisValue = new BigDecimal(Allocations[i][1]); BigDecimal AllocationValue = thisValue.divide(sum,16, BigDecimal.ROUND_HALF_UP).multiply(Total).setScale(newScale, BigDecimal.ROUND_HALF_UP); returnvalue[i][0] = Allocations[i][0];

returnvalue[i][1] = AllocationValue.toString(); }else{

returnvalue[i][0] = Allocations[i][0]; returnvalue[i][1] = \ } }

//判断分摊后每条记录数据是否与总数相同 for(int i=0;i

if(returnvalue[i][1]!=null&&!\

Allocationsum = Allocationsum.add(new BigDecimal(returnvalue[i][1])); } }

//如果分摊后结果与分摊前总数不一等。在分摊记录最后一条。加上。分摊后总数与分摊总数的差值

if(Allocationsum.compareTo(Total)!=0){ BigDecimal xz = new BigDecimal(returnvalue[returnvalue.length-1][1]).subtract(Allocationsum.subtract(Total)); returnvalue[returnvalue.length-1][1] = xz.toString(); }

} catch (Exception e) {

StringBuffer er = new StringBuffer(); for(int i=0;i

er.append(\ \ }

alert2(\分摊出错\分摊总数:\ 明细:\ }

return returnvalue; } }

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库BOS笔记(6)在线全文阅读。

BOS笔记(6).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/540423.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: