📄 propertyuinfo.java
字号:
iResult = 0;
}
}
else {
iResult = 0;
}
}
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("退出addPropertyByPublish方法...");
}
public int addPropertyByPublish(PropertyuDAO propDao, String cust_class, String info_type) throws SaasApplicationException {
PropertyuExt properExt = new PropertyuExt();
// 参数说明 1 级别为一级的会员 6 会员登录
log.LOG_INFO(propDao.getProperty_value()+"==cust_class="+cust_class+"=========info_type==="+info_type);
HashMap map = param.getSystemParameter("B2B", "101", cust_class, info_type);
if (map != null && map.size() > 0) {
if (map.get("para_code3") != null) {
Integer value = Integer.parseInt(propDao.getProperty_value());
value = value + Integer.parseInt(map.get("para_code3").toString());
propDao.setProperty_value(value.toString());
}
}
properExt.setParam(":VUSER_ID", propDao.getUser_id());
properExt.setParam(":VACCT_ID", propDao.getAcct_id());
properExt.setParam(":VCOUNT_TYPE", propDao.getCount_type());
properExt.setParam(":VPROPERTY_TYPE", propDao.getProperty_type());
properExt.setParam(":VPROPERTY_VALUE", propDao.getProperty_value());
properExt.setParam(":VCOUNT_UNIT", propDao.getCount_unit());
properExt.setParam(":VENABLE_TAG", propDao.getEnable_tag());
properExt.setParam(":VRSRV_STR1", propDao.getRsrv_str1());
properExt.setParam(":VRSRV_STR2", propDao.getRsrv_str2());
properExt.setParam(":VRSRV_STR3", propDao.getRsrv_str3());
properExt.setParam(":VRSRV_STR7", propDao.getRsrv_str7());
properExt.setParam(":VRSRV_STR8", propDao.getRsrv_str8());
properExt.setParam(":VRSRV_STR9", propDao.getRsrv_str9());
properExt.setParam(":VRSRV_STR10", propDao.getRsrv_str10());
properExt.setParam(":VREMARK", propDao.getRemark());
tradeQuery.executeBy(properExt.insBy("UPDATE_BY_ALL"));
this.outBuffer.setString("PROPERTY_VALUE", propDao.getProperty_value());
this.outBuffer.setString("PROPERTY_TYPE", propDao.getProperty_type());
this.outBuffer.setString("REMARK", propDao.getRemark());
return 0;
}
/**
* @param attr
* @param code1
* @return 判断是否启用审批机制
* @throws SaasApplicationException
*/
public boolean getValidityInfo(String attr, String code1) throws SaasApplicationException {
boolean audit = false;
CommparaExt comExt = new CommparaExt();
comExt.setParam(":VPARA_CODE1", code1);
comExt.setParam(":VPARAM_ATTR", attr);
ArrayList list = comExt.selByList("SEL_PARA_CODE2");
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
if (map.get("para_code3") != null) {
String code = map.get("para_code3").toString();
if (code == "1" || code.equals("1")) {
audit = true;
}
else {
audit = false;
}
}
}
return audit;
}
/**
* 会员登录时系统赠送黄金
*
* @param inbuffer
*/
public void userLoadProperty(Buffers inbuffer) {
log.LOG_INFO("进入userLoadProperty方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String acct_id = comm.GenTradeId();
String user_id = inbuffer.getString("SESSION_USER_ID");
String login = inbuffer.getString("LOGIN");
String property_type = "0";
String property_value = "0";
String count_unit = "";
String count_type = "";// 默认值
String enable_tag = "0";
String rsrv_str1 = "";
String rsrv_str2 = "";
String rsrv_str3 = "";
String rsrv_str7 = "";
String rsrv_str8 = "";
String rsrv_str9 = "";
String rsrv_str10 = "";
String remark = "会员登录";
String cust_class = inbuffer.getString("SESSION_CUST_CLASS");
try {
PropertyuDAO propDao = new PropertyuDAO();
propDao.setUser_id(user_id);
propDao.setCount_type(count_type);
propDao.setProperty_type(property_type);
propDao.setProperty_value(property_value);
propDao.setCount_unit(count_unit);
propDao.setEnable_tag(enable_tag);
propDao.setRsrv_str1(rsrv_str1);
propDao.setRsrv_str2(rsrv_str2);
propDao.setRsrv_str3(rsrv_str3);
propDao.setRsrv_str7(rsrv_str7);
propDao.setRsrv_str8(rsrv_str8);
propDao.setRsrv_str9(rsrv_str9);
propDao.setRsrv_str10(rsrv_str10);
propDao.setRemark(remark);
HashMap map = getUserPropertyByUserId(user_id, property_type);
if (login == "0" || login.equals("0")) {// 如果用户未登录过
if (map != null && map.size() > 0) {
if (map.get("acct_id") != null) {
acct_id = map.get("acct_id").toString();
propDao.setAcct_id(acct_id);
property_value = map.get("property_value").toString();
propDao.setProperty_value(property_value);
iResult = userLoadProperty(propDao, cust_class);
}
}
else {
propDao.setAcct_id(acct_id);
iResult = addDefaultUserProperty(propDao);
}
}
else {
iResult = 0;
}
}
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("退出userLoadProperty方法...");
}
public int userLoadProperty(PropertyuDAO propDao, String cust_class) throws SaasApplicationException {
PropertyuExt properExt = new PropertyuExt();
// 参数说明 1 级别为一级的会员 6 会员登录
HashMap map = param.getSystemParameter("B2B", "101", cust_class, "6");
if (map != null && map.size() > 0) {
if (map.get("para_code3") != null) {
Integer value = Integer.parseInt(propDao.getProperty_value());
value = value + Integer.parseInt(map.get("para_code3").toString());
propDao.setProperty_value(value.toString());
}
}
properExt.setParam(":VUSER_ID", propDao.getUser_id());
properExt.setParam(":VACCT_ID", propDao.getAcct_id());
properExt.setParam(":VCOUNT_TYPE", propDao.getCount_type());
properExt.setParam(":VPROPERTY_TYPE", propDao.getProperty_type());
properExt.setParam(":VPROPERTY_VALUE", propDao.getProperty_value());
properExt.setParam(":VCOUNT_UNIT", propDao.getCount_unit());
properExt.setParam(":VENABLE_TAG", propDao.getEnable_tag());
properExt.setParam(":VRSRV_STR1", propDao.getRsrv_str1());
properExt.setParam(":VRSRV_STR2", propDao.getRsrv_str2());
properExt.setParam(":VRSRV_STR3", propDao.getRsrv_str3());
properExt.setParam(":VRSRV_STR7", propDao.getRsrv_str7());
properExt.setParam(":VRSRV_STR8", propDao.getRsrv_str8());
properExt.setParam(":VRSRV_STR9", propDao.getRsrv_str9());
properExt.setParam(":VRSRV_STR10", propDao.getRsrv_str10());
properExt.setParam(":VREMARK", propDao.getRemark());
tradeQuery.executeBy(properExt.insBy("UPDATE_BY_ALL"));
this.outBuffer.setString("PROPERTY_VALUE", propDao.getProperty_value());
this.outBuffer.setString("PROPERTY_TYPE", propDao.getProperty_type());
this.outBuffer.setString("REMARK", propDao.getRemark());
return 0;
}
/**
* @param user_id
* @param property_type
* @return 取出会员财产
* @throws SaasApplicationException
*/
public String getUserPropertyValue(String user_id, String property_type) throws SaasApplicationException {
String value = "0";
HashMap map = getUserPropertyByUserId(user_id, property_type);
if (map != null && map.size() > 0) {
if (map.get("property_value") != null) {
value = map.get("property_value").toString();
}
}
return value;
}
/**
* @param user_id
* @param property_type
* @return 返回单条财产信息
* @throws SaasApplicationException
*/
public HashMap getUserPropertyByUserId(String user_id, String property_type) throws SaasApplicationException {
PropertyuExt properExt = new PropertyuExt();
HashMap map = new HashMap();
properExt.setParam(":VUSER_ID", user_id);
properExt.setParam(":VPROPERTY_TYPE", property_type);
ArrayList list = properExt.selByList("SEL_BY_ID");
if (list != null && list.size() > 0) {
map = (HashMap) list.get(0);
}
return map;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -