package com.neusoft.struts.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import com.neusoft.struts.use.MakeToSqlDate;
import com.neusoft.struts.vo.City;
import com.neusoft.struts.vo.Product;
import com.neusoft.struts.vo.RpCardSaleRecordT;
public class CardSellDAO {
private DB mydb;
public CardSellDAO(){
mydb=new DB();
}
public boolean addCardSell(String checkStatus,String date, String cityCode,
String productCode, double cardParValueFee, double discount,
int cardSellAmount, String recordOperator, double totalFee,
double discountFee) throws Exception {
String ddmonthyy=MakeToSqlDate.makeToSqlDate(date);
String sql="insert into RP_CARD_SALE_RECORD_T values(RP_CARD_SALE_RECORD_S.nextval,?,?,?,?,?,?,?,?,null,null,?,?)";
Object []params={ddmonthyy,cityCode,productCode,discount,cardSellAmount,cardParValueFee,recordOperator,checkStatus,totalFee,discountFee};
try {
mydb.doPstmt(sql, params);
return true;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
@SuppressWarnings("unchecked")
public List selectCardSell(String startDate, String endDate,
String cityCode, String productCode, String checkStatus) throws Exception {
List<RpCardSaleRecordT> list=new ArrayList<RpCardSaleRecordT>();
String startDay=null;
if(startDate!=null)
if(!startDate.equals(""))
startDay=MakeToSqlDate.makeToSqlDate(startDate);
String endDay=null;
if(endDate!=null)
if(!endDate.equals(""))
endDay=MakeToSqlDate.makeToSqlDate(endDate);
String sql="select * from RP_CARD_SALE_RECORD_T";
if(startDate!=null){
if(endDate!=null){
if(!startDate.equals("")&&!endDate.equals("")||!cityCode.equals("###")||!productCode.equals("######")||!checkStatus.equals("#")){
sql+=" where";
}
}
}
if(endDate!=null&&startDate!=null&&!startDate.equals("")&&!endDate.equals("")){
sql+=" sale_date between '"+startDay+"'";
sql+=" and '"+endDay+"'";
}
if(cityCode!=null&&!cityCode.equals("###")){
sql+=" and city_code='"+cityCode+"'";
}
if(productCode!=null&&!productCode.equals("######")){
sql+=" and product_code='"+productCode+"'";
}
if(checkStatus!=null&&!checkStatus.equals("#")){
sql+=" and CHECK_STATUS='"+checkStatus+"'";
}
//System.out.println(sql);
//Object[]params={startDay,endDay};
try {
mydb.doPstmt(sql, null);
ResultSet rs=mydb.getRs();
while(rs.next()){
RpCardSaleRecordT rp=new RpCardSaleRecordT();
int id=rs.getInt("id");
Date saledate=rs.getDate("SALE_DATE");
String citycode=rs.getString("CITY_CODE");
String cityname=getCityName(citycode);
String productcode=rs.getString("PRODUCT_CODE");
String productname=getProductName(productcode);
//double discountRate=rs.getDouble("DISCOUNT_RATE");
int cardSaleAmount=rs.getInt("CARD_SALE_AMOUNT");
double cardParValueFee=rs.getInt("CARD_PAR_VALUE_FEE");
String recordOperator=rs.getString("RECORD_OPERATOR");
String checkstatus=rs.getString("CHECK_STATUS");
String checkPerson=rs.getString("CHECK_PERSON");
Date checkTime=rs.getDate("CHECK_TIME");
double totalFee=rs.getDouble("TOTAL_FEE");
double discountFee=rs.getDouble("DISCOUNT_FEE");
rp.setSaleAmount(cardSaleAmount);
rp.setCardParValueFee(cardParValueFee);
if(checkPerson!=null){
rp.setCheckPerson(checkPerson);
}else{
rp.setCheckPerson("无信息!");
}
rp.setCheckStatusCode(checkstatus);
if(checkstatus.equals("2")){
rp.setCheckStatus("未稽核");
}else if(checkstatus.equals("1")){
rp.setCheckStatus("稽核成功");
}else{
rp.setCheckStatus("稽核失败");
}
if(checkTime!=null){
rp.setCheckTime(checkTime);
}else{
rp.setStringDate("无信息!");
}
rp.setCityName(cityname);
rp.setDiscountFee(discountFee);
double disFee=totalFee-discountFee;
rp.setDisFee(disFee);
rp.setId(id);
rp.setProductName(productname);
rp.setRecordOperator(recordOperator);
rp.setSaleDate(saledate);
rp.setTotalFee(totalFee);
list.add(rp);
}
return list;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return list;
}
public boolean delCardSell(int id) {
String sql="delete from RP_CARD_SALE_RECORD_T where id=?";
Object []params={id};
try {
mydb.doPstmt(sql, params);
return true;
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
@SuppressWarnings("unchecked")
public List getAllCardSell() throws Exception {
String sql="select * from RP_CARD_SALE_RECORD_T";
List<RpCardSaleRecordT> list=new ArrayList<RpCardSaleRecordT>();
try {
mydb.doPstmt(sql, null);
ResultSet rs=mydb.getRs();
while(rs.next()){
RpCardSaleRecordT rp=new RpCardSaleRecordT();
int id=rs.getInt("id");
Date saledate=rs.getDate("SALE_DATE");
String citycode=rs.getString("CITY_CODE");
String cityname=getCityName(citycode);
String productcode=rs.getString("PRODUCT_CODE");
String productname=getProductName(productcode);
//double discountRate=rs.getDouble("DISCOUNT_RATE");
int cardSaleAmount=rs.getInt("CARD_SALE_AMOUNT");
double cardParValueFee=rs.getDouble("CARD_PAR_VALUE_FEE");
String recordOperator=rs.getString("RECORD_OPERATOR");
String checkstatus=rs.getString("CHECK_STATUS");
String checkPerson=rs.getString("CHECK_PERSON");
Date checkTime=rs.getDate("CHECK_TIME");
double totalFee=rs.getDouble("TOTAL_FEE");
double discountFee=rs.getDouble("DISCOUNT_FEE");
rp.setSaleAmount(cardSaleAmount);
rp.setCardParValueFee(cardParValueFee);
rp.setCheckPerson(checkPerson);
rp.setCheckStatusCode(checkstatus);
if(checkstatus.equals("2")){
rp.setCheckStatus("未稽核");
}else if(checkstatus.equals("1")){
rp.setCheckStatus("稽核成功");
}else{
rp.setCheckStatus("稽核失败");
}
rp.setCheckTime(checkTime);
rp.setCityName(cityname);
rp.setDiscountFee(discountFee);
double disFee=totalFee-discountFee;
rp.setDisFee(disFee);
rp.setId(id);
rp.setProductName(productname);
rp.setRecordOperator(recordOperator);
rp.setSaleDate(saledate);
rp.setTotalFee(totalFee);
list.add(rp);
}
return list;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return list;
}
public RpCardSaleRecordT getCardSellById(int _id) throws Exception {
String sql = "select * from RP_CARD_SALE_RECORD_T where id=?";
Object []params={_id};
RpCardSaleRecordT cardsell=null;
try {
mydb.doPstmt(sql, params);
ResultSet rs=mydb.getRs();
if(rs.next()){
cardsell=new RpCardSaleRecordT();
int id=rs.getInt("id");
Date saledate=rs.getDate("SALE_DATE");
String citycode=rs.getString("CITY_CODE");
String cityname=getCityName(citycode);
String productcode=rs.getString("PRODUCT_CODE");
String productname=getProductName(productcode);
//double discountRate=rs.getDouble("DISCOUNT_RATE");
int cardSaleAmount=rs.getInt("CARD_SALE_AMOUNT");
double cardParValueFee=rs.getDouble("CARD_PAR_VALUE_FEE");
String recordOperator=rs.getString("RECORD_OPERATOR");
String checkstatus=rs.getString("CHECK_STATUS");
String checkPerson=rs.getString("CHECK_PERSON");
Date checkTime=rs.getDate("CHECK_TIME");
double totalFee=rs.getDouble("TOTAL_FEE");
double discountFee=rs.getDouble("DISCOUNT_FEE");
cardsell.setSaleAmount(cardSaleAmount);
cardsell.setCardParValueFee(cardParValueFee);
cardsell.setCheckPerson(checkPerson);
if(checkstatus.equals("2")){
cardsell.setCheckStatus("未稽核");
}else if(checkstatus.equals("1")){
没有合适的资源?快使用搜索试试~ 我知道了~
人事管理系统、java、struts
共244个文件
java:68个
class:63个
jsp:44个
4星 · 超过85%的资源 需积分: 3 10 下载量 201 浏览量
2011-05-16
09:08:24
上传
评论
收藏 1.1MB RAR 举报
温馨提示
人事管理系统、挺好的有源码、欢迎下载、挺好的、欢迎下载啊,呵呵呵,是一个学习java的好项目
资源推荐
资源详情
资源评论
收起资源包目录
人事管理系统、java、struts (244个子文件)
speaker.bmp 202B
Business_feeDao.class 9KB
PreDAO.class 9KB
AccountDAO.class 7KB
OpDB.class 6KB
RpCardSaleRecordT.class 4KB
RpNetBalanceRecordT.class 4KB
AddCardSellCheckAction.class 4KB
JhBusiness_feeAction.class 4KB
Business_fee.class 4KB
AddNetBalanceCheckAction.class 4KB
SelectAccountAction.class 4KB
JhAction.class 4KB
SelectNetBalanceAction.class 4KB
SelectBusiness_feeAction.class 4KB
LoginAction.class 3KB
SelectPreAction.class 3KB
DelNetBalanceAction.class 3KB
NetBalanceDAO.class 3KB
DelPreAction.class 3KB
NextNetPageAction.class 3KB
AccountRecord.class 3KB
CardSellDAO.class 3KB
PreviousNetPageAction.class 3KB
AddCardSell.class 3KB
NextPageAction.class 3KB
DelCardSellAction.class 3KB
SelectCardSellAction.class 3KB
DoUpdateBusiness_feeAction.class 3KB
PreNextPageAction.class 3KB
PreviousPageAction.class 3KB
PrePreviousPageAction.class 3KB
BusinessPreviousPageAction.class 3KB
AddPreAction.class 3KB
AddNetBalanceAction.class 3KB
Pre_fee_record.class 3KB
ModifyPreAction.class 3KB
DoEditCardSellAction.class 3KB
DoEditNetBalanceAction.class 3KB
DB.class 2KB
AddAccountRecord.class 2KB
UpdateAction.class 2KB
Product.class 2KB
AddBusiness_feeAction.class 2KB
EditCardSellAction.class 2KB
EditNetBalanceAction.class 2KB
CheckAccountAction.class 2KB
ReaddBusiness_feeAction.class 2KB
LogoutAction.class 2KB
UpdateBusiness_feeAction.class 2KB
AccountSelect.class 2KB
EditAccountRecord.class 2KB
FindPreAction.class 2KB
GetNetBalanceAction.class 1KB
Pager.class 1KB
Pager.class 1KB
Page.class 1KB
DoString.class 1KB
AdminDAO.class 1KB
Business_feeType.class 833B
WriteType.class 788B
AccountType.class 786B
Type.class 765B
City.class 765B
.classpath 682B
mycss.css 1KB
style1.css 686B
Thumbs.db 54KB
login_11.gif 9KB
login_06.gif 5KB
login_10.gif 4KB
login_03.gif 4KB
login_07.gif 3KB
login_08.gif 2KB
login_09.gif 2KB
left_top.GIF 2KB
cup.GIF 2KB
login_btn_bg.gif 991B
Imgmenu1_2.gif 913B
homepage.GIF 901B
email.GIF 900B
dl.gif 813B
cz.gif 796B
home.gif 654B
revigate.GIF 608B
yzm.gif 307B
ed-item.gif 179B
dmwaste.gif 156B
jobPane.gif 111B
Imgmenu1_1.gif 77B
subMenu_ico.GIF 71B
login1.html 4KB
login.html 2KB
standard.jar 384KB
jstl.jar 20KB
CardSellDAO.java 14KB
NetBalanceDAO.java 13KB
Business_feeDao.java 10KB
PreDAO.java 8KB
AccountDAO.java 7KB
共 244 条
- 1
- 2
- 3
资源评论
- kikey1232012-12-27这是web的,不是我要的
飞鸿123
- 粉丝: 0
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用C语言与python分别实现文件的读写功能
- zephyr sdk package 2
- zephyr sdk package 1
- optimization.ipynb
- 数据库标识码BSM重排序工具、重构标识码工具
- 基于C语言的校园导航系统报告.doc
- __init__.py
- tensorflow-gpu-2.6.5-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-rocm-2.13.1.600-cp38-cp38-manylinux2014-x86-64.whl
- tensorflow-rocm-2.13.0.570-cp311-cp311-manylinux2014-x86-64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功