📄 paramethodmgr.java
字号:
* 取得param_attr
*/
public String getParam_CodeMax(String subsys_code, String param_attr) throws SaasApplicationException {
String param_code = "0";
CommparaExt compExt = new CommparaExt();
compExt.setParam(":VSUBSYS_CODE", subsys_code);
compExt.setParam(":VPARAM_ATTR", param_attr);
ArrayList list = compExt.selByList("SEL_BY_CODE_MAX");
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
if (map.get("mx") != null) {
int max = Integer.parseInt(map.get("mx").toString()) + 1;
param_code = String.valueOf(max);
}
}
return param_code;
}
/**
* 会员指数管理
*
* @XTYPE:0 新增 1修改
*/
public void saveOrUpdateComparam(Buffers inbuffer) {
log.LOG_INFO("进入saveOrUpdateComparam方法...");
this.outBuffer = inbuffer;
this.outBuffer = inbuffer;
int iResult = -1;
String xType = inbuffer.getString("XTYPE");
String subsys_code = inbuffer.getString("SUBSYS_CODE");
String param_attr = inbuffer.getString("PARAM_ATTR");
String param_code = inbuffer.getString("PARAM_CODE");
String param_name = inbuffer.getString("PARAM_NAME");
String para_code1 = inbuffer.getString("PARA_CODE1");
String para_code2 = inbuffer.getString("PARA_CODE2");
String para_code3 = inbuffer.getString("PARA_CODE3");
String para_code4 = inbuffer.getString("PARA_CODE4");
String para_code5 = inbuffer.getString("PARA_CODE5");
String para_code6 = inbuffer.getString("PARA_CODE6");
String para_code7 = inbuffer.getString("PARA_CODE7");
String para_code8 = inbuffer.getString("PARA_CODE8");
String para_code9 = inbuffer.getString("PARA_CODE9");
String para_code10 = inbuffer.getString("PARA_CODE10");
String para_code11 = inbuffer.getString("PARA_CODE11");
String para_code12 = inbuffer.getString("PARA_CODE12");
String para_code13 = inbuffer.getString("PARA_CODE13");
String para_code14 = inbuffer.getString("PARA_CODE14");
String para_code15 = inbuffer.getString("PARA_CODE15");
String para_code16 = inbuffer.getString("PARA_CODE16");
String para_code17 = inbuffer.getString("PARA_CODE17");
String para_code18 = inbuffer.getString("PARA_CODE18");
String para_code19 = inbuffer.getString("PARA_CODE19");
String para_code20 = inbuffer.getString("PARA_CODE20");
String para_code21 = inbuffer.getString("PARA_CODE21");
String para_code22 = inbuffer.getString("PARA_CODE22");
String para_code23 = inbuffer.getString("PARA_CODE23");
String para_code24 = inbuffer.getString("PARA_CODE24");
String para_code25 = inbuffer.getString("PARA_CODE25");
String para_code26 = inbuffer.getString("PARA_CODE26");
String para_code27 = inbuffer.getString("PARA_CODE27");
String para_code28 = inbuffer.getString("PARA_CODE28");
String para_code29 = inbuffer.getString("PARA_CODE29");
String para_code30 = inbuffer.getString("PARA_CODE30");
String start_date = inbuffer.getString("START_DATE");
String end_date = inbuffer.getString("END_DATE");
String remark = inbuffer.getString("REMARK");
String update_staff_id = inbuffer.getString("SESSION_USER_ID");
String update_time = comm.GenSysdate("1");
try {
CommparaDAO comp = new CommparaDAO();
comp.setSubsys_code(subsys_code);
comp.setParam_code(param_code);
comp.setParam_name(param_name);
comp.setParam_attr(param_attr);
comp.setStart_date(start_date);
comp.setPara_code1(para_code1);
comp.setPara_code4(para_code4);
comp.setPara_code5(para_code5);
comp.setPara_code6(para_code6);
comp.setPara_code7(para_code7);
comp.setPara_code8(para_code8);
comp.setPara_code9(para_code9);
comp.setPara_code10(para_code10);
comp.setPara_code11(para_code11);
comp.setPara_code12(para_code12);
comp.setPara_code13(para_code13);
comp.setPara_code14(para_code14);
comp.setPara_code15(para_code15);
comp.setPara_code16(para_code16);
comp.setPara_code17(para_code17);
comp.setPara_code18(para_code18);
comp.setPara_code19(para_code19);
comp.setPara_code20(para_code20);
comp.setPara_code2(para_code2);
comp.setPara_code21(para_code21);
comp.setPara_code22(para_code22);
comp.setPara_code23(para_code23);
comp.setPara_code24(para_code24);
comp.setPara_code25(para_code25);
comp.setPara_code26(para_code26);
comp.setPara_code27(para_code27);
comp.setPara_code28(para_code28);
comp.setPara_code29(para_code29);
comp.setPara_code3(para_code3);
comp.setPara_code30(para_code30);
comp.setEnd_date(end_date);
comp.setUpdate_staff_id(update_staff_id);
comp.setUpdate_time(update_time);
comp.setRemark(remark);
iResult = saveOrUpdateComparam(comp, xType);
}
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("退出saveOrUpdateComparam方法...");
}
public int saveOrUpdateComparam(CommparaDAO comp, String info_type) throws SaasApplicationException {
CommparaExt compExt = new CommparaExt();
compExt.setParam(":VSUBSYS_CODE", comp.getSubsys_code());
compExt.setParam(":VPARAM_ATTR", comp.getParam_attr());
compExt.setParam(":VPARAM_CODE", comp.getParam_code());
compExt.setParam(":VPARAM_NAME", comp.getParam_name());
compExt.setParam(":VPARA_CODE1", comp.getPara_code1());
compExt.setParam(":VPARA_CODE2", comp.getPara_code2());
compExt.setParam(":VPARA_CODE3", comp.getPara_code3());
compExt.setParam(":VPARA_CODE4", comp.getPara_code4());
compExt.setParam(":VPARA_CODE5", comp.getPara_code5());
compExt.setParam(":VPARA_CODE6", comp.getPara_code6());
compExt.setParam(":VPARA_CODE7", comp.getPara_code7());
compExt.setParam(":VPARA_CODE8", comp.getPara_code8());
compExt.setParam(":VPARA_CODE9", comp.getPara_code9());
compExt.setParam(":VPARA_CODE10", comp.getPara_code10());
compExt.setParam(":VPARA_CODE11", comp.getPara_code11());
compExt.setParam(":VPARA_CODE12", comp.getPara_code12());
compExt.setParam(":VPARA_CODE13", comp.getPara_code13());
compExt.setParam(":VPARA_CODE14", comp.getPara_code14());
compExt.setParam(":VPARA_CODE15", comp.getPara_code15());
compExt.setParam(":VPARA_CODE16", comp.getPara_code16());
compExt.setParam(":VPARA_CODE17", comp.getPara_code17());
compExt.setParam(":VPARA_CODE18", comp.getPara_code18());
compExt.setParam(":VPARA_CODE19", comp.getPara_code19());
compExt.setParam(":VPARA_CODE20", comp.getPara_code20());
compExt.setParam(":VPARA_CODE21", comp.getPara_code21());
compExt.setParam(":VPARA_CODE22", comp.getPara_code22());
compExt.setParam(":VPARA_CODE23", comp.getPara_code23());
compExt.setParam(":VPARA_CODE24", comp.getPara_code24());
compExt.setParam(":VPARA_CODE25", comp.getPara_code25());
compExt.setParam(":VPARA_CODE26", comp.getPara_code26());
compExt.setParam(":VPARA_CODE27", comp.getPara_code27());
compExt.setParam(":VPARA_CODE28", comp.getPara_code28());
compExt.setParam(":VPARA_CODE29", comp.getPara_code29());
compExt.setParam(":VPARA_CODE30", comp.getPara_code30());
compExt.setParam(":VSTART_DATE", comp.getStart_date());
compExt.setParam(":VEND_DATE", comp.getEnd_date());
compExt.setParam(":VREMARK", comp.getRemark());
compExt.setParam(":VUPDATE_STAFF_ID", comp.getUpdate_staff_id());
compExt.setParam(":VUPDATE_TIME", comp.getUpdate_time());
boolean trade = checkWealth(comp.getSubsys_code(), comp.getParam_attr(), comp.getPara_code4(), comp.getPara_code6());
if (trade) {
tradeQuery.executeBy(compExt.insBy("EDIT_BY_ALL"));
}
else {
tradeQuery.executeBy(compExt.insBy("INS_BY_ALL"));
}
return 0;
}
/**
* 删除参数
*/
public void removeComparam(Buffers inbuffer) {
log.LOG_INFO("进入removeComparam方法...");
this.outBuffer = inbuffer;
this.outBuffer = inbuffer;
int iResult = -1;
String subsys_code = inbuffer.getString("SUBSYS_CODE");
String param_attr = inbuffer.getString("PARAM_ATTR");
String para_code1 = inbuffer.getString("PARA_CODE1");
String para_code4 = inbuffer.getString("PARA_CODE4");
try {
CommparaDAO comp = new CommparaDAO();
comp.setSubsys_code(subsys_code);
comp.setPara_code1(para_code1);
comp.setParam_attr(param_attr);
comp.setPara_code4(para_code4);
iResult = removeComparam(comp);
}
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("退出saveOrUpdateComparam方法...");
}
public int removeComparam(CommparaDAO comp) throws SaasApplicationException {
CommparaExt compExt = new CommparaExt();
compExt.setParam(":VSUBSYS_CODE", comp.getSubsys_code());
compExt.setParam(":VPARA_CODE1", comp.getPara_code1());
compExt.setParam(":VPARAM_ATTR", comp.getParam_attr());
compExt.setParam(":VPARA_CODE4", comp.getPara_code4());
tradeQuery.executeBy(compExt.insBy("DEL_BY_CODE"));
return 0;
}
/**
* 找出会员财富单条信息
*/
public HashMap getCommparamByCode4(String subsys_code, String param_attr, String para_code1, String para_code4) throws SaasApplicationException {
CommparaExt compExt = new CommparaExt();
HashMap map = new HashMap();
compExt.setParam(":VSUBSYS_CODE", subsys_code);
compExt.setParam(":VPARA_CODE1", para_code1);
compExt.setParam(":VPARAM_ATTR", param_attr);
compExt.setParam(":VPARA_CODE4", para_code4);
ArrayList list = compExt.selByList("SEL_BY_CODE4");
if (list != null && list.size() > 0) {
map = (HashMap) list.get(0);
}
return map;
}
/**
* @param subsys_code
* @param param_attr
* @param para_code4
* @param para_code6
* @return 检测会员财富设置是否重复
* @throws SaasApplicationException
*/
public boolean checkWealth(String subsys_code, String param_attr, String para_code4, String para_code6) throws SaasApplicationException {
boolean result = false;
CommparaExt commpExt = new CommparaExt();
commpExt.setParam(":VSUBSYS_CODE", subsys_code);
commpExt.setParam(":VPARA_CODE6", para_code6);
commpExt.setParam(":VPARAM_ATTR", param_attr);
commpExt.setParam(":VPARA_CODE4", para_code4);
ArrayList list = commpExt.selByList("SEL_BY_CHECKCODE");
if (list != null && list.size() > 0) {
result = true;
}
return result;
}
/**
* 系统初始化会员财产
*/
public HashMap getSystemParameter(String subsys_code, String param_attr, String para_code4, String para_code6) throws SaasApplicationException {
HashMap propMap = new HashMap();
CommparaExt commpExt = new CommparaExt();
commpExt.setParam(":VSUBSYS_CODE", subsys_code);
commpExt.setParam(":VPARA_CODE6", para_code6);
commpExt.setParam(":VPARAM_ATTR", param_attr);
commpExt.setParam(":VPARA_CODE4", para_code4);
ArrayList list = commpExt.selByList("SEL_BY_CHECKCODE");
if (list != null && list.size() > 0) {
propMap = (HashMap) list.get(0);
}
return propMap;
}
/**
* @param attr
* @param code1
* @return 取出参数信息值
* @throws SaasApplicationException
*/
public ArrayList getComparamListByCode(String attr, String code1) throws SaasApplicationException {
CommparaExt comExt = new CommparaExt();
comExt.setParam(":VPARA_CODE1", code1);
comExt.setParam(":VPARAM_ATTR", attr);
ArrayList list = comExt.selByList("SEL_PARA_CODE2");
return list;
}
/**
* @param attr
* @return 获取文件的相对路径
* @throws SaasApplicationException
*/
public HashMap getPagetUrlByCode(String attr) throws SaasApplicationException {
HashMap urlMap = new HashMap();
ArrayList list = getCompareInfoByAttr(attr);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
HashMap map = (HashMap) list.get(i);
String code1 = map.get("para_code1").toString();
String url = map.get("para_code7").toString();
urlMap.put(code1, url);
}
}
return urlMap;
}
/**
* @param cust_id
* @param state_code
* @param state_code1
* @param para_attr
* @return 取出客户订购的服务
* @throws SaasApplicationException
*/
public String getCustServerSelect(String cust_id, String state_code, String state_code1, String para_attr) throws SaasApplicationException {
String role = "";
ArrayList list = new ArrayList();
CommparaExt newExt = new CommparaExt();
newExt.setParam(":VCUST_ID", cust_id);
newExt.setParam(":VSTATE_CODE", state_code);
newExt.setParam(":VSTATE_CODE1", state_code1);
newExt.setParam(":VPARAM_ATTR", para_attr);
list = newExt.selByList("SEL_BY_PARAM_SERVER");
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
HashMap map = (HashMap) list.get(i);
String para_code1 = map.get("para_code1").toString();
String para_code2 = map.get("para_code1").toString();
role = role + "<option value=" + para_code1 + ">" + para_code2 + "</option>";
}
}
return role;
}
/**
* 取出广告数量
*/
public int getAdvertiseNumber(String param_attr, String code_1) throws SaasApplicationException {
int num = 0;
ArrayList list = getComparamListByCode(param_attr, code_1);
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
if (map.get("para_code3") != null) {
num = Integer.parseInt(map.get("para_code3").toString());
}
}
return num;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -