package com.smart.web.units.action;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.smart.business.common.BusinessConstants;
import com.smart.common.proxy.Carrier;
import com.smart.common.struts.BaseAction;
import com.smart.entity.common.SmartCity;
import com.smart.entity.common.SmartCounty;
import com.smart.entity.common.SmartProvince;
import com.smart.entity.common.SmartTown;
import com.smart.entity.common.SmartVillage;
import com.smart.entity.units.SmartClass;
import com.smart.entity.units.SmartLogicGrade;
import com.smart.entity.units.SmartRealGrade;
import com.smart.entity.units.SmartSchool;
import com.smart.web.units.form.UnitsPublicForm;
public class UnitsPublicActionTwo extends BaseAction {
public ActionForward init(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
/***************执行上一步操作的时候********************************/
String rulename = (String) request.getSession()
.getAttribute("rulename");
String fathername = (String) request.getSession().getAttribute(
"fathername");
String maxLength = (String) request.getSession().getAttribute(
"maxLength");
String id2 = (String) request.getSession().getAttribute("id2");
Integer maxLength1 = Integer.parseInt(maxLength);
String ID = "";
/*********当id2就是上级的NO为0时候是表示执行 省级设置操作***********/
if (id2.equals("0") || fathername.equals("0") || id2.equals("")) {
ID = "0";
fathername = "省级设置";
request.getSession().setAttribute("id2", "0");
request.getSession().setAttribute("rulename", "省级设置");
} else {
Integer length1 = Integer.parseInt(maxLength);
Integer length2 = id2.length();
ID = id2.substring(0, length2 - length1);
request.getSession().setAttribute("id2", ID);
request.getSession().setAttribute("rulename", fathername);
}
List list = (List) typeBaseInfo(ID, fathername);// 查出信息表
request.getSession().setAttribute("resultList", list);// 返回到页面的list
String lastName = "";
Integer length = 0;
/*************把上级别的名字以及这个级别的编号长度输到 页面上*******************/
UnitsPublicForm unitsPublicForm = (UnitsPublicForm) form;
Iterator itClass = list.iterator();
while (itClass.hasNext()) {
unitsPublicForm = (UnitsPublicForm) itClass.next();
if (unitsPublicForm.getID().equals(id2)) {
lastName = unitsPublicForm.getLastName();
length = unitsPublicForm.getMaxlength();
}
}
request.getSession().setAttribute("fathername", lastName);// 上一个级别的名字
String size = String.valueOf(length);
request.getSession().setAttribute("maxLength", size);// 这级别的编号长度
return mapping.findForward("info");
}
/**************取消操作******************/
public ActionForward cancel(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String rulename = (String) request.getSession()
.getAttribute("rulename");
String fathername = (String) request.getSession().getAttribute(
"fathername");
String ruleclass = (String) request.getSession().getAttribute(
"ruleclass");
Integer maxlength = (Integer) request.getSession().getAttribute(
"maxlength");
String id2 = (String) request.getSession().getAttribute("id2");
String id = (String) request.getSession().getAttribute("ID");
List list = (List) typeBaseInfo(id2, rulename);
request.getSession().setAttribute("resultList", list);// 返回到页面的list
return mapping.findForward("info");
}
/**************增加按钮的时候把信息输出到 增加的页面******************/
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
UnitsPublicForm unitsPublicForm = (UnitsPublicForm) form;
ArrayList list = (ArrayList) request.getSession().getAttribute(
"resultList");
String rulename = (String) request.getSession()
.getAttribute("rulename");// 这一级别的名字
String fathername = (String) request.getSession().getAttribute(
"fathername");// 上一级别的名字
Integer maxlength = (Integer) request.getSession().getAttribute(
"maxlength");
String id2 = (String) request.getSession().getAttribute("id2");
request.getSession().setAttribute("resultList", list);
request.getSession().setAttribute("rulename", rulename);
request.getSession().setAttribute("fathername", fathername);
request.getSession().setAttribute("maxlength", maxlength);
request.getSession().setAttribute("id2", id2);
return mapping.findForward("infoadd");
}
/**
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
/**************增加一个设置的操作,保存*****************/
public ActionForward save(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
UnitsPublicForm unitsPublicForm = (UnitsPublicForm) form;
String rulename = (String) request.getSession()
.getAttribute("rulename");
String fathername = (String) request.getSession().getAttribute(
"fathername"); // 上级别的名字
String id2 = (String) request.getSession().getAttribute("id2");// 上一级别的no
String ID = "";
if (id2 == "") {
return null;
}
if (id2.equals("0")) {
ID = String.valueOf(unitsPublicForm.getID()); // 这个是第一级别的时候自己的ID就是代号不用加上级别
} else {
String recID = String.valueOf(unitsPublicForm.getID());
ID = id2 + recID;// /////////////////////下一级ID等于上一级的ID加上自己的输入ID
}
if (rulename.equals("省级设置")) {
SmartProvince province = new SmartProvince();
province.setProvinceNo(ID);
province.setProvinceName(unitsPublicForm.getName());
province.setRemark(unitsPublicForm.getRemark());
province.setLastclassNo(id2);
province.setLength(unitsPublicForm.getMaxlength());
province.setRuleclassName(rulename);
province.setLastName("0");
province.setNextName(unitsPublicForm.getNextName());
Map params = new HashMap();
params.put("obj", province);
this.call(new Carrier(params,
BusinessConstants.UNITS_PUBLIC_BUSINESS,
"SaveProvinceResources"));
}
if (rulename.equals("市级设置")) {
SmartCity city = new SmartCity();
Map params = new HashMap();
city.setCityNo(ID);
city.setCityName(unitsPublicForm.getName());
city.setRemark(unitsPublicForm.getRemark());
city.setRefLogicGrade(123);
city.setLastclassNo(id2);
city.setLength(unitsPublicForm.getMaxlength());
city.setRuleclassName(rulename);
city.setLastName(fathername);
city.setNextName(unitsPublicForm.getNextName());
params.put("obj", city);
this.call(new Carrier(params,
BusinessConstants.UNITS_PUBLIC_BUSINESS,
"SaveCityResources"));
}
if (rulename.equals("县/区设置")) {
Map params = new HashMap();
params.put("id", id2);
SmartCounty county = new SmartCounty();
county.setCountyNo(ID);
county.setCountyName(unitsPublicForm.getName());
county.setRemark(unitsPublicForm.getRemark());
county.setLastclassNo(id2);
county.setLength(unitsPublicForm.getMaxlength());
county.setRuleclassName(rulename);
county.setLastName(fathername);
county.setNextName(unitsPublicForm.getNextName());
params.put("obj", county);
this.call(new Carrier(params,
BusinessConstants.UNITS_PUBLIC_BUSINESS,
"SaveCountyResources"));
}
if (rulename.equals("乡/镇设置")) {
SmartTown
没有合适的资源?快使用搜索试试~ 我知道了~
基于JAVA的公共资源模块的设计.zip
共174个文件
java:79个
jsp:33个
xml:17个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 74 浏览量
2024-08-05
16:36:05
上传
评论
收藏 175KB ZIP 举报
温馨提示
基于JAVA的公共资源模块实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 基于JAVA的公共资源模块实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 基于JAVA的公共资源模块实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 基于JAVA的公共资源模块实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 基于JAVA的公共资源模块实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。
资源推荐
资源详情
资源评论
收起资源包目录
基于JAVA的公共资源模块的设计.zip (174个子文件)
.#SmartCourse.java.1.1 3KB
.#BusinessConstants.java.1.1 1KB
Entries 1KB
Entries 529B
Entries 426B
Entries 395B
Entries 391B
Entries 284B
Entries 255B
Entries 206B
Entries 115B
Entries 107B
Entries 26B
UnitsPublicActionTwo.java 40KB
DropDownListBusiness.java 28KB
UnitsPublicBusiness.java 20KB
UnitsPublicAction.java 10KB
UnitsPublicResourcesBusiness.java 9KB
UnitsCourseEditAction.java 8KB
DropDownListTag.java 8KB
UnitsTopicAnswerAction.java 6KB
UnitsTopicDifficultyAction.java 6KB
UnitsTopicPropleAction.java 6KB
UnitsExamTypeAddAction.java 6KB
UnitsPaperTypeAddAction.java 6KB
UnitsSectionEditAction.java 5KB
UnitsTopicProUpdateAction.java 5KB
UnitsPublicImpl.java 4KB
UnitsTopicDifUpdateAction.java 4KB
SmartSchool.java 4KB
UnitsTopicAnswerUpdateAction.java 4KB
UnitsKnowledgeEditAction.java 4KB
SmartRealGrade.java 4KB
SmartCity.java 4KB
UnitsPublicForm.java 3KB
SmartCounty.java 3KB
UnitsTopicSetBusiness.java 3KB
UnitsTopicChoiceAction.java 3KB
UnitsSectionListAction.java 3KB
UnitsKnowledgeAction.java 3KB
UnitsSectionAddAction.java 3KB
SmartClass.java 3KB
SmartProvince.java 3KB
UnitsCourseListAction.java 3KB
SmartCourse.java 3KB
UnitsTopicImpl.java 3KB
UnitsPublicResourcesImpl.java 3KB
UnitsCourseAddAction.java 3KB
SmartSection.java 2KB
SmartRule.java 2KB
SmartVillage.java 2KB
SmartKnowledgePoint.java 2KB
UnitsPaperTypeAction.java 2KB
SmartTown.java 2KB
SmartLogicGrade.java 2KB
UnitsCourseBusiness.java 2KB
UnitsExamTypeAction.java 2KB
UnitsKnowledgeAddAction.java 2KB
Code.java 2KB
UnitsSectionBusiness.java 2KB
UnitsKnowledgeForm.java 2KB
UnitsPublicResourcesForm.java 2KB
UnitsSectionImpl.java 2KB
SearchPoints.java 2KB
UnitsKnowledgeBusiness.java 2KB
UntisSectionFrom.java 2KB
UnitsExamTypeAddForm.java 2KB
UnitsExamTypeImpl.java 2KB
UnitsPaperTypeBusiness.java 2KB
BusinessConstants.java 1KB
UnitsExamTypeBusiness.java 1KB
UnitsKnowledgeSearchAction.java 1KB
UnitsTopicSetForm.java 1KB
UnitsPaperTypeAddForm.java 1KB
UnitsPublicDAO.java 1KB
UnitsCourseImpl.java 1KB
UnitsKnowledgeImpl.java 1KB
UnitsTopicSetDAO.java 941B
UnitsPublicResourcesDAO.java 841B
UnitsCourseForm.java 768B
UnitsShowCourseListFrom.java 662B
UnitsCourseAction.java 649B
UnitsPaperTypeImpl.java 600B
UnitsKnowledgeListAction.java 585B
UnitsPaperSetAction.java 575B
UnitsAction.java 572B
UnitsExamTypeDAO.java 428B
UnitsCourseDAO.java 423B
UnitsSectionDAO.java 376B
UnitsPaperTypeDAO.java 330B
UnitsKnowledgeDAO.java 325B
UnitsTopicDifficultyForm.java 164B
Units_Public_Resources_Info_update.jsp 10KB
Units_Public_Resources_Info_add.jsp 9KB
UnitsTopic_Set_test.jsp 6KB
UnitsKnowledge_Search.jsp 6KB
UnitsPublic.jsp 5KB
Units_Public_Resources_Info.jsp 5KB
UnitsTopic_Difficulty_Set.jsp 4KB
UnitsTopic_Problem_Set.jsp 4KB
共 174 条
- 1
- 2
资源评论
大雨淅淅
- 粉丝: 4150
- 资源: 340
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功