📄 gbs_mifentryactionlogic.java
字号:
/*
* Created on 2004/08/10
*
*/
package LOGIC;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.sql.DataSource;
import COMMON.ReturnValue;
import COMMON.SystemConstants;
import DB.GBS_MCountry_DB;
import DB.GBS_MCustomer_DB;
import DB.GBS_MMifDetail_DB;
import DB.GBS_MSubsidiary_DB;
import DB.GBS_MWideUse_DB;
import DataBean.GBS_Customer_stBean;
import DataBean.GBS_MMif_stBean;
import DataBean.GBS_MWideUse_stBean;
import DataBean.GBS_MifEntryList_stBean;
/**
* <p>Title: MIF ENTRY </p>
* <p>Description: process page action<br>
* </p>
* <p> Copyright (c) 2004</p>
* @author xjl
* @version 1.0
*/
public class GBS_MifEntryActionLogic implements SystemConstants {
private DataSource datasource = null;
/**
* trans datasource to db
* @param datasource
*/
public GBS_MifEntryActionLogic(DataSource datasource) {
this.datasource = datasource;
}
/**
* get Subsidiary
* @param none
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue getSubsidiary() throws Exception {
ReturnValue returnValue = new ReturnValue();
GBS_MSubsidiary_DB Subsidiary_DB = new GBS_MSubsidiary_DB(this.datasource);
//get data for combox
returnValue = ( ReturnValue ) Subsidiary_DB.getSubsidiaryList();
return returnValue;
}
/**
* get ProductCategory
* @param none
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue getProductCategory() throws Exception{
ReturnValue returnValue = new ReturnValue();
GBS_MWideUse_DB WideUse_DB = new GBS_MWideUse_DB( this.datasource );
Map returnMap = new HashMap();
returnValue = WideUse_DB.selectByTargetUse( "PRODUCT_CATEGORY" );
if ( !returnValue.isError() ){
ArrayList lstMainKey = new ArrayList();
ArrayList lstString1 = new ArrayList();
lstMainKey.add("-1");
lstString1.add("");
ArrayList list = (ArrayList) returnValue.getDataValue();
for ( int i = 0; list != null && i < list.size(); i++ ){
GBS_MWideUse_stBean mWideUse_st = ( GBS_MWideUse_stBean )list.get( i );
lstMainKey.add( mWideUse_st.getMainKey());
lstString1.add( mWideUse_st.getString1());
}
returnMap.put(PRODUCT_CATEGORY_CODE, lstMainKey);
returnMap.put(PRODUCT_CATEGORY_LABEL, lstString1);
returnValue.setDataValue( returnMap );
}
return returnValue;
}
/**
* get Currency
* @param none
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue getCurrency() throws Exception{
ReturnValue returnValue = new ReturnValue();
GBS_MWideUse_DB WideUse_DB = new GBS_MWideUse_DB( this.datasource );
Map returnMap = new HashMap();
returnValue = WideUse_DB.selectByTargetUse( "CURRENCY" );
if ( !returnValue.isError() ){
ArrayList lstMainKey = new ArrayList();
ArrayList lstString1 = new ArrayList();
lstMainKey.add("-1");
lstString1.add("");
ArrayList list = (ArrayList) returnValue.getDataValue();
for ( int i = 0; list != null && i < list.size(); i++ ){
GBS_MWideUse_stBean mWideUse_st = ( GBS_MWideUse_stBean )list.get( i );
lstMainKey.add( mWideUse_st.getMainKey());
lstString1.add( mWideUse_st.getString1());
}
returnMap.put(CURRENCY_CODE, lstMainKey);
returnMap.put(CURRENCY_LABEL, lstString1);
returnValue.setDataValue( returnMap );
}
return returnValue;
}
/**
* get Country
* @param none
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue getCountry() throws Exception{
ReturnValue returnValue = new ReturnValue();
GBS_MCountry_DB Country_DB = new GBS_MCountry_DB( this.datasource );
//get data for combox
returnValue = ( ReturnValue ) Country_DB.getCountry();
return returnValue;
}
/**
* get CustomerName
* @param strCustomerId
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue getCustomerName( String strCustomerId ) throws Exception{
ReturnValue returnValue = new ReturnValue();
GBS_MCustomer_DB mCustomerDb = new GBS_MCustomer_DB( this.datasource );
//get CustomerName
returnValue = ( ReturnValue ) mCustomerDb.selectByCustmerID( strCustomerId );
if ( !returnValue.isError() ){
GBS_Customer_stBean stBean = ( GBS_Customer_stBean )returnValue.getDataValue();
if ( stBean != null ){
String strCustomer = stBean.getCustomerName();
returnValue.setDataValue( strCustomer );
}
}
return returnValue;
}
/**
* get MifDetail
* @param GBS_MMif_stBean
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue getMifDetail( GBS_MMif_stBean fIn ) throws Exception{
ReturnValue returnValue = new ReturnValue();
GBS_MMifDetail_DB MifDetail_DB = new GBS_MMifDetail_DB( this.datasource );
//getData from db
returnValue = (ReturnValue) MifDetail_DB.getMifDetailList( fIn );
return returnValue;
}
/**
* Insert Mif and MifDetail
* @param GBS_MifEntryList_stBean FormFile
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue addMifDetail(GBS_MifEntryList_stBean fIn, String seqNo, String fileStatus) throws Exception {
GBS_MMifDetail_DB MifDetail_DB = new GBS_MMifDetail_DB(this.datasource);
//insert (MIF忣曬 and MIF徻嵶忣曬)
return MifDetail_DB.addMifDetail(fIn, seqNo, fileStatus);
}
/**
* Update Mif and MifDetail
* @param
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue updMifDetail(GBS_MifEntryList_stBean fIn, String seqNo, String fileStatus) throws Exception {
GBS_MMifDetail_DB MifDetail_DB = new GBS_MMifDetail_DB(this.datasource);
//update (MIF忣曬 and MIF徻嵶忣曬)
return MifDetail_DB.updateMifDetail(fIn, seqNo,fileStatus);
}
/**
* Delete Mif and MifDetail
* @param GBS_MMif_stBean
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @since 2004/08/10
*/
public ReturnValue delMifDetail( GBS_MMif_stBean fIn )
throws Exception{
GBS_MMifDetail_DB MifDetail_DB = new GBS_MMifDetail_DB( this.datasource );
//delete (MIF忣曬 and MIF徻嵶忣曬)
ReturnValue returnValue = ( ReturnValue ) MifDetail_DB.deleteMifDetail( fIn );
return returnValue;
}
public ReturnValue getCountrySubsList() throws Exception {
GBS_MCountry_DB db = new GBS_MCountry_DB(this.datasource);
return db.getCountryCodeAndSubsCode();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -