📄 oppproainfo.java
字号:
package com.saas.biz.oppProAMgr;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import com.saas.biz.commen.commMethodMgr;
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.dao.oppProADAO.*;
public class OppProAInfo{
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public OppProAInfo() {
log = new Logger(this);
tradeQuery = new Dbtable();
}
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;
}
//添加一条竞争项目分析
public void addOppProAInfo(Buffers inbuffer) {
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
log.LOG_INFO("进入addOppProAInfo方法...");
String cust_id=inbuffer.getString("CUST_ID");
String proj_id=inbuffer.getString("PROJ_ID");
String item_id=inbuffer.getString("ITEM_ID");
String opp_cust_id=inbuffer.getString("OPP_CUST_ID");
String title=inbuffer.getString("TITLE");
String content=inbuffer.getString("CONTENT");
String score=inbuffer.getString("SCORE");
String level=inbuffer.getString("LEVEL");
String remark=inbuffer.getString("REMARK");
int iResult = -1;
try {
iResult = addOppProAInfo(cust_id,proj_id,item_id,opp_cust_id,title,content,score,level,remark);
}
catch (SaasApplicationException 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("退出addOppProAInfo方法...");
}
public int addOppProAInfo(String cust_id,String proj_id,String item_id,String opp_cust_id,String title,String content,String score,String level,String remark) throws SaasApplicationException {
OppProAExt oppProAExt = new OppProAExt();
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VPROJ_ID",proj_id);
oppProAExt.setParam(":VITEM_ID",item_id);
oppProAExt.setParam(":VOPP_CUST_ID",opp_cust_id);
oppProAExt.setParam(":VTITLE",title);
oppProAExt.setParam(":VCONTENT",content);
oppProAExt.setParam(":VSCORE",score);
oppProAExt.setParam(":VLEVEL",level);
oppProAExt.setParam(":VREMARK",remark);
tradeQuery.executeBy(oppProAExt.insBy("INS_OPP_PRO_A"));
return 0;
}
public void updateOppProA(Buffers inbuffer) {
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
log.LOG_INFO("进入updateOppProA方法...");
String cust_id=inbuffer.getString("SESSION_CUST_ID");
String item_id=inbuffer.getString("ITEM_ID");
String opp_cust_id=inbuffer.getString("OPP_CUST_ID");
String title=inbuffer.getString("TITLE");
String content=inbuffer.getString("CONTENT");
String score=inbuffer.getString("SCORE");
String level=inbuffer.getString("LEVEL");
String remark=inbuffer.getString("REMARK");
int iResult = -1;
try {
iResult = updateOppProA(cust_id,item_id,opp_cust_id,title,content,score,level,remark);
}
catch (SaasApplicationException 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("退出updateOppProA方法...");
}
public int updateOppProA(String cust_id,String item_id,String opp_cust_id,String title,String content,String score,String level,String remark) throws SaasApplicationException {
OppProAExt oppProAExt = new OppProAExt();
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VITEM_ID",item_id);
oppProAExt.setParam(":VOPP_CUST_ID",opp_cust_id);
oppProAExt.setParam(":VTITLE",title);
oppProAExt.setParam(":VCONTENT",content);
oppProAExt.setParam(":VSCORE",score);
oppProAExt.setParam(":VLEVEL",level);
oppProAExt.setParam(":VREMARK",remark);
tradeQuery.executeBy(oppProAExt.insBy("UPDATE_OPP_PROA"));
return 0;
}
public ArrayList getOppProList(int iStart,String proj_id,String cust_id) throws SaasApplicationException{
OppProAExt oppProAExt = new OppProAExt();
ArrayList list = new ArrayList();
try {
if (iStart == 0) {
iStart = 0;
}
else {
iStart = (iStart - 1) * 20;
}
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VPROJ_ID",proj_id);
list = oppProAExt.selByList("SEL_OPPPROA_BY_PROJ_ID", iStart, 20);
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
//取出所有的竞争项目
public ArrayList getOppProAByItemId(String item_id,String cust_id) throws SaasApplicationException{
OppProAExt oppProAExt = new OppProAExt();
ArrayList list = new ArrayList();
try {
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VITEM_ID",item_id);
list = oppProAExt.selByList("SEL_OPP_PROA_BY_ITEM_ID");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
//删除竞争项目
public void delOppProA(Buffers inbuffer) {
log.LOG_INFO("进入delOppProA方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
try {
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String item_id = inbuffer.getString("ITEM_ID");
iResult = delOppPro(cust_id,item_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("退出delOppProA方法...");
}
public int delOppPro(String cust_id, String item_id) throws SaasApplicationException {
OppProAExt oppProAExt = new OppProAExt();
oppProAExt.setParam(":VCUST_ID", cust_id);
oppProAExt.setParam(":VITEM_ID", item_id);
tradeQuery.executeBy(oppProAExt.insBy("DEL_BY_OPP_PRO_A"));
return 0;
}
//通过proj_id取出对应的竞争项目
public ArrayList getOppProAList(int iStart,String cust_id,String proj_id) throws SaasApplicationException{
OppProAExt oppProAExt = new OppProAExt();
ArrayList list = new ArrayList();
try {
if (iStart == 0) {
iStart = 0;
}
else {
iStart = (iStart - 1) * 20;
}
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VPROJ_ID",proj_id);
list = oppProAExt.selByList("SEL_OPPA_BY_PROJ_ID",iStart, 20);
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
public int getOppProAList(String cust_id,String proj_id) throws SaasApplicationException{
OppProAExt oppProAExt = new OppProAExt();
ArrayList list = new ArrayList();
int count=0;
try {
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VPROJ_ID",proj_id);
list = oppProAExt.selByList("SEL_OPPA_BY_PROJ_ID");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
if(list != null && list.size()>0){
count = list.size();
}
return count;
}
public ArrayList getOppList(int iStart,String cust_id,String proj_id) throws SaasApplicationException{
OppProAExt oppProAExt = new OppProAExt();
log.LOG_INFO("========="+iStart);
log.LOG_INFO("========="+cust_id);
log.LOG_INFO("========="+proj_id);
ArrayList list = new ArrayList();
try {
iStart = iStart*3;
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VPROJ_ID",proj_id);
list = oppProAExt.selByList("SEL_OPP_LIST_PAGE",iStart,4);
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
public int getOppList(String cust_id,String proj_id) throws SaasApplicationException{
OppProAExt oppProAExt = new OppProAExt();
ArrayList list = new ArrayList();
int count=0;
try {
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VPROJ_ID",proj_id);
list = oppProAExt.selByList("SEL_OPP_LIST_PAGE");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
if(list != null && list.size()>0){
count = list.size();
}
return count;
}
public ArrayList getOppTitleList(String cust_id,String opp_cust_id) throws SaasApplicationException{
OppProAExt oppProAExt = new OppProAExt();
ArrayList list = new ArrayList();
try {
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VOPP_CUST_ID",opp_cust_id);
list = oppProAExt.selByList("SEL_OPP_TITLE");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
public ArrayList getProAByItemIdList(String cust_id,String item_id) throws SaasApplicationException{
OppProAExt oppProAExt = new OppProAExt();
ArrayList list = new ArrayList();
try {
oppProAExt.setParam(":VCUST_ID",cust_id);
oppProAExt.setParam(":VITEM_ID",item_id);
list = oppProAExt.selByList("SEL_OPP_BY_ITEM_ID");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -