|
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.mooctest.data.ResponseDTO;
|
|
import com.mooctest.data.ResponseDTO;
|
|
import com.mooctest.service.JobService;
|
|
import com.mooctest.service.JobService;
|
|
import com.mooctest.service.PaperService;
|
|
import com.mooctest.service.PaperService;
|
|
|
|
+import com.mooctest.util.TimeUtil;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -68,6 +69,7 @@ public class JobController {
|
|
@RequestParam("itemGroupList") String itemGroupList, @RequestParam("crossCertify") String crossCertify,
|
|
@RequestParam("itemGroupList") String itemGroupList, @RequestParam("crossCertify") String crossCertify,
|
|
@RequestParam("crossCertifyNum") int crossCertifyNum){
|
|
@RequestParam("crossCertifyNum") int crossCertifyNum){
|
|
JSONObject data = jobService.changeJob(jobId,name,descriptioin,time,paperId,workers,itemGroupList,workNum,crossCertify,crossCertifyNum);
|
|
JSONObject data = jobService.changeJob(jobId,name,descriptioin,time,paperId,workers,itemGroupList,workNum,crossCertify,crossCertifyNum);
|
|
|
|
+
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -95,11 +97,13 @@ public class JobController {
|
|
return "jobDetail";
|
|
return "jobDetail";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //visit website
|
|
@GetMapping(value = "/changeJob")
|
|
@GetMapping(value = "/changeJob")
|
|
public String change ( Model model , @RequestParam("id") String id){
|
|
public String change ( Model model , @RequestParam("id") String id){
|
|
//参数为对应JOB的id
|
|
//参数为对应JOB的id
|
|
try {
|
|
try {
|
|
JSONObject detail = jobService.getSinglePaper(id);
|
|
JSONObject detail = jobService.getSinglePaper(id);
|
|
|
|
+ changeJobTime(detail);
|
|
model.addAttribute("job",detail);
|
|
model.addAttribute("job",detail);
|
|
JSONObject paper = paperService.getSinglePaper((String)detail.get("paper_id"));
|
|
JSONObject paper = paperService.getSinglePaper((String)detail.get("paper_id"));
|
|
model.addAttribute("paper",paper);
|
|
model.addAttribute("paper",paper);
|
|
@@ -152,4 +156,18 @@ public class JobController {
|
|
temp.put("create_time",new Timestamp(Long.parseLong(temp.get("create_time").toString()))); // 修改创建时间的格式 以便前段展示
|
|
temp.put("create_time",new Timestamp(Long.parseLong(temp.get("create_time").toString()))); // 修改创建时间的格式 以便前段展示
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void changeJobTime ( Object input){
|
|
|
|
+ JSONObject temp = (JSONObject) input;
|
|
|
|
+ String startTime = temp.get("create_time").toString();
|
|
|
|
+ String endTime = temp.get("end_time").toString();
|
|
|
|
+ if(!startTime.contains("AM")&&!startTime.contains("PM")){
|
|
|
|
+ //should transfer
|
|
|
|
+ temp.put("start_time", TimeUtil.timestamp2str(startTime));
|
|
|
|
+ }
|
|
|
|
+ if(!endTime.contains("AM")&&!endTime.contains("PM")){
|
|
|
|
+ //should transfer
|
|
|
|
+ temp.put("end_time", TimeUtil.timestamp2str(endTime));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|