📄 appinfo.java
字号:
package com.saas.biz.appMgr;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Map.Entry;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.appDAO.AppDAO;
import com.saas.biz.dao.appDAO.AppExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
import com.saas.biz.custMgr.*;
public class AppInfo {
Dbtable tradeQuery;
commMethodMgr comm;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public AppInfo() {
log = new Logger(this);
tradeQuery = new Dbtable();
comm = new commMethodMgr();
}
public void setTradeQuery(Dbtable tradeQuery) {
this.tradeQuery = tradeQuery;
}
public Dbtable getTradeQuery() {
return this.tradeQuery;
}
public void setOutBuffer(Buffers outBuffer) {
this.outBuffer = outBuffer;
}
public Buffers getOutBuffer() {
return this.outBuffer;
}
public ArrayList getQueryResult() {
return this.queryResult;
}
public void setQueryResult(ArrayList queryResult) {
this.queryResult = queryResult;
}
/**
* 新增群组 user_id:是多个人员的id,以|分隔
*
* @param inbuffer
*/
public void addAppInfo(Buffers inbuffer) {
log.LOG_INFO("进入addAppInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id=inbuffer.getString("SESSION_CUST_ID");
String form_id=inbuffer.getString("FORM_ID");
String app_id=inbuffer.getString("APP_ID");
String app_no=inbuffer.getString("APP_NO");
String goods_id=inbuffer.getString("GOODS_ID");
String resource_id=inbuffer.getString("RESOURCE_ID");
String aim_id=inbuffer.getString("AIM_ID");
String obj_user_id=inbuffer.getString("OBJ_USER_ID");
String obj_user_name=inbuffer.getString("OBJ_USER_NAME");
String app_type=inbuffer.getString("APP_TYPE");
String app_date=inbuffer.getString("APP_DATE");
String state_code=inbuffer.getString("STATE_CODE");
String state_code_date=inbuffer.getString("STATE_CODE_DATE");
String user_id=inbuffer.getString("SESSION_USER_ID");
String publish_date=inbuffer.getString("PUBLISH_DATE");
String remark=inbuffer.getString("REMARK");
try {
iResult = addAppInfo(form_id,cust_id,app_id,app_no,goods_id,resource_id,aim_id,obj_user_id,
obj_user_name,app_type,app_date,state_code,state_code_date,
user_id,publish_date,remark);
} catch (Exception e) {
log.LOG_INFO(e.getMessage());
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
} else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出addAppInfo方法...");
}
public int addAppInfo(String form_id,String cust_id,String app_id,String app_no,String goods_id,String resource_id,String aim_id,String obj_user_id,
String obj_user_name,String app_type,String app_date,String state_code,String state_code_date,
String user_id,String publish_date,String remark) throws SaasApplicationException {
AppExt appExt = new AppExt();
appExt.setParam(":VFORM_ID",form_id);
appExt.setParam(":VCUST_ID",cust_id);
appExt.setParam(":VAPP_ID",app_id);
appExt.setParam(":VAPP_NO",app_no);
appExt.setParam(":VGOODS_ID",goods_id);
appExt.setParam(":VRESOURCE_ID",resource_id);
appExt.setParam(":VAIM_ID",aim_id);
appExt.setParam(":VOBJ_USER_ID",obj_user_id);
appExt.setParam(":VOBJ_USER_NAME",obj_user_name);
appExt.setParam(":VAPP_TYPE",app_type);
appExt.setParam(":VAPP_DATE",app_date);
appExt.setParam(":VSTATE_CODE",state_code);
appExt.setParam(":VSTATE_CODE_DATE",state_code_date);
appExt.setParam(":VUSER_ID",user_id);
appExt.setParam(":VPUBLISH_DATE",publish_date);
appExt.setParam(":VREMARK",remark);
tradeQuery.executeBy(appExt.insBy("INS_All_APP"));
return 0;
}
public void updateAppInfo(Buffers inbuffer) {
log.LOG_INFO("进入updateAppInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id=inbuffer.getString("SESSION_CUST_ID");
String app_id=inbuffer.getString("APP_ID");
String app_no=inbuffer.getString("APP_NO");
String goods_id=inbuffer.getString("GOODS_ID");
String resource_id=inbuffer.getString("RESOURCE_ID");
String aim_id=inbuffer.getString("AIM_ID");
String obj_user_id=inbuffer.getString("OBJ_USER_ID");
String obj_user_name=inbuffer.getString("OBJ_USER_NAME");
String app_type=inbuffer.getString("APP_TYPE");
String app_date=inbuffer.getString("APP_DATE");
String state_code=inbuffer.getString("STATE_CODE");
String state_code_date=inbuffer.getString("STATE_CODE_DATE");
String user_id=inbuffer.getString("SESSION_USER_ID");
String publish_date=inbuffer.getString("PUBLISH_DATE");
String remark=inbuffer.getString("REMARK");
try {
iResult = updateAppInfo(cust_id,app_id,app_no,goods_id,resource_id,aim_id,obj_user_id,
obj_user_name,app_type,app_date,state_code,state_code_date,
user_id,publish_date,remark);
} catch (Exception e) {
log.LOG_INFO(e.getMessage());
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
} else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出updateAppInfo方法...");
}
public int updateAppInfo(String cust_id,String app_id,String app_no,String goods_id,String resource_id,String aim_id,String obj_user_id,
String obj_user_name,String app_type,String app_date,String state_code,String state_code_date,
String user_id,String publish_date,String remark) throws SaasApplicationException {
AppExt appExt = new AppExt();
appExt.setParam(":VCUST_ID",cust_id);
appExt.setParam(":VAPP_ID",app_id);
appExt.setParam(":VAPP_NO",app_no);
appExt.setParam(":VGOODS_ID",goods_id);
appExt.setParam(":VRESOURCE_ID",resource_id);
appExt.setParam(":VAIM_ID",aim_id);
appExt.setParam(":VOBJ_USER_ID",obj_user_id);
appExt.setParam(":VOBJ_USER_NAME",obj_user_name);
appExt.setParam(":VAPP_TYPE",app_type);
appExt.setParam(":VAPP_DATE",app_date);
appExt.setParam(":VSTATE_CODE",state_code);
appExt.setParam(":VSTATE_CODE_DATE",state_code_date);
appExt.setParam(":VUSER_ID",user_id);
appExt.setParam(":VPUBLISH_DATE",publish_date);
appExt.setParam(":VREMARK",remark);
tradeQuery.executeBy(appExt.insBy("UPDATE_All_APP"));
return 0;
}
public void delAppInfo(Buffers inbuffer) {
log.LOG_INFO("进入delAppInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String app_id = inbuffer.getString("APP_ID");
try {
iResult = delAppInfo(cust_id,app_id);
} catch (Exception e) {
log.LOG_INFO(e.getMessage());
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
} else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出delAppInfo方法...");
}
public int delAppInfo(String cust_id,String app_id) throws SaasApplicationException {
AppExt appExt = new AppExt();
appExt.setParam(":VCUST_ID",cust_id);
appExt.setParam(":VAPP_ID",app_id);
tradeQuery.executeBy(appExt.insBy("DEL_ONE_APP"));
return 0;
}
public ArrayList getAllApp(int iStart,String cust_id,String state_code) throws SaasApplicationException{
AppExt appExt = new AppExt();
ArrayList list = new ArrayList();
try {
iStart = iStart*20;
appExt.setParam(":VCUST_ID",cust_id);
appExt.setParam(":VSTATE_CODE",state_code);
list = appExt.selByList("SEL_ALL_APP", iStart, 20);
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
public int getAllApp(String cust_id,String state_code) throws SaasApplicationException{
AppExt appExt = new AppExt();
ArrayList list = new ArrayList();
int count=0;
try {
appExt.setParam(":VCUST_ID",cust_id);
appExt.setParam(":VSTATE_CODE",state_code);
list = appExt.selByList("SEL_ALL_APP");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
if(list!=null && list.size()>0){
count=list.size();
}
return count;
}
public HashMap getOneApp(String cust_id,String app_id) {
ArrayList list = new ArrayList();
AppExt appExt = new AppExt();
appExt.setParam(":VCUST_ID", cust_id);
appExt.setParam(":VAPP_ID", app_id);
list = appExt.selByList("SEL_ONE_APP");
HashMap map = new HashMap();
if (list != null && list.size() > 0) {
map = (HashMap) list.get(0);
}
return map;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -