信息管理平台
源码
package com.hdsx.giscj.dlyszt.action;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
import javax.annotation.Resource;
import org.apachemons.beanutils.BeanUtils;
import org.apachemons.beanutils.BeanUtilsBean;
import org.apachemons.beanutils.PropertyUtils;
import org.apachemons.beanutils.PropertyUtilsBean;
import org.apachemons.io.FileUtils;
import org.apache.struts2.ServletActionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import com.hdsx.giscj.action.BaseActionSupport;
import com.hdsx.giscj.dlyszt.bean.GISKyz;
import com.hdsx.giscj.dlyszt.service.IKyzService;
import com.hdsx.giscj.file.Container;
import com.hdsx.giscj.file.FileUtil;
import com.hdsx.giscj.file.IContainer;
import com.hdsx.giscj.file.SysInstance;
import com.hdsx.giscj.util.Constant;
import com.hdsx.giscj.util.EasyUIPage;
import com.hdsx.giscj.util.JsonUtils;
import com.hdsx.giscj.util.ResponseUtils;
import com.hdsx.giscj.util.StringUtile;
import com.hdsx.ao.page.Page;h5源码交易平台
import com.opensymphony.xwork2.ModelDriven;
/**
*信息管理平台action
* @author wangk
*
*/
@Controller
public class KyzAction extends BaseActionSupport<GISKyz> {
/**
*
*/
private static final long serialVersionUID = 7250452295894546674L;
private final Logger log = Logger( KyzAction.class);
private GISKyz gISKyz;
@Resource
private IKyzService iKyzService;
/** The cache list. */
private List<GISKyz> List();
/** The container. */
private IContainer<GISKyz> container=new Container<GISKyz>();
/** The upload. */
private File upload;
/** The upload file name. */
private String uploadFileName;
/**
* 分页 俩参数 page 哪页 、rows 条数
*/
private int page = Constant.PAGE;
private int rows = Constant.ROWS;
public void selectOne(){
String id = Request().getParameter("id");
try {
JsonUtils.write(iKyzService.doSelectOne("ID='"+id+"'"), Response().getWriter(),"shape","yyyy-MM-dd HH:mm:ss");
} catch (Exception e) {
("查询数据异常!{}",e.getMessage());
e.printStackTrace();
}
}
public void selectPage(){
EasyUIPage<GISKyz> p = new EasyUIPage<GISKyz>(this.page, ws);
StringBuffer sqlWhere = new StringBuffer();
if(!StringUtile.isEmptyStr(Kyzmc())){
sqlWhere.append("KYZMC like '%");
sqlWhere.append(Kyzmc());
sqlWhere.append("%'");
}
if(!StringUtile.isEmptyStr(Kyzbm())){
if(sqlWhere.length()>0){
sqlWhere.append(" AND ");
}
sqlWhere.append("KYZBM like '%");
sqlWhere.append(Kyzbm());
sqlWhere.append("%'");
}
try{
Page page = new Page(this.page, ws);
int total = 0;//查询记录总数量
List<GISKyz> lists = null;//当前页查询记录
String where = "";
if(!StringUtile.String())){
where+=String();
}
total = iKyzService.doCount(where);
lists = iKyzService.doSelectList(where, page);
//赋值 总条数
p.setTotal(total);
//每页的数据
p.setRows(lists);
JsonUtils.write(p, Response().getWriter());
}catch(Exception e){
("分页查询数据异常!{}",e.getMessage());
e.printStackTrace();
}
}
//添加
public void add() {
try {
iKyzService.doInsert(gISKyz);
ResponseUtils.Response(), "1");
} catch (Exception e) {
("保存数据异常{}", e.getMessage());
ResponseUtils.Response(), "0");
e.printStackTrace();
}
}
//更新
public void modify(){
try{
iKyzService.doUpdate(gISKyz);
ResponseUtils.Response(), "1");
}catch(Exception e){
ResponseUtils.Response(), "0");
("更新数据异常!{}", e.getMessage());
e.printStackTrace();
}
}
//删除
public void remove(){
try{
iKyzService.doDelete(gISKyz);
ResponseUtils.Response(), "1");
}catch(Exception e){
ResponseUtils.Response(), "0");
("删除数据异常!{}", e.getMessage());
e.printStackTrace();
}
}
//批量删除
public void removeBatch(){
try{
String ids = Request().getParameter("ids");
iKyzService.doDelBatch(ids);
ResponseUtils.Response(), "1");
}catch(Exception e){
ResponseUtils.Response(), "0");
("删除数据异常!{}", e.getMessage());
e.printStackTrace();
}
}
/**
* 读取文件.
*/
public void fileUpload(){
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论