web端代码

GYZ_branch
JoeyG 2 years ago
parent afcd511263
commit a1194e2cd6

@ -63,7 +63,21 @@
</exclusion>
</exclusions>
</dependency>
<!-- 表格导出-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
</dependency>
<!-- fastjson -->
<dependency>
<groupId>com.alibaba</groupId>

@ -7,7 +7,7 @@ import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = {"com.example.demo.controller", "com.example.demo.config", "com.example.demo.service.impl"})
@ComponentScan(basePackages = {"com.example.demo.controller", "com.example.demo.config", "com.example.demo.service.impl","com.example.demo.mapper"})
@MapperScan("com.example.demo.mapper")
public class DemoApplication {

@ -1,7 +1,4 @@
package com.example.demo.common;
;/**
* Create by eval on 2019/3/20
*/
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@ -17,13 +14,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassName WechatUtil
* @Description TODO
* @Author eval
* @Date 9:44 2019/3/20
* @Version 1.0
*/
public class WechatUtil {
public static JSONObject getSessionKeyOrOpenId(String code) {
String requestUrl = "https://api.weixin.qq.com/sns/jscode2session";

@ -0,0 +1,143 @@
package com.example.demo.common;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ZipUtils {
private static final int BUFFER_SIZE = 2 * 1024;
/**
* ZIP 1
*
* @param srcDir
* @param out
* @param KeepDirStructure ,true:;
* false:(,)
* @throws RuntimeException
*/
public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure)
throws RuntimeException {
long start = System.currentTimeMillis();
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(out);
File sourceFile = new File(srcDir);
compress(sourceFile, zos, sourceFile.getName(), KeepDirStructure);
long end = System.currentTimeMillis();
System.out.println("压缩完成,耗时:" + (end - start) + " ms");
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils", e);
} finally {
if (zos != null) {
try {
zos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* ZIP 2
*
* @param srcFiles
* @param out
* @throws RuntimeException
*/
public static void toZip(List<File> srcFiles, OutputStream out) throws RuntimeException {
long start = System.currentTimeMillis();
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(out);
for (File srcFile : srcFiles) {
byte[] buf = new byte[BUFFER_SIZE];
zos.putNextEntry(new ZipEntry(srcFile.getName()));
int len;
FileInputStream in = new FileInputStream(srcFile);
while ((len = in.read(buf)) != -1) {
zos.write(buf, 0, len);
}
zos.closeEntry();
in.close();
}
long end = System.currentTimeMillis();
System.out.println("压缩完成,耗时:" + (end - start) + " ms");
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils", e);
} finally {
if (zos != null) {
try {
zos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
*
*
* @param sourceFile
* @param zos zip
* @param name
* @param KeepDirStructure ,true:;
* false:(,)
* @throws Exception
*/
private static void compress(File sourceFile, ZipOutputStream zos, String name,
boolean KeepDirStructure) throws Exception {
byte[] buf = new byte[BUFFER_SIZE];
if (sourceFile.isFile()) {
// 向zip输出流中添加一个zip实体构造器中name为zip实体的文件的名字
zos.putNextEntry(new ZipEntry(name));
// copy文件到zip输出流中
int len;
FileInputStream in = new FileInputStream(sourceFile);
while ((len = in.read(buf)) != -1) {
zos.write(buf, 0, len);
}
// Complete the entry
zos.closeEntry();
in.close();
} else {
File[] listFiles = sourceFile.listFiles();
if (listFiles == null || listFiles.length == 0) {
// 需要保留原来的文件结构时,需要对空文件夹进行处理
if (KeepDirStructure) {
// 空文件夹的处理
zos.putNextEntry(new ZipEntry(name + "/"));
// 没有文件不需要文件的copy
zos.closeEntry();
}
} else {
for (File file : listFiles) {
// 判断是否需要保留原来的文件结构
if (KeepDirStructure) {
// 注意file.getName()前面需要带上父文件夹的名字加一斜杠,
// 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
compress(file, zos, name + "/" + file.getName(), KeepDirStructure);
} else {
compress(file, zos, file.getName(), KeepDirStructure);
}
}
}
}
}
public static void main(String[] args) throws Exception {
/** 测试压缩方法1 */
FileOutputStream fos1 = new FileOutputStream(new File("./test.zip"));
ZipUtils.toZip("C:\\Users\\1\\OneDrive - sliverki\\学习", fos1, true);
}
}

@ -0,0 +1,25 @@
package com.example.demo.config;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class LoginHandleInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
/*
session
*/
Object loginUser= request.getSession().getAttribute("loginUser");
if(loginUser==null){//没登陆
request.setAttribute("msg","没有权限,请先登录");
request.getRequestDispatcher("/index.html").forward(request,response);
return false;
}else{
return true;
}
}
}

@ -1,6 +1,7 @@
package com.example.demo.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@ -11,4 +12,10 @@ public class MyMvcConfig implements WebMvcConfigurer {
registry.addViewController("/").setViewName("index");
registry.addViewController("/index.html").setViewName("index");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LoginHandleInterceptor()).addPathPatterns("/**").excludePathPatterns("/index.html","dashboard","/","/login","/css/**","/js/**","/img/**");
}
}

@ -1,19 +0,0 @@
package com.example.demo.config.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* Web
*
* @author huang
* @since 2022-03-18
*/
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("login/login");
}
}

@ -0,0 +1,67 @@
package com.example.demo.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@SpringBootApplication
@Tag(name ="你的接口",description = "test")
public class ControllerText {
@Operation(summary = "获取用户列表",description = "test")
@RequestMapping("getUser")
public Map<String, Object> getUser(){
System.out.println("微信小程序正在调用。。。");
Map<String, Object> map = new HashMap<String, Object>();
List<String> list = new ArrayList<String>();
list.add("zhangsan");
list.add("lisi");
list.add("wanger");
list.add("mazi");
map.put("list",list);
System.out.println("微信小程序调用完成。。。");
return map;
}
@Operation(summary = "获取用户表",description = "test")
@RequestMapping("getWord")
public Map<String, Object> getText(String word){
Map<String, Object> map = new HashMap<String, Object>();
String message = "我能力有限,不要为难我";
if ("后来".equals(word)) {
message="正在热映的后来的我们是刘若英的处女作。";
}else if("微信小程序".equals(word)){
message= "想获取更多微信小程序相关知识,请更多的阅读微信官方文档,还有其他更多微信开发相关的内容,学无止境。";
}else if("cauc".equals(word)){
message="yes";
}
map.put("message", message);
return map;
}
@Autowired
JdbcTemplate jct;
@Operation(summary = "取用户列表",description = "test")
@GetMapping("userslist")
public List<Map<String, Object>> userlist(){
String sql = "select * from user";
List<Map<String, Object>> map = jct.queryForList(sql);
System.out.println("调用sql");
return map;
}
}

@ -0,0 +1,42 @@
package com.example.demo.controller;
import com.example.demo.common.util.FormatResponseUtil;
import com.example.demo.common.util.ResponseResult;
import com.example.demo.domain.Dragon;
import com.example.demo.service.impl.DragonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/dragon")
public class DragonController {
@Autowired(required = false)
DragonServiceImpl dragonService;
@GetMapping("/dragonList")
public ResponseResult queryAll() {
return FormatResponseUtil.formatResponse(dragonService.queryAll());
}
@PostMapping("/addDragon")
public ResponseResult addDragon(@RequestBody Dragon dragon) {
//System.out.println("1111111111");
return FormatResponseUtil.formatResponse(dragonService.save(dragon));
}
@DeleteMapping("/delete")//这里执行的是物理删除
public ResponseResult delTDragonById(Integer id) {
return FormatResponseUtil.formatResponse(dragonService.delDragonById(id));
}
@GetMapping("/one")
public ResponseResult queryById(int id) {
return FormatResponseUtil.formatResponse(dragonService.queryDragonById(id));
}
@PostMapping("/dragonInfo")
public ResponseResult updateArea(@RequestBody Dragon dragon) {
return FormatResponseUtil.formatResponse(dragonService.updateById(dragon));
}
}

@ -1,8 +1,10 @@
package com.example.demo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.domain.Dragonson;
import com.example.demo.domain.Taskson;
import com.example.demo.domain.User;
import com.example.demo.mapper.DragonsonMapper;
import com.example.demo.mapper.TasksonMapper;
import com.example.demo.mapper.UserMapper;
import io.swagger.v3.oas.annotations.Operation;
@ -20,6 +22,7 @@ import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Date;
import java.util.List;
@Tag(name = "任务上传", description = " ")
@ -29,6 +32,9 @@ public class TaskuploadController {
private TasksonMapper tasksonMapper;
@Autowired
private UserMapper userMapper;
@Autowired
private DragonsonMapper dragonsonMapper;
@RequestMapping(value = "/taskupload", method = RequestMethod.POST)
@Operation(summary = "任务上传接口")
@ -91,10 +97,35 @@ public class TaskuploadController {
}
System.out.println("upload success");
taskson.setFilepath(path);
taskson.setFinishtime(new Date());
this.tasksonMapper.updateById(taskson);
return "upload successful";
}
@RequestMapping("/uploadDragon")
public String uploaddragon(@RequestParam(name = "skey", required = true) String skey,
@RequestParam(name = "dragonid", required = true) int dragonid,
@RequestParam(name = "text", required = true) String text) {
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.like("skey", skey);
User user = this.userMapper.selectOne(queryWrapper);
QueryWrapper<Dragonson> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.like("studentnumber", user.getStudentNumber());
queryWrapper1.like("dragon_id", dragonid);
Dragonson dragonson = this.dragonsonMapper.selectOne(queryWrapper1);
if (dragonson == null) {
dragonson = new Dragonson();
dragonson.setDragonid(dragonid);
dragonson.setStudentnumber(user.getStudentNumber());
this.dragonsonMapper.insert(dragonson);
}
dragonson.setText(text);
dragonson.setFinishtime(new Date());
this.dragonsonMapper.updateById(dragonson);
return "success";
}
}

@ -6,6 +6,7 @@ import com.example.demo.common.HttpGetUtil;
import com.example.demo.domain.Rcode;
import com.example.demo.domain.User;
import com.example.demo.mapper.RcodeMapper;
import com.example.demo.mapper.TasksonMapper;
import com.example.demo.mapper.UserMapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -20,10 +21,7 @@ import java.util.*;
@Tag(name = "真·用户接口", description = "用户登录,")
@RestController
public class UserController {
@RequestMapping("/index")
public String first() {
return "index";
}
@Autowired
private UserMapper userMapper;
@ -97,6 +95,8 @@ public class UserController {
* @authkirito
* @date2022/10/20
*/
@Autowired
TasksonMapper tasksonMapper;
@RequestMapping("/atbind")
@Operation(summary = "用户绑定接口")
public void atbind(@RequestParam(value = "studentnumber", required = true) String studentnumber,
@ -117,6 +117,7 @@ public class UserController {
/**
*
* s
*
* @param skey
* @return code

@ -1,167 +1,355 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.common.HttpGetUtil;
import com.example.demo.domain.Rcode;
import com.example.demo.domain.User;
import com.example.demo.mapper.RcodeMapper;
import com.example.demo.domain.*;
import com.example.demo.mapper.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.codec.binary.Base64;
import org.apache.tomcat.util.http.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.nio.Buffer;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import javax.servlet.http.HttpSession;
import java.util.List;
@Controller
@RequestMapping("/web")
@Tag(name = "web端")
public class Webcontroller {
@RequestMapping("/dashboard")
public String login() {
return "dashboard";
}
@RequestMapping("/list")
public String numer() {
return "list";
@RequestMapping("/index")
public String first(){
return "index";
}
/**
* qrcode
* issue: 线使
* ,线
*
* @return
*/
@RequestMapping("/getqrcode")
public Object getqrcode() {
RestTemplate restTemplate = new RestTemplate();
//首先获取ACCESS_TOKEN
String getAccessTokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx08c675f6ba5b2cdc&secret=0c28388c09ff373d391fe66d085dd39d";
JSONObject tokenResult = restTemplate.getForObject(getAccessTokenUrl, JSONObject.class);
assert tokenResult != null;
String accessToken = tokenResult.getString("access_token");
//System.out.println(accessToken);
//然后调用微信官方api生成二维码
String createQrCodeUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
//此处我是使用的阿里巴巴的fastJson
JSONObject createQrParam = new JSONObject();
//createQrParam.put("scene", scene);
//createQrParam.put("page", page);
PrintWriter out = null;
InputStream in = null;
try {
URL realUrl = new URL(createQrCodeUrl);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new PrintWriter(conn.getOutputStream());
// 发送请求参数,利用connection的输出流去写数据到connection中我的参数数据流出我的电脑内存到connection中让connection把参数帮我传到URL中去请求。
out.print(createQrParam);
// flush输出流的缓冲
out.flush();
//获取URL的connection中的输入流这个输入流就是我请求的url返回的数据,返回的数据在这个输入流中,流入我内存,我将从此流中读取数据。
in = conn.getInputStream();
//定义个空字节数组
byte[] data = null;
// 读取图片字节数组
try {
//创建字节数组输出流作为中转仓库,等待被写入数据
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buff = new byte[100];
int rc = 0;
while ((rc = in.read(buff, 0, 100)) > 0) {
//向中转的输出流循环写出输入流中的数据
swapStream.write(buff, 0, rc);
}
//此时connection的输入流返回给我们的请求结果数据已经被完全地写入了我们定义的中转输出流swapStream中
data = swapStream.toByteArray();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
String base64Code = new String(Objects.requireNonNull(Base64.encodeBase64(data)));
//Base64转byte[]数组
System.out.println(base64Code);
} catch (Exception e) {
System.out.println("发送 POST 请求出现异常!" + e);
e.printStackTrace();
}
// 使用finally块来关闭输出流、输入流
finally {
try {
if (out != null) {
out.close();
}
if (in != null) {
in.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
return null;
}
/**
* 使
*
*
* @auth:kirito
*/
@Autowired
RcodeMapper rcodeMapper;
@RequestMapping("/login")
@Operation(summary = "登录")
public void weblogin(@RequestParam(value = "code") String code) {
public String login(
@RequestParam("code") String code,
Model model,
HttpSession session
){
QueryWrapper<Rcode> queryWrapper = new QueryWrapper<>();
queryWrapper.like("code", code);
Rcode authrcode = this.rcodeMapper.selectOne(queryWrapper);
String skey = authrcode.getSkey();
// System.out.println(skey);
if(!skey.isEmpty()){
QueryWrapper<User> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.like("skey",skey);
User user=this.userMapper.selectOne(queryWrapper1);
String id=user.getStudentNumber();
session.setAttribute("loginUser",id);
return "dashboard";
}else{
/*
*/
model.addAttribute("msg","验证码错误");
return "index";
}
}
//@RequestMapping("/list")
/*public String numer(){
return "list";
}*/
@Autowired
UserMapper userMapper;
@RequestMapping("/users")
/*
*/
public String numer(ModelMap map){
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.select("name","student_number","power");
List<User> users = userMapper.selectList(queryWrapper);
map.put("users",users);
// System.out.println(users);
// System.out.println(userList);
// model.addAttribute("users",userList);
}
return "list";
}
/*
*/
@GetMapping("/deluser/{StudentNumber}")
public String delUser(@PathVariable("StudentNumber") String StudentNumber){
/*
*/
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.select("student_number").like("student_number", StudentNumber);
List<User> users = userMapper.selectList(queryWrapper);
userMapper.delete(queryWrapper);
// System.out.println(users);
// System.out.println(StudentNumber);
return "redirect:/users";
}
/*
*/
@GetMapping("/user/{StudentNumber}")
public String toUpdateUser(@PathVariable("StudentNumber")String StudentNumber,Model model,ModelMap map){
/*
*/
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.select("name","student_number","power").like("student_number", StudentNumber);
List<User> users = userMapper.selectList(queryWrapper);
// System.out.println(users);
// System.out.println(users.get(10));
// System.out.println(StudentNumber);
model.addAttribute("users",users);
// map.put("users",users);
return "user/update";
}
@RequestMapping("/update")
public String updateUser(
@RequestParam("Studentnumber") String Studentnumber,
@RequestParam("name") String name,
@RequestParam("power") int power,
@RequestParam("stuid") String stuid,
@RequestParam("stuname" )String stuname
){
//
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.like("student_number",stuid);
User user=this.userMapper.selectOne(queryWrapper);
if(!name.isEmpty()){
user.setName(name);
}else{
user.setName(stuname);
}
if(!Studentnumber.isEmpty()){
user.setStudentNumber(Studentnumber);
}else{
user.setStudentNumber(stuid);
}
user.setStudentNumber(stuid);
user.setPower(power);
this.userMapper.updateById(user);
// List<User> users = userMapper.selectList(queryWrapper);
// System.out.println(user);
return"redirect:/users";
}
@Autowired
TaskMapper taskMapper;
@RequestMapping("totaltask")
public String totasklist(Model model){
QueryWrapper<Task>queryWrapper = new QueryWrapper<>();
queryWrapper.select("id","name","property","status","deadtime");
List<Task> tasks=this.taskMapper.selectList(queryWrapper);
model.addAttribute("tasks",tasks);
return "task/tasklist";
}
@Autowired
DragonMapper dragonMapper;
@RequestMapping("totalgroupnote")
/*
*/
public String togroupnotelist(Model model){
QueryWrapper<Dragon>queryWrapper = new QueryWrapper<>();
queryWrapper.select("id","name","property","status","deadtime");
List<Dragon> tasks=this.dragonMapper.selectList(queryWrapper);
model.addAttribute("tasks",tasks);
return "task/groupnotelist";
}
@Autowired
TasksonMapper tasksonMapper;
@RequestMapping("/item1/{id}")
public String totaskdetail(@PathVariable("id")String id,Model model){
/*
*/
QueryWrapper<Taskson>queryWrapper = new QueryWrapper<>();
queryWrapper.select("task_id","studentnumber","finishtime","filepath").like("task_id", id);
List<Taskson> taskson=this.tasksonMapper.selectList(queryWrapper);
// System.out.println(taskson);
model.addAttribute("taskdetail",taskson);
return "task/taskdetail";
}
// @Autowired
// TasksonMapper tasksonMapper;
@Autowired
DragonsonMapper dragonsonMapper;
@RequestMapping("/item2/{id}")
/*
*/
public String togroupdetail(@PathVariable("id")String id,Model model){
/*
*/
QueryWrapper<Dragonson>queryWrapper = new QueryWrapper<>();
queryWrapper.select("task_id","studentnumber","finishtime","filepath").like("task_id", id);
List<Dragonson> groupson=this.dragonsonMapper.selectList(queryWrapper);
System.out.println(groupson);
model.addAttribute("groupdetail",groupson);
return "task/groupdetail";
}
@RequestMapping("taskedit")
public String totasklistedit(Model model){
QueryWrapper<Task>queryWrapper = new QueryWrapper<>();
queryWrapper.select("id","name","property","status","deadtime");
List<Task> tasks=this.taskMapper.selectList(queryWrapper);
model.addAttribute("tasks",tasks);
return "task/taskeditlist";
}
@GetMapping ("/itemedit1/{id}")
public String totaskedit(@PathVariable("id") String id,Model model){
/*
*/
QueryWrapper<Task>queryWrapper=new QueryWrapper<>();
queryWrapper.select().like("id",id);
List<Task>tasks=this.taskMapper.selectList(queryWrapper);
model.addAttribute("tasks",tasks);
return "/task/taskupdate";
}
/*
*/
@GetMapping("taskupdate")
public String taskedit(@RequestParam("id")String id,
@RequestParam("name") String name,
@RequestParam("property") String property,
@RequestParam("deadtime") String deadtime,
@RequestParam("status") int status
){
QueryWrapper<Task>queryWrapper = new QueryWrapper<>();
queryWrapper.select().like("id", id);
Task task =this.taskMapper.selectOne(queryWrapper);
if(!name.isEmpty()){
task.setName(name);
}
if(!property.isEmpty()){
task.setProperty(property);
}
if (!deadtime.isEmpty()){
task.setDeadtime(deadtime);
}
task.setStatus(status);
// List<Task> tasks=this.taskMapper.selectList(queryWrapper);
// System.out.println(tasks);
this.taskMapper.updateById(task);
return "redirect:/taskedit";
}
@RequestMapping("togroupnoteedit")
/*
*/
public String togroupnoteeditlist(Model model){
QueryWrapper<Dragon>queryWrapper = new QueryWrapper<>();
queryWrapper.select("id","name","property","status","deadtime");
List<Dragon> tasks=this.dragonMapper.selectList(queryWrapper);
model.addAttribute("tasks",tasks);
return "task/groupnoteeditlist";
}
@GetMapping ("/itemedit2/{id}")
public String togroupnoteedit(@PathVariable("id") String id,Model model){
/*
*/
QueryWrapper<Dragon>queryWrapper=new QueryWrapper<>();
queryWrapper.select().like("id",id);
List<Dragon>tasks=this.dragonMapper.selectList(queryWrapper);
model.addAttribute("tasks",tasks);
return "/task/groupnoteupdate";
}
@GetMapping("groupnoteupdate")
public String groupnoteedit(@RequestParam("id")String id,
@RequestParam("name") String name,
@RequestParam("property") String property,
@RequestParam("deadtime") String deadtime,
@RequestParam("status") int status
){
QueryWrapper<Dragon>queryWrapper = new QueryWrapper<>();
queryWrapper.select().like("id", id);
Dragon task =this.dragonMapper.selectOne(queryWrapper);
if(!name.isEmpty()){
task.setName(name);
}
if(!property.isEmpty()){
task.setProperty(property);
}
if (!deadtime.isEmpty()){
task.setDeadtime(deadtime);
}
task.setStatus(status);
// List<Task> tasks=this.taskMapper.selectList(queryWrapper);
// System.out.println(tasks);
this.dragonMapper.updateById(task);
return "redirect:/togroupnoteedit";
}
/*
*/
@GetMapping("/itemdel1/{id}")
public String delTask(@PathVariable("id") String id){
/*
*/
QueryWrapper<Task> queryWrapper = new QueryWrapper<>();
queryWrapper.select().like("id", id);
List<Task> users = this.taskMapper.selectList(queryWrapper);
this.taskMapper.delete(queryWrapper);
// System.out.println(users);
// System.out.println(StudentNumber);
return "redirect:/taskedit";
}
/*
*/
@GetMapping("/itemdel2/{id}")
public String delgroupnote(@PathVariable("id") String id){
/*
*/
QueryWrapper<Dragon> queryWrapper = new QueryWrapper<>();
queryWrapper.select().like("id", id);
List<Dragon> users = this.dragonMapper.selectList(queryWrapper);
this.dragonMapper.delete(queryWrapper);
// System.out.println(users);
// System.out.println(StudentNumber);
return "redirect:/togroupnoteedit";
}
}

@ -0,0 +1,122 @@
package com.example.demo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.domain.Dragonson;
import com.example.demo.domain.User;
import com.example.demo.mapper.DragonsonMapper;
import com.example.demo.mapper.UserMapper;
import org.apache.poi.hssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.List;
@Controller
public class Webneed {
@Autowired
DragonsonMapper dragonsonMapper;
@GetMapping("/exceldownload/{Taskid}")
public void download(HttpServletResponse response, @PathVariable("Taskid") String dragonid) throws IOException {
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("接龙情况");
QueryWrapper<Dragonson> queryWrapper = new QueryWrapper<>();
queryWrapper.like("dragon_id", dragonid);
List<Dragonson> list = this.dragonsonMapper.selectList(queryWrapper);
String filename = dragonid + ".xls";
int rowNum = 1;
//表头
String[] headers = {"num", "dragonid", "studentnumber", "finishtime", "text"};
HSSFRow row = sheet.createRow(0);
for (int i = 0; i < headers.length; i++) {
HSSFCell cell = row.createCell(i);
HSSFRichTextString text = new HSSFRichTextString(headers[i]);
cell.setCellValue(text);
}
//在表中存放查询到的数据放入对应的列
for (Dragonson dragonson : list) {
HSSFRow row1 = sheet.createRow(rowNum);
row1.createCell(0).setCellValue(dragonson.getId());
row1.createCell(1).setCellValue(dragonson.getDragonid());
row1.createCell(2).setCellValue(dragonson.getStudentnumber());
row1.createCell(3).setCellValue(dragonson.getFinishtime());
row1.createCell(4).setCellValue(dragonson.getText());
rowNum++;
}
response.setContentType("application/octet-stream");
response.setHeader("Content-disposition", "attachment;filename=" + filename);
response.flushBuffer();
workbook.write(response.getOutputStream());
}
@RequestMapping("/daochu")
public String daochu() {
return "daochu";
}
@RequestMapping("/filedownload/{Taskid}")
public String downloadfile(@PathVariable("Taskid") String taskid,
HttpServletResponse response) throws UnsupportedEncodingException {
File scFileDir = new File("./");
String fileName = taskid + ".zip";
File fileDir = new File(scFileDir, fileName);
System.out.println(fileDir.getName());
if (fileDir.exists()) {
// 配置文件下载
response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream");
// 下载文件能正常显示中文
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 实现文件下载
byte[] buffer = new byte[1024];
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
fis = new FileInputStream(fileDir);
bis = new BufferedInputStream(fis);
OutputStream os = response.getOutputStream();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
System.out.println("Download the song successfully!");
} catch (Exception e) {
System.out.println("Download the song failed!");
} finally {
if (bis != null) {
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
return null;
}
}

@ -0,0 +1,108 @@
package com.example.demo.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
public class Dragon {
private static final long serialVersionUID = 1L;
public static final String CREATE_TIME = "createTime";
public static final String MODIFIED_TIME = "lastEditTime";
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String name;
/*
*
* */
private String property;
private String deadtime;
//任务状态默认0未完成
private Integer status;
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
/**
*
*/
@TableField(fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
public String getDeadtime() {
return deadtime;
}
public void setDeadtime(String deadtime) {
this.deadtime = deadtime;
}
/**
*
*/
@TableField(fill = FieldFill.UPDATE)
private LocalDateTime lastTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public LocalDateTime getLastTime() {
return lastTime;
}
public void setLastTime(LocalDateTime lastTime) {
this.lastTime = lastTime;
}
@Override
public String toString() {
return "Dragon{" +
"id=" + id +
", name=" + name +
", priority=" + property +
", createTime=" + createTime +
", lastTime=" + lastTime +
"}";
}
}

@ -0,0 +1,61 @@
package com.example.demo.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@TableName("dragonson")
public class Dragonson extends Wrapper<Dragonson> {
/**
* id
*/
@TableField("id")
private int id;
/**
* dragon_id
*/
@TableField("dragon_id")
private int dragonid;
/**
* studentnumber
*/
@TableField("studentnumber")
private String studentnumber;
/**
* finishtime
*/
@TableField("finishtime")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date finishtime;
/**
* text
*/
@TableField("text")
private String text;
@Override
public Dragonson getEntity() {
return null;
}
@Override
public MergeSegments getExpression() {
return null;
}
@Override
public void clear() {
}
@Override
public String getSqlSegment() {
return null;
}
}

@ -1,14 +1,36 @@
package com.example.demo.domain;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
import lombok.Data;
import java.util.Random;
public class Rcode {
@Data
@TableName("rcode")
public class Rcode extends Wrapper<Rcode> {
private String code;
private String skey;
public Rcode() {
}
@Override
public Rcode getEntity() {
return null;
}
@Override
public MergeSegments getExpression() {
return null;
}
@Override
public void clear() {
}
public Rcode(String code, String skey) {
this.code = code;
this.skey = skey;
@ -58,4 +80,9 @@ public class Rcode {
return code;
}
@Override
public String getSqlSegment() {
return null;
}
}

@ -0,0 +1,12 @@
package com.example.demo.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.domain.Dragon;
import org.apache.ibatis.annotations.Mapper;
/**
*
*/
@Mapper
public interface DragonMapper extends BaseMapper<Dragon> {
}

@ -0,0 +1,10 @@
package com.example.demo.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.domain.Dragonson;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DragonsonMapper extends BaseMapper<Dragonson> {
}

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.DragonMapper">
</mapper>

@ -0,0 +1,25 @@
package com.example.demo.service;
import com.example.demo.domain.Dragon;
import java.util.List;
/**
*
*/
public interface IDragonService {
/**
* Area
*/
List<Dragon> queryAll();
/**
* IdDragon
*/
Dragon queryDragonById(int id);
/**
* IdDragon
*/
boolean delDragonById(int id);
}

@ -0,0 +1,41 @@
package com.example.demo.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.domain.Dragon;
import com.example.demo.mapper.DragonMapper;
import com.example.demo.service.IDragonService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class DragonServiceImpl extends ServiceImpl<DragonMapper, Dragon> implements IDragonService {
@Autowired(required = false)
DragonMapper dragonMapper;
@Override
public List<Dragon> queryAll() {
LambdaQueryWrapper<Dragon> wrapper = Wrappers.lambdaQuery();
wrapper.orderByAsc(Dragon::getId);
List<Dragon> dragonList = dragonMapper.selectList(wrapper);
return dragonList;
}
@Override
public Dragon queryDragonById(int id) {
Dragon dragon = dragonMapper.selectById(id);
return dragon;
}
@Override
public boolean delDragonById(int id) {
boolean ans;
int i = dragonMapper.deleteById(id);
return ans = i > 0 ? true : false;
}
}

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<table border="0" style="margin-top:4px; margin-left: 18px">
<tr>
<td><a href="#" class="easyui-linkbutton" onclick="downloadfile();">数据导出</a></td>
</tr>
<script>
function downloadfile() {
window.location.href = "/exceldownload";
}
</script>
</table>
</body>
</html>

@ -43,11 +43,11 @@
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="">admin</a>
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Sign out</a>
<a class="nav-link" th:href="@{/index}">Sign out</a>
</li>
</ul>
</nav>
@ -58,7 +58,7 @@
<div class="sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">
<a class="nav-link active" th:href="@{/totaltask}">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
<polyline points="9 22 9 12 15 12 15 22"></polyline>

@ -16,12 +16,13 @@
</head>
<body class="text-center">
<form class="form-signin" action="dashboard.html">
<form class="form-signin" action="/login">
<img class="mb-4" th:src="@{/img/bootstrap-solid.svg}" alt="" width="72" height="72">
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
<p style="color: red" th:text="${msg}" ></p>
<label class="sr-only">Username</label>
<input type="text" class="form-control" placeholder="微信授权登录(未实现)" required="" autofocus="">
<input type="text" name="code" class="form-control" placeholder="微信授权登录(未实现)" required="" autofocus="">
<div class="checkbox mb-3">
<label>

@ -44,11 +44,11 @@
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>
<a class="navbar-brand col-sm-3 col-md-2 mr-0" >Admin</a>
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Sign out</a>
<a class="nav-link" th:href="@{/index}"Sign out</a>
</li>
</ul>
</nav>
@ -77,7 +77,7 @@
<td th:text="${user.name}"></td>
<!-- <td th:text="${user.gender}"></td>-->
<!-- <td th:text="${user.city}"></td>-->
<td th:text="${user.power==0?'admin':'user'}"></td>
<td th:text="${user.power==0?'user':'admin'}"></td>
<td>
<a class="btn btn-sm btn-primary"th:href="@{/user/}+${user.StudentNumber}">编辑</a>
<a class="btn btn-sm btn-danger"th:href="@{/deluser/}+${user.StudentNumber}">删除</a>

@ -0,0 +1,202 @@
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang=xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/dashboard.css" rel="stylesheet">
<style type="text/css">
/* Chart.js */
@-webkit-keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
@keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
.chartjs-render-monitor {
-webkit-animation: chartjs-render-animation 0.001s;
animation: chartjs-render-animation 0.001s;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<!-- <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>-->
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" th:href="@{/index}">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>ID</th>
<th>学号</th>
<th>提交时间</th>
<th>文件地址</th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${groupdetail}" >
<form th:action="@{/totalgroupnote}" method="get">
<td th:text="${item.Taskid}"></td>
<td th:text="${item.studentnumber}"></td>
<td th:text="${item.finishtime}"></td>
<td th:text="${item.filepath}"></td>
<td><a class="btn btn-sm btn-success"th:href="@{/exceldownload/}+${item.Taskid}">导出</a></td>
<!-- <input type="hidden" name="taskid" th:value="${item.id}">-->
<!-- <input type="hidden" name="taskname" th:value="${item.name}">-->
<!-- <div class="form-group">-->
<!-- <label>学号</label>-->
<!-- <input type="text" name="Studentnumber" class="form-control" th:placeholder="${user.StudentNumber}">-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>姓名</label>-->
<!-- <input type="text" name="name" class="form-control" th:placeholder="${user.name}">-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>权限</label><br>-->
<!-- <div class="form-check form-check-inline">-->
<!-- <input class="form-check-input" type="radio" name="power" value="1">-->
<!-- <label class="form-check-label">管理员</label>-->
<!-- </div>-->
<!-- <div class="form-check form-check-inline">-->
<!-- <input class="form-check-input" type="radio" name="power" value="0">-->
<!-- <label class="form-check-label">用户</label>-->
<!-- </div>-->
<!-- </div>-->
<button type="submit" class="btn btn-primary">返回</button>
</form>
</tr>
</tbody>
</table>
<!-- <form th:action="@{/user}">-->
<!-- <div class="form-group">-->
<!-- <label>学号</label>-->
<!-- <input th:text="${user.name}" type="text" class="form-control" placeholder="海绵宝宝">-->
<!-- <div th:text="${users}"></div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>姓名</label>-->
<!-- <input type="email" class="form-control" placeholder="">-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Gender</label><br>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="1">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">男</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="0">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">女</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <div class="form-group">-->
<!-- <label>管理员</label>-->
<!-- <select class="form-control">-->
<!-- <option>是</option>-->
<!-- <option>否</option>-->
<!--&lt;!&ndash; <option>3</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>4</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>5</option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Birth</label>&ndash;&gt;-->
<!--&lt;!&ndash; <input type="text" class="form-control" placeholder="嘤嘤嘤">&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <button type="submit" class="btn btn-primary">添加</button>-->
<!-- </form>-->
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>
feather.replace()
</script>
<!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
datasets: [{
data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
lineTension: 0,
backgroundColor: 'transparent',
borderColor: '#007bff',
borderWidth: 4,
pointBackgroundColor: '#007bff'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
},
legend: {
display: false,
}
}
});
</script>
</body>
</html>

@ -0,0 +1,148 @@
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang=xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/dashboard.css" rel="stylesheet">
<style type="text/css">
/* Chart.js */
@-webkit-keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
@keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
.chartjs-render-monitor {
-webkit-animation: chartjs-render-animation 0.001s;
animation: chartjs-render-animation 0.001s;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<!-- <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>-->
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" th:href="@{/index}">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<h2>接龙管理</h2>
<a class="btn btn-sm btn-success"th:href="@{/taskedit}">切换</a>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>id</th>
<th>名称</th>
<th>内容</th>
<th>完成状态</th>
<th>截止时间</th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${tasks}" >
<td th:text="${item.id}"></td>
<td th:text="${item.name}"></td>
<td th:text="${item.property}"></td>
<td th:text="${item.status==0?'未完成':'已完成'}"></td>
<td th:text="${item.deadtime}"></td>
<td><a class="btn btn-sm btn-primary"th:href="@{/itemedit2/}+${item.id}">编辑</a>
<a class="btn btn-sm btn-danger"th:href="@{/itemdel2/}+${item.id}">删除</a></td>
<!-- <a class="btn btn-sm btn-primary"th:href="@{/user/}+${user.StudentNumber}">编辑</a>-->
<!-- <a class="btn btn-sm btn-danger"th:href="@{/deluser/}+${user.StudentNumber}">删除</a>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td th:text="${user.skey}"></td>-->
<!-- </tr>-->
<!-- <tr th:each="user:${users}">-->
<!-- <td th:text="@{}"></td>-->
<!-- </tr>-->
</tbody>
</table>
</div>
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>
feather.replace()
</script>
<!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
datasets: [{
data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
lineTension: 0,
backgroundColor: 'transparent',
borderColor: '#007bff',
borderWidth: 4,
pointBackgroundColor: '#007bff'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
},
legend: {
display: false,
}
}
});
</script>
</body>
</html>

@ -0,0 +1,146 @@
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang=xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/dashboard.css" rel="stylesheet">
<style type="text/css">
/* Chart.js */
@-webkit-keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
@keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
.chartjs-render-monitor {
-webkit-animation: chartjs-render-animation 0.001s;
animation: chartjs-render-animation 0.001s;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<!-- <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>-->
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" th:href="@{/index}">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<h2>数据统计(接龙)</h2>
<a class="btn btn-sm btn-success"th:href="@{/totaltask}">切换</a>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>id</th>
<th>名称</th>
<th>内容</th>
<th>完成状态</th>
<th>截止时间</th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${tasks}" >
<td th:text="${item.id}"></td>
<td th:text="${item.name}"></td>
<td th:text="${item.property}"></td>
<td th:text="${item.status==0?'未完成':'已完成'}"></td>
<td th:text="${item.deadtime}"></td>
<td><a class="btn btn-sm btn-primary"th:href="@{/item2/}+${item.id}">详情</a></td>
<!-- <a class="btn btn-sm btn-primary"th:href="@{/user/}+${user.StudentNumber}">编辑</a>-->
<!-- <a class="btn btn-sm btn-danger"th:href="@{/deluser/}+${user.StudentNumber}">删除</a>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td th:text="${user.skey}"></td>-->
<!-- </tr>-->
<!-- <tr th:each="user:${users}">-->
<!-- <td th:text="@{}"></td>-->
<!-- </tr>-->
</tbody>
</table>
</div>
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>
feather.replace()
</script>
<!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
datasets: [{
data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
lineTension: 0,
backgroundColor: 'transparent',
borderColor: '#007bff',
borderWidth: 4,
pointBackgroundColor: '#007bff'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
},
legend: {
display: false,
}
}
});
</script>
</body>
</html>

@ -0,0 +1,211 @@
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang=xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/dashboard.css" rel="stylesheet">
<style type="text/css">
/* Chart.js */
@-webkit-keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
@keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
.chartjs-render-monitor {
-webkit-animation: chartjs-render-animation 0.001s;
animation: chartjs-render-animation 0.001s;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<table class="table table-striped table-sm">
<tbody>
<tr th:each="item : ${tasks}" >
<form th:action="@{/groupnoteupdate}" method="get">
<div class="form-group">
<label th:text="@{/ID:/}+${item.id}"></label>
<div></div>
<!-- <div th:text="${item.id}"></div>-->
<input type="hidden" name="id" th:value="${item.id}">
<label>任务名称</label>
<input type="text" name="name" class="form-control" th:placeholder="${item.name}">
</div>
<div class="form-group">
<label>内容</label>
<input type="text" name="property" class="form-control" th:placeholder="${item.property}">
</div>
<div class="form-group">
<label>截止时间</label>
<input type="text" name="deadtime" class="form-control" th:placeholder="${item.deadtime}">
</div>
<div class="form-group">
<label>完成状态</label><br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="status" value="1">
<label class="form-check-label">已完成</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="status" value="0">
<label class="form-check-label">未完成</label>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label>管理员</label>-->
<!-- <select class="form-control">-->
<!-- <option>是</option>-->
<!-- <option>否</option>-->
<!-- &lt;!&ndash; <option>3</option>&ndash;&gt;-->
<!-- &lt;!&ndash; <option>4</option>&ndash;&gt;-->
<!-- &lt;!&ndash; <option>5</option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>Birth</label>-->
<!-- <input type="text" class="form-control" placeholder="嘤嘤嘤">-->
<!-- </div>-->
<button type="submit" class="btn btn-primary">添加</button>
</form>
</tr>
<!-- <tr>-->
<!-- <td th:text="${user.skey}"></td>-->
<!-- </tr>-->
<!-- <tr th:each="user:${users}">-->
<!-- <td th:text="@{}"></td>-->
<!-- </tr>-->
</tbody>
</table>
<!-- <form th:action="@{/user}">-->
<!-- <div class="form-group">-->
<!-- <label>学号</label>-->
<!-- <input th:text="${user.name}" type="text" class="form-control" placeholder="海绵宝宝">-->
<!-- <div th:text="${users}"></div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>姓名</label>-->
<!-- <input type="email" class="form-control" placeholder="">-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Gender</label><br>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="1">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">男</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="0">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">女</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <div class="form-group">-->
<!-- <label>管理员</label>-->
<!-- <select class="form-control">-->
<!-- <option>是</option>-->
<!-- <option>否</option>-->
<!--&lt;!&ndash; <option>3</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>4</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>5</option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Birth</label>&ndash;&gt;-->
<!--&lt;!&ndash; <input type="text" class="form-control" placeholder="嘤嘤嘤">&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <button type="submit" class="btn btn-primary">添加</button>-->
<!-- </form>-->
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>
feather.replace()
</script>
<!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
datasets: [{
data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
lineTension: 0,
backgroundColor: 'transparent',
borderColor: '#007bff',
borderWidth: 4,
pointBackgroundColor: '#007bff'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
},
legend: {
display: false,
}
}
});
</script>
</body>
</html>

@ -0,0 +1,200 @@
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang=xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/dashboard.css" rel="stylesheet">
<style type="text/css">
/* Chart.js */
@-webkit-keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
@keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
.chartjs-render-monitor {
-webkit-animation: chartjs-render-animation 0.001s;
animation: chartjs-render-animation 0.001s;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>ID</th>
<th>学号</th>
<th>提交时间</th>
<th>文件地址</th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${taskdetail}" >
<form th:action="@{/totaltask}" method="get">
<td th:text="${item.Taskid}"></td>
<td th:text="${item.studentnumber}"></td>
<td th:text="${item.finishtime}"></td>
<td th:text="${item.filepath}"></td>
<td><a class="btn btn-sm btn-success"th:href="@{/filedownload/}+${item.Taskid}">导出</a></td>
<!-- <input type="hidden" name="taskid" th:value="${item.id}">-->
<!-- <input type="hidden" name="taskname" th:value="${item.name}">-->
<!-- <div class="form-group">-->
<!-- <label>学号</label>-->
<!-- <input type="text" name="Studentnumber" class="form-control" th:placeholder="${user.StudentNumber}">-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>姓名</label>-->
<!-- <input type="text" name="name" class="form-control" th:placeholder="${user.name}">-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>权限</label><br>-->
<!-- <div class="form-check form-check-inline">-->
<!-- <input class="form-check-input" type="radio" name="power" value="1">-->
<!-- <label class="form-check-label">管理员</label>-->
<!-- </div>-->
<!-- <div class="form-check form-check-inline">-->
<!-- <input class="form-check-input" type="radio" name="power" value="0">-->
<!-- <label class="form-check-label">用户</label>-->
<!-- </div>-->
<!-- </div>-->
<button type="submit" class="btn btn-primary">返回</button>
</form>
</tr>
</tbody>
</table>
<!-- <form th:action="@{/user}">-->
<!-- <div class="form-group">-->
<!-- <label>学号</label>-->
<!-- <input th:text="${user.name}" type="text" class="form-control" placeholder="海绵宝宝">-->
<!-- <div th:text="${users}"></div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>姓名</label>-->
<!-- <input type="email" class="form-control" placeholder="">-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Gender</label><br>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="1">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">男</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="0">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">女</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <div class="form-group">-->
<!-- <label>管理员</label>-->
<!-- <select class="form-control">-->
<!-- <option>是</option>-->
<!-- <option>否</option>-->
<!--&lt;!&ndash; <option>3</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>4</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>5</option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Birth</label>&ndash;&gt;-->
<!--&lt;!&ndash; <input type="text" class="form-control" placeholder="嘤嘤嘤">&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <button type="submit" class="btn btn-primary">添加</button>-->
<!-- </form>-->
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>
feather.replace()
</script>
<!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
datasets: [{
data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
lineTension: 0,
backgroundColor: 'transparent',
borderColor: '#007bff',
borderWidth: 4,
pointBackgroundColor: '#007bff'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
},
legend: {
display: false,
}
}
});
</script>
</body>
</html>

@ -0,0 +1,148 @@
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang=xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/dashboard.css" rel="stylesheet">
<style type="text/css">
/* Chart.js */
@-webkit-keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
@keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
.chartjs-render-monitor {
-webkit-animation: chartjs-render-animation 0.001s;
animation: chartjs-render-animation 0.001s;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<h2>任务管理</h2>
<a class="btn btn-sm btn-success"th:href="@{/togroupnoteedit}">切换</a>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>id</th>
<th>名称</th>
<th>内容</th>
<th>完成状态</th>
<th>截止时间</th>
</tr>
</thead>
<tbody>
<tr th:each="item : ${tasks}" >
<td th:text="${item.id}"></td>
<td th:text="${item.name}"></td>
<td th:text="${item.property}"></td>
<td th:text="${item.status==0?'未完成':'已完成'}"></td>
<td th:text="${item.deadtime}"></td>
<td><a class="btn btn-sm btn-primary"th:href="@{/itemedit1/}+${item.id}">编辑</a>
<a class="btn btn-sm btn-danger"th:href="@{/itemdel1/}+${item.id}">删除</a></td>
<!-- <a class="btn btn-sm btn-primary"th:href="@{/user/}+${user.StudentNumber}">编辑</a>-->
<!-- <a class="btn btn-sm btn-danger"th:href="@{/deluser/}+${user.StudentNumber}">删除</a>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td th:text="${user.skey}"></td>-->
<!-- </tr>-->
<!-- <tr th:each="user:${users}">-->
<!-- <td th:text="@{}"></td>-->
<!-- </tr>-->
</tbody>
</table>
</div>
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>
feather.replace()
</script>
<!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
datasets: [{
data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
lineTension: 0,
backgroundColor: 'transparent',
borderColor: '#007bff',
borderWidth: 4,
pointBackgroundColor: '#007bff'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
},
legend: {
display: false,
}
}
});
</script>
</body>
</html>

@ -58,31 +58,33 @@
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<h2>用户管理</h2>
<h2>数据统计(任务)</h2>
<a class="btn btn-sm btn-success"th:href="@{/totalgroupnote}">切换</a>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>student_number</th>
<th>name</th>
<!-- <th>gender</th>-->
<!-- <th>city</th>-->
<th>power</th>
<th>id</th>
<th>名称</th>
<th>内容</th>
<th>完成状态</th>
<th>截止时间</th>
</tr>
</thead>
<tbody>
<tr th:each="user : ${users}" >
<td th:text="${user.StudentNumber}"></td>
<!-- <td>11</td>-->
<td th:text="${user.name}"></td>
<!-- <td th:text="${user.gender}"></td>-->
<!-- <td th:text="${user.city}"></td>-->
<td th:text="${user.power==0?'admin':'user'}"></td>
<td>
<a class="btn btn-sm btn-primary"th:href="@{/user/}+${user.StudentNumber}">编辑</a>
<a class="btn btn-sm btn-danger"th:href="@{/deluser/}+${user.StudentNumber}">删除</a>
</td>
</tr>
<tr th:each="item : ${tasks}" >
<td th:text="${item.id}"></td>
<td th:text="${item.name}"></td>
<td th:text="${item.property}"></td>
<td th:text="${item.status==0?'未完成':'已完成'}"></td>
<td th:text="${item.deadtime}"></td>
<td><a class="btn btn-sm btn-primary"th:href="@{/item1/}+${item.id}">编辑</a></td>
<!-- <a class="btn btn-sm btn-primary"th:href="@{/user/}+${user.StudentNumber}">编辑</a>-->
<!-- <a class="btn btn-sm btn-danger"th:href="@{/deluser/}+${user.StudentNumber}">删除</a>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td th:text="${user.skey}"></td>-->
<!-- </tr>-->

@ -0,0 +1,211 @@
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang=xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/dashboard.css" rel="stylesheet">
<style type="text/css">
/* Chart.js */
@-webkit-keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
@keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
.chartjs-render-monitor {
-webkit-animation: chartjs-render-animation 0.001s;
animation: chartjs-render-animation 0.001s;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<table class="table table-striped table-sm">
<tbody>
<tr th:each="item : ${tasks}" >
<form th:action="@{/taskupdate}" method="get">
<div class="form-group">
<label th:text="@{/ID:/}+${item.id}"></label>
<div></div>
<!-- <div th:text="${item.id}"></div>-->
<input type="hidden" name="id" th:value="${item.id}">
<label>任务名称</label>
<input type="text" name="name" class="form-control" th:placeholder="${item.name}">
</div>
<div class="form-group">
<label>内容</label>
<input type="text" name="property" class="form-control" th:placeholder="${item.property}">
</div>
<div class="form-group">
<label>截止时间</label>
<input type="text" name="deadtime" class="form-control" th:placeholder="${item.deadtime}">
</div>
<div class="form-group">
<label>完成状态</label><br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="status" value="1">
<label class="form-check-label">已完成</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="status" value="0">
<label class="form-check-label">未完成</label>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label>管理员</label>-->
<!-- <select class="form-control">-->
<!-- <option>是</option>-->
<!-- <option>否</option>-->
<!-- &lt;!&ndash; <option>3</option>&ndash;&gt;-->
<!-- &lt;!&ndash; <option>4</option>&ndash;&gt;-->
<!-- &lt;!&ndash; <option>5</option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>Birth</label>-->
<!-- <input type="text" class="form-control" placeholder="嘤嘤嘤">-->
<!-- </div>-->
<button type="submit" class="btn btn-primary">添加</button>
</form>
</tr>
<!-- <tr>-->
<!-- <td th:text="${user.skey}"></td>-->
<!-- </tr>-->
<!-- <tr th:each="user:${users}">-->
<!-- <td th:text="@{}"></td>-->
<!-- </tr>-->
</tbody>
</table>
<!-- <form th:action="@{/user}">-->
<!-- <div class="form-group">-->
<!-- <label>学号</label>-->
<!-- <input th:text="${user.name}" type="text" class="form-control" placeholder="海绵宝宝">-->
<!-- <div th:text="${users}"></div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>姓名</label>-->
<!-- <input type="email" class="form-control" placeholder="">-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Gender</label><br>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="1">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">男</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="0">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">女</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <div class="form-group">-->
<!-- <label>管理员</label>-->
<!-- <select class="form-control">-->
<!-- <option>是</option>-->
<!-- <option>否</option>-->
<!--&lt;!&ndash; <option>3</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>4</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>5</option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Birth</label>&ndash;&gt;-->
<!--&lt;!&ndash; <input type="text" class="form-control" placeholder="嘤嘤嘤">&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <button type="submit" class="btn btn-primary">添加</button>-->
<!-- </form>-->
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>
feather.replace()
</script>
<!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
datasets: [{
data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
lineTension: 0,
backgroundColor: 'transparent',
borderColor: '#007bff',
borderWidth: 4,
pointBackgroundColor: '#007bff'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
},
legend: {
display: false,
}
}
});
</script>
</body>
</html>

@ -0,0 +1,203 @@
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang=xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/dashboard.css" rel="stylesheet">
<style type="text/css">
/* Chart.js */
@-webkit-keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
@keyframes chartjs-render-animation {
from {
opacity: 0.99
}
to {
opacity: 1
}
}
.chartjs-render-monitor {
-webkit-animation: chartjs-render-animation 0.001s;
animation: chartjs-render-animation 0.001s;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Company name</a>
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div th:insert="~{dashboard::sidebar}"></div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<table class="table table-striped table-sm">
<tbody>
<tr th:each="user : ${users}" >
<form th:action="@{/update}" method="get">
<input type="hidden" name="stuid" th:value="${user.StudentNumber}">
<input type="hidden" name="stuname" th:value="${user.name}">
<div class="form-group">
<label>学号</label>
<input type="text" name="Studentnumber" class="form-control" th:placeholder="${user.StudentNumber}">
</div>
<div class="form-group">
<label>姓名</label>
<input type="text" name="name" class="form-control" th:placeholder="${user.name}">
</div>
<div class="form-group">
<label>权限</label><br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="power" value="1">
<label class="form-check-label">管理员</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="power" value="0">
<label class="form-check-label">用户</label>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label>管理员</label>-->
<!-- <select class="form-control">-->
<!-- <option>是</option>-->
<!-- <option>否</option>-->
<!-- &lt;!&ndash; <option>3</option>&ndash;&gt;-->
<!-- &lt;!&ndash; <option>4</option>&ndash;&gt;-->
<!-- &lt;!&ndash; <option>5</option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>Birth</label>-->
<!-- <input type="text" class="form-control" placeholder="嘤嘤嘤">-->
<!-- </div>-->
<button type="submit" class="btn btn-primary">添加</button>
</form>
</tr>
<!-- <tr>-->
<!-- <td th:text="${user.skey}"></td>-->
<!-- </tr>-->
<!-- <tr th:each="user:${users}">-->
<!-- <td th:text="@{}"></td>-->
<!-- </tr>-->
</tbody>
</table>
<!-- <form th:action="@{/user}">-->
<!-- <div class="form-group">-->
<!-- <label>学号</label>-->
<!-- <input th:text="${user.name}" type="text" class="form-control" placeholder="海绵宝宝">-->
<!-- <div th:text="${users}"></div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>姓名</label>-->
<!-- <input type="email" class="form-control" placeholder="">-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Gender</label><br>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="1">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">男</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; <div class="form-check form-check-inline">&ndash;&gt;-->
<!--&lt;!&ndash; <input class="form-check-input" type="radio" name="gender" value="0">&ndash;&gt;-->
<!--&lt;!&ndash; <label class="form-check-label">女</label>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <div class="form-group">-->
<!-- <label>管理员</label>-->
<!-- <select class="form-control">-->
<!-- <option>是</option>-->
<!-- <option>否</option>-->
<!--&lt;!&ndash; <option>3</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>4</option>&ndash;&gt;-->
<!--&lt;!&ndash; <option>5</option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="form-group">&ndash;&gt;-->
<!--&lt;!&ndash; <label>Birth</label>&ndash;&gt;-->
<!--&lt;!&ndash; <input type="text" class="form-control" placeholder="嘤嘤嘤">&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <button type="submit" class="btn btn-primary">添加</button>-->
<!-- </form>-->
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>
feather.replace()
</script>
<!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
datasets: [{
data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
lineTension: 0,
backgroundColor: 'transparent',
borderColor: '#007bff',
borderWidth: 4,
pointBackgroundColor: '#007bff'
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: false
}
}]
},
legend: {
display: false,
}
}
});
</script>
</body>
</html>
Loading…
Cancel
Save