📄 basicsettingsaction.java
字号:
for(String bankuaiId : bankuaiIdArray){
fidBuffer.append(","+bankuaiId);
}
List<Map<String,String>> forumsInfoMapList = dataBaseService.executeQuery("SELECT fid,postcredits,replycredits,digestcredits,postattachcredits,getattachcredits FROM "+tablePrefix+"forumfields WHERE fid IN("+fidBuffer.toString()+")");
for (String bankuaiId : bankuaiIdArray) {
boolean bool = true;
Map<String,String> forumsInfoMap = null;
for (Map<String,String> tempMap:forumsInfoMapList) {
if (tempMap.get("fid").equals(bankuaiId)) {
forumsInfoMap = tempMap;
break;
}
}
if (forumsInfoMap != null) {
Map tempMap = null;
String postcreditsstatus_ = request.getParameter("postcreditsstatus_" + bankuaiId);
String postcreditsInDS = forumsInfoMap.get("postcredits");
String textName1 = "postcredits_" + bankuaiId;
tempMap = getResultString(request, postcreditsstatus_,
postcreditsInDS, creditid, textName1);
bool = bool&&(Boolean) tempMap.get("bool");
String postcreditsResult = (String) tempMap.get("result");
String replycreditsstatus_ = request
.getParameter("replycreditsstatus_" + bankuaiId);
String replycreditsInDS = forumsInfoMap.get("replycredits");
String textName2 = "replycredits_" + bankuaiId;
tempMap = getResultString(request, replycreditsstatus_,
replycreditsInDS, creditid, textName2);
bool = bool&&(Boolean) tempMap.get("bool");
String replycreditsResult = (String) tempMap.get("result");
String digestcreditsstatus_ = request
.getParameter("digestcreditsstatus_"
+ bankuaiId);
String digestcreditsInDS = forumsInfoMap.get("digestcredits");
String textName3 = "digestcredits_" + bankuaiId;
tempMap = getResultString(request, digestcreditsstatus_,
digestcreditsInDS, creditid, textName3);
bool = bool&&(Boolean) tempMap.get("bool");
String digestcreditsResult = (String) tempMap.get("result");
String postattachcreditsstatus_ = request
.getParameter("postattachcreditsstatus_"
+ bankuaiId);
String postattachcreditsInDS = forumsInfoMap.get("postattachcredits");
String textName4 = "postattachcredits_" + bankuaiId;
tempMap = getResultString(request, postattachcreditsstatus_,
postattachcreditsInDS, creditid, textName4);
bool = bool&&(Boolean) tempMap.get("bool");
String postattachcreditsResult = (String) tempMap.get("result");
String getattachcreditsstatus_ = request
.getParameter("getattachcreditsstatus_"
+ bankuaiId);
String getattachcreditsInDS = forumsInfoMap.get("getattachcredits");
String textName5 = "getattachcredits_" + bankuaiId;
tempMap = getResultString(request, getattachcreditsstatus_,
getattachcreditsInDS, creditid, textName5);
bool = bool&&(Boolean) tempMap.get("bool");
String getattachcreditsResult = (String) tempMap.get("result");
if (!bool) {
dataBaseService.execute("UPDATE "+tablePrefix+"forumfields SET postcredits='"+postcreditsResult+"',replycredits='"+replycreditsResult+"',digestcredits='"+digestcreditsResult+"',postattachcredits='"+postattachcreditsResult+"',getattachcredits='"+getattachcreditsResult+"' WHERE fid="+bankuaiId);
}
}
}
request.setAttribute("successInfo", "积分项目设置成功更新。");
request.setAttribute("requestPath",request.getContextPath()+ FinalProperty.FROM_BasicSettingsAction_GO_bksetting+"&extcreditid="+creditId);
request.getSession().setAttribute("extcreditidFromBankuaiSettingCommit", creditId);
return mapping.findForward("success");
}
}
@SuppressWarnings("unchecked")
private List<BKSettingVO> getBKSettingVOList(int creditid){
List<BKSettingVO> bKSettingVOList = new ArrayList<BKSettingVO>();
List<Map<String,String>> forumsMapList = dataBaseService.executeQuery("SELECT f.fid,f.fup,f.type,f.name,ff.postcredits,ff.replycredits,ff.getattachcredits,ff.postattachcredits,ff.digestcredits FROM "+tablePrefix+"forums AS f LEFT JOIN "+tablePrefix+"forumfields AS ff ON f.fid=ff.fid WHERE f.fup<>0");
if(forumsMapList!=null){
BKSettingVO bkSettingVO = null;
BKSettingVO subBKSettingVO = null;
Map tempMap = null;
Byte tempByte = null;
String postcredits = null;
String replycredits = null;
String getattachcredits = null;
String postattachcredits = null;
String digestcredits = null;
String forumFid = null;
String subFup = null;
String type = null;
Map<String,String> forumsMap = null;
int forumsMapListSize = forumsMapList.size();
for(int i = 0; i<forumsMapListSize;i++){
forumsMap = forumsMapList.get(i);
bkSettingVO = new BKSettingVO();
type = forumsMap.get("type");
if(type.equals("forum")){
forumFid = forumsMap.get("fid");
bkSettingVO.setFid(forumFid);
bkSettingVO.setFup(forumsMap.get("fup"));
bkSettingVO.setType(type);
bkSettingVO.setName(forumsMap.get("name"));
postcredits = forumsMap.get("postcredits");
tempMap = dataParse.characterParse(postcredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
bkSettingVO.setPostcredits(tempByte.toString());
}
replycredits = forumsMap.get("replycredits");
tempMap = dataParse.characterParse(replycredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
bkSettingVO.setReplycredits(tempByte.toString());
}
getattachcredits= forumsMap.get("getattachcredits");
tempMap = dataParse.characterParse(getattachcredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
bkSettingVO.setGetattachcredits(tempByte.toString());
}
postattachcredits = forumsMap.get("postattachcredits");
tempMap = dataParse.characterParse(postattachcredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
bkSettingVO.setPostattachcredits(tempByte.toString());
}
digestcredits = forumsMap.get("digestcredits");
tempMap = dataParse.characterParse(digestcredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
bkSettingVO.setDigestcredits(tempByte.toString());
}
bKSettingVOList.add(bkSettingVO);
for(int j = 0;j<forumsMapListSize;j++){
forumsMap = forumsMapList.get(j);
subFup = forumsMap.get("fup");
if(subFup.equals(forumFid)){
subBKSettingVO = new BKSettingVO();
subBKSettingVO.setFid(forumsMap.get("fid"));
subBKSettingVO.setFup(subFup);
subBKSettingVO.setType(forumsMap.get("type"));
subBKSettingVO.setName(forumsMap.get("name"));
postcredits = forumsMap.get("postcredits");
tempMap = dataParse.characterParse(postcredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
subBKSettingVO.setPostcredits(tempByte.toString());
}
replycredits = forumsMap.get("replycredits");
tempMap = dataParse.characterParse(replycredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
subBKSettingVO.setReplycredits(tempByte.toString());
}
getattachcredits= forumsMap.get("getattachcredits");
tempMap = dataParse.characterParse(getattachcredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
subBKSettingVO.setGetattachcredits(tempByte.toString());
}
postattachcredits = forumsMap.get("postattachcredits");
tempMap = dataParse.characterParse(postattachcredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
subBKSettingVO.setPostattachcredits(tempByte.toString());
}
digestcredits = forumsMap.get("digestcredits");
tempMap = dataParse.characterParse(digestcredits, false);
tempByte = (Byte)tempMap.get(creditid);
if(tempByte!=null){
subBKSettingVO.setDigestcredits(tempByte.toString());
}
bKSettingVOList.add(subBKSettingVO);
}
}
}
}
}
return bKSettingVOList;
}
@SuppressWarnings("unchecked")
public ActionForward usergroupSetting(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
String settingsubmit = request.getParameter("settingsubmit");
if(settingsubmit == null){
String creditId = request.getParameter("extcreditid");
if (creditId == null) {
HttpSession session = request.getSession();
creditId = (String) session.getAttribute(
"extcreditidFromUsergroupSettingCommit");
session.removeAttribute(
"extcreditidFromUsergroupSettingCommit");
}
int creditid = Integer.parseInt(creditId);
List<UsergroupSettingVO> usergroupSettingVOList = getUsergroupSettingVOList(creditId);
Map extcredits = dataParse.characterParse(ForumInit.settings.get("extcredits"), true);
Map extcredit = (Map) extcredits.get(creditid);
request.setAttribute("extcredits", extcredits);
request.setAttribute("usergroupVOList", usergroupSettingVOList);
request.setAttribute("extcreditid", creditid);
request.setAttribute("extcredit", extcredit);
return mapping.findForward("usergroupsetting");
}else{
String creditId = request.getParameter("extcreditid");
List<Map<String,String>> ugInfoMapList = dataBaseService.executeQuery("SELECT groupid,grouptitle,raterange FROM "+tablePrefix+"usergroups ORDER By radminid DESC,groupid DESC");
for (Map<String,String> ugInfoMap : ugInfoMapList) {
String groupId = ugInfoMap.get("groupid");
String checkBox = request.getParameter("raterangestatus_"+ groupId);
String minValue = request.getParameter("minValue_"+ groupId);
String maxValue = request.getParameter("maxValue_"+ groupId);
String hourMaxValue = request.getParameter("hourMaxValue_"+ groupId);
if (checkBox != null) {
String grouptitle = ugInfoMap.get("grouptitle");
minValue = FormDataCheck
.getNumberFromFormOfDisplayorder(minValue);
minValue = (Long.valueOf(minValue) < -999 ? "-999" : minValue);
maxValue = FormDataCheck
.getNumberFromFormOfDisplayorder(maxValue);
maxValue = (Long.valueOf(maxValue) > 999 ? "999" : maxValue);
hourMaxValue = FormDataCheck
.getNumberFromFormOfDisplayorder(hourMaxValue);
hourMaxValue = (Long.valueOf(hourMaxValue) > 99999 ? "99999"
: hourMaxValue);
Long longMinValue = Long.valueOf(minValue);
Long longMaxValue = Long.valueOf(maxValue);
Long longHourMaxValue = Long.valueOf(hourMaxValue);
if (longMinValue >= longMaxValue
|| longHourMaxValue < longMaxValue
|| longHourMaxValue + longMinValue < 0) {
request.setAttribute("errorInfo",grouptitle+ " 评分上下限或 24 小时最大评分数设置有误,请返回修改。");
return mapping.findForward("error");
}
}
if (minValue != null) {
String raterange = ugInfoMap.get("raterange");
if (raterange != null && !raterange.equals("")) {
String[] raterangeArray = raterange.split("\t");
int count = raterangeArray.length / 4;
boolean haveExtcredit = false;
int sign = 0;
for (int j = 0; j < count; j++) {
String extcreditid = raterangeArray[j * 4];
if (extcreditid.equals(creditId)) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -