LayUI 表单和表格的简单应用

<%@page import="com.open.eac.core.app.AppHandle"%>
<%@page import="com.open.eac.core.structure.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://www.open.com/eac/core/tag"%>







党员发展阶段管理






	
	

	
党员发展阶段管理

 

 

 

<%@page import="com.open.eac.core.app.AppHandle"%>
<%@page import="com.open.eac.core.structure.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://www.open.com/eac/core/tag"%>







党员发展阶段设置





	
	
	
您的当前位置:党务-党员发展
党员发展阶段设置

 

package com.open.stddj.dev.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.open.stddj.dev.common.JsonResult;
import com.open.stddj.dev.dto.ApplyStepDTO;
import com.open.stddj.dev.service.ApplyStepService;

@Controller
@RequestMapping("/step")
public class ApplyStepController {
	@Autowired
	private ApplyStepService applyStepService;

	@RequestMapping("/all")
	@ResponseBody
	public JsonResult quaryAll() {
		JsonResult list = applyStepService.selectAll();
		return list;
	}
	
	@RequestMapping(value="/deleteStp")
	@ResponseBody
	public  int  deleteStp(String stepId) throws Exception {
		 return applyStepService.deleteStp(stepId);
	}
	
	@ResponseBody
 	@RequestMapping(value="/addStp")
 	public int addStp(String stepName,int userType,int orderSeq,String stepDesc) throws Exception {
 		ApplyStepDTO  stp = new ApplyStepDTO();
 		stp.setStepName(stepName);
 		stp.setUserType(userType);
 		stp.setOrderSeq(orderSeq);
 		stp.setStepDesc(stepDesc); 
 		return applyStepService.addStp(stp);
 	}
	@ResponseBody
	@RequestMapping(value="/queryOne")
	public ApplyStepDTO quaryOne(String stepId) throws Exception{
		return  applyStepService.selectOne(Integer.valueOf(stepId));
	}
	
	@ResponseBody
	@RequestMapping(value="/updateStp")
 	public int updateStp(String stepId,String stepName,int userType,int orderSeq,String stepDesc) throws Exception {
		System.out.println(stepId);
 		ApplyStepDTO  stp = new ApplyStepDTO();
 		stp.setStepId(Integer.valueOf(stepId));
 		stp.setStepName(stepName);
 		stp.setUserType(userType);
 		stp.setOrderSeq(orderSeq);
 		stp.setStepDesc(stepDesc);
 		return applyStepService.update(stp);
 	}
}

 

package com.open.stddj.dev.common;

import java.io.Serializable;
import java.util.List;

public class JsonResult implements Serializable  {

	private static final long serialVersionUID = 1L;
	private List data;//存储最终查询的数据  
	/*private Integer startIndex;//结束索引  
    private Integer endIndex;//开始索引  
    private Integer CurPage=1;//当前页  
*/    private Integer count;//总记录数  
   /* private Integer records=10;//每页显示个数  
    private Integer previesPage;//前一页  
    private Integer nextPage;//下一页  
    private Integer totalPage;//总页数  
*/    private String msg;//返回信息
  	private int code; //状态码
  	
  	public JsonResult() {
  		
  	}

	public JsonResult(Integer curPage,Integer count,Integer records) {
		
//		    this.CurPage=curPage;//当前页  
	        this.count=count;//总记录数
//	        this.records=records==null?this.records:records;//每页显示个数  
//	        this.previesPage=(curPage==1?1:curPage-1);//上一页  
//	        this.nextPage=(curPage==totalPage)?totalPage:(curPage+1);//下一页 
//	        this.totalPage=count%this.records==0?count/this.records:count/this.records+1;  
//	        this.startIndex=(curPage-1)*this.records+1;
//	        this.endIndex=curPage*this.records; 
	        this.msg=this.count>0?"返回"+count+"条数据":"查询失败!";
	        this.code=this.count>0?1:0;
	}


	

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public List getData() {
		return data;
	}


	public void setData(List data) {
		this.data = data;
	}


	public String getMsg() {
		return msg;
	}


	public void setMsg(String msg) {
		this.msg = msg;
	}


	public int getCode() {
		return code;
	}


	public void setCode(int code) {
		this.code = code;
	}
	public static void main(String[] args) {
		int curPage=2;  
        int totalCount=37;  
        int pageCount=5;  
        JsonResult pt = new JsonResult(curPage,totalCount,pageCount);  
//        System.out.println("每页显示个数"+pt.getRecords());
//        System.out.println("下一页"+pt.getNextPage());  
//        System.out.println("上一页"+pt.getPreviesPage());  
//        System.out.println("当前页:"+curPage);  
//        System.out.println("总页"+pt.getTotalPage());  
//        System.out.println("开始索引"+pt.getStartIndex());  
//        System.out.println("结束索引"+pt.getEndIndex());  
//        System.out.println("状态码"+pt.getCode());
//        System.out.println("消息"+pt.getMsg());

	}
}

 

你可能感兴趣的:(LayUI 表单和表格的简单应用)