📄 gbs_requestactionlogic.java
字号:
/**
* method GBS_UsermasterActionLogic.java
* created on 07-30-2004
*
* @author GXK
* @version1.0
*/
package LOGIC;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import org.apache.struts.upload.FormFile;
import COMMON.ReturnValue;
import COMMON.SystemConstants;
import DB.GBS_MCountry_DB;
import DB.GBS_MCustomer_DB;
import DB.GBS_MSubsidiary_DB;
import DB.GBS_MWideUse_DB;
import DB.GBS_RfpAttach_DB;
import DB.GBS_RfpCountry_DB;
import DB.GBS_TRfp_DB;
import DB.GBS_TTemp_DB;
import DataBean.GBS_RfpAttachList_stBean;
import DataBean.GBS_RfpCountry_stBean;
public class GBS_RequestActionLogic implements SystemConstants {
private DataSource datasource = null;
/**
* trans datasource to db
* @param datasource
*/
public GBS_RequestActionLogic(DataSource datasource) {
this.datasource = datasource;
}
public ReturnValue getCustomer( String customerID ) throws Exception {
GBS_MCustomer_DB mCustomerDb = new GBS_MCustomer_DB( this.datasource );
return mCustomerDb.selectByCustmerID( customerID );
}
public ReturnValue getRfpInfo( String CustomerID, String RfpID ) throws Exception {
GBS_TRfp_DB rfpDb = new GBS_TRfp_DB(this.datasource);
return rfpDb.selectByCustomerIDRfpID(CustomerID, RfpID);
}
public ReturnValue getRfpCountryInfo( String CustomerID, String RfpNo ) throws Exception {
GBS_RfpCountry_DB RfpCountry_DB = new GBS_RfpCountry_DB(this.datasource);
return RfpCountry_DB.selectByCustomerIDRfpID(CustomerID, RfpNo);
}
public ReturnValue getRfpAttachInfo( String CustomerID, String RfpID ,int plusHour) throws Exception {
GBS_RfpAttach_DB RfpAttach_DB = new GBS_RfpAttach_DB(this.datasource);
return RfpAttach_DB.selectByCustomerIDRfpID(CustomerID, RfpID,plusHour);
}
public ReturnValue getAttachmentFile( GBS_RfpAttachList_stBean st,
HttpServletResponse response )
throws Exception{
GBS_RfpAttach_DB RfpAttach_DB = new GBS_RfpAttach_DB(this.datasource);
ReturnValue returnValue = RfpAttach_DB.getAttachmentFile( st.getCustomerID(),
st.getRfpNo(),
st.getLineNo(),
st.getSeqNo(),
response
);
return returnValue;
}
public ReturnValue getAllCountryName()throws Exception{
GBS_MCountry_DB MCountry_DB = new GBS_MCountry_DB(this.datasource);
ReturnValue returnValue = MCountry_DB.seletAllCountryNameByCountrySubsidiary();
return returnValue;
}
public ReturnValue addAttachmentFileIntoTempTable( String strSissionID,
String createUser,
FormFile attachmentFile)throws Exception {
GBS_TTemp_DB TTemp_DB = new GBS_TTemp_DB(this.datasource);
ReturnValue returnValue = TTemp_DB.insertRfpAttachmentIntoTempTable( strSissionID,
createUser,
attachmentFile);
return returnValue;
}
public ReturnValue addRfpInfo(
String customerID,
String rfpNo,
String repRcvDate,
String dueDate,
String infoDueDate,
String Country,
String hardwareCategory,
String leaseRentalOutright,
String quantity,
String remarks,
String comment,
String createUserID,
String subdiadiaryCode)
throws Exception {
GBS_TRfp_DB tRfpDb = new GBS_TRfp_DB(this.datasource);
ReturnValue returnValue =
tRfpDb.insertRfpInfo(
customerID,
repRcvDate,
dueDate,
infoDueDate,
Country,
hardwareCategory,
leaseRentalOutright,
quantity,
remarks,
comment,
createUserID,
subdiadiaryCode);
return returnValue;
}
public ReturnValue updRfpInfo(
String customerID,
String rfpNo,
String repRcvDate,
String dueDate,
String infoDueDate,
String Country,
String hardwareCategory,
String leaseRentalOutright,
String quantity,
String remarks,
String comment,
String createUserID,
String subsidiaryCode)
throws Exception {
GBS_TRfp_DB tRfpDb = new GBS_TRfp_DB(this.datasource);
ReturnValue returnValue =
tRfpDb.updateRfpInfo(
customerID,
rfpNo,
repRcvDate,
dueDate,
infoDueDate,
Country,
hardwareCategory,
leaseRentalOutright,
quantity,
remarks,
comment,
createUserID,
subsidiaryCode);
return returnValue;
}
public ReturnValue saveRfpCountryInfo( String customerID,
String rfpNo,
String loginUserId,
ArrayList countryCodeList)throws Exception{
ReturnValue returnValue = new ReturnValue();
GBS_RfpCountry_stBean RfpCountry_stBean = new GBS_RfpCountry_stBean();
ArrayList RfpCountryList = new ArrayList();
GBS_RfpCountry_DB RfpCountry_DB = new GBS_RfpCountry_DB(this.datasource);
for(int i=0;i<countryCodeList.size();i++){
//崙儅僗僞偐傜崙僐乕僪偲尰朄僐乕僪傪庢摼丏
if(countryCodeList.get(i) != null){
returnValue = RfpCountry_DB.selectCountryInfo(countryCodeList.get(i).toString());
RfpCountry_stBean = (GBS_RfpCountry_stBean)returnValue.getDataValue();
RfpCountryList.add(RfpCountry_stBean);
}
}
//RFP娭楢崙偺僨乕僞傪峏怴
returnValue = RfpCountry_DB.update(customerID,rfpNo,loginUserId,RfpCountryList);
return returnValue;
}
public ReturnValue saveRfpAttachment( List list, String userID )throws Exception {
GBS_RfpAttach_DB RfpAttach_DB = new GBS_RfpAttach_DB(this.datasource);
ReturnValue returnValue = RfpAttach_DB.saveRfpAttachment(list, userID);
return returnValue;
}
//Add by Gxk 2004/08/23
/**
* Get subsidiary name by code
* @param subsidiaryCode String
* @return ReturnValue
* @throws Exception
*/
public ReturnValue getSubsidiaryName(String subsidiaryCode) throws Exception {
GBS_MSubsidiary_DB DB = new GBS_MSubsidiary_DB(this.datasource);
return DB.getSubsidiaryName(subsidiaryCode);
}
/**
* Get mail list to send mail
* @param customerId String
* @param rfpNo String
* @return ReturnValue
* @throws Exception
*/
public ReturnValue getMail(String customerId,String rfpNo) throws Exception{
GBS_RfpCountry_DB DB = new GBS_RfpCountry_DB(this.datasource);
return DB.selectEmailList(customerId,rfpNo);
}
/**
* Get wideUse list from db
* @param str String
* @return ReturnValue
* @throws Exception
*/
public ReturnValue getWideUse(String str)throws Exception{
GBS_MWideUse_DB DB = new GBS_MWideUse_DB(this.datasource);
return DB.selectByTargetUse(str);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -