Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
823b1298ef
6
pom.xml
6
pom.xml
@ -102,6 +102,12 @@
|
||||
<version>1.18.16</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--<dependency>
|
||||
<artifactId>module-building-pictures</artifactId>
|
||||
<groupId>cn.com.tenlion</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -0,0 +1,127 @@
|
||||
package cn.com.tenlion.controller.api.examination;
|
||||
|
||||
import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
|
||||
import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
|
||||
import cn.com.tenlion.service.examination.IExaminationService;
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: ExaminationController
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/examination")
|
||||
public class ExaminationController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IExaminationService examinationService;
|
||||
|
||||
@ApiOperation(value = "新增", notes = "新增接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("save")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult save(@RequestBody ExaminationVO examinationVO) {
|
||||
examinationService.save(examinationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除", notes = "删除接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public SuccessResult remove(@PathVariable("ids") String ids) {
|
||||
examinationService.remove(Arrays.asList(ids.split("\\_")));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改", notes = "修改接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update/{examinationId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult update(@PathVariable("examinationId") String examinationId, @RequestBody ExaminationVO examinationVO) {
|
||||
examinationService.update(examinationId, examinationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "详情", notes = "详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{examinationId}")
|
||||
public ExaminationDTO get(@PathVariable("examinationId") String examinationId) {
|
||||
return examinationService.get(examinationId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "列表", notes = "列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<ExaminationDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return examinationService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页列表", notes = "分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-page")
|
||||
public SuccessResultList<List<ExaminationDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return examinationService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计", notes = "统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return new SuccessResultData<>(examinationService.count(params));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取随机监考老师", notes = "获取随机监考老师接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("sel-exam-user")
|
||||
public ExaminationDTO selExamUser() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return examinationService.selExamUser(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取剩余监考老师", notes = "获取剩余监考老师接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("result-exam-user")
|
||||
public List<ExaminationDTO> resultExamUser() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return examinationService.resultExamUser(params);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package cn.com.tenlion.controller.app.api.examination;
|
||||
|
||||
import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
|
||||
import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
|
||||
import cn.com.tenlion.service.examination.IExaminationService;
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: ExaminationAppController
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.APP_PREFIX + "/examination")
|
||||
public class ExaminationAppController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IExaminationService examinationService;
|
||||
|
||||
@ApiOperation(value = "新增", notes = "新增接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("save")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult save(@RequestHeader("token") String token, @RequestBody ExaminationVO examinationVO) {
|
||||
examinationService.save(token, examinationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除(id列表)", notes = "删除(id列表)接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) {
|
||||
examinationService.remove(token, Arrays.asList(ids.split("\\_")));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改", notes = "修改接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("updateexamination/{examinationId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult updateExamination(@RequestHeader("token") String token, @PathVariable("examinationId") String examinationId, @RequestBody ExaminationVO examinationVO) {
|
||||
examinationService.update(token, examinationId, examinationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "详情(通过ID)", notes = "详情(通过ID)接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{examinationId}")
|
||||
public ExaminationDTO get(@RequestHeader("token") String token, @PathVariable("examinationId") String examinationId) {
|
||||
return examinationService.get(examinationId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "列表", notes = "列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<ExaminationDTO> list(@RequestHeader("token") String token) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return examinationService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页列表", notes = "分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpageexamination")
|
||||
public SuccessResultList<List<ExaminationDTO>> listPage(@RequestHeader("token") String token, ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return examinationService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计", notes = "统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return new SuccessResultData<>(examinationService.count(params));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package cn.com.tenlion.controller.resource.examination;
|
||||
|
||||
import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
|
||||
import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
|
||||
import cn.com.tenlion.service.examination.IExaminationService;
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: ExaminationResourceController
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/examination")
|
||||
public class ExaminationResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IExaminationService examinationService;
|
||||
|
||||
@ApiOperation(value = "新增", notes = "新增接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("save")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult save(@RequestBody ExaminationVO examinationVO) {
|
||||
examinationService.save(examinationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除(id列表)", notes = "删除(id列表)接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public SuccessResult remove(@PathVariable("ids") String ids) {
|
||||
examinationService.remove(Arrays.asList(ids.split("\\_")));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改", notes = "修改接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update/{examinationId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult update(@PathVariable("examinationId") String examinationId, @RequestBody ExaminationVO examinationVO) {
|
||||
examinationService.update(examinationId, examinationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "详情", notes = "详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "examinationId", value = "ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{examinationId}")
|
||||
public ExaminationDTO get(@PathVariable("examinationId") String examinationId) {
|
||||
return examinationService.get(examinationId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "列表", notes = "列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<ExaminationDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return examinationService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页列表", notes = "分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<ExaminationDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return examinationService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计", notes = "统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return new SuccessResultData<>(examinationService.count(params));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.com.tenlion.controller.route.examination;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* @ClassName: ExaminationController
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "路由")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/examination")
|
||||
public class ExaminationRouteController extends DefaultBaseController {
|
||||
|
||||
@GetMapping("save")
|
||||
public ModelAndView save() {
|
||||
return new ModelAndView("examination/save");
|
||||
}
|
||||
|
||||
@GetMapping("update")
|
||||
public ModelAndView update() {
|
||||
return new ModelAndView("examination/update");
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
public ModelAndView list() {
|
||||
return new ModelAndView("examination/list");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
package cn.com.tenlion.dao.examination;
|
||||
|
||||
import cn.com.tenlion.pojo.bos.examination.ExaminationBO;
|
||||
import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
|
||||
import cn.com.tenlion.pojo.dtos.examinationhis.ExaminationHisDTO;
|
||||
import cn.com.tenlion.pojo.pos.examination.ExaminationPO;
|
||||
import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IExaminationDao
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Repository
|
||||
public interface IExaminationDao {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param params
|
||||
* @throws SaveException
|
||||
*/
|
||||
void save(Map<String, Object> params) throws SaveException;
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param params
|
||||
* @throws RemoveException
|
||||
*/
|
||||
void remove(Map<String, Object> params) throws RemoveException;
|
||||
|
||||
/**
|
||||
* 删除(物理)
|
||||
*
|
||||
* @param params
|
||||
* @throws RemoveException
|
||||
*/
|
||||
void delete(Map<String, Object> params) throws RemoveException;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param params
|
||||
* @throws UpdateException
|
||||
*/
|
||||
void update(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
ExaminationDTO get(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
ExaminationBO getBO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
ExaminationPO getPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<ExaminationDTO> list(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<ExaminationBO> listBO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<ExaminationPO> listPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
Integer count(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 判断当天是否存在监考老师信息
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<ExaminationHisDTO> hasUser(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 保存监考信息
|
||||
* @param params
|
||||
* @throws SaveException
|
||||
*/
|
||||
void saveExamHis(Map<String, Object> params) throws SaveException;
|
||||
|
||||
/**
|
||||
* 当前考试是否存在在监考记录表
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
ExaminationHisDTO hasExam(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 修改监考信息
|
||||
* @param params
|
||||
* @throws SearchException
|
||||
*/
|
||||
void updateExamHis(Map<String, Object> params) throws SearchException;
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package cn.com.tenlion.pojo.bos.examination;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: ExaminationBO
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
public class ExaminationBO {
|
||||
|
||||
private String examinationId;
|
||||
private String name;
|
||||
private String phone;
|
||||
private Integer isCheck;
|
||||
private String gmtCreate;
|
||||
private String creator;
|
||||
private String gmtModified;
|
||||
private String modifier;
|
||||
private Integer isDelete;
|
||||
|
||||
public String getExaminationId() {
|
||||
return examinationId == null ? "" : examinationId.trim();
|
||||
}
|
||||
|
||||
public void setExaminationId(String examinationId) {
|
||||
this.examinationId = examinationId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name == null ? "" : name.trim();
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone == null ? "" : phone.trim();
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Integer getIsCheck() {
|
||||
return isCheck == null ? 0 : isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(Integer isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtModified() {
|
||||
return gmtModified == null ? "" : gmtModified.trim();
|
||||
}
|
||||
|
||||
public void setGmtModified(String gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
public String getModifier() {
|
||||
return modifier == null ? "" : modifier.trim();
|
||||
}
|
||||
|
||||
public void setModifier(String modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete == null ? 0 : isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package cn.com.tenlion.pojo.dtos.examination;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: ExaminationDTO
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class ExaminationDTO {
|
||||
|
||||
@ApiModelProperty(name = "examinationId", value = "主键UUID")
|
||||
private String examinationId;
|
||||
@ApiModelProperty(name = "name", value = "考务人员姓名")
|
||||
private String name;
|
||||
@ApiModelProperty(name = "phone", value = "考务人员联系方式")
|
||||
private String phone;
|
||||
@ApiModelProperty(name = "isCheck", value = "0:未参加监考,1:参加监考")
|
||||
private Integer isCheck;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "")
|
||||
private String gmtCreate;
|
||||
@ApiModelProperty(name = "creator", value = "")
|
||||
private String creator;
|
||||
@ApiModelProperty(name = "gmtModified", value = "")
|
||||
private String gmtModified;
|
||||
@ApiModelProperty(name = "modifier", value = "")
|
||||
private String modifier;
|
||||
@ApiModelProperty(name = "isDelete", value = "")
|
||||
private Integer isDelete;
|
||||
|
||||
public String getExaminationId() {
|
||||
return examinationId == null ? "" : examinationId.trim();
|
||||
}
|
||||
|
||||
public void setExaminationId(String examinationId) {
|
||||
this.examinationId = examinationId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name == null ? "" : name.trim();
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone == null ? "" : phone.trim();
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Integer getIsCheck() {
|
||||
return isCheck == null ? 0 : isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(Integer isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtModified() {
|
||||
return gmtModified == null ? "" : gmtModified.trim();
|
||||
}
|
||||
|
||||
public void setGmtModified(String gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
public String getModifier() {
|
||||
return modifier == null ? "" : modifier.trim();
|
||||
}
|
||||
|
||||
public void setModifier(String modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete == null ? 0 : isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package cn.com.tenlion.pojo.dtos.examinationhis;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: ExaminationHisDTO
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class ExaminationHisDTO {
|
||||
|
||||
@ApiModelProperty(name = "examinationHisId", value = "监考历史表主键ID")
|
||||
private String examinationHisId;
|
||||
@ApiModelProperty(name = "startTime", value = "考试开始时间")
|
||||
private String startTime;
|
||||
@ApiModelProperty(name = "endTime", value = "考试结束时间")
|
||||
private String endTime;
|
||||
@ApiModelProperty(name = "examinationId", value = "监考老师ID")
|
||||
private String examinationId;
|
||||
@ApiModelProperty(name = "examinationRoomId", value = "考场ID")
|
||||
private String examinationRoomId;
|
||||
@ApiModelProperty(name = "examId", value = "考试ID")
|
||||
private String examId;
|
||||
|
||||
public String getExaminationHisId() {
|
||||
return examinationHisId;
|
||||
}
|
||||
|
||||
public void setExaminationHisId(String examinationHisId) {
|
||||
this.examinationHisId = examinationHisId;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getExaminationId() {
|
||||
return examinationId;
|
||||
}
|
||||
|
||||
public void setExaminationId(String examinationId) {
|
||||
this.examinationId = examinationId;
|
||||
}
|
||||
|
||||
public String getExaminationRoomId() {
|
||||
return examinationRoomId;
|
||||
}
|
||||
|
||||
public void setExaminationRoomId(String examinationRoomId) {
|
||||
this.examinationRoomId = examinationRoomId;
|
||||
}
|
||||
|
||||
public String getExamId() {
|
||||
return examId;
|
||||
}
|
||||
|
||||
public void setExamId(String examId) {
|
||||
this.examId = examId;
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package cn.com.tenlion.pojo.pos.examination;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: ExaminationPO
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
public class ExaminationPO {
|
||||
|
||||
private String examinationId;
|
||||
private String name;
|
||||
private String phone;
|
||||
private Integer isCheck;
|
||||
private String gmtCreate;
|
||||
private String creator;
|
||||
private String gmtModified;
|
||||
private String modifier;
|
||||
private Integer isDelete;
|
||||
|
||||
public String getExaminationId() {
|
||||
return examinationId == null ? "" : examinationId.trim();
|
||||
}
|
||||
|
||||
public void setExaminationId(String examinationId) {
|
||||
this.examinationId = examinationId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name == null ? "" : name.trim();
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone == null ? "" : phone.trim();
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Integer getIsCheck() {
|
||||
return isCheck == null ? 0 : isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(Integer isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtModified() {
|
||||
return gmtModified == null ? "" : gmtModified.trim();
|
||||
}
|
||||
|
||||
public void setGmtModified(String gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
public String getModifier() {
|
||||
return modifier == null ? "" : modifier.trim();
|
||||
}
|
||||
|
||||
public void setModifier(String modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete == null ? 0 : isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package cn.com.tenlion.pojo.vos.examination;
|
||||
|
||||
import ink.wgink.annotation.CheckEmptyAnnotation;
|
||||
import ink.wgink.annotation.CheckNumberAnnotation;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: ExaminationVO
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class ExaminationVO {
|
||||
|
||||
@ApiModelProperty(name = "name", value = "考务人员姓名")
|
||||
private String name;
|
||||
@ApiModelProperty(name = "phone", value = "考务人员联系方式")
|
||||
private String phone;
|
||||
@ApiModelProperty(name = "isCheck", value = "0:未参加监考,1:参加监考")
|
||||
@CheckNumberAnnotation(name = "0:未参加监考,1:参加监考")
|
||||
private Integer isCheck;
|
||||
|
||||
public String getName() {
|
||||
return name == null ? "" : name.trim();
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone == null ? "" : phone.trim();
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Integer getIsCheck() {
|
||||
return isCheck == null ? 0 : isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(Integer isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,204 @@
|
||||
package cn.com.tenlion.service.examination;
|
||||
|
||||
import cn.com.tenlion.pojo.bos.examination.ExaminationBO;
|
||||
import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
|
||||
import cn.com.tenlion.pojo.pos.examination.ExaminationPO;
|
||||
import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IExaminationService
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
public interface IExaminationService {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param examinationVO
|
||||
* @return
|
||||
*/
|
||||
void save(ExaminationVO examinationVO);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param token
|
||||
* @param examinationVO
|
||||
* @return
|
||||
*/
|
||||
void save(String token, ExaminationVO examinationVO);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param examinationVO
|
||||
* @return examinationId
|
||||
*/
|
||||
String saveReturnId(ExaminationVO examinationVO);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param token
|
||||
* @param examinationVO
|
||||
* @return examinationId
|
||||
*/
|
||||
String saveReturnId(String token, ExaminationVO examinationVO);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param ids id列表
|
||||
* @return
|
||||
*/
|
||||
void remove(List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param token
|
||||
* @param ids id列表
|
||||
* @return
|
||||
*/
|
||||
void remove(String token, List<String> ids);
|
||||
|
||||
/**
|
||||
* 删除(物理删除)
|
||||
*
|
||||
* @param ids id列表
|
||||
*/
|
||||
void delete(List<String> ids);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param examinationId
|
||||
* @param examinationVO
|
||||
* @return
|
||||
*/
|
||||
void update(String examinationId, ExaminationVO examinationVO);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param token
|
||||
* @param examinationId
|
||||
* @param examinationVO
|
||||
* @return
|
||||
*/
|
||||
void update(String token, String examinationId, ExaminationVO examinationVO);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param params 参数Map
|
||||
* @return
|
||||
*/
|
||||
ExaminationDTO get(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param examinationId
|
||||
* @return
|
||||
*/
|
||||
ExaminationDTO get(String examinationId);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param params 参数Map
|
||||
* @return
|
||||
*/
|
||||
ExaminationBO getBO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param examinationId
|
||||
* @return
|
||||
*/
|
||||
ExaminationBO getBO(String examinationId);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param params 参数Map
|
||||
* @return
|
||||
*/
|
||||
ExaminationPO getPO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param examinationId
|
||||
* @return
|
||||
*/
|
||||
ExaminationPO getPO(String examinationId);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<ExaminationDTO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<ExaminationBO> listBO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<ExaminationPO> listPO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<ExaminationDTO>> listPage(ListPage page);
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Integer count(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取随机监考老师
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
ExaminationDTO selExamUser(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 获取剩余监考老师列表
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<ExaminationDTO> resultExamUser(Map<String, Object> params) throws SearchException;
|
||||
}
|
@ -0,0 +1,298 @@
|
||||
package cn.com.tenlion.service.examination.impl;
|
||||
|
||||
import cn.com.tenlion.dao.examination.IExaminationDao;
|
||||
import cn.com.tenlion.pojo.bos.examination.ExaminationBO;
|
||||
import cn.com.tenlion.pojo.dtos.examination.ExaminationDTO;
|
||||
import cn.com.tenlion.pojo.dtos.examinationhis.ExaminationHisDTO;
|
||||
import cn.com.tenlion.pojo.pos.examination.ExaminationPO;
|
||||
import cn.com.tenlion.pojo.vos.examination.ExaminationVO;
|
||||
import cn.com.tenlion.service.examination.IExaminationService;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @ClassName: ExaminationServiceImpl
|
||||
* @Description:
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-05-01 15:16:57
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Service
|
||||
public class ExaminationServiceImpl extends DefaultBaseService implements IExaminationService {
|
||||
|
||||
@Autowired
|
||||
private IExaminationDao examinationDao;
|
||||
|
||||
@Override
|
||||
public void save(ExaminationVO examinationVO) {
|
||||
saveReturnId(examinationVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(String token, ExaminationVO examinationVO) {
|
||||
saveReturnId(token, examinationVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveReturnId(ExaminationVO examinationVO) {
|
||||
return saveReturnId(null, examinationVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveReturnId(String token, ExaminationVO examinationVO) {
|
||||
String examinationId = UUIDUtil.getUUID();
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(examinationVO);
|
||||
params.put("examinationId", examinationId);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
setSaveInfo(params);
|
||||
} else {
|
||||
setAppSaveInfo(token, params);
|
||||
}
|
||||
examinationDao.save(params);
|
||||
return examinationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(List<String> ids) {
|
||||
remove(null, ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(String token, List<String> ids) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("examinationIds", ids);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
setUpdateInfo(params);
|
||||
} else {
|
||||
setAppUpdateInfo(token, params);
|
||||
}
|
||||
examinationDao.remove(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(List<String> ids) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("examinationIds", ids);
|
||||
examinationDao.delete(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String examinationId, ExaminationVO examinationVO) {
|
||||
update(null, examinationId, examinationVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String token, String examinationId, ExaminationVO examinationVO) {
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(examinationVO);
|
||||
params.put("examinationId", examinationId);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
setUpdateInfo(params);
|
||||
} else {
|
||||
setAppUpdateInfo(token, params);
|
||||
}
|
||||
examinationDao.update(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExaminationDTO get(Map<String, Object> params) {
|
||||
return examinationDao.get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExaminationDTO get(String examinationId) {
|
||||
Map<String, Object> params = super.getHashMap(2);
|
||||
params.put("examinationId", examinationId);
|
||||
return get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExaminationBO getBO(Map<String, Object> params) {
|
||||
return examinationDao.getBO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExaminationBO getBO(String examinationId) {
|
||||
Map<String, Object> params = super.getHashMap(2);
|
||||
params.put("examinationId", examinationId);
|
||||
return getBO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExaminationPO getPO(Map<String, Object> params) {
|
||||
return examinationDao.getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExaminationPO getPO(String examinationId) {
|
||||
Map<String, Object> params = super.getHashMap(2);
|
||||
params.put("examinationId", examinationId);
|
||||
return getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExaminationDTO> list(Map<String, Object> params) {
|
||||
return examinationDao.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExaminationBO> listBO(Map<String, Object> params) {
|
||||
return examinationDao.listBO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExaminationPO> listPO(Map<String, Object> params) {
|
||||
return examinationDao.listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<ExaminationDTO>> listPage(ListPage page) {
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<ExaminationDTO> examinationDTOs = list(page.getParams());
|
||||
PageInfo<ExaminationDTO> pageInfo = new PageInfo<>(examinationDTOs);
|
||||
return new SuccessResultList<>(examinationDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer count(Map<String, Object> params) {
|
||||
Integer count = examinationDao.count(params);
|
||||
return count == null ? 0 : count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExaminationDTO selExamUser(Map<String, Object> params) throws SearchException {
|
||||
if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("startTime"))) {
|
||||
throw new SearchException("请传入考试开始时间");
|
||||
}
|
||||
if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("endTime"))) {
|
||||
throw new SearchException("请传入考试结束时间");
|
||||
}
|
||||
if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("examinationRoomId"))) {
|
||||
throw new SearchException("请传入考场ID");
|
||||
}
|
||||
if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("examId"))) {
|
||||
throw new SearchException("请传入考试ID");
|
||||
}
|
||||
// 判断当前考试是否存在在监考记录表中,存在,获取监考老师信息,后续做修改操作,否则,做新增操作
|
||||
ExaminationHisDTO examinationHisDTO = examinationDao.hasExam(params);
|
||||
// 先获取所有考务人员
|
||||
List<ExaminationDTO> examinationDTOList = list(params);
|
||||
if(null != examinationDTOList && examinationDTOList.size() > 0) {
|
||||
// 获取考试日期(精确到天)
|
||||
String startDay = params.get("startTime").toString();
|
||||
startDay = startDay.substring(0, 10);
|
||||
params.put("startDay", startDay);
|
||||
int randomNum = (int)(Math.random() * examinationDTOList.size());
|
||||
ExaminationDTO examinationDTO = examinationDTOList.get(randomNum);
|
||||
params.put("startDay", startDay);
|
||||
params.put("examinationId", examinationDTO.getExaminationId());
|
||||
if(null != examinationHisDTO) {
|
||||
if(examinationHisDTO.getExaminationId().equals(examinationDTO.getExaminationId())) {
|
||||
examinationDTO = removeAndReturnUser(randomNum, examinationDTO, examinationDTOList);
|
||||
params.put("examinationId", examinationDTO.getExaminationId());
|
||||
return updateLogic(randomNum, examinationDTO, examinationDTOList, params);
|
||||
}
|
||||
return updateLogic(randomNum, examinationDTO, examinationDTOList, params);
|
||||
}
|
||||
return insertLogic(randomNum, examinationDTO, examinationDTOList, params);
|
||||
}
|
||||
throw new SearchException("暂无考务人员数据");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExaminationDTO> resultExamUser(Map<String, Object> params) throws SearchException {
|
||||
if(com.alibaba.excel.util.StringUtils.isEmpty(params.get("startTime"))) {
|
||||
throw new SearchException("请传入考试开始时间");
|
||||
}
|
||||
// 先获取所有考务人员
|
||||
List<ExaminationDTO> examinationDTOList = list(params);
|
||||
if(null == examinationDTOList) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 获取考试日期(精确到天)
|
||||
String startDay = params.get("startTime").toString();
|
||||
startDay = startDay.substring(0, 10);
|
||||
params.put("startDay", startDay);
|
||||
List<ExaminationHisDTO> examinationHisDTOList = examinationDao.hasUser(params);
|
||||
if(null == examinationHisDTOList) {
|
||||
return examinationDTOList;
|
||||
}
|
||||
Iterator<ExaminationDTO> iterator = examinationDTOList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ExaminationDTO examinationDTO = iterator.next();
|
||||
for(ExaminationHisDTO examinationHisDTO: examinationHisDTOList) {
|
||||
if(examinationDTO.getExaminationId().equals(examinationHisDTO.getExaminationId())) {
|
||||
iterator.remove();
|
||||
System.out.println(44);
|
||||
}
|
||||
}
|
||||
}
|
||||
return examinationDTOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当天是否存在该考务人员的监考记录
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
private Integer hasUser(Map<String, Object> params) {
|
||||
List<ExaminationHisDTO> examinationHisDTOList = examinationDao.hasUser(params);
|
||||
Integer count = 0;
|
||||
if(null != examinationHisDTOList && examinationHisDTOList.size() > 0) {
|
||||
count = examinationHisDTOList.size();
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除不满足条件人员并重新选择
|
||||
* @return
|
||||
*/
|
||||
private ExaminationDTO removeAndReturnUser(Integer randomNum, ExaminationDTO examinationDTO, List<ExaminationDTO> examinationDTOList) {
|
||||
examinationDTOList.remove(randomNum);
|
||||
randomNum = (int)(Math.random() * examinationDTOList.size());
|
||||
examinationDTO = examinationDTOList.get(randomNum);
|
||||
return examinationDTO;
|
||||
}
|
||||
|
||||
private ExaminationDTO updateLogic(Integer randomNum, ExaminationDTO examinationDTO, List<ExaminationDTO> examinationDTOList, Map<String, Object> params) {
|
||||
Integer count = hasUser(params);
|
||||
if(count > 0) {
|
||||
examinationDTO = removeAndReturnUser(randomNum, examinationDTO, examinationDTOList);
|
||||
params.put("examinationId", examinationDTO.getExaminationId());
|
||||
return updateLogic(randomNum, examinationDTO, examinationDTOList, params);
|
||||
}else {
|
||||
params.put("examinationId", examinationDTO.getExaminationId());
|
||||
setUpdateInfo(params);
|
||||
examinationDao.updateExamHis(params);
|
||||
return examinationDTO;
|
||||
}
|
||||
}
|
||||
|
||||
private ExaminationDTO insertLogic(Integer randomNum, ExaminationDTO examinationDTO, List<ExaminationDTO> examinationDTOList, Map<String, Object> params) {
|
||||
Integer count = hasUser(params);
|
||||
if(count > 0) {
|
||||
examinationDTO = removeAndReturnUser(randomNum, examinationDTO, examinationDTOList);
|
||||
params.put("examinationId", examinationDTO.getExaminationId());
|
||||
return insertLogic(randomNum, examinationDTO, examinationDTOList, params);
|
||||
}else {
|
||||
String examinationHisId = UUIDUtil.getUUID();
|
||||
params.put("examinationHisId", examinationHisId);
|
||||
params.put("examinationId", examinationDTO.getExaminationId());
|
||||
setSaveInfo(params);
|
||||
examinationDao.saveExamHis(params);
|
||||
return examinationDTO;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
server:
|
||||
port: 7009
|
||||
url: http://127.0.0.1:7009/signup
|
||||
port: 8089
|
||||
url: http://192.168.0.111:8089/signup
|
||||
system-title: 考试报名系统
|
||||
system-sub-title: 考试报名系统
|
||||
servlet:
|
||||
@ -25,11 +25,11 @@ spring:
|
||||
max-request-size: 1GB
|
||||
datasource:
|
||||
druid:
|
||||
url: jdbc:mysql://127.0.0.1:3306/db_examination_signup?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC
|
||||
url: jdbc:mysql://49.232.216.45:3306/db_module_building_pictures?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC
|
||||
db-type: mysql
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
username: renpengcheng
|
||||
password: tsrenpengcheng
|
||||
initial-size: 2
|
||||
min-idle: 2
|
||||
max-active: 5
|
||||
|
@ -0,0 +1,383 @@
|
||||
<?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="cn.com.tenlion.dao.examination.IExaminationDao">
|
||||
|
||||
<resultMap id="examinationDTO" type="cn.com.tenlion.pojo.dtos.examination.ExaminationDTO">
|
||||
<result column="examination_id" property="examinationId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="is_check" property="isCheck"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="modifier" property="modifier"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="examinationHisDTO" type="cn.com.tenlion.pojo.dtos.examinationhis.ExaminationHisDTO">
|
||||
<result column="examination_his_id" property="examinationHisId"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="examination_id" property="examinationId"/>
|
||||
<result column="examination_room_id" property="examinationRoomId"/>
|
||||
<result column="exam_id" property="examId"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="examinationBO" type="cn.com.tenlion.pojo.bos.examination.ExaminationBO">
|
||||
<result column="examination_id" property="examinationId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="is_check" property="isCheck"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="modifier" property="modifier"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="examinationPO" type="cn.com.tenlion.pojo.pos.examination.ExaminationPO">
|
||||
<result column="examination_id" property="examinationId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="is_check" property="isCheck"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="modifier" property="modifier"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 新增 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO emergency_examination(
|
||||
examination_id,
|
||||
name,
|
||||
phone,
|
||||
is_check,
|
||||
gmt_create,
|
||||
creator,
|
||||
gmt_modified,
|
||||
modifier,
|
||||
is_delete
|
||||
) VALUES(
|
||||
#{examinationId},
|
||||
#{name},
|
||||
#{phone},
|
||||
#{isCheck},
|
||||
#{gmtCreate},
|
||||
#{creator},
|
||||
#{gmtModified},
|
||||
#{modifier},
|
||||
#{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除 -->
|
||||
<update id="remove" parameterType="map">
|
||||
UPDATE
|
||||
emergency_examination
|
||||
SET
|
||||
gmt_modified = #{gmtModified},
|
||||
modifier = #{modifier},
|
||||
is_delete = 1
|
||||
WHERE
|
||||
examination_id IN
|
||||
<foreach collection="examinationIds" index="index" open="(" separator="," close=")">
|
||||
#{examinationIds[${index}]}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 删除(物理) -->
|
||||
<update id="delete" parameterType="map">
|
||||
DELETE FROM
|
||||
emergency_examination
|
||||
WHERE
|
||||
examination_id IN
|
||||
<foreach collection="examinationIds" index="index" open="(" separator="," close=")">
|
||||
#{examinationIds[${index}]}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update" parameterType="map">
|
||||
UPDATE
|
||||
emergency_examination
|
||||
SET
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
<if test="isCheck != null">
|
||||
is_check = #{isCheck},
|
||||
</if>
|
||||
gmt_modified = #{gmtModified},
|
||||
modifier = #{modifier},
|
||||
examination_id = examination_id
|
||||
WHERE
|
||||
examination_id = #{examinationId}
|
||||
</update>
|
||||
|
||||
<!-- 详情 -->
|
||||
<select id="get" parameterType="map" resultMap="examinationDTO">
|
||||
SELECT
|
||||
t1.name,
|
||||
t1.phone,
|
||||
t1.is_check,
|
||||
t1.examination_id
|
||||
FROM
|
||||
emergency_examination t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="examinationId != null and examinationId != ''">
|
||||
AND
|
||||
t1.examination_id = #{examinationId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 详情 -->
|
||||
<select id="getBO" parameterType="map" resultMap="examinationBO">
|
||||
SELECT
|
||||
t1.examination_id,
|
||||
t1.name,
|
||||
t1.phone,
|
||||
t1.is_check,
|
||||
t1.gmt_create,
|
||||
t1.creator,
|
||||
t1.gmt_modified,
|
||||
t1.modifier,
|
||||
t1.is_delete
|
||||
FROM
|
||||
emergency_examination t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="examinationId != null and examinationId != ''">
|
||||
AND
|
||||
t1.examination_id = #{examinationId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 详情 -->
|
||||
<select id="getPO" parameterType="map" resultMap="examinationPO">
|
||||
SELECT
|
||||
t1.examination_id,
|
||||
t1.name,
|
||||
t1.phone,
|
||||
t1.is_check,
|
||||
t1.gmt_create,
|
||||
t1.creator,
|
||||
t1.gmt_modified,
|
||||
t1.modifier,
|
||||
t1.is_delete
|
||||
FROM
|
||||
emergency_examination t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="examinationId != null and examinationId != ''">
|
||||
AND
|
||||
t1.examination_id = #{examinationId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="list" parameterType="map" resultMap="examinationDTO">
|
||||
SELECT
|
||||
t1.examination_id,
|
||||
t1.name,
|
||||
t1.phone,
|
||||
t1.is_check,
|
||||
t1.gmt_create,
|
||||
t1.creator,
|
||||
t1.gmt_modified,
|
||||
t1.modifier,
|
||||
t1.is_delete,
|
||||
1
|
||||
FROM
|
||||
emergency_examination t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
<!-- 这里添加其他条件 -->
|
||||
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="examinationIds != null and examinationIds.size > 0">
|
||||
AND
|
||||
t1.examination_id IN
|
||||
<foreach collection="examinationIds" index="index" open="(" separator="," close=")">
|
||||
#{examinationIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="listBO" parameterType="map" resultMap="examinationBO">
|
||||
SELECT
|
||||
t1.examination_id,
|
||||
t1.name,
|
||||
t1.phone,
|
||||
t1.is_check,
|
||||
t1.gmt_create,
|
||||
t1.creator,
|
||||
t1.gmt_modified,
|
||||
t1.modifier,
|
||||
t1.is_delete
|
||||
FROM
|
||||
emergency_examination t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
<!-- 这里添加其他条件 -->
|
||||
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="examinationIds != null and examinationIds.size > 0">
|
||||
AND
|
||||
t1.examination_id IN
|
||||
<foreach collection="examinationIds" index="index" open="(" separator="," close=")">
|
||||
#{examinationIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="listPO" parameterType="map" resultMap="examinationPO">
|
||||
SELECT
|
||||
t1.examination_id,
|
||||
t1.name,
|
||||
t1.phone,
|
||||
t1.is_check,
|
||||
t1.gmt_create,
|
||||
t1.creator,
|
||||
t1.gmt_modified,
|
||||
t1.modifier,
|
||||
t1.is_delete
|
||||
FROM
|
||||
emergency_examination t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
<!-- 这里添加其他条件 -->
|
||||
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="examinationIds != null and examinationIds.size > 0">
|
||||
AND
|
||||
t1.examination_id IN
|
||||
<foreach collection="examinationIds" index="index" open="(" separator="," close=")">
|
||||
#{examinationIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 统计 -->
|
||||
<select id="count" parameterType="map" resultType="Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
emergency_examination t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
</select>
|
||||
|
||||
<!-- 当前考试是否存在在监考记录表 -->
|
||||
<select id="hasExam" parameterType="map" resultMap="examinationHisDTO">
|
||||
SELECT
|
||||
t1.examination_his_id,
|
||||
t1.start_time,
|
||||
t1.end_time,
|
||||
t1.examination_id,
|
||||
t1.examination_room_id,
|
||||
t1.exam_id
|
||||
FROM
|
||||
emergency_examination_his t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
AND t1.exam_id = #{examId}
|
||||
LIMIT 0, 1
|
||||
</select>
|
||||
|
||||
<!-- 判断当天是否存在监考老师信息 -->
|
||||
<select id="hasUser" parameterType="map" resultMap="examinationHisDTO">
|
||||
SELECT
|
||||
t1.examination_his_id,
|
||||
t1.start_time,
|
||||
t1.end_time,
|
||||
t1.examination_id,
|
||||
t1.examination_room_id,
|
||||
t1.exam_id
|
||||
FROM
|
||||
emergency_examination_his t1
|
||||
WHERE
|
||||
(
|
||||
datediff(t1.gmt_create, #{startDay}) = 0
|
||||
)
|
||||
AND t1.is_delete = 0
|
||||
<if test="examinationId != null and examinationId != ''">
|
||||
AND examination_id = #{examinationId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 保存监考信息 -->
|
||||
<insert id="saveExamHis" parameterType="map">
|
||||
INSERT INTO emergency_examination_his (
|
||||
examination_his_id,
|
||||
start_time,
|
||||
end_time,
|
||||
examination_id,
|
||||
examination_room_id,
|
||||
exam_id,
|
||||
gmt_create,
|
||||
creator,
|
||||
gmt_modified,
|
||||
modifier,
|
||||
is_delete
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{examinationHisId},
|
||||
#{startTime},
|
||||
#{endTime},
|
||||
#{examinationId},
|
||||
#{examinationRoomId},
|
||||
#{examId},
|
||||
#{gmtCreate},
|
||||
#{creator},
|
||||
#{gmtModified},
|
||||
#{modifier},
|
||||
#{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改监考信息 -->
|
||||
<update id="updateExamHis" parameterType="map">
|
||||
UPDATE emergency_examination_his
|
||||
SET examination_id = #{examinationId},
|
||||
gmt_modified = #{gmtModified},
|
||||
modifier = #{modifier}
|
||||
WHERE
|
||||
is_delete = 0
|
||||
AND exam_id = #{examId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
340
src/main/resources/static/route/examination/list.html
Normal file
340
src/main/resources/static/route/examination/list.html
Normal file
@ -0,0 +1,340 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/signup/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
<!-- 表头按钮组 -->
|
||||
<script type="text/html" id="headerToolBar">
|
||||
<div class="layui-btn-group">
|
||||
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
|
||||
<i class="fa fa-lg fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
|
||||
<i class="fa fa-lg fa-edit"></i> 编辑
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
|
||||
<i class="fa fa-lg fa-trash"></i> 删除
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="testEvent">
|
||||
<i class="fa fa-lg fa-trash"></i> 测试随机监考人员
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="searchEvent">
|
||||
<i class="fa fa-lg fa-trash"></i> 剩余监考人员
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/examination/list-page';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: '#headerToolBar',
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'examinationId', width: 180, title: '主键UUID', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'name', width: 180, title: '考务人员姓名', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'phone', width: 180, title: '考务人员联系方式', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isCheck', width: 180, title: '0:未参加监考,1:参加监考', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'creator', width: 180, title: '', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtModified', width: 180, title: '', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'modifier', width: 180, title: '', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isDelete', width: 180, title: '', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
function removeData(ids) {
|
||||
top.dialog.msg(top.dataMessage.delete, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var layIndex;
|
||||
top.restAjax.delete(top.restAjax.path('api/examination/remove/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
|
||||
reloadTable();
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
// 选择随机监考老师
|
||||
function selExamUser() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/examination/sel-exam-user?startTime={startTime}&endTime={endTime}&examinationRoomId={examinationRoomId}&examId={examId}',
|
||||
['2021-05-02 10:00:00', '2021-05-02 12:00:00', '111', '222']), {}, null, function(code, data) {
|
||||
console.log(data)
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
// 剩余监考老师
|
||||
function resultUser() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/examination/result-exam-user?startTime={startTime}',
|
||||
['2021-05-02 10:00:00']), {}, null, function(code, data) {
|
||||
console.log(data)
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
|
||||
// 事件 - 增删改
|
||||
table.on('toolbar(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'saveEvent') {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/examination/save.html', []),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(layEvent === 'updateEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/examination/update.html?examinationId={examinationId}', [checkDatas[0].examinationId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'removeEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectDelete);
|
||||
} else {
|
||||
var ids = '';
|
||||
for(var i = 0, item; item = checkDatas[i++];) {
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item['examinationId'];
|
||||
}
|
||||
removeData(ids);
|
||||
}
|
||||
} else if(layEvent === 'testEvent') {
|
||||
selExamUser()
|
||||
} else if(layEvent === 'searchEvent') {
|
||||
resultUser()
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
172
src/main/resources/static/route/examination/save.html
Normal file
172
src/main/resources/static/route/examination/save.html
Normal file
@ -0,0 +1,172 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/signup/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>新增内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">姓名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="name" name="name" class="layui-input" value="" placeholder="请输入考务人员姓名" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">联系方式</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="phone" name="phone" class="layui-input" value="" placeholder="请输入考务人员联系方式" maxlength="15">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">参考情况</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="isCheck" name="isCheck" class="layui-input" value="0" placeholder="请输入0:未参加监考,1:参加监考" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
function refreshDownloadTemplet(fileName, file) {
|
||||
var dataRander = {};
|
||||
dataRander[fileName] = file;
|
||||
|
||||
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
|
||||
document.getElementById(fileName +'FileBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化文件列表
|
||||
function initFileList(fileName, ids, callback) {
|
||||
var dataForm = {};
|
||||
dataForm[fileName] = ids;
|
||||
form.val('dataForm', dataForm);
|
||||
|
||||
if(!ids) {
|
||||
refreshDownloadTemplet(fileName, []);
|
||||
if(callback) {
|
||||
callback(fileName, []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
top.restAjax.get(top.restAjax.path('api/file/list', []), {
|
||||
ids: ids
|
||||
}, null, function(code, data) {
|
||||
refreshDownloadTemplet(fileName, data);
|
||||
if(callback) {
|
||||
callback(fileName, data);
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化视频
|
||||
function initVideo(fileName, data) {
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
var player = new ckplayer({
|
||||
container: '#'+ fileName + i,
|
||||
variable: 'player',
|
||||
flashplayer: false,
|
||||
video: {
|
||||
file: 'route/file/download/true/'+ item.fileId,
|
||||
type: 'video/mp4'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.post(top.restAjax.path('api/examination/save', []), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
189
src/main/resources/static/route/examination/update.html
Normal file
189
src/main/resources/static/route/examination/update.html
Normal file
@ -0,0 +1,189 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/signup/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">姓名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="name" name="name" class="layui-input" value="" placeholder="请输入考务人员姓名" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">联系方式</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="phone" name="phone" class="layui-input" value="" placeholder="请输入考务人员联系方式" maxlength="15">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">参考情况</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="isCheck" name="isCheck" class="layui-input" value="0" placeholder="请输入0:未参加监考,1:参加监考" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var examinationId = top.restAjax.params(window.location.href).examinationId;
|
||||
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
function refreshDownloadTemplet(fileName, file) {
|
||||
var dataRander = {};
|
||||
dataRander[fileName] = file;
|
||||
|
||||
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
|
||||
document.getElementById(fileName +'FileBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化文件列表
|
||||
function initFileList(fileName, ids, callback) {
|
||||
var dataForm = {};
|
||||
dataForm[fileName] = ids;
|
||||
form.val('dataForm', dataForm);
|
||||
|
||||
if(!ids) {
|
||||
refreshDownloadTemplet(fileName, []);
|
||||
if(callback) {
|
||||
callback(fileName, []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
top.restAjax.get(top.restAjax.path('api/file/list', []), {
|
||||
ids: ids
|
||||
}, null, function(code, data) {
|
||||
refreshDownloadTemplet(fileName, data);
|
||||
if(callback) {
|
||||
callback(fileName, data);
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化视频
|
||||
function initVideo(fileName, data) {
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
var player = new ckplayer({
|
||||
container: '#'+ fileName + i,
|
||||
variable: 'player',
|
||||
flashplayer: false,
|
||||
video: {
|
||||
file: 'route/file/download/true/'+ item.fileId,
|
||||
type: 'video/mp4'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/examination/get/{examinationId}', [examinationId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/examination/update/{examinationId}', [examinationId]), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user