毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

JSP电信电话计费系统设计(含英文文献翻译) 第19页

更新时间:2010-4-9:  来源:毕业论文
JSP电信通讯计费系统设计(含英文文献翻译)
return callFee+ this.callFee(phoneHead, countTime,time_long - time_temp, first_order,time_length);
} else if (time_length == dArray.get(order).getTimeLength()) {
return callFee + this.callFee(phoneHead, countTime,time_long - time_temp,first_order + 1, 0);
}
}
if (time_length == dArray.get(order).getTimeLength() - sTime) {
order++;    //阶段序号加1
time_length = 0;//阶段时长清零
continue;
}
 * 时段优惠计费
 */
Date beginTime = ConvertDate.convertToDate(startTime);
for (int i = 0; i < mArray.size(); i++) {
 /**
  与上面节日优惠雷同
  代码省略••••••
 */
}
}
批价类
/**
 * name:InsertFee.java
 * coder:wangpeng
 * date time:Mar 25, 2009 8:38:32 PM
 */
package com.hexin.wp;
import com.hexin.wp.bean.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import com.hexin.jdbc.DBUtil;
/**
 *
 * @author Administrator 单条通话记录出账类
 */
public class InsertFeeDetails {
Statement stmt = null;
//初始化数据库连接类
DBUtil db = new DBUtil();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/**
 * 计算每条通话记录产生的费用 插入数据库费用详单表中
 */
public void insertFeeDetails(ArrayList<CallDetailsBean> callList) {
Connection conn = db.getConnection();
if (conn == null) {
String oracleDriver = "oracle.jdbc.driver.OracleDriver";
String connStr = "jdbc:oracle:thin:@127.0.0.1:XE";
try {
Class.forName(oracleDriver);
conn = DriverManager.getConnection(connStr, "scott", "scott");
} catch (Exception e) {
e.printStackTrace();
}
}
String callID;
String phoneHead = null;
Date startTime = null;
int time_long;
String periodMonth = null;
int callTypeNo;
double callFee;
//循环通话记录表中记录
for (int i = 0; i < callList.size(); i++) {
callID = callList.get(i).getCallID();
try {
 //处理时间为统一格式 yyyy-MM-dd HH:mm:ss
startTime = df.parse(callList.get(i).getStartTime().toString().substring(0, 19));
} catch (ParseException e) {
e.printStackTrace();
i++;
continue;
}
//取号码头
phoneHead = callList.get(i).getPhoneHead();
//取帐期编号
periodMonth = callList.get(i).getPeriodMonth();
//取通话时长
time_long = callList.get(i).getCall_length();
CallMoney cm = new CallMoney();
//调用计费方法,计算通话费用
callFee = cm.callFee(phoneHead, startTime, time_long, 0, 0);
callTypeNo = cm.callTypeNo;
String sql = "insert into CALL_DETAILS_FEE
(id,call_id,call_type_no,fee_total,period_month) values(call_details_fee_seq.nextval,"+ callID+ ","+ callTypeNo+ ","+ callFee+ ","+ periodMonth + ")";
String updateSQL = "update CALL_DETAILS set IF_PJ = 1 where call_id= "
+ callID;
System.out.println("正在..." + updateSQL);
try {
if (conn != null) {
conn.setAutoCommit(false); //关闭事务自动提交
stmt = conn.createStatement();
stmt.execute(sql); //插入通话详单记录
stmt.executeUpdate(updateSQL); //将是否出账标示为1:已完成批价
conn.commit(); //事务提交
}
} catch (SQLException e) {
try {
//事务异常,回滚!
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
//某条记录插入异常,继续操作下条记录
continue;
}
}
/**
 * 关闭数据库连接
 */
try {
if (this.stmt != null)
this.stmt.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
e.printStackTrace();

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 下一页

JSP电信电话计费系统设计(含英文文献翻译) 第19页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。