package cn.gatherlife.wms.business.service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.xson.common.object.XCO;
import org.xson.tangyuan.executor.SqlServiceActuator;
import cn.gatherlife.wms.business.util.Constant;
import cn.gatherlife.wms.business.util.TimeUtil;
import cn.gatherlife.wms.business.util.XCOUtil;
@Service
public class TaskService {
@Autowired
ExperimentService experimentService;
@Autowired
ExampleService exampleService;
@Autowired
ClassService classService;
@Autowired
RoomService roomService;
@Autowired
UserService userService;
/**
* 插入班级
* @param xco
* @return
*/
public long insertTask(XCO xco){
long now_time = new Date().getTime()+Constant.TIME_提前几天绑定课程*24*60*60*1000;
XCO experiment = experimentService.selectExpById(xco);//实验
XCO example = exampleService.selectExaById(xco);//习题
XCO dxco = new XCO();
dxco.setLongValue("order_id", xco.getLongValue("order_id"));
XCO orderRoom = roomService.selectOrderRoomTimeById(xco);
XCO dxco2 = new XCO();
dxco2.setLongValue("room_id", orderRoom.getLongValue("room_id"));
XCO room = roomService.selectRoomById(dxco2);
int place_count = 0;
if(null!=room){
place_count = room.getIntegerValue("place_count");
}
orderRoom.setIntegerValue("place_count", place_count);
orderRoom.setIntegerValue("place_ok_count", 0);
long sys_time = 0l;
try {
sys_time = Long.valueOf(TimeUtil.dateToStamp(orderRoom.getStringValue("begin_time")));
} catch (ParseException e) {
e.printStackTrace();
}
//预约时间已失效
if(now_time > sys_time){
return 5;
}
if(null!=experiment){
orderRoom.setStringValue("experiment_name", experiment.getStringValue("experiment_name"));
orderRoom.setLongValue("experiment_id", experiment.getLongValue("experiment_id"));
}
if(null!=example){
orderRoom.setLongValue("example_id", example.getLongValue("example_id"));
orderRoom.setStringValue("example_name", example.getStringValue("example_name"));
orderRoom.setStringValue("example_content", example.getStringValue("example_content"));
}
orderRoom.setStringValue("class_name", "班级1");
orderRoom.setIntegerValue("class_id", 0);
orderRoom.setStringValue("course_name", xco.getStringValue("course_name"));
long row = SqlServiceActuator.execute("wms-courseservices.insertCourse", orderRoom);
return row;
}
/**
* 任务课程列表
* @param xco
* @return
*/
public XCO tasklist(XCO xco){
XCO rep = SqlServiceActuator.execute("wms-courseservices.courselist", xco);
long now_time = new Date().getTime()+Constant.TIME_提前几天绑定课程*24*60*60*1000;
long now_time2 = new Date().getTime();
if(rep.getLongValue("total") > 0){
List<XCO> list = rep.getXCOListValue("data");
if(null!=list && list.size() > 0){
for(int i=0,j=list.size();i<j;i++){
long sys_time = 0l;
try {
sys_time = Long.valueOf(TimeUtil.dateToStamp(list.get(i).getStringValue("begin_time")));
} catch (ParseException e) {
e.printStackTrace();
}
long sys_time2 = 0l;
try {
sys_time2 = Long.valueOf(TimeUtil.dateToStamp(list.get(i).getStringValue("end_time")));
} catch (ParseException e) {
e.printStackTrace();
}
//判断当前时间是否可以绑课
if(now_time > sys_time){
list.get(i).setIntegerValue("flag", 0);
}else{
list.get(i).setIntegerValue("flag", 1);
}
//判断当前课程是否已上课过
if(now_time2 > sys_time2){
list.get(i).setIntegerValue("flag2", 0);
}else{
list.get(i).setIntegerValue("flag2", 1);
}
}
}
}
return rep;
}
/**
* 学生任务课程列表
* @param xco
* @return
*/
public XCO studenttasklist(XCO xco){
return SqlServiceActuator.execute("wms-courseservices.studenttasklist", xco);
}
/**
*学生预约后,看到到课程 进行上课列表
* * @param xco
* @return
*/
public XCO studentyuyuelist(XCO xco){
long now_time = new Date().getTime();//+Constant.TIME_提前几天学生选课*24*60*60*1000;
xco.setStringValue("endd_time", TimeUtil.stampToDate(now_time+""));
return SqlServiceActuator.execute("wms-courseservices.studentyuyuelist", xco);
}
/**
* 教师批改列表
* @param xco
* @return
*/
public XCO studentCourselist(XCO xco){
return SqlServiceActuator.execute("wms-courseservices.studentCourselist", xco);
}
/**
* 教师批改作业
* @param xco
* @return
*/
public int updateTeacherCourse(XCO xco){
return SqlServiceActuator.execute("wms-courseservices.updateTeacherCourse", xco);
}
/**
* 教师批改报告
* @param xco
* @return
*/
public int updateTeacherReport(XCO xco){
return SqlServiceActuator.execute("wms-courseservices.updateTeacherReport", xco);
}
/**
* 学生开始答题
* @param xco
* @return
*/
public int updateBeginTime(XCO xco){
//更新课程为开始
SqlServiceActuator.execute("wms-courseservices.updateCourseStart", xco);
return SqlServiceActuator.execute("wms-courseservices.updateBeginTime", xco);
}
/**
* 学生提交作业
* @param xco
* @return
*/
public int updateStudentCourse(XCO xco){
XCO req = SqlServiceActuator.execute("wms-courseservices.studentTaskById", xco);
if(req.getIntegerValue("example_score") != 0){
return 5;
}else{
String example_content = XCOUtil.encodeTextForXML(xco.getStringValue("example_content"));
xco.setStringValue("example_content", example_content);
return SqlServiceActuator.execute("wms-courseservices.updateStudentCourse", xco);
}
//SqlServiceActuator.execute("wms-courseservices.updateStudentCourse30", xco);
}
/**
* 学生提交报告
* @param xco
* @return
*/
public int updateStudentReport(XCO xco){
XCO req = SqlServiceActuator.execute("wms-courseservices.studentTaskById", xco);
if(req.getIntegerValue("experiment_checked") != 0){
return 5;
}else{
return SqlServiceActuator.execute("wms-courseservices.updateStudentReport", xco);
}
}
/**
* 修改作业未完成
* @param xco
* @return
*/
public int updateStudentCourse30(XCO xco){
XCO exp = SqlServiceActuator.execute("wms-courseservices.exampleById", xco);
XCO rep = SqlServiceActuator.execute("wms-courseservices.reportById", xco);
if(exp.getIntegerValue("state") == 30 && !"".equals(rep.getStringValue("experiment_report"))){
return SqlServiceActuator.execute("wms-courseservices.updateStudentCourse30", xco);
}
return 0;
}
/**
* 判断学生作业是否全部完成
* @param xco
* @return
*/
public void updateComplateCourse(XCO xco){
SqlServiceActuator.execute("wms-courseservices.updateComplateCourse", xco);
}
/**
* 查找某个课程下面学生已做题的数目
* @param xco
* @return
*/
public long askCourseNum(XCO xco){
long count = SqlServiceActuator.execute("wms-courseservices.askCourseNum", xco);
return count;
}
/**
* 查找单个对象
* @param xco
* @return
*/
public XCO selectTaskById(XCO xco){
XCO req = SqlServiceActuator.execute("wms-courseservices.selectCourseById", xco);
long room_id = req.getLongValue("room_id");
long time_id = req.getLongValue("time_id");
XCO data = new XCO();
data.setLongValue("room_id", room_id);
data.setLongValue("time_id", time_id);
List<XCO> roomlist = SqlServiceActuator.execute("wms-roomservices.kwTimeIdRoomId", data);
req.setXCOListValue("roomlist", roomlist);
XCO room = SqlServiceActuator.execute("wms-roomservices.s
没有合适的资源?快使用搜索试试~ 我知道了~
Java开发的实验教学平台.rar
共971个文件
gif:191个
png:178个
js:145个
需积分: 5 0 下载量 156 浏览量
2024-05-16
08:59:49
上传
评论
收藏 31.43MB RAR 举报
温馨提示
实验教学平台通过校方教务处制定每个学期的教学目标,老师根据教学目标来安排教学计划和实验课程,学生根据实验课的安排进行实验课的预约,按照老师的实验安排对实验课和作业进行在线提交;老师可以在线管理学生的实验报告和实验作业并进行批改;学生可以实时查看到实验结果;教务处根据实验室及设备的占用情况和利用率进行对外开发,极大的提高是实验课的效率和利用率,同时提高了学生的动手能力。本平台适用于各类大专院校,对实验教学的管理。
资源推荐
资源详情
资源评论
收起资源包目录
Java开发的实验教学平台.rar (971个子文件)
main.asp 4KB
cloud-admin_bak.css 205KB
cloud-admin.css 205KB
cloud-admin.min.css 146KB
fuelux.min.css 128KB
bootstrap.css 120KB
bootstrap.min.css 97KB
animate.min.css 50KB
style.css 40KB
font-awesome.min.css 30KB
jquery-ui-1.10.3.custom.min.css 26KB
default.css 21KB
font-awesome.css 21KB
fuelux-responsive.min.css 19KB
font-awesome.min.css 17KB
utopia.css 16KB
night.css 16KB
nature.css 16KB
earth.css 16KB
graphite.css 16KB
default.css 16KB
style.css 16KB
bootstrap-theme.css 14KB
night.min.css 14KB
document.css 14KB
night.min1.css 13KB
night.min-2016-10-14.css 13KB
bootstrap-theme.min.css 13KB
nature.min.css 13KB
earth.min.css 13KB
default.min.css 13KB
utopia.min.css 13KB
graphite.min.css 13KB
flags.min.css 12KB
layer.css 11KB
style18.css 9KB
glDatePicker.darkneon.css 8KB
glDatePicker.default.css 8KB
responsive.css 6KB
common.css 5KB
datepicker.css 5KB
datepicker.css 5KB
responsive.min.css 5KB
inbox.css 5KB
datepicker.css 5KB
lhgcalendar.css 4KB
datepicker.css 4KB
photoswipe.css 4KB
datepicker.css 4KB
datepicker.css 3KB
docco.css 3KB
qq.css 3KB
layer.ext.css 3KB
glDatePicker.flatwhite.css 2KB
simple.css 2KB
base.css 2KB
format2.css 2KB
module.css 2KB
index.vsb.css 1KB
prettify.css 973B
demo.css 959B
login.css 683B
pagination.css 631B
print.css 307B
WdatePicker.css 137B
_sitegray_d.css 22B
fontawesome-webfont.eot 37KB
glyphicons-halflings-regular.eot 20KB
bodybg.gif 37KB
bodybg.gif 37KB
static.gif 35KB
35.gif 13KB
42.gif 13KB
40.gif 10KB
12.gif 9KB
18.gif 8KB
19.gif 8KB
11.gif 8KB
32.gif 7KB
49.gif 6KB
bg_msgbox.gif 6KB
29.gif 6KB
loading-0.gif 6KB
lefttop_bj.gif 5KB
97.gif 5KB
65.gif 5KB
31.gif 5KB
46.gif 5KB
57.gif 5KB
45.gif 5KB
8.gif 5KB
43.gif 4KB
33.gif 4KB
loading.gif 4KB
11.gif 4KB
68.gif 4KB
26.gif 4KB
14.gif 4KB
7.gif 4KB
51.gif 4KB
共 971 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
小王毕业啦
- 粉丝: 1542
- 资源: 210
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功