parent
d6b0d70a7e
commit
e7aa6c9d03
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="src/main/webapp/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src/main/resources"/>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="src/main/webapp/WEB-INF/classes"/>
|
||||
</classpath>
|
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>ssm_xsktsign</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
|
||||
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||
<attributes>
|
||||
<attribute name="hide" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,9 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="ssm_xsktsign-0.0.1-SNAPSHOT">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<property name="context-root" value="ssm_xsktsign"/>
|
||||
<property name="java-output-path" value="/ssm_xsktsign/src/main/webapp/WEB-INF/classes"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
@ -0,0 +1,12 @@
|
||||
<root>
|
||||
<facet id="jst.jsf">
|
||||
<node name="libprov">
|
||||
<attribute name="provider-id" value="jsf-no-op-library-provider"/>
|
||||
</node>
|
||||
</facet>
|
||||
<facet id="jst.jaxrs">
|
||||
<node name="libprov">
|
||||
<attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
|
||||
</node>
|
||||
</facet>
|
||||
</root>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
<installed facet="jst.web" version="2.5"/>
|
||||
<installed facet="jst.jsf" version="2.2"/>
|
||||
<installed facet="jst.jaxrs" version="2.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
</faceted-project>
|
@ -0,0 +1 @@
|
||||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
|
@ -0,0 +1 @@
|
||||
Window
|
@ -0,0 +1,2 @@
|
||||
disabled=06target
|
||||
eclipse.preferences.version=1
|
@ -0,0 +1,83 @@
|
||||
package com.kwxy.hyt.base;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* Controller基类
|
||||
*/
|
||||
public class BaseController {
|
||||
|
||||
protected Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
protected final static String DATE_FORMATE = "yyyy-MM-dd";
|
||||
|
||||
/**
|
||||
* 返回服务端处理结果
|
||||
*
|
||||
* @param obj
|
||||
* 服务端输出对象
|
||||
* @return 输出处理结果给前段JSON格式数据
|
||||
*/
|
||||
public String responseResult(Object obj) {
|
||||
String jsonObj = null;
|
||||
if (obj != null) {
|
||||
logger.info("后端返回对象:{}", obj);
|
||||
jsonObj = JSONObject.toJSONString(obj);
|
||||
logger.info("后端返回数据:" + jsonObj);
|
||||
}
|
||||
logger.info("输出结果:{}", jsonObj);
|
||||
return jsonObj;
|
||||
}
|
||||
|
||||
|
||||
// 下面是判断null的操作
|
||||
|
||||
public boolean isEmpty(String str) {
|
||||
return (null == str) || (str.trim().length() <= 0);
|
||||
}
|
||||
|
||||
public boolean isEmpty(Character cha) {
|
||||
return (null == cha) || cha.equals(' ');
|
||||
}
|
||||
|
||||
public boolean isEmpty(Object obj) {
|
||||
return (null == obj);
|
||||
}
|
||||
|
||||
public boolean isEmpty(Object[] objs) {
|
||||
return (null == objs) || (objs.length <= 0);
|
||||
}
|
||||
|
||||
public boolean isEmpty(Collection<?> obj) {
|
||||
return (null == obj) || obj.isEmpty();
|
||||
}
|
||||
|
||||
public boolean isEmpty(Set<?> set) {
|
||||
return (null == set) || set.isEmpty();
|
||||
}
|
||||
|
||||
public boolean isEmpty(Serializable obj) {
|
||||
return null == obj;
|
||||
}
|
||||
|
||||
public boolean isEmpty(Map<?, ?> map) {
|
||||
return (null == map) || map.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 获得map
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> getMap(){
|
||||
return new HashMap<String,Object>();
|
||||
}
|
||||
}
|
@ -0,0 +1,180 @@
|
||||
package com.kwxy.hyt.controller;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kwxy.hyt.base.BaseController;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/bj")
|
||||
public class BjController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 依赖注入 start dao/service/===
|
||||
*/
|
||||
@Autowired
|
||||
private BjService bjService;
|
||||
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对By Sql)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findBySql")
|
||||
public String findBySql(Bj bj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
String sql = "SELECT * FROM bj WHERE isDelete = 0 ";
|
||||
if(!isEmpty(bj.getName())){
|
||||
sql += " and name like '%"+bj.getName()+"%'";
|
||||
}
|
||||
if(!isEmpty(bj.getZy())){
|
||||
sql += " and zy like '%"+bj.getZy()+"%'";
|
||||
}
|
||||
if(!isEmpty(bj.getIsDelete())){
|
||||
sql += " and isDelete like '%"+bj.getIsDelete()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Bj> pagers = bjService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", bj);
|
||||
return "bj/bj";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMap")
|
||||
public String findByMap(Bj bj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(bj.getName())){
|
||||
params.put("name", bj.getName());
|
||||
}
|
||||
if(!isEmpty(bj.getZy())){
|
||||
params.put("zy", bj.getZy());
|
||||
}
|
||||
if(!isEmpty(bj.getIsDelete())){
|
||||
params.put("isDelete", bj.getIsDelete());
|
||||
}
|
||||
//分页查询
|
||||
Pager<Bj> pagers = bjService.findByMap(params);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", bj);
|
||||
return "bj/bj";
|
||||
}
|
||||
|
||||
/**********************************【增删改】******************************************************/
|
||||
|
||||
/**
|
||||
* 跳至添加页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
public String add() {
|
||||
return "bj/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳至详情页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/view")
|
||||
public String view(Integer id,Model model) {
|
||||
Bj obj = bjService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "bj/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAdd")
|
||||
public String exAdd(Bj bj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
bj.setIsDelete(0);
|
||||
bjService.insert(bj);
|
||||
return "redirect:/bj/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳至修改页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/update")
|
||||
public String update(Integer id,Model model) {
|
||||
Bj obj = bjService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "bj/update";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate")
|
||||
public String exUpdate(Bj bj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
bjService.updateById(bj);
|
||||
//2.通过主键id修改
|
||||
//bjService.updateById(bj);
|
||||
return "redirect:/bj/findBySql.action";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通过主键
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Bj load = bjService.load(id);
|
||||
load.setIsDelete(1);
|
||||
bjService.updateById(load);
|
||||
return "redirect:/bj/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,239 @@
|
||||
package com.kwxy.hyt.controller;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kwxy.hyt.base.BaseController;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/fdy")
|
||||
public class FdyController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 依赖注入 start dao/service/===
|
||||
*/
|
||||
@Autowired
|
||||
private FdyService fdyService;
|
||||
|
||||
@Autowired
|
||||
private BjService bjService;
|
||||
|
||||
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对By Sql)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findBySql")
|
||||
public String findBySql(Fdy fdy, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
String sql = "SELECT * FROM fdy WHERE isDelete = 0 ";
|
||||
if(!isEmpty(fdy.getUsername())){
|
||||
sql += " and username like '%"+fdy.getUsername()+"%'";
|
||||
}
|
||||
if(!isEmpty(fdy.getPassword())){
|
||||
sql += " and password like '%"+fdy.getPassword()+"%'";
|
||||
}
|
||||
if(!isEmpty(fdy.getCode())){
|
||||
sql += " and code like '%"+fdy.getCode()+"%'";
|
||||
}
|
||||
if(!isEmpty(fdy.getSex())){
|
||||
sql += " and sex like '%"+fdy.getSex()+"%'";
|
||||
}
|
||||
if(!isEmpty(fdy.getBjId())){
|
||||
sql += " and bjId like '%"+fdy.getBjId()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Fdy> pagers = fdyService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", fdy);
|
||||
return "fdy/fdy";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMap")
|
||||
public String findByMap(Fdy fdy, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(fdy.getUsername())){
|
||||
params.put("username", fdy.getUsername());
|
||||
}
|
||||
if(!isEmpty(fdy.getPassword())){
|
||||
params.put("password", fdy.getPassword());
|
||||
}
|
||||
if(!isEmpty(fdy.getCode())){
|
||||
params.put("code", fdy.getCode());
|
||||
}
|
||||
if(!isEmpty(fdy.getSex())){
|
||||
params.put("sex", fdy.getSex());
|
||||
}
|
||||
if(!isEmpty(fdy.getBjId())){
|
||||
params.put("bjId", fdy.getBjId());
|
||||
}
|
||||
//分页查询
|
||||
Pager<Fdy> pagers = fdyService.findByMap(params);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", fdy);
|
||||
return "fdy/fdy";
|
||||
}
|
||||
|
||||
/**********************************【增删改】******************************************************/
|
||||
|
||||
/**
|
||||
* 跳至添加页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
public String add(Model model) {
|
||||
// 查询班级列表
|
||||
Bj b = new Bj();
|
||||
b.setIsDelete(0);
|
||||
List<Bj> listAllByEntity = bjService.listAllByEntity(b);
|
||||
model.addAttribute("bjs", listAllByEntity);
|
||||
return "fdy/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳至详情页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/view")
|
||||
public String view(Integer id,Model model) {
|
||||
Fdy obj = fdyService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "fdy/view";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/pass")
|
||||
public String pass(Integer id,HttpServletRequest request,Model model) {
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
Fdy obj = fdyService.load(userId);
|
||||
model.addAttribute("obj",obj);
|
||||
return "fdy/pass";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/upass")
|
||||
@ResponseBody
|
||||
public String upass(HttpServletRequest request,String password){
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
JSONObject j = new JSONObject();
|
||||
if (attribute == null){
|
||||
j.put("res", 0);
|
||||
return j.toString();
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
Fdy byId = fdyService.getById(userId);
|
||||
byId.setPassword(password);
|
||||
fdyService.updateById(byId);
|
||||
j.put("res", 1);
|
||||
return j.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAdd")
|
||||
public String exAdd(Fdy fdy, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
fdy.setIsDelete(0);
|
||||
fdyService.insert(fdy);
|
||||
return "redirect:/fdy/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳至修改页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/update")
|
||||
public String update(Integer id,Model model) {
|
||||
Bj b = new Bj();
|
||||
b.setIsDelete(0);
|
||||
List<Bj> listAllByEntity = bjService.listAllByEntity(b);
|
||||
model.addAttribute("bjs", listAllByEntity);
|
||||
|
||||
Fdy obj = fdyService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "fdy/update";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate")
|
||||
public String exUpdate(Fdy fdy, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
fdyService.updateById(fdy);
|
||||
//2.通过主键id修改
|
||||
//fdyService.updateById(fdy);
|
||||
return "redirect:/fdy/findBySql.action";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通过主键
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Fdy load = fdyService.load(id);
|
||||
load.setIsDelete(1);
|
||||
fdyService.updateById(load);
|
||||
return "redirect:/fdy/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,526 @@
|
||||
package com.kwxy.hyt.controller;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kwxy.hyt.base.BaseController;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/manage")
|
||||
public class ManageController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 依赖注入 start dao/service/===
|
||||
*/
|
||||
@Autowired
|
||||
private ManageService manageService;
|
||||
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
|
||||
/*********************************查询列表【不分页】***********************************************/
|
||||
|
||||
/**
|
||||
* 【不分页 => 查询列表 => 无条件】
|
||||
* @Title: listAll
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listAll")
|
||||
public String listAll(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response){
|
||||
List<Manage> listAll = manageService.listAll();
|
||||
model.addAttribute("list", listAll);
|
||||
return "manage/manage";
|
||||
}
|
||||
|
||||
/**
|
||||
* 【不分页=》查询列表=>有条件】
|
||||
* @Title: listByEntity
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listByEntity")
|
||||
public String listByEntity(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response){
|
||||
List<Manage> listAll = manageService.listAllByEntity(manage);
|
||||
model.addAttribute("list", listAll);
|
||||
return "manage/manage";
|
||||
}
|
||||
|
||||
/**
|
||||
* 【不分页=》查询列表=>有条件】
|
||||
* @Title: listByMap
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listByMap")
|
||||
public String listByMap(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response){
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(manage.getUsername())){
|
||||
params.put("username", manage.getUsername());
|
||||
}
|
||||
if(!isEmpty(manage.getPassword())){
|
||||
params.put("password", manage.getPassword());
|
||||
}
|
||||
List<Manage> listAll = manageService.listByMap(params);
|
||||
model.addAttribute("list", listAll);
|
||||
return "manage/manage";
|
||||
}
|
||||
|
||||
|
||||
/*********************************查询列表【分页】***********************************************/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对象)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByObj")
|
||||
public String findByObj(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
Pager<Manage> pagers = manageService.findByEntity(manage);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", manage);
|
||||
return "manage/manage";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对By Sql)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findBySql")
|
||||
public String findBySql(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
String sql = "SELECT * FROM manage WHERE 1=1 ";
|
||||
if(!isEmpty(manage.getUsername())){
|
||||
sql += " and username like '%"+manage.getUsername()+"%'";
|
||||
}
|
||||
if(!isEmpty(manage.getPassword())){
|
||||
sql += " and password like '%"+manage.getPassword()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Manage> pagers = manageService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", manage);
|
||||
return "manage/manage";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMap")
|
||||
public String findByMap(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(manage.getUsername())){
|
||||
params.put("username", manage.getUsername());
|
||||
}
|
||||
if(!isEmpty(manage.getPassword())){
|
||||
params.put("password", manage.getPassword());
|
||||
}
|
||||
//分页查询
|
||||
Pager<Manage> pagers = manageService.findByMap(params);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", manage);
|
||||
return "manage/manage";
|
||||
}
|
||||
|
||||
/**********************************【增删改】******************************************************/
|
||||
|
||||
/**
|
||||
* 跳至添加页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
public String add() {
|
||||
return "manage/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳至详情页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/view")
|
||||
public String view(Integer id,Model model) {
|
||||
Manage obj = manageService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "manage/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAdd")
|
||||
public String exAdd(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
manageService.insert(manage);
|
||||
return "redirect:/manage/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳至修改页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/update")
|
||||
public String update(Integer id,Model model) {
|
||||
Manage obj = manageService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "manage/update";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate")
|
||||
public String exUpdate(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
manageService.updateById(manage);
|
||||
//2.通过主键id修改
|
||||
//manageService.updateById(manage);
|
||||
return "redirect:/manage/findBySql.action";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通过主键
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
///1.通过主键删除
|
||||
manageService.deleteById(id);
|
||||
/*以下是多种删除方式*/
|
||||
// //2.通过实体条件删除
|
||||
// manageService.deleteByEntity(manage);
|
||||
// //3.通过参数删除
|
||||
// //通过map查询
|
||||
// Map<String,Object> params = new HashMap<String,Object>();
|
||||
//
|
||||
// if(!isEmpty(manage.getUsername())){
|
||||
// params.put("username", manage.getUsername());
|
||||
// }
|
||||
//
|
||||
// if(!isEmpty(manage.getPassword())){
|
||||
// params.put("password", manage.getPassword());
|
||||
// }
|
||||
//
|
||||
// manageService.deleteByMap(params);
|
||||
// //4.状态删除
|
||||
// Manage load = manageService.getById(manage.getId())
|
||||
// load.setIsDelete(1);
|
||||
// manageService.update(load);
|
||||
//5.状态删除
|
||||
//Manage load = manageService.load(id);
|
||||
//load.setIsDelete(1);
|
||||
//manageService.updateById(load);
|
||||
return "redirect:/manage/findBySql.action";
|
||||
}
|
||||
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
// --------------------------------------- 【下面是ajax操作的方法。】 ------------------------------
|
||||
|
||||
/*********************************查询列表【不分页】***********************************************/
|
||||
|
||||
/**
|
||||
* 【不分页 => 查询列表 => 无条件】
|
||||
* @Title: listAll
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listAllJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String listAllJson(Manage manage, HttpServletRequest request, HttpServletResponse response){
|
||||
List<Manage> listAll = manageService.listAll();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("list", listAll);
|
||||
jsonObject.put("obj", manage);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【不分页=》查询列表=>有条件】
|
||||
* @Title: listByEntity
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listByEntityJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String listByEntityJson(Manage manage, HttpServletRequest request, HttpServletResponse response){
|
||||
List<Manage> listAll = manageService.listAllByEntity(manage);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("list", listAll);
|
||||
jsonObject.put("obj", manage);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【不分页=》查询列表=>有条件】
|
||||
* @Title: listByMap
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listByMapJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String listByMapJson(Manage manage,HttpServletRequest request, HttpServletResponse response){
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(manage.getUsername())){
|
||||
params.put("username", manage.getUsername());
|
||||
}
|
||||
if(!isEmpty(manage.getPassword())){
|
||||
params.put("password", manage.getPassword());
|
||||
}
|
||||
List<Manage> listAll = manageService.listByMap(params);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("list", listAll);
|
||||
jsonObject.put("obj", manage);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list json(通过对象)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByObjJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String findByObjByEntityJson(Manage manage, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
Pager<Manage> pagers = manageService.findByEntity(manage);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("pagers", pagers);
|
||||
jsonObject.put("obj", manage);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list json(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMapJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String findByMapJson(Manage manage,HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(manage.getUsername())){
|
||||
params.put("username", manage.getUsername());
|
||||
}
|
||||
if(!isEmpty(manage.getPassword())){
|
||||
params.put("password", manage.getPassword());
|
||||
}
|
||||
//分页查询
|
||||
Pager<Manage> pagers = manageService.findByMap(params);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("pagers", pagers);
|
||||
jsonObject.put("obj", manage);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ajax 添加
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAddJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String exAddJson(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
manageService.insert(manage);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("message", "添加成功");
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ajax 修改
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate.json", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String exUpdateJson(Manage manage, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
manageService.updateById(manage);
|
||||
//2.通过主键id修改
|
||||
//manageService.updateById(manage);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("message", "修改成功");
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* ajax 删除
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete.json", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String exDeleteJson(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
///1.通过主键删除
|
||||
manageService.deleteById(id);
|
||||
/*以下是多种删除方式*/
|
||||
// //2.通过实体条件删除
|
||||
// manageService.deleteByEntity(manage);
|
||||
// //3.通过参数删除
|
||||
// //通过map查询
|
||||
// Map<String,Object> params = new HashMap<String,Object>();
|
||||
//
|
||||
// if(!isEmpty(manage.getUsername())){
|
||||
// params.put("username", manage.getUsername());
|
||||
// }
|
||||
//
|
||||
// if(!isEmpty(manage.getPassword())){
|
||||
// params.put("password", manage.getPassword());
|
||||
// }
|
||||
//
|
||||
// manageService.deleteByMap(params);
|
||||
// //4.状态删除
|
||||
// Manage load = manageService.getById(manage.getId())
|
||||
// load.setIsDelete(1);
|
||||
// manageService.updateById(load);
|
||||
//5.状态删除
|
||||
//Manage load = manageService.load(id);
|
||||
//load.setIsDelete(1);
|
||||
//manageService.updateById(load);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("message", "删除成功");
|
||||
return jsonObject.toString();
|
||||
}
|
||||
/**
|
||||
* 单文件上传
|
||||
* @param file
|
||||
* @param request
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/saveFile")
|
||||
public String saveFile(@RequestParam(value = "file", required = false) MultipartFile file, HttpServletRequest request, Model model) {
|
||||
|
||||
System.out.println("开始");
|
||||
String path = request.getSession().getServletContext().getRealPath("/upload");
|
||||
String fileName = file.getOriginalFilename();
|
||||
System.out.println(path);
|
||||
File targetFile = new File(path, fileName);
|
||||
if(!targetFile.exists()){
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
//保存
|
||||
try {
|
||||
file.transferTo(targetFile);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* springMvc多文件上传
|
||||
* @param files
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/saveFiles")
|
||||
public String saveFiles(@RequestParam("file") CommonsMultipartFile[] files,Integer id,HttpServletRequest request){
|
||||
for(int i = 0;i<files.length;i++){
|
||||
System.out.println("fileName---------->" + files[i].getOriginalFilename());
|
||||
if(!files[i].isEmpty()){
|
||||
int pre = (int) System.currentTimeMillis();
|
||||
try {
|
||||
//拿到输出流,同时重命名上传的文件
|
||||
String filePath = request.getRealPath("/upload");
|
||||
File f=new File(filePath);
|
||||
if(!f.exists()){
|
||||
f.mkdirs();
|
||||
}
|
||||
String fileNmae=new Date().getTime() + files[i].getOriginalFilename();
|
||||
File file=new File(filePath+"/"+pre + files[i].getOriginalFilename());
|
||||
if(!file.exists()){
|
||||
file.createNewFile();
|
||||
}
|
||||
files[i].transferTo(file);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("上传出错");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,326 @@
|
||||
package com.kwxy.hyt.controller;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kwxy.hyt.base.BaseController;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/qj")
|
||||
public class QjController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 依赖注入 start dao/service/===
|
||||
*/
|
||||
@Autowired
|
||||
private QjService qjService;
|
||||
|
||||
@Autowired
|
||||
private StudentService studentService;
|
||||
|
||||
@Autowired
|
||||
private FdyService fdyService;
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对By Sql)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findBySql")
|
||||
public String findBySql(Qj qj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
|
||||
|
||||
//分页查询
|
||||
String sql = "SELECT * FROM qj WHERE fdyId = "+userId;
|
||||
if(!isEmpty(qj.getBjId())){
|
||||
sql += " and bjId like '%"+qj.getBjId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStudentId())){
|
||||
sql += " and studentId like '%"+qj.getStudentId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getFdyId())){
|
||||
sql += " and fdyId like '%"+qj.getFdyId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStartTime())){
|
||||
sql += " and startTime like '%"+qj.getStartTime()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getEndTime())){
|
||||
sql += " and endTime like '%"+qj.getEndTime()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStatus())){
|
||||
sql += " and status like '%"+qj.getStatus()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Qj> pagers = qjService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", qj);
|
||||
return "qj/qj";
|
||||
}
|
||||
|
||||
//findBySqlSign
|
||||
@RequestMapping(value = "/findBySqlSign")
|
||||
public String findBySqlSign(Qj qj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
//分页查询
|
||||
String sql = "SELECT * FROM qj WHERE bjId = "+qj.getBjId();
|
||||
if(!isEmpty(qj.getBjId())){
|
||||
sql += " and bjId like '%"+qj.getBjId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStudentId())){
|
||||
sql += " and studentId like '%"+qj.getStudentId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getFdyId())){
|
||||
sql += " and fdyId like '%"+qj.getFdyId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStartTime())){
|
||||
sql += " and startTime like '%"+qj.getStartTime()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getEndTime())){
|
||||
sql += " and endTime like '%"+qj.getEndTime()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStatus())){
|
||||
sql += " and status like '%"+qj.getStatus()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Qj> pagers = qjService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", qj);
|
||||
model.addAttribute("bjId", qj.getBjId());
|
||||
return "qj/qjSign";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 我的请假
|
||||
* @param qj
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
//myqj
|
||||
//findBySqlSign
|
||||
@RequestMapping(value = "/myqj")
|
||||
public String myqj(Qj qj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
//分页查询
|
||||
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
|
||||
String sql = "SELECT * FROM qj WHERE studentId = "+userId;
|
||||
|
||||
if(!isEmpty(qj.getBjId())){
|
||||
sql += " and bjId like '%"+qj.getBjId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStudentId())){
|
||||
sql += " and studentId like '%"+qj.getStudentId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getFdyId())){
|
||||
sql += " and fdyId like '%"+qj.getFdyId()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStartTime())){
|
||||
sql += " and startTime like '%"+qj.getStartTime()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getEndTime())){
|
||||
sql += " and endTime like '%"+qj.getEndTime()+"%'";
|
||||
}
|
||||
if(!isEmpty(qj.getStatus())){
|
||||
sql += " and status like '%"+qj.getStatus()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Qj> pagers = qjService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", qj);
|
||||
return "qj/myqj";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMap")
|
||||
public String findByMap(Qj qj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(qj.getBjId())){
|
||||
params.put("bjId", qj.getBjId());
|
||||
}
|
||||
if(!isEmpty(qj.getStudentId())){
|
||||
params.put("studentId", qj.getStudentId());
|
||||
}
|
||||
if(!isEmpty(qj.getFdyId())){
|
||||
params.put("fdyId", qj.getFdyId());
|
||||
}
|
||||
if(!isEmpty(qj.getStartTime())){
|
||||
params.put("startTime", qj.getStartTime());
|
||||
}
|
||||
if(!isEmpty(qj.getEndTime())){
|
||||
params.put("endTime", qj.getEndTime());
|
||||
}
|
||||
if(!isEmpty(qj.getStatus())){
|
||||
params.put("status", qj.getStatus());
|
||||
}
|
||||
//分页查询
|
||||
Pager<Qj> pagers = qjService.findByMap(params);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", qj);
|
||||
return "qj/qj";
|
||||
}
|
||||
|
||||
/**********************************【增删改】******************************************************/
|
||||
|
||||
/**
|
||||
* 跳至添加页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
public String add() {
|
||||
return "qj/add";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/myadd")
|
||||
public String myadd() {
|
||||
return "qj/myadd";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳至详情页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/view")
|
||||
public String view(Integer id,Model model) {
|
||||
Qj obj = qjService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "qj/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAdd")
|
||||
public String exAdd(Qj qj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
qj.setStatus(0);
|
||||
|
||||
Student byId = studentService.getById(userId);
|
||||
Integer bjId = byId.getBjId();
|
||||
Fdy f = new Fdy();
|
||||
f.setBjId(bjId);
|
||||
List<Fdy> listAllByEntity = fdyService.listAllByEntity(f);
|
||||
|
||||
qj.setBjId(bjId);
|
||||
qj.setFdyId(listAllByEntity.get(0).getId());
|
||||
qj.setStudentId(userId);
|
||||
|
||||
qjService.insert(qj);
|
||||
return "redirect:/qj/myqj.action";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳至修改页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/update")
|
||||
public String update(Integer id,Model model) {
|
||||
Qj obj = qjService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "qj/update";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate")
|
||||
public String exUpdate(Qj qj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
qjService.updateById(qj);
|
||||
//2.通过主键id修改
|
||||
//qjService.updateById(qj);
|
||||
return "redirect:/qj/myqj.action";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/sp")
|
||||
public String sp(Qj qj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
Qj byId = qjService.getById(qj.getId());
|
||||
byId.setStatus(qj.getStatus());
|
||||
byId.setContent(qj.getContent());
|
||||
qjService.updateById(byId);
|
||||
return "redirect:/qj/findBySql.action";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通过主键
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
///1.通过主键删除
|
||||
qjService.deleteById(id);
|
||||
return "redirect:/qj/myqj.action";
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,338 @@
|
||||
package com.kwxy.hyt.controller;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kwxy.hyt.base.BaseController;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/sign")
|
||||
public class SignController extends BaseController {
|
||||
|
||||
/**
|
||||
* 依赖注入 start dao/service/===
|
||||
*/
|
||||
@Autowired
|
||||
private RecordService recordService;
|
||||
|
||||
@Autowired
|
||||
private SignService signService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private TeacherBjService teacherBjService;
|
||||
|
||||
@Autowired
|
||||
private FdyService fdyService;
|
||||
|
||||
@Autowired
|
||||
private StudentService studentService;
|
||||
|
||||
/**
|
||||
* 教师查看自己所教学的班级
|
||||
* mybj
|
||||
*/
|
||||
|
||||
@RequestMapping(value = "/mybj")
|
||||
public String mybj(Sign sign, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
TeacherBj b = new TeacherBj();
|
||||
b.setTeacherId(userId);
|
||||
List<TeacherBj> listAllByEntity = teacherBjService.listAllByEntity(b);
|
||||
model.addAttribute("bjs", listAllByEntity);
|
||||
return "sign/mybj";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/mybj2")
|
||||
public String mybj2(Sign sign, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
TeacherBj b = new TeacherBj();
|
||||
b.setTeacherId(userId);
|
||||
List<TeacherBj> listAllByEntity = teacherBjService.listAllByEntity(b);
|
||||
model.addAttribute("bjs", listAllByEntity);
|
||||
return "sign/mybj2";
|
||||
}
|
||||
|
||||
|
||||
//${ctx}/sign/mySign.do?bjId=${data.bjId}
|
||||
|
||||
@RequestMapping(value = "/findBySql")
|
||||
public String findBySql(Sign sign, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
|
||||
String sql = "SELECT * FROM sign WHERE bjId= "+sign.getBjId() + " and teacherId="+userId;
|
||||
if(!isEmpty(sign.getBjId())){
|
||||
sql += " and bjId like '%"+sign.getBjId()+"%'";
|
||||
}
|
||||
if(!isEmpty(sign.getTeacherId())){
|
||||
sql += " and teacherId like '%"+sign.getTeacherId()+"%'";
|
||||
}
|
||||
if(!isEmpty(sign.getName())){
|
||||
sql += " and name like '%"+sign.getName()+"%'";
|
||||
}
|
||||
if(!isEmpty(sign.getStatus())){
|
||||
sql += " and status like '%"+sign.getStatus()+"%'";
|
||||
}
|
||||
if(!isEmpty(sign.getFdyId())){
|
||||
sql += " and fdyId like '%"+sign.getFdyId()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Sign> pagers = signService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", sign);
|
||||
model.addAttribute("bjId", sign.getBjId());
|
||||
return "sign/sign";
|
||||
}
|
||||
|
||||
/**
|
||||
* 辅导员列表
|
||||
* @param sign
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/fdySign")
|
||||
public String fdySign(Sign sign, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
|
||||
String sql = "SELECT * FROM sign WHERE fdyId= "+userId;
|
||||
|
||||
if(!isEmpty(sign.getBjId())){
|
||||
sql += " and bjId like '%"+sign.getBjId()+"%'";
|
||||
}
|
||||
if(!isEmpty(sign.getTeacherId())){
|
||||
sql += " and teacherId like '%"+sign.getTeacherId()+"%'";
|
||||
}
|
||||
if(!isEmpty(sign.getName())){
|
||||
sql += " and name like '%"+sign.getName()+"%'";
|
||||
}
|
||||
if(!isEmpty(sign.getStatus())){
|
||||
sql += " and status like '%"+sign.getStatus()+"%'";
|
||||
}
|
||||
if(!isEmpty(sign.getFdyId())){
|
||||
sql += " and fdyId like '%"+sign.getFdyId()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Sign> pagers = signService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", sign);
|
||||
return "sign/fdySign";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMap")
|
||||
public String findByMap(Sign sign, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(sign.getBjId())){
|
||||
params.put("bjId", sign.getBjId());
|
||||
}
|
||||
if(!isEmpty(sign.getTeacherId())){
|
||||
params.put("teacherId", sign.getTeacherId());
|
||||
}
|
||||
if(!isEmpty(sign.getName())){
|
||||
params.put("name", sign.getName());
|
||||
}
|
||||
if(!isEmpty(sign.getStatus())){
|
||||
params.put("status", sign.getStatus());
|
||||
}
|
||||
if(!isEmpty(sign.getFdyId())){
|
||||
params.put("fdyId", sign.getFdyId());
|
||||
}
|
||||
//分页查询
|
||||
Pager<Sign> pagers = signService.findByMap(params);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", sign);
|
||||
return "sign/sign";
|
||||
}
|
||||
|
||||
/**********************************【增删改】******************************************************/
|
||||
|
||||
/**
|
||||
* 跳至添加页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
public String add(Integer bjId,Model model) {
|
||||
model.addAttribute("bjId", bjId);
|
||||
return "sign/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳至详情页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/view")
|
||||
public String view(Integer id,Model model) {
|
||||
Sign obj = signService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "sign/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAdd")
|
||||
public String exAdd(Sign sign, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
sign.setTeacherId(userId);
|
||||
sign.setStatus(0);
|
||||
signService.insert(sign);
|
||||
//查询学生,插入记录表
|
||||
Student s = new Student();
|
||||
s.setBjId(sign.getBjId());
|
||||
s.setIsDelete(0);
|
||||
List<Student> listAllByEntity = studentService.listAllByEntity(s);
|
||||
if (!CollectionUtils.isEmpty(listAllByEntity)){
|
||||
|
||||
for (Student ss : listAllByEntity){
|
||||
Record re = new Record();
|
||||
// re.setCreateTime(new Date());
|
||||
re.setSignId(sign.getId());
|
||||
//0 未签到 1 已签到 2 请假
|
||||
re.setStatus(0);
|
||||
re.setStudentId(ss.getId());
|
||||
recordService.insert(re);
|
||||
}
|
||||
}
|
||||
return "redirect:/sign/findBySql.action?bjId="+sign.getBjId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳至修改页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/update")
|
||||
public String update(Integer id,Model model) {
|
||||
Sign obj = signService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "sign/update";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/sp")
|
||||
public String sp(Sign sign, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
Sign obj = signService.load(sign.getId());
|
||||
|
||||
if (sign.getStatus() == 2){
|
||||
Fdy f = new Fdy();
|
||||
f.setBjId(obj.getBjId());
|
||||
Fdy byEntity = null;
|
||||
try {
|
||||
byEntity = fdyService.listAllByEntity(f).get(0);
|
||||
obj.setFdyId(byEntity.getId());
|
||||
obj.setStatus(sign.getStatus());
|
||||
signService.updateById(obj);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//2.通过主键id修改
|
||||
//signService.updateById(sign);
|
||||
return "redirect:/sign/findBySql.action?bjId="+obj.getBjId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/exUpdate")
|
||||
public String exUpdate(Sign sign, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Sign obj = signService.load(sign.getId());
|
||||
signService.updateById(sign);
|
||||
return "redirect:/sign/findBySql?bjId="+obj.getBjId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通过主键
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Sign obj = signService.load(id);
|
||||
///1.通过主键删除
|
||||
signService.deleteById(id);
|
||||
return "redirect:/sign/findBySql?bjId="+obj.getBjId();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,254 @@
|
||||
package com.kwxy.hyt.controller;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kwxy.hyt.base.BaseController;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/student")
|
||||
public class StudentController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private BjService bjService;
|
||||
/**
|
||||
* 依赖注入 start dao/service/===
|
||||
*/
|
||||
@Autowired
|
||||
private StudentService studentService;
|
||||
|
||||
@Autowired
|
||||
private FdyService fdyService;
|
||||
|
||||
@Autowired
|
||||
private RecordService recordService;
|
||||
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对By Sql)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findBySql")
|
||||
public String findBySql(Student student, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
Fdy byId = fdyService.getById(userId);
|
||||
if (byId== null || byId.getBjId() == null){
|
||||
return "redirect:/login/message?type=1";
|
||||
}
|
||||
//分页查询
|
||||
String sql = "SELECT * FROM student WHERE isDelete = 0 and bjId = "+ byId.getBjId();
|
||||
if(!isEmpty(student.getCode())){
|
||||
sql += " and code like '%"+student.getCode()+"%'";
|
||||
}
|
||||
if(!isEmpty(student.getUsername())){
|
||||
sql += " and username like '%"+student.getUsername()+"%'";
|
||||
}
|
||||
if(!isEmpty(student.getPassword())){
|
||||
sql += " and password like '%"+student.getPassword()+"%'";
|
||||
}
|
||||
if(!isEmpty(student.getBjId())){
|
||||
sql += " and bjId like '%"+student.getBjId()+"%'";
|
||||
}
|
||||
if(!isEmpty(student.getIsDelete())){
|
||||
sql += " and isDelete like '%"+student.getIsDelete()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Student> pagers = studentService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", student);
|
||||
return "student/student";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/pass")
|
||||
public String pass(Integer id,HttpServletRequest request,Model model) {
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
Student obj = studentService.load(userId);
|
||||
model.addAttribute("obj",obj);
|
||||
return "student/pass";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/upass")
|
||||
@ResponseBody
|
||||
public String upass(HttpServletRequest request,String password){
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
JSONObject j = new JSONObject();
|
||||
if (attribute == null){
|
||||
j.put("res", 0);
|
||||
return j.toString();
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
Student byId = studentService.getById(userId);
|
||||
byId.setPassword(password);
|
||||
studentService.updateById(byId);
|
||||
j.put("res", 1);
|
||||
return j.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMap")
|
||||
public String findByMap(Student student, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(student.getCode())){
|
||||
params.put("code", student.getCode());
|
||||
}
|
||||
if(!isEmpty(student.getUsername())){
|
||||
params.put("username", student.getUsername());
|
||||
}
|
||||
if(!isEmpty(student.getPassword())){
|
||||
params.put("password", student.getPassword());
|
||||
}
|
||||
if(!isEmpty(student.getBjId())){
|
||||
params.put("bjId", student.getBjId());
|
||||
}
|
||||
if(!isEmpty(student.getIsDelete())){
|
||||
params.put("isDelete", student.getIsDelete());
|
||||
}
|
||||
//分页查询
|
||||
Pager<Student> pagers = studentService.findByMap(params);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", student);
|
||||
return "student/student";
|
||||
}
|
||||
|
||||
/**********************************【增删改】******************************************************/
|
||||
|
||||
/**
|
||||
* 跳至添加页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
public String add() {
|
||||
return "student/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳至详情页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/view")
|
||||
public String view(Integer id,Model model) {
|
||||
Student obj = studentService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "student/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAdd")
|
||||
public String exAdd(Student student, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
Fdy byId = fdyService.getById(userId);
|
||||
if (byId== null || byId.getBjId() == null){
|
||||
return "redirect:/login/message?type=1";
|
||||
}
|
||||
student.setBjId(byId.getBjId());
|
||||
student.setIsDelete(0);
|
||||
studentService.insert(student);
|
||||
return "redirect:/student/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳至修改页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/update")
|
||||
public String update(Integer id,Model model) {
|
||||
Student obj = studentService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "student/update";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate")
|
||||
public String exUpdate(Student student, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
studentService.updateById(student);
|
||||
//2.通过主键id修改
|
||||
//studentService.updateById(student);
|
||||
return "redirect:/student/findBySql.action";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通过主键
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Student load = studentService.load(id);
|
||||
load.setIsDelete(1);
|
||||
studentService.updateById(load);
|
||||
return "redirect:/student/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,526 @@
|
||||
package com.kwxy.hyt.controller;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kwxy.hyt.base.BaseController;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/teacherBj")
|
||||
public class TeacherBjController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 依赖注入 start dao/service/===
|
||||
*/
|
||||
@Autowired
|
||||
private TeacherBjService teacherBjService;
|
||||
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
|
||||
/*********************************查询列表【不分页】***********************************************/
|
||||
|
||||
/**
|
||||
* 【不分页 => 查询列表 => 无条件】
|
||||
* @Title: listAll
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listAll")
|
||||
public String listAll(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response){
|
||||
List<TeacherBj> listAll = teacherBjService.listAll();
|
||||
model.addAttribute("list", listAll);
|
||||
return "teacherBj/teacherBj";
|
||||
}
|
||||
|
||||
/**
|
||||
* 【不分页=》查询列表=>有条件】
|
||||
* @Title: listByEntity
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listByEntity")
|
||||
public String listByEntity(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response){
|
||||
List<TeacherBj> listAll = teacherBjService.listAllByEntity(teacherBj);
|
||||
model.addAttribute("list", listAll);
|
||||
return "teacherBj/teacherBj";
|
||||
}
|
||||
|
||||
/**
|
||||
* 【不分页=》查询列表=>有条件】
|
||||
* @Title: listByMap
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listByMap")
|
||||
public String listByMap(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response){
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(teacherBj.getTeacherId())){
|
||||
params.put("teacherId", teacherBj.getTeacherId());
|
||||
}
|
||||
if(!isEmpty(teacherBj.getBjId())){
|
||||
params.put("bjId", teacherBj.getBjId());
|
||||
}
|
||||
List<TeacherBj> listAll = teacherBjService.listByMap(params);
|
||||
model.addAttribute("list", listAll);
|
||||
return "teacherBj/teacherBj";
|
||||
}
|
||||
|
||||
|
||||
/*********************************查询列表【分页】***********************************************/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对象)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByObj")
|
||||
public String findByObj(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
Pager<TeacherBj> pagers = teacherBjService.findByEntity(teacherBj);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", teacherBj);
|
||||
return "teacherBj/teacherBj";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对By Sql)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findBySql")
|
||||
public String findBySql(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
String sql = "SELECT * FROM teacherBj WHERE 1=1 ";
|
||||
if(!isEmpty(teacherBj.getTeacherId())){
|
||||
sql += " and teacherId like '%"+teacherBj.getTeacherId()+"%'";
|
||||
}
|
||||
if(!isEmpty(teacherBj.getBjId())){
|
||||
sql += " and bjId like '%"+teacherBj.getBjId()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<TeacherBj> pagers = teacherBjService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", teacherBj);
|
||||
return "teacherBj/teacherBj";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMap")
|
||||
public String findByMap(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(teacherBj.getTeacherId())){
|
||||
params.put("teacherId", teacherBj.getTeacherId());
|
||||
}
|
||||
if(!isEmpty(teacherBj.getBjId())){
|
||||
params.put("bjId", teacherBj.getBjId());
|
||||
}
|
||||
//分页查询
|
||||
Pager<TeacherBj> pagers = teacherBjService.findByMap(params);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", teacherBj);
|
||||
return "teacherBj/teacherBj";
|
||||
}
|
||||
|
||||
/**********************************【增删改】******************************************************/
|
||||
|
||||
/**
|
||||
* 跳至添加页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
public String add() {
|
||||
return "teacherBj/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳至详情页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/view")
|
||||
public String view(Integer id,Model model) {
|
||||
TeacherBj obj = teacherBjService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "teacherBj/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAdd")
|
||||
public String exAdd(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
teacherBjService.insert(teacherBj);
|
||||
return "redirect:/teacherBj/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳至修改页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/update")
|
||||
public String update(Integer id,Model model) {
|
||||
TeacherBj obj = teacherBjService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "teacherBj/update";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate")
|
||||
public String exUpdate(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
teacherBjService.updateById(teacherBj);
|
||||
//2.通过主键id修改
|
||||
//teacherBjService.updateById(teacherBj);
|
||||
return "redirect:/teacherBj/findBySql.action";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通过主键
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
///1.通过主键删除
|
||||
teacherBjService.deleteById(id);
|
||||
/*以下是多种删除方式*/
|
||||
// //2.通过实体条件删除
|
||||
// teacherBjService.deleteByEntity(teacherBj);
|
||||
// //3.通过参数删除
|
||||
// //通过map查询
|
||||
// Map<String,Object> params = new HashMap<String,Object>();
|
||||
//
|
||||
// if(!isEmpty(teacherBj.getTeacherId())){
|
||||
// params.put("teacherId", teacherBj.getTeacherId());
|
||||
// }
|
||||
//
|
||||
// if(!isEmpty(teacherBj.getBjId())){
|
||||
// params.put("bjId", teacherBj.getBjId());
|
||||
// }
|
||||
//
|
||||
// teacherBjService.deleteByMap(params);
|
||||
// //4.状态删除
|
||||
// TeacherBj load = teacherBjService.getById(teacherBj.getId())
|
||||
// load.setIsDelete(1);
|
||||
// teacherBjService.update(load);
|
||||
//5.状态删除
|
||||
//TeacherBj load = teacherBjService.load(id);
|
||||
//load.setIsDelete(1);
|
||||
//teacherBjService.updateById(load);
|
||||
return "redirect:/teacherBj/findBySql.action";
|
||||
}
|
||||
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
// --------------------------------------- 【下面是ajax操作的方法。】 ------------------------------
|
||||
|
||||
/*********************************查询列表【不分页】***********************************************/
|
||||
|
||||
/**
|
||||
* 【不分页 => 查询列表 => 无条件】
|
||||
* @Title: listAll
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listAllJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String listAllJson(TeacherBj teacherBj, HttpServletRequest request, HttpServletResponse response){
|
||||
List<TeacherBj> listAll = teacherBjService.listAll();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("list", listAll);
|
||||
jsonObject.put("obj", teacherBj);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【不分页=》查询列表=>有条件】
|
||||
* @Title: listByEntity
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listByEntityJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String listByEntityJson(TeacherBj teacherBj, HttpServletRequest request, HttpServletResponse response){
|
||||
List<TeacherBj> listAll = teacherBjService.listAllByEntity(teacherBj);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("list", listAll);
|
||||
jsonObject.put("obj", teacherBj);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【不分页=》查询列表=>有条件】
|
||||
* @Title: listByMap
|
||||
* @Description: TODO(这里用一句话描述这个方法的作用)
|
||||
* @param @return 设定文件
|
||||
* @author
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
@RequestMapping(value = "/listByMapJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String listByMapJson(TeacherBj teacherBj,HttpServletRequest request, HttpServletResponse response){
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(teacherBj.getTeacherId())){
|
||||
params.put("teacherId", teacherBj.getTeacherId());
|
||||
}
|
||||
if(!isEmpty(teacherBj.getBjId())){
|
||||
params.put("bjId", teacherBj.getBjId());
|
||||
}
|
||||
List<TeacherBj> listAll = teacherBjService.listByMap(params);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("list", listAll);
|
||||
jsonObject.put("obj", teacherBj);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list json(通过对象)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByObjJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String findByObjByEntityJson(TeacherBj teacherBj, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
Pager<TeacherBj> pagers = teacherBjService.findByEntity(teacherBj);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("pagers", pagers);
|
||||
jsonObject.put("obj", teacherBj);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list json(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMapJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String findByMapJson(TeacherBj teacherBj,HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(teacherBj.getTeacherId())){
|
||||
params.put("teacherId", teacherBj.getTeacherId());
|
||||
}
|
||||
if(!isEmpty(teacherBj.getBjId())){
|
||||
params.put("bjId", teacherBj.getBjId());
|
||||
}
|
||||
//分页查询
|
||||
Pager<TeacherBj> pagers = teacherBjService.findByMap(params);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("pagers", pagers);
|
||||
jsonObject.put("obj", teacherBj);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ajax 添加
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAddJson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String exAddJson(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
teacherBjService.insert(teacherBj);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("message", "添加成功");
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ajax 修改
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate.json", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String exUpdateJson(TeacherBj teacherBj, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//1.通过实体类修改,可以多传修改条件
|
||||
teacherBjService.updateById(teacherBj);
|
||||
//2.通过主键id修改
|
||||
//teacherBjService.updateById(teacherBj);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("message", "修改成功");
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* ajax 删除
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete.json", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String exDeleteJson(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
///1.通过主键删除
|
||||
teacherBjService.deleteById(id);
|
||||
/*以下是多种删除方式*/
|
||||
// //2.通过实体条件删除
|
||||
// teacherBjService.deleteByEntity(teacherBj);
|
||||
// //3.通过参数删除
|
||||
// //通过map查询
|
||||
// Map<String,Object> params = new HashMap<String,Object>();
|
||||
//
|
||||
// if(!isEmpty(teacherBj.getTeacherId())){
|
||||
// params.put("teacherId", teacherBj.getTeacherId());
|
||||
// }
|
||||
//
|
||||
// if(!isEmpty(teacherBj.getBjId())){
|
||||
// params.put("bjId", teacherBj.getBjId());
|
||||
// }
|
||||
//
|
||||
// teacherBjService.deleteByMap(params);
|
||||
// //4.状态删除
|
||||
// TeacherBj load = teacherBjService.getById(teacherBj.getId())
|
||||
// load.setIsDelete(1);
|
||||
// teacherBjService.updateById(load);
|
||||
//5.状态删除
|
||||
//TeacherBj load = teacherBjService.load(id);
|
||||
//load.setIsDelete(1);
|
||||
//teacherBjService.updateById(load);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("message", "删除成功");
|
||||
return jsonObject.toString();
|
||||
}
|
||||
/**
|
||||
* 单文件上传
|
||||
* @param file
|
||||
* @param request
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/saveFile")
|
||||
public String saveFile(@RequestParam(value = "file", required = false) MultipartFile file, HttpServletRequest request, Model model) {
|
||||
|
||||
System.out.println("开始");
|
||||
String path = request.getSession().getServletContext().getRealPath("/upload");
|
||||
String fileName = file.getOriginalFilename();
|
||||
System.out.println(path);
|
||||
File targetFile = new File(path, fileName);
|
||||
if(!targetFile.exists()){
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
//保存
|
||||
try {
|
||||
file.transferTo(targetFile);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* springMvc多文件上传
|
||||
* @param files
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/saveFiles")
|
||||
public String saveFiles(@RequestParam("file") CommonsMultipartFile[] files,Integer id,HttpServletRequest request){
|
||||
for(int i = 0;i<files.length;i++){
|
||||
System.out.println("fileName---------->" + files[i].getOriginalFilename());
|
||||
if(!files[i].isEmpty()){
|
||||
int pre = (int) System.currentTimeMillis();
|
||||
try {
|
||||
//拿到输出流,同时重命名上传的文件
|
||||
String filePath = request.getRealPath("/upload");
|
||||
File f=new File(filePath);
|
||||
if(!f.exists()){
|
||||
f.mkdirs();
|
||||
}
|
||||
String fileNmae=new Date().getTime() + files[i].getOriginalFilename();
|
||||
File file=new File(filePath+"/"+pre + files[i].getOriginalFilename());
|
||||
if(!file.exists()){
|
||||
file.createNewFile();
|
||||
}
|
||||
files[i].transferTo(file);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("上传出错");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,312 @@
|
||||
package com.kwxy.hyt.controller;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kwxy.hyt.base.BaseController;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/teacher")
|
||||
public class TeacherController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 依赖注入 start dao/service/===
|
||||
*/
|
||||
@Autowired
|
||||
private TeacherService teacherService;
|
||||
|
||||
@Autowired
|
||||
private BjService bjService;
|
||||
|
||||
@Autowired
|
||||
private TeacherBjService teacherBjService;
|
||||
|
||||
|
||||
// --------------------------------------- 华丽分割线 ------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对象)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByObj")
|
||||
public String findByObj(Teacher teacher, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
Pager<Teacher> pagers = teacherService.findByEntity(teacher);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", teacher);
|
||||
return "teacher/teacher";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过对By Sql)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findBySql")
|
||||
public String findBySql(Teacher teacher, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//分页查询
|
||||
String sql = "SELECT * FROM teacher WHERE isDelete = 0 ";
|
||||
if(!isEmpty(teacher.getCode())){
|
||||
sql += " and code like '%"+teacher.getCode()+"%'";
|
||||
}
|
||||
if(!isEmpty(teacher.getUsername())){
|
||||
sql += " and username like '%"+teacher.getUsername()+"%'";
|
||||
}
|
||||
if(!isEmpty(teacher.getPassword())){
|
||||
sql += " and password like '%"+teacher.getPassword()+"%'";
|
||||
}
|
||||
if(!isEmpty(teacher.getKc())){
|
||||
sql += " and kc like '%"+teacher.getKc()+"%'";
|
||||
}
|
||||
if(!isEmpty(teacher.getIsDelete())){
|
||||
sql += " and isDelete like '%"+teacher.getIsDelete()+"%'";
|
||||
}
|
||||
sql += " ORDER BY ID DESC ";
|
||||
Pager<Teacher> pagers = teacherService.findBySqlRerturnEntity(sql);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", teacher);
|
||||
return "teacher/teacher";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 返回list对象(通过Map)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findByMap")
|
||||
public String findByMap(Teacher teacher, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
//通过map查询
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
if(!isEmpty(teacher.getCode())){
|
||||
params.put("code", teacher.getCode());
|
||||
}
|
||||
if(!isEmpty(teacher.getUsername())){
|
||||
params.put("username", teacher.getUsername());
|
||||
}
|
||||
if(!isEmpty(teacher.getPassword())){
|
||||
params.put("password", teacher.getPassword());
|
||||
}
|
||||
if(!isEmpty(teacher.getKc())){
|
||||
params.put("kc", teacher.getKc());
|
||||
}
|
||||
if(!isEmpty(teacher.getIsDelete())){
|
||||
params.put("isDelete", teacher.getIsDelete());
|
||||
}
|
||||
//分页查询
|
||||
Pager<Teacher> pagers = teacherService.findByMap(params);
|
||||
model.addAttribute("pagers", pagers);
|
||||
//存储查询条件
|
||||
model.addAttribute("obj", teacher);
|
||||
return "teacher/teacher";
|
||||
}
|
||||
|
||||
/**********************************【增删改】******************************************************/
|
||||
|
||||
/**
|
||||
* 跳至添加页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
public String add(Model model) {
|
||||
// 查询班级列表
|
||||
Bj b = new Bj();
|
||||
b.setIsDelete(0);
|
||||
List<Bj> listAllByEntity = bjService.listAllByEntity(b);
|
||||
model.addAttribute("bjs", listAllByEntity);
|
||||
return "teacher/add";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/pass")
|
||||
public String pass(Integer id,HttpServletRequest request,Model model) {
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
|
||||
if (attribute == null){
|
||||
return "redirect:/login/uLogin";
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
Teacher obj = teacherService.load(userId);
|
||||
model.addAttribute("obj",obj);
|
||||
return "teacher/pass";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/upass")
|
||||
@ResponseBody
|
||||
public String upass(HttpServletRequest request,String password){
|
||||
Object attribute = request.getSession().getAttribute("userId");
|
||||
JSONObject j = new JSONObject();
|
||||
if (attribute == null){
|
||||
j.put("res", 0);
|
||||
return j.toString();
|
||||
}
|
||||
Integer userId = Integer.valueOf(attribute.toString());
|
||||
Teacher byId = teacherService.getById(userId);
|
||||
byId.setPassword(password);
|
||||
teacherService.updateById(byId);
|
||||
j.put("res", 1);
|
||||
return j.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳至详情页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/view")
|
||||
public String view(Integer id,Model model) {
|
||||
Teacher obj = teacherService.load(id);
|
||||
model.addAttribute("obj",obj);
|
||||
return "teacher/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加执行
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exAdd")
|
||||
public String exAdd(Teacher teacher,@RequestParam(value = "ids") Integer[] ids, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
if (ids != null && ids.length > 0){
|
||||
teacher.setIsDelete(0);
|
||||
teacherService.insert(teacher);
|
||||
for (Integer bId : ids){
|
||||
TeacherBj tb = new TeacherBj();
|
||||
tb.setBjId(bId);
|
||||
tb.setTeacherId(teacher.getId());
|
||||
teacherBjService.insert(tb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return "redirect:/teacher/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳至修改页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/update")
|
||||
public String update(Integer id,Model model) {
|
||||
Teacher obj = teacherService.load(id);
|
||||
// 查询班级列表
|
||||
Bj b = new Bj();
|
||||
b.setIsDelete(0);
|
||||
List<Bj> listAllByEntity = bjService.listAllByEntity(b);
|
||||
//查看教师已经选中的
|
||||
TeacherBj t = new TeacherBj();
|
||||
t.setTeacherId(id);
|
||||
List<TeacherBj> select = teacherBjService.listAllByEntity(t);
|
||||
|
||||
List<Integer> ids = new ArrayList<Integer>();
|
||||
|
||||
if (!CollectionUtils.isEmpty(select)){
|
||||
for (TeacherBj b2 : select){
|
||||
ids.add(b2.getBjId());
|
||||
}
|
||||
}
|
||||
|
||||
if (!CollectionUtils.isEmpty(listAllByEntity)){
|
||||
|
||||
for (Bj bj : listAllByEntity){
|
||||
|
||||
if (!CollectionUtils.isEmpty(ids) && ids.contains(bj.getId())){
|
||||
bj.setIsCheck(1);
|
||||
}else{
|
||||
bj.setIsCheck(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
model.addAttribute("bjs", listAllByEntity);
|
||||
model.addAttribute("obj",obj);
|
||||
return "teacher/update";
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/exUpdate")
|
||||
public String exUpdate(Teacher teacher,@RequestParam(value = "ids") Integer[] ids, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
teacherService.updateById(teacher);
|
||||
if (ids != null && ids.length > 0){
|
||||
teacher.setIsDelete(0);
|
||||
//删除
|
||||
TeacherBj t = new TeacherBj();
|
||||
t.setTeacherId(teacher.getId());
|
||||
teacherBjService.deleteByEntity(t);
|
||||
for (Integer bId : ids){
|
||||
TeacherBj tb = new TeacherBj();
|
||||
tb.setBjId(bId);
|
||||
tb.setTeacherId(teacher.getId());
|
||||
teacherBjService.insert(tb);
|
||||
}
|
||||
}
|
||||
return "redirect:/teacher/findBySql.action";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通过主键
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Teacher load = teacherService.load(id);
|
||||
TeacherBj t = new TeacherBj();
|
||||
t.setTeacherId(id);
|
||||
teacherBjService.deleteByEntity(t);
|
||||
load.setIsDelete(1);
|
||||
teacherService.updateById(load);
|
||||
return "redirect:/teacher/findBySql.action";
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.kwxy.hyt.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.kwxy.hyt.utils.SystemContext;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class SystemContextFilter implements Filter{
|
||||
private Integer pageSize;
|
||||
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
|
||||
public void doFilter(ServletRequest req, ServletResponse resp,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
Integer offset = 0;
|
||||
try {
|
||||
offset = Integer.parseInt(req.getParameter("pager.offset"));
|
||||
} catch (NumberFormatException e) {}
|
||||
try {
|
||||
SystemContext.setOrder(req.getParameter("order"));
|
||||
SystemContext.setSort(req.getParameter("sort"));
|
||||
SystemContext.setPageOffset(offset);
|
||||
SystemContext.setPageSize(pageSize);
|
||||
SystemContext.setRealPath(((HttpServletRequest)req).getSession().getServletContext().getRealPath("/"));
|
||||
chain.doFilter(req,resp);
|
||||
} finally {
|
||||
SystemContext.removeOrder();
|
||||
SystemContext.removeSort();
|
||||
SystemContext.removePageOffset();
|
||||
SystemContext.removePageSize();
|
||||
SystemContext.removeRealPath();
|
||||
}
|
||||
}
|
||||
|
||||
public void init(FilterConfig cfg) throws ServletException {
|
||||
try {
|
||||
pageSize = Integer.parseInt(cfg.getInitParameter("pageSize"));
|
||||
} catch (NumberFormatException e) {
|
||||
pageSize = 15;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
|
||||
|
||||
public interface BjMapper extends BaseDao<Bj>{
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
|
||||
|
||||
public interface FdyMapper extends BaseDao<Fdy>{
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
public interface ManageMapper extends BaseDao<Manage>{
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
public interface QjMapper extends BaseDao<Qj>{
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
public interface RecordMapper extends BaseDao<Record>{
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
public interface SignMapper extends BaseDao<Sign>{
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
public interface StudentMapper extends BaseDao<Student>{
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
public interface TeacherBjMapper extends BaseDao<TeacherBj>{
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.mapper;
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
import com.kwxy.hyt.base.BaseDao;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.utils.Pager;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
|
||||
public interface TeacherMapper extends BaseDao<Teacher>{
|
||||
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
public class Bj implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields Name : name
|
||||
*
|
||||
* */
|
||||
private String name;
|
||||
/**
|
||||
* @Fields Zy : 专业
|
||||
*
|
||||
* */
|
||||
private String zy;
|
||||
|
||||
|
||||
private Integer isCheck;
|
||||
|
||||
/**
|
||||
* @Fields IsDelete : 是否删除 0 否 1 是
|
||||
*
|
||||
* */
|
||||
private Integer isDelete;
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getZy() {
|
||||
return this.zy;
|
||||
}
|
||||
|
||||
public void setZy(String zy) {
|
||||
this.zy = zy;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return this.isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
public Bj() {
|
||||
|
||||
}
|
||||
|
||||
public Bj(Integer id ,String name ,String zy ,Integer isDelete ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.name=name;
|
||||
this.zy=zy;
|
||||
this.isDelete=isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Bj [id="+ id + ",name="+ name + ",zy="+ zy + ",isDelete="+ isDelete + "]";
|
||||
}
|
||||
|
||||
public Integer getIsCheck() {
|
||||
return isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(Integer isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,136 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
public class Fdy implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields Username : username
|
||||
*
|
||||
* */
|
||||
private String username;
|
||||
/**
|
||||
* @Fields Password : password
|
||||
*
|
||||
* */
|
||||
private String password;
|
||||
/**
|
||||
* @Fields Code : code
|
||||
*
|
||||
* */
|
||||
private String code;
|
||||
/**
|
||||
* @Fields Sex : sex
|
||||
*
|
||||
* */
|
||||
private String sex;
|
||||
/**
|
||||
* @Fields BjId : 班级id
|
||||
*
|
||||
* */
|
||||
private Integer bjId;
|
||||
|
||||
private Bj bj;
|
||||
|
||||
private Integer isDelete;
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return this.username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return this.sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public Integer getBjId() {
|
||||
return this.bjId;
|
||||
}
|
||||
|
||||
public void setBjId(Integer bjId) {
|
||||
this.bjId = bjId;
|
||||
}
|
||||
|
||||
|
||||
public Fdy() {
|
||||
|
||||
}
|
||||
|
||||
public Fdy(Integer id ,String username ,String password ,String code ,String sex ,Integer bjId ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.username=username;
|
||||
this.password=password;
|
||||
this.code=code;
|
||||
this.sex=sex;
|
||||
this.bjId=bjId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Fdy [id="+ id + ",username="+ username + ",password="+ password + ",code="+ code + ",sex="+ sex + ",bjId="+ bjId + "]";
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Bj getBj() {
|
||||
return bj;
|
||||
}
|
||||
|
||||
public void setBj(Bj bj) {
|
||||
this.bj = bj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,74 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public class Manage implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields Username : username
|
||||
*
|
||||
* */
|
||||
private String username;
|
||||
/**
|
||||
* @Fields Password : password
|
||||
*
|
||||
* */
|
||||
private String password;
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return this.username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public Manage() {
|
||||
|
||||
}
|
||||
|
||||
public Manage(Integer id ,String username ,String password ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.username=username;
|
||||
this.password=password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Manage [id="+ id + ",username="+ username + ",password="+ password + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,182 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public class Qj implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields BjId : bjId
|
||||
*
|
||||
* */
|
||||
private Integer bjId;
|
||||
/**
|
||||
* @Fields StudentId : studentId
|
||||
*
|
||||
* */
|
||||
private Integer studentId;
|
||||
|
||||
private Student student;
|
||||
|
||||
private Bj bj;
|
||||
/**
|
||||
* @Fields FdyId : fdyId
|
||||
*
|
||||
* */
|
||||
private Integer fdyId;
|
||||
|
||||
private Fdy fdy;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields StartTime : startTime
|
||||
*
|
||||
* */
|
||||
private String startTime;
|
||||
/**
|
||||
* @Fields EndTime : endTime
|
||||
*
|
||||
* */
|
||||
private String endTime;
|
||||
/**
|
||||
* @Fields Status : 是否通过 0 待审核 1 通过 2 不通过
|
||||
*
|
||||
* */
|
||||
private Integer status;
|
||||
|
||||
private String reason;
|
||||
|
||||
private String content;
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getBjId() {
|
||||
return this.bjId;
|
||||
}
|
||||
|
||||
public void setBjId(Integer bjId) {
|
||||
this.bjId = bjId;
|
||||
}
|
||||
|
||||
public Integer getStudentId() {
|
||||
return this.studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(Integer studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
public Integer getFdyId() {
|
||||
return this.fdyId;
|
||||
}
|
||||
|
||||
public void setFdyId(Integer fdyId) {
|
||||
this.fdyId = fdyId;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return this.startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return this.endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
public Qj() {
|
||||
|
||||
}
|
||||
|
||||
public Qj(Integer id ,Integer bjId ,Integer studentId ,Integer fdyId ,String startTime ,String endTime ,Integer status ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.bjId=bjId;
|
||||
this.studentId=studentId;
|
||||
this.fdyId=fdyId;
|
||||
this.startTime=startTime;
|
||||
this.endTime=endTime;
|
||||
this.status=status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Qj [id="+ id + ",bjId="+ bjId + ",studentId="+ studentId + ",fdyId="+ fdyId + ",startTime="+ startTime + ",endTime="+ endTime + ",status="+ status + "]";
|
||||
}
|
||||
|
||||
public Student getStudent() {
|
||||
return student;
|
||||
}
|
||||
|
||||
public void setStudent(Student student) {
|
||||
this.student = student;
|
||||
}
|
||||
|
||||
public Bj getBj() {
|
||||
return bj;
|
||||
}
|
||||
|
||||
public void setBj(Bj bj) {
|
||||
this.bj = bj;
|
||||
}
|
||||
|
||||
public Fdy getFdy() {
|
||||
return fdy;
|
||||
}
|
||||
|
||||
public void setFdy(Fdy fdy) {
|
||||
this.fdy = fdy;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,136 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public class Record implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields SignId : signId
|
||||
*
|
||||
* */
|
||||
private Integer signId;
|
||||
|
||||
private Sign sign;
|
||||
|
||||
private Student student;
|
||||
|
||||
/**
|
||||
* @Fields StudentId : studentId
|
||||
*
|
||||
* */
|
||||
private Integer studentId;
|
||||
/**
|
||||
* @Fields Ip : ip
|
||||
*
|
||||
* */
|
||||
private String ip;
|
||||
/**
|
||||
* @Fields CreateTime : createTime
|
||||
*
|
||||
* */
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* @Fields Status : 0 未签到 1 已签到 2 请假
|
||||
*
|
||||
* */
|
||||
private Integer status;
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getSignId() {
|
||||
return this.signId;
|
||||
}
|
||||
|
||||
public void setSignId(Integer signId) {
|
||||
this.signId = signId;
|
||||
}
|
||||
|
||||
public Integer getStudentId() {
|
||||
return this.studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(Integer studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return this.ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public java.util.Date getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(java.util.Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
public Record() {
|
||||
|
||||
}
|
||||
|
||||
public Record(Integer id ,Integer signId ,Integer studentId ,String ip ,java.util.Date createTime ,Integer status ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.signId=signId;
|
||||
this.studentId=studentId;
|
||||
this.ip=ip;
|
||||
this.createTime=createTime;
|
||||
this.status=status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Record [id="+ id + ",signId="+ signId + ",studentId="+ studentId + ",ip="+ ip + ",createTime="+ createTime + ",status="+ status + "]";
|
||||
}
|
||||
|
||||
public Sign getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(Sign sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public Student getStudent() {
|
||||
return student;
|
||||
}
|
||||
|
||||
public void setStudent(Student student) {
|
||||
this.student = student;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,147 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public class Sign implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields BjId : bjId
|
||||
*
|
||||
* */
|
||||
private Integer bjId;
|
||||
/**
|
||||
* @Fields TeacherId : teacherId
|
||||
*
|
||||
* */
|
||||
private Integer teacherId;
|
||||
/**
|
||||
* @Fields Name : 0 新建 1 结束 2 上报
|
||||
*
|
||||
* */
|
||||
private String name;
|
||||
/**
|
||||
* @Fields Status : status
|
||||
*
|
||||
* */
|
||||
private Integer status;
|
||||
/**
|
||||
* @Fields FdyId : fdyId
|
||||
*
|
||||
* */
|
||||
private Integer fdyId;
|
||||
|
||||
private Teacher teacher;
|
||||
|
||||
private Fdy fdy;
|
||||
|
||||
private Bj bj;
|
||||
|
||||
|
||||
public Bj getBj() {
|
||||
return bj;
|
||||
}
|
||||
|
||||
public void setBj(Bj bj) {
|
||||
this.bj = bj;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getBjId() {
|
||||
return this.bjId;
|
||||
}
|
||||
|
||||
public void setBjId(Integer bjId) {
|
||||
this.bjId = bjId;
|
||||
}
|
||||
|
||||
public Integer getTeacherId() {
|
||||
return this.teacherId;
|
||||
}
|
||||
|
||||
public void setTeacherId(Integer teacherId) {
|
||||
this.teacherId = teacherId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getFdyId() {
|
||||
return this.fdyId;
|
||||
}
|
||||
|
||||
public void setFdyId(Integer fdyId) {
|
||||
this.fdyId = fdyId;
|
||||
}
|
||||
|
||||
|
||||
public Sign() {
|
||||
|
||||
}
|
||||
|
||||
public Sign(Integer id ,Integer bjId ,Integer teacherId ,String name ,Integer status ,Integer fdyId ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.bjId=bjId;
|
||||
this.teacherId=teacherId;
|
||||
this.name=name;
|
||||
this.status=status;
|
||||
this.fdyId=fdyId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Sign [id="+ id + ",bjId="+ bjId + ",teacherId="+ teacherId + ",name="+ name + ",status="+ status + ",fdyId="+ fdyId + "]";
|
||||
}
|
||||
|
||||
public Teacher getTeacher() {
|
||||
return teacher;
|
||||
}
|
||||
|
||||
public void setTeacher(Teacher teacher) {
|
||||
this.teacher = teacher;
|
||||
}
|
||||
|
||||
public Fdy getFdy() {
|
||||
return fdy;
|
||||
}
|
||||
|
||||
public void setFdy(Fdy fdy) {
|
||||
this.fdy = fdy;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,127 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public class Student implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields Code : code
|
||||
*
|
||||
* */
|
||||
private String code;
|
||||
/**
|
||||
* @Fields Username : username
|
||||
*
|
||||
* */
|
||||
private String username;
|
||||
/**
|
||||
* @Fields Password : password
|
||||
*
|
||||
* */
|
||||
private String password;
|
||||
/**
|
||||
* @Fields BjId : bjId
|
||||
*
|
||||
* */
|
||||
private Integer bjId;
|
||||
|
||||
private Bj bj;
|
||||
|
||||
/**
|
||||
* @Fields IsDelete : isDelete
|
||||
*
|
||||
* */
|
||||
private Integer isDelete;
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return this.username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public Integer getBjId() {
|
||||
return this.bjId;
|
||||
}
|
||||
|
||||
public void setBjId(Integer bjId) {
|
||||
this.bjId = bjId;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return this.isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
public Student() {
|
||||
|
||||
}
|
||||
|
||||
public Student(Integer id ,String code ,String username ,String password ,Integer bjId ,Integer isDelete ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.code=code;
|
||||
this.username=username;
|
||||
this.password=password;
|
||||
this.bjId=bjId;
|
||||
this.isDelete=isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Student [id="+ id + ",code="+ code + ",username="+ username + ",password="+ password + ",bjId="+ bjId + ",isDelete="+ isDelete + "]";
|
||||
}
|
||||
|
||||
public Bj getBj() {
|
||||
return bj;
|
||||
}
|
||||
|
||||
public void setBj(Bj bj) {
|
||||
this.bj = bj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,116 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public class Teacher implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields Code : code
|
||||
*
|
||||
* */
|
||||
private String code;
|
||||
/**
|
||||
* @Fields Username : username
|
||||
*
|
||||
* */
|
||||
private String username;
|
||||
/**
|
||||
* @Fields Password : password
|
||||
*
|
||||
* */
|
||||
private String password;
|
||||
/**
|
||||
* @Fields Kc : 课程名
|
||||
*
|
||||
* */
|
||||
private String kc;
|
||||
/**
|
||||
* @Fields IsDelete : isDelete
|
||||
*
|
||||
* */
|
||||
private Integer isDelete;
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return this.username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getKc() {
|
||||
return this.kc;
|
||||
}
|
||||
|
||||
public void setKc(String kc) {
|
||||
this.kc = kc;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return this.isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
public Teacher() {
|
||||
|
||||
}
|
||||
|
||||
public Teacher(Integer id ,String code ,String username ,String password ,String kc ,Integer isDelete ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.code=code;
|
||||
this.username=username;
|
||||
this.password=password;
|
||||
this.kc=kc;
|
||||
this.isDelete=isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Teacher [id="+ id + ",code="+ code + ",username="+ username + ",password="+ password + ",kc="+ kc + ",isDelete="+ isDelete + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,94 @@
|
||||
package com.kwxy.hyt.po;
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public class TeacherBj implements Serializable {
|
||||
private static final long serialVersionUID = 3148176768559230877L;
|
||||
|
||||
|
||||
/**
|
||||
* @Fields Id : id
|
||||
*
|
||||
* */
|
||||
private Integer id;
|
||||
/**
|
||||
* @Fields TeacherId : teacherId
|
||||
*
|
||||
* */
|
||||
private Integer teacherId;
|
||||
/**
|
||||
* @Fields BjId : bjId
|
||||
*
|
||||
* */
|
||||
private Integer bjId;
|
||||
|
||||
private Bj bj;
|
||||
|
||||
private Teacher teacher;
|
||||
|
||||
public Integer getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getTeacherId() {
|
||||
return this.teacherId;
|
||||
}
|
||||
|
||||
public void setTeacherId(Integer teacherId) {
|
||||
this.teacherId = teacherId;
|
||||
}
|
||||
|
||||
public Integer getBjId() {
|
||||
return this.bjId;
|
||||
}
|
||||
|
||||
public void setBjId(Integer bjId) {
|
||||
this.bjId = bjId;
|
||||
}
|
||||
|
||||
|
||||
public TeacherBj() {
|
||||
|
||||
}
|
||||
|
||||
public TeacherBj(Integer id ,Integer teacherId ,Integer bjId ){
|
||||
super();
|
||||
this.id=id;
|
||||
this.teacherId=teacherId;
|
||||
this.bjId=bjId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TeacherBj [id="+ id + ",teacherId="+ teacherId + ",bjId="+ bjId + "]";
|
||||
}
|
||||
|
||||
public Bj getBj() {
|
||||
return bj;
|
||||
}
|
||||
|
||||
public void setBj(Bj bj) {
|
||||
this.bj = bj;
|
||||
}
|
||||
|
||||
public Teacher getTeacher() {
|
||||
return teacher;
|
||||
}
|
||||
|
||||
public void setTeacher(Teacher teacher) {
|
||||
this.teacher = teacher;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
public interface BjService extends BaseService<Bj>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
public interface FdyService extends BaseService<Fdy>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public interface ManageService extends BaseService<Manage>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public interface QjService extends BaseService<Qj>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public interface RecordService extends BaseService<Record>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public interface SignService extends BaseService<Sign>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public interface StudentService extends BaseService<Student>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public interface TeacherBjService extends BaseService<TeacherBj>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.kwxy.hyt.service;
|
||||
import com.kwxy.hyt.base.BaseService;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
public interface TeacherService extends BaseService<Teacher>{
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.BjService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class BjServiceImpl extends BaseServiceImpl<Bj> implements BjService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private BjMapper bjMapper;
|
||||
@Override
|
||||
public BaseDao<Bj> getBaseDao() {
|
||||
return bjMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.FdyService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分23秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class FdyServiceImpl extends BaseServiceImpl<Fdy> implements FdyService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private FdyMapper fdyMapper;
|
||||
@Override
|
||||
public BaseDao<Fdy> getBaseDao() {
|
||||
return fdyMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.ManageService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class ManageServiceImpl extends BaseServiceImpl<Manage> implements ManageService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private ManageMapper manageMapper;
|
||||
@Override
|
||||
public BaseDao<Manage> getBaseDao() {
|
||||
return manageMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.QjService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class QjServiceImpl extends BaseServiceImpl<Qj> implements QjService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private QjMapper qjMapper;
|
||||
@Override
|
||||
public BaseDao<Qj> getBaseDao() {
|
||||
return qjMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.RecordService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class RecordServiceImpl extends BaseServiceImpl<Record> implements RecordService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private RecordMapper recordMapper;
|
||||
@Override
|
||||
public BaseDao<Record> getBaseDao() {
|
||||
return recordMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.SignService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class SignServiceImpl extends BaseServiceImpl<Sign> implements SignService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private SignMapper signMapper;
|
||||
@Override
|
||||
public BaseDao<Sign> getBaseDao() {
|
||||
return signMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.StudentService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class StudentServiceImpl extends BaseServiceImpl<Student> implements StudentService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private StudentMapper studentMapper;
|
||||
@Override
|
||||
public BaseDao<Student> getBaseDao() {
|
||||
return studentMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.TeacherBjService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class TeacherBjServiceImpl extends BaseServiceImpl<TeacherBj> implements TeacherBjService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private TeacherBjMapper teacherBjMapper;
|
||||
@Override
|
||||
public BaseDao<TeacherBj> getBaseDao() {
|
||||
return teacherBjMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author administrator
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
package com.kwxy.hyt.service.impl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.kwxy.hyt.base.*;
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.service.TeacherService;
|
||||
import java.util.*;
|
||||
|
||||
import com.kwxy.hyt.po.*;
|
||||
import com.kwxy.hyt.mapper.*;
|
||||
import com.kwxy.hyt.service.*;
|
||||
|
||||
/**
|
||||
* @ClassName:
|
||||
* @Description:
|
||||
* @author - - admin
|
||||
* @date - 2018年10月27日 09时48分24秒
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class TeacherServiceImpl extends BaseServiceImpl<Teacher> implements TeacherService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private TeacherMapper teacherMapper;
|
||||
@Override
|
||||
public BaseDao<Teacher> getBaseDao() {
|
||||
return teacherMapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.kwxy.hyt.utils;
|
||||
|
||||
public class HttpConstants {
|
||||
|
||||
public static final String SYSTEM_ERROR_MSG = "系统错误";
|
||||
|
||||
public static final String REQUEST_PARAMS_NULL = "请求参数为空";
|
||||
|
||||
public static final String SERVICE_RESPONSE_NULL = "服务端返回结果为空";
|
||||
|
||||
// 服务端返回成功的标志
|
||||
public static final String SERVICE_RESPONSE_SUCCESS_CODE = "AMS00000";
|
||||
|
||||
// 服务端返回结果的标志
|
||||
public static final String SERVICE_RESPONSE_RESULT_FLAG = "returnCode";
|
||||
|
||||
// 服务端返回结果失败的标志
|
||||
public static final String SERVICE_RESPONSE_RESULT_MSG = "errorMsg";
|
||||
|
||||
// 返回给前段页面成功或失败的标志
|
||||
public static final String RESPONSE_RESULT_FLAG_ISERROR = "isError";
|
||||
|
||||
// 执行删除操作
|
||||
public static final String OPERATION_TYPE_DELETE = "D";
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.kwxy.hyt.utils;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializeConfig;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.alibaba.fastjson.serializer.SimpleDateFormatSerializer;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class JsonUtil {
|
||||
|
||||
private static final String[] DATE_FORMAT = { "yyyy-MM-dd HH:mm:ss" };
|
||||
|
||||
private static SerializeConfig config = new SerializeConfig();
|
||||
static {
|
||||
String dateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
config.put(java.util.Date.class, new SimpleDateFormatSerializer(dateFormat));
|
||||
}
|
||||
|
||||
public static String toJson(Object obj) {
|
||||
String json = null;
|
||||
|
||||
try {
|
||||
if (obj != null) {
|
||||
json = JSON.toJSONString(obj, SerializerFeature.WriteDateUseDateFormat);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
public static <T> T toBean(String json, Class<T> clazz) {
|
||||
T bean = null;
|
||||
|
||||
try {
|
||||
if (json != null) {
|
||||
bean = JSON.parseObject(json, clazz);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
public static <T> List<T> toBeanList(String json, Class<T> clazz) {
|
||||
List<T> beanList = null;
|
||||
|
||||
try {
|
||||
if (json != null) {
|
||||
beanList = JSON.parseArray(json, clazz);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return beanList;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
// {
|
||||
//
|
||||
// Map map = new HashMap();
|
||||
// map.put("total", 0);
|
||||
// map.put("rows", new Object[0]);
|
||||
// map.put("sessionStatus", 0);
|
||||
// map.put("null", null);
|
||||
// map.put("date", new Date());
|
||||
// map.put("time", new Timestamp(System.currentTimeMillis()));
|
||||
//
|
||||
// String json = toJson(map);
|
||||
// System.out.println(json);
|
||||
//
|
||||
// Map toMap = toBean(json, Map.class);
|
||||
// System.out.println(toMap);
|
||||
// }
|
||||
|
||||
// {
|
||||
// List<HeatInfoVO> heatInfoList = new ArrayList<HeatInfoVO>();
|
||||
//
|
||||
// HeatInfoVO heatInfoVO = new HeatInfoVO();
|
||||
// heatInfoVO.setErrMsg("err");
|
||||
// heatInfoList.add(heatInfoVO);
|
||||
//
|
||||
// List<HeatInfoDetailVO> heatInfoDetailList = new ArrayList<HeatInfoDetailVO>();
|
||||
//
|
||||
// for (int i = 0; i < 3; i++) {
|
||||
// HeatInfoDetailVO heatInfoDetailVO = new HeatInfoDetailVO();
|
||||
// heatInfoDetailVO.setAreaType("type" + i);
|
||||
// heatInfoDetailList.add(heatInfoDetailVO);
|
||||
// }
|
||||
//
|
||||
// heatInfoVO.setHeatInfoDetailList(heatInfoDetailList);
|
||||
//
|
||||
// String json = JsonUtil.toJson(heatInfoList);
|
||||
// System.out.println(json);
|
||||
//
|
||||
// List<HeatInfoVO> heatInfoList2 = JsonUtil.toBeanList(json, HeatInfoVO.class);
|
||||
// System.out.println(heatInfoList2.get(0).getErrMsg());
|
||||
// System.out.println(heatInfoList2.get(0).getHeatInfoDetailList().get(0).getAreaType());
|
||||
// System.out.println(JsonUtil.toJson(heatInfoList2));
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.kwxy.hyt.utils;
|
||||
import java.util.List;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
|
||||
|
||||
/**
|
||||
* 分页对象
|
||||
* @author Administrator
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public class Pager<T> {
|
||||
/**
|
||||
* 分页的大小
|
||||
*/
|
||||
private int size;
|
||||
/**
|
||||
* 分页的起始页
|
||||
*/
|
||||
private int offset;
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
private long total;
|
||||
/**
|
||||
* 分页的数据
|
||||
*/
|
||||
private List<T> datas;
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
public int getOffset() {
|
||||
return offset;
|
||||
}
|
||||
public void setOffset(int offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
public List<T> getDatas() {
|
||||
return datas;
|
||||
}
|
||||
public void setDatas(List<T> datas) {
|
||||
this.datas = datas;
|
||||
}
|
||||
/**
|
||||
* 构造方法里面求数据
|
||||
* @param datas
|
||||
*/
|
||||
public Pager(List<T> datas) {
|
||||
if(datas instanceof Page){
|
||||
Page<T> page = (Page<T>)datas;
|
||||
setOffset(page.getPageNum());
|
||||
setSize(page.getPageSize());
|
||||
setTotal(page.getTotal());
|
||||
setDatas(datas);
|
||||
}
|
||||
|
||||
}
|
||||
public Pager() {
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.kwxy.hyt.utils;
|
||||
/**
|
||||
* 用来传递列表对象的ThreadLocal数据
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class SystemContext {
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
private static ThreadLocal<Integer> pageSize = new ThreadLocal<Integer>();
|
||||
/**
|
||||
* 分页的起始页
|
||||
*/
|
||||
private static ThreadLocal<Integer> pageOffset = new ThreadLocal<Integer>();
|
||||
/**
|
||||
* 列表的排序字段
|
||||
*/
|
||||
private static ThreadLocal<String> sort = new ThreadLocal<String>();
|
||||
/**
|
||||
* 列表的排序方式
|
||||
*/
|
||||
private static ThreadLocal<String> order = new ThreadLocal<String>();
|
||||
|
||||
private static ThreadLocal<String> realPath = new ThreadLocal<String>();
|
||||
|
||||
|
||||
|
||||
public static String getRealPath() {
|
||||
return realPath.get();
|
||||
}
|
||||
public static void setRealPath(String _realPath) {
|
||||
SystemContext.realPath.set(_realPath);
|
||||
}
|
||||
public static Integer getPageSize() {
|
||||
return pageSize.get();
|
||||
}
|
||||
public static void setPageSize(Integer _pageSize) {
|
||||
pageSize.set(_pageSize);
|
||||
}
|
||||
public static Integer getPageOffset() {
|
||||
return pageOffset.get();
|
||||
}
|
||||
public static void setPageOffset(Integer _pageOffset) {
|
||||
pageOffset.set(_pageOffset);
|
||||
}
|
||||
public static String getSort() {
|
||||
return sort.get();
|
||||
}
|
||||
public static void setSort(String _sort) {
|
||||
SystemContext.sort.set(_sort);
|
||||
}
|
||||
public static String getOrder() {
|
||||
return order.get();
|
||||
}
|
||||
public static void setOrder(String _order) {
|
||||
SystemContext.order.set(_order);
|
||||
}
|
||||
|
||||
public static void removePageSize() {
|
||||
pageSize.remove();
|
||||
}
|
||||
|
||||
public static void removePageOffset() {
|
||||
pageOffset.remove();
|
||||
}
|
||||
|
||||
public static void removeSort() {
|
||||
sort.remove();
|
||||
}
|
||||
|
||||
public static void removeOrder() {
|
||||
order.remove();
|
||||
}
|
||||
|
||||
public static void removeRealPath() {
|
||||
realPath.remove();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.kwxy.hyt.utils;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* Helper for creating random and Type 1 (time-based) UUIDs.
|
||||
*
|
||||
* @author xuan.chen
|
||||
*/
|
||||
public class UUIDUtils {
|
||||
|
||||
private static boolean IS_THREADLOCALRANDOM_AVAILABLE = false;
|
||||
private static Random random;
|
||||
private static final long leastSigBits;
|
||||
private static final ReentrantLock lock = new ReentrantLock();
|
||||
private static long lastTime;
|
||||
|
||||
static {
|
||||
try {
|
||||
IS_THREADLOCALRANDOM_AVAILABLE = null != UUIDUtils.class.getClassLoader().loadClass(
|
||||
"java.util.concurrent.ThreadLocalRandom");
|
||||
} catch (ClassNotFoundException e) {
|
||||
}
|
||||
|
||||
byte[] seed = new SecureRandom().generateSeed(8);
|
||||
leastSigBits = new BigInteger(seed).longValue();
|
||||
if (!IS_THREADLOCALRANDOM_AVAILABLE) {
|
||||
random = new Random(leastSigBits);
|
||||
}
|
||||
}
|
||||
|
||||
private UUIDUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new random UUID.
|
||||
*
|
||||
* @return the new UUID
|
||||
*/
|
||||
public static String random() {
|
||||
byte[] randomBytes = new byte[16];
|
||||
if (IS_THREADLOCALRANDOM_AVAILABLE) {
|
||||
java.util.concurrent.ThreadLocalRandom.current().nextBytes(randomBytes);
|
||||
} else {
|
||||
random.nextBytes(randomBytes);
|
||||
}
|
||||
|
||||
long mostSigBits = 0;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
mostSigBits = (mostSigBits << 8) | (randomBytes[i] & 0xff);
|
||||
}
|
||||
long leastSigBits = 0;
|
||||
for (int i = 8; i < 16; i++) {
|
||||
leastSigBits = (leastSigBits << 8) | (randomBytes[i] & 0xff);
|
||||
}
|
||||
|
||||
return new UUID(mostSigBits, leastSigBits).toString().replaceAll("-", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new time-based UUID.
|
||||
*
|
||||
* @return the new UUID
|
||||
*/
|
||||
public static String create() {
|
||||
long timeMillis = (System.currentTimeMillis() * 10000) + 0x01B21DD213814000L;
|
||||
|
||||
lock.lock();
|
||||
try {
|
||||
if (timeMillis > lastTime) {
|
||||
lastTime = timeMillis;
|
||||
} else {
|
||||
timeMillis = ++lastTime;
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
// time low
|
||||
long mostSigBits = timeMillis << 32;
|
||||
|
||||
// time mid
|
||||
mostSigBits |= (timeMillis & 0xFFFF00000000L) >> 16;
|
||||
|
||||
// time hi and version
|
||||
mostSigBits |= 0x1000 | ((timeMillis >> 48) & 0x0FFF); // version 1
|
||||
|
||||
return new UUID(mostSigBits, leastSigBits).toString().replaceAll("-", "");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
jdbc.driver=com.mysql.jdbc.Driver
|
||||
jdbc.url=jdbc:mysql://127.0.0.1:3306/ssm_xsktsign?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||
jdbc.username=root
|
||||
jdbc.password=123456
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
log4j.rootLogger=DEBUG, Console
|
||||
#Console
|
||||
log4j.appender.Console=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n
|
||||
log4j.logger.java.sql.ResultSet=INFO
|
||||
log4j.logger.org.apache=INFO
|
||||
log4j.logger.java.sql.Connection=DEBUG
|
||||
log4j.logger.java.sql.Statement=DEBUG
|
||||
log4j.logger.java.sql.PreparedStatement=DEBUG
|
@ -0,0 +1,18 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.2.xsd
|
||||
http://www.springframework.org/schema/aop
|
||||
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
|
||||
http://www.springframework.org/schema/tx
|
||||
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd " default-autowire="byName">
|
||||
<!-- 商品管理的service -->
|
||||
<context:component-scan base-package="com.kwxy.hyt"></context:component-scan>
|
||||
<context:annotation-config></context:annotation-config>
|
||||
</beans>
|
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue