资源简介
智能小区管理系统javaweb+mysql,jdk版本是1.7,如果用1.8的jdk,请添加jar包
代码片段和文件信息
package com.jypc.action;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONobject;
import org.apache.struts2.ServletActionContext;
import com.jypc.bean.AssetInfoBean;
import com.jypc.bean.AssetTypeBean;
import com.jypc.bean.PagerView;
import com.jypc.dao.AssetInfoDao;
import com.opensymphony.xwork2.ActionSupport;
public class AssetInfoAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
private List assetInfoList;// 物业费用信息集合
private List assetTypeList;// 费用类型信息
private String id;
private String tips;
private AssetInfoBean model;
private PagerView pager = new PagerView();
AssetInfoDao assetInfoDao;
@Resource(name = “assetInfoDao“)
public void setAssetInfoDao(AssetInfoDao assetInfoDao) {
this.assetInfoDao = assetInfoDao;
}
@Override
public String execute() throws Exception {
initData();
return “success“;
}
/**
* 初始化数据
*/
public void initData() {
pager.setAllData(assetInfoDao.getDataNum());
assetInfoList = assetInfoDao.getAssetInfoList(pager);
assetTypeList = assetInfoDao.getAssetTypeList();
}
/**
* 判断主键是否重复
*
* @throws IOException
*/
public void exists() throws IOException {
HttpServletResponse response = ServletActionContext.getResponse();
PrintWriter out = response.getWriter();
int result = assetInfoDao.exists(id) ? 1 : 0;
out.print(result);
out.flush();// 刷新
out.close();// 关闭
}
/**
* 物业费用信息添加
*
* @return 0[失败] >0[成功]
*/
public String assetAdd() {
int result = 0;
result = assetInfoDao.assetAdd(model);
if (result > 0) {
tips = “添加成功!“;
} else {
tips = “添加失败!“;
}
initData();
return “success“;
}
/**
* 删除单条信息
*
* @return true:删除成功;false:删除失败
*/
public String delInfo() {
int result = assetInfoDao.delInfo(id);
if (result > 0) {
setTips(“删除成功!“);
} else {
setTips(“删除失败!“);
}
initData();
return “success“;
}
/**
* 删除所选中的记录
*
* @return
*/
public String deleteAssetLists() {
HttpServletRequest request = ServletActionContext.getRequest();
// 获取所选中的,名字叫delCost的复选框按钮的值
String[] assetInfoList = request.getParameterValues(“delAsset“);
int result = 0;
for (String item : assetInfoList) {
result += assetInfoDao.delInfo(item);
}
this.tips = “成功删除了“ + result + “条记录“;
initData();
return “success“;
}
/**
* 根据费用编号获取要修改的物业费用信息
*
* @throws IOException
*/
public void getAssetModel() throws IOException {
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType(“text/html“);
response.setCharacterEncoding(“UTF-8“);
PrintWriter out = response.getWriter();// 获取out
out.print(JSONobject.f
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-11-02 09:55 Intelligent_Community\
文件 1217 2017-11-02 10:00 Intelligent_Community\.classpath
文件 1346 2016-02-26 10:41 Intelligent_Community\.project
目录 0 2017-11-02 09:55 Intelligent_Community\.settings\
文件 522 2016-02-26 10:41 Intelligent_Community\.settings\.jsdtscope
文件 251 2016-02-26 10:41 Intelligent_Community\.settings\com.genuitec.eclipse.core.prefs
文件 79 2016-02-26 10:41 Intelligent_Community\.settings\com.genuitec.eclipse.migration.prefs
文件 57 2016-02-26 10:41 Intelligent_Community\.settings\org.eclipse.core.resources.prefs
文件 364 2016-02-26 10:41 Intelligent_Community\.settings\org.eclipse.jdt.core.prefs
文件 524 2016-02-26 10:41 Intelligent_Community\.settings\org.eclipse.wst.common.component
文件 172 2016-02-26 10:41 Intelligent_Community\.settings\org.eclipse.wst.common.project.facet.core.prefs.xm
文件 462 2016-02-26 10:41 Intelligent_Community\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2016-02-26 10:41 Intelligent_Community\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2016-02-26 10:41 Intelligent_Community\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-11-02 09:55 Intelligent_Community\WebRoot\
目录 0 2017-11-02 09:55 Intelligent_Community\WebRoot\me
文件 39 2016-02-26 10:41 Intelligent_Community\WebRoot\me
目录 0 2017-11-02 09:55 Intelligent_Community\WebRoot\StrutsDtd\
文件 3764 2016-02-26 10:41 Intelligent_Community\WebRoot\StrutsDtd\struts-2.3.dtd
目录 0 2017-11-02 09:55 Intelligent_Community\WebRoot\WEB-INF\
目录 0 2017-11-02 09:55 Intelligent_Community\WebRoot\WEB-INF\classes\
文件 2664 2016-02-26 10:41 Intelligent_Community\WebRoot\WEB-INF\classes\beans.xm
目录 0 2017-11-02 09:55 Intelligent_Community\WebRoot\WEB-INF\classes\com\
目录 0 2017-11-02 09:55 Intelligent_Community\WebRoot\WEB-INF\classes\com\jypc\
目录 0 2017-11-02 09:55 Intelligent_Community\WebRoot\WEB-INF\classes\com\jypc\action\
文件 5621 2016-02-26 16:07 Intelligent_Community\WebRoot\WEB-INF\classes\com\jypc\action\AssetInfoAction.class
文件 5194 2016-02-26 16:07 Intelligent_Community\WebRoot\WEB-INF\classes\com\jypc\action\AssetTypeAction.class
文件 5852 2016-02-26 16:07 Intelligent_Community\WebRoot\WEB-INF\classes\com\jypc\action\BuildingAction.class
文件 6686 2016-02-26 16:07 Intelligent_Community\WebRoot\WEB-INF\classes\com\jypc\action\CardAction.class
文件 5489 2016-02-26 16:07 Intelligent_Community\WebRoot\WEB-INF\classes\com\jypc\action\CommunityInfoAction.class
文件 6379 2016-02-26 16:07 Intelligent_Community\WebRoot\WEB-INF\classes\com\jypc\action\CompleteCostAction.class
............此处省略564个文件信息
评论
共有 条评论