diff --git a/src/main/java/cn/com/tenlion/controller/api/examination/distribution/DistributionController.java b/src/main/java/cn/com/tenlion/controller/api/examination/distribution/DistributionController.java index efd1470..8a04c7f 100644 --- a/src/main/java/cn/com/tenlion/controller/api/examination/distribution/DistributionController.java +++ b/src/main/java/cn/com/tenlion/controller/api/examination/distribution/DistributionController.java @@ -1,6 +1,8 @@ package cn.com.tenlion.controller.api.examination.distribution; import cn.com.tenlion.pojo.dtos.distribution.DistributionDTO; +import cn.com.tenlion.pojo.dtos.distributionfield.DistributionFieldCountDTO; +import cn.com.tenlion.pojo.dtos.distributionfield.DistributionFieldProportionDTO; import cn.com.tenlion.pojo.vos.distribution.DistributionSaveVO; import cn.com.tenlion.pojo.vos.distribution.DistributionVO; import cn.com.tenlion.service.examination.distribution.IDistributionService; @@ -108,4 +110,29 @@ public class DistributionController extends DefaultBaseController { return new SuccessResultData<>(distributionService.count(params)); } + @ApiOperation(value = "本周考试数量", notes = "本周考试数量接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("week-count") + SuccessResultData> weekCount() { + Map params = requestParams(); + return new SuccessResultData>(distributionService.weekCount(params)); + } + + @ApiOperation(value = "考场数量", notes = "考场数量接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("field-count") + SuccessResultData fieldCount() { + Map params = requestParams(); + return new SuccessResultData<>(distributionService.fieldCount(params)); + } + + @ApiOperation(value = "考场使用频次", notes = "考场使用频次占比接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("use-count") + SuccessResultData> useCount() { + Map params = requestParams(); + return new SuccessResultData>(distributionService.useCount(params)); + } + + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/controller/api/examination/stationuser/StationUserController.java b/src/main/java/cn/com/tenlion/controller/api/examination/stationuser/StationUserController.java index bfc154e..01636d4 100644 --- a/src/main/java/cn/com/tenlion/controller/api/examination/stationuser/StationUserController.java +++ b/src/main/java/cn/com/tenlion/controller/api/examination/stationuser/StationUserController.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.common.component.SecurityComponent; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.ErrorResult; @@ -32,6 +33,8 @@ import java.util.Map; @RequestMapping(ISystemConstant.API_PREFIX + "/stationuser") public class StationUserController extends DefaultBaseController { + @Autowired + protected SecurityComponent securityComponent; @Autowired private IStationUserService stationUserService; @@ -78,6 +81,14 @@ public class StationUserController extends DefaultBaseController { return stationUserService.get(stationUserId); } + @ApiOperation(value = "列表", notes = "列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-user") + public List listByUser() { + String userId = securityComponent.getCurrentUser().getUserId(); + return stationUserService.getStationByUserId(userId); + } + @ApiOperation(value = "列表", notes = "列表接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("list") diff --git a/src/main/java/cn/com/tenlion/dao/examination/distribution/IDistributionDao.java b/src/main/java/cn/com/tenlion/dao/examination/distribution/IDistributionDao.java index 488ba67..a25e6ee 100644 --- a/src/main/java/cn/com/tenlion/dao/examination/distribution/IDistributionDao.java +++ b/src/main/java/cn/com/tenlion/dao/examination/distribution/IDistributionDao.java @@ -118,4 +118,6 @@ public interface IDistributionDao { Integer count(Map params) throws SearchException; List getListByFieldId(Map params) throws SearchException; + + void updateStatus(Map params) throws UpdateException; } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/dao/examination/distributionfield/IDistributionFieldDao.java b/src/main/java/cn/com/tenlion/dao/examination/distributionfield/IDistributionFieldDao.java index e7bffcb..80d14a5 100644 --- a/src/main/java/cn/com/tenlion/dao/examination/distributionfield/IDistributionFieldDao.java +++ b/src/main/java/cn/com/tenlion/dao/examination/distributionfield/IDistributionFieldDao.java @@ -116,4 +116,7 @@ public interface IDistributionFieldDao { */ Integer count(Map params) throws SearchException; + List> queryWeekCount(Map queryParams); + + Integer queryCount(Map params); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/distribution/DistributionDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/distribution/DistributionDTO.java index 91e3a58..3f16ae3 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/distribution/DistributionDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/distribution/DistributionDTO.java @@ -49,11 +49,21 @@ public class DistributionDTO { @ApiModelProperty(name = "distributionAllotTime", value = "") private String distributionAllotTime; @ApiModelProperty(name = "distributionFieldList", value = "") - private ListdistributionFieldList; + private List distributionFieldList; @ApiModelProperty(name = "distributionEndTime", value = "预计结束时间") private String distributionEndTime; @ApiModelProperty(name = "distributionAllotEndTime", value = "分配结束时间") private String distributionAllotEndTime; + @ApiModelProperty(name = "examType", value = "考试类型。1:理论,2:实操") + private Integer examType; + + public Integer getExamType() { + return examType; + } + + public void setExamType(Integer examType) { + this.examType = examType; + } public String getDistributionEndTime() { return distributionEndTime == null ? "" : distributionEndTime; diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldCountDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldCountDTO.java new file mode 100644 index 0000000..1ca7887 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldCountDTO.java @@ -0,0 +1,30 @@ +package cn.com.tenlion.pojo.dtos.distributionfield; + +import java.util.ArrayList; +import java.util.List; + +public class DistributionFieldCountDTO { + + private String fieldName; + + private List weekList = new ArrayList(); + + public String getFieldName() { + return fieldName == null ? "" : fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public List getWeekList() { + if (weekList == null) { + return new ArrayList<>(); + } + return weekList; + } + + public void setWeekList(List weekList) { + this.weekList = weekList; + } +} diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldDTO.java index 6e3e8ec..96ecbef 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldDTO.java @@ -39,6 +39,16 @@ public class DistributionFieldDTO { private Integer isDelete; @ApiModelProperty(name = "invigilatorId", value = "监考老师ID") private String invigilatorId; + @ApiModelProperty(name = "invigilatorName", value = "监考老师姓名") + private String invigilatorName; + + public String getInvigilatorName() { + return invigilatorName == null ? "" : invigilatorName; + } + + public void setInvigilatorName(String invigilatorName) { + this.invigilatorName = invigilatorName; + } public String getInvigilatorId() { return invigilatorId == null ? "" : invigilatorId; diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldProportionDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldProportionDTO.java new file mode 100644 index 0000000..06e8713 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/distributionfield/DistributionFieldProportionDTO.java @@ -0,0 +1,24 @@ +package cn.com.tenlion.pojo.dtos.distributionfield; + +public class DistributionFieldProportionDTO { + + private String fieldName; + + private Integer count; + + public String getFieldName() { + return fieldName == null ? "" : fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } +} diff --git a/src/main/java/cn/com/tenlion/service/examination/distribution/IDistributionService.java b/src/main/java/cn/com/tenlion/service/examination/distribution/IDistributionService.java index a6f7844..4d9ea5f 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distribution/IDistributionService.java +++ b/src/main/java/cn/com/tenlion/service/examination/distribution/IDistributionService.java @@ -2,6 +2,8 @@ package cn.com.tenlion.service.examination.distribution; import cn.com.tenlion.pojo.bos.distribution.DistributionBO; import cn.com.tenlion.pojo.dtos.distribution.DistributionDTO; +import cn.com.tenlion.pojo.dtos.distributionfield.DistributionFieldCountDTO; +import cn.com.tenlion.pojo.dtos.distributionfield.DistributionFieldProportionDTO; import cn.com.tenlion.pojo.pos.distribution.DistributionPO; import cn.com.tenlion.pojo.vos.distribution.DistributionSaveVO; import cn.com.tenlion.pojo.vos.distribution.DistributionVO; @@ -185,4 +187,11 @@ public interface IDistributionService { */ Integer count(Map params); + List weekCount(Map params); + + Integer fieldCount(Map params); + + List useCount(Map params); + + void updateStatus(String planId, String status); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java index 3b46c3b..ad92997 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java @@ -4,8 +4,12 @@ import cn.com.tenlion.dao.examination.distribution.IDistributionDao; import cn.com.tenlion.organizationmanagement.pojo.dtos.organization.OrganizationDTO; import cn.com.tenlion.organizationmanagement.service.organization.IOrganizationService; import cn.com.tenlion.pojo.bos.distribution.DistributionBO; +import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; import cn.com.tenlion.pojo.dtos.distribution.DistributionDTO; +import cn.com.tenlion.pojo.dtos.distributionfield.DistributionFieldCountDTO; import cn.com.tenlion.pojo.dtos.distributionfield.DistributionFieldDTO; +import cn.com.tenlion.pojo.dtos.distributionfield.DistributionFieldProportionDTO; +import cn.com.tenlion.pojo.dtos.examapply.ExamApplyDTO; import cn.com.tenlion.pojo.pos.distribution.DistributionPO; import cn.com.tenlion.pojo.vos.distribution.DistributionSaveVO; import cn.com.tenlion.pojo.vos.distribution.DistributionVO; @@ -244,7 +248,15 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist @Override public DistributionDTO get(Map params) { - return distributionDao.get(params); + DistributionDTO dto = distributionDao.get(params); + if(dto == null) { + return null; + } + Map query = new HashMap(); + query.put("examId", dto.getDistributionId()); + ExamApplyDTO examApplyDTO = iExamApplyService.get(query); + dto.setExamType(examApplyDTO.getExamType()); + return dto; } @Override @@ -305,7 +317,6 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist @Override public SuccessResultList> listPage(ListPage page) { - PageHelper.startPage(page.getPage(), page.getRows()); /** * 查出当前人员绑定的考点人员配置 * 只显示已经绑定考点的信息 @@ -321,6 +332,8 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist return new SuccessResultList<>(distributionDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } page.getParams().put("stationIdList", stationIdList); + + PageHelper.startPage(page.getPage(), page.getRows()); List distributionDTOs = list(page.getParams()); /** * 回显考场 @@ -332,13 +345,119 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist dto.setDistributionFieldList(dtoList); } PageInfo pageInfo = new PageInfo<>(distributionDTOs); - return new SuccessResultList<>(distributionDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + SuccessResultList> result = new SuccessResultList<>(distributionDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + return result; } @Override public Integer count(Map params) { + /** + * 查出当前人员绑定的考点人员配置 + * 只显示已经绑定考点的信息 + */ + String userId = securityComponent.getCurrentUser().getUserId(); + List stationIdList = iStationUserService.getStationByUserId(userId); + if(stationIdList == null || stationIdList.size() < 1) { + return 0; + } + params.put("stationIdList", stationIdList); Integer count = distributionDao.count(params); return count == null ? 0 : count; } + @Override + public List weekCount(Map params) { + /** + * 查出当前人员绑定的考点人员配置 + * 只显示已经绑定考点的信息 + */ + String userId = securityComponent.getCurrentUser().getUserId(); + List stationIdList = iStationUserService.getStationByUserId(userId); + /** + * 防止无权限的人员进行查看 + */ + List resultList = new ArrayList(); + if(stationIdList == null || stationIdList.size() < 1 && !"1".equals(userId)) { + return resultList; + } + Map query = new HashMap(); + Map queryParams = new HashMap(); + for (String stationId: stationIdList) { + query.put("organizationType", stationId); + List organizationDTOList = iOrganizationService.list(query); + for(OrganizationDTO organizationDTO : organizationDTOList) { + queryParams.put("fieldId", organizationDTO.getOrganizationId()); + List weekList = iDistributionFieldService.queryWeekCount(queryParams); + + DistributionFieldCountDTO countDTO = new DistributionFieldCountDTO(); + countDTO.setFieldName(organizationDTO.getOrganizationName()); + countDTO.setWeekList(weekList); + resultList.add(countDTO); + } + } + return resultList; + } + + @Override + public Integer fieldCount(Map params) { + /** + * 查出当前人员绑定的考点人员配置 + * 只显示已经绑定考点的信息 + */ + String userId = securityComponent.getCurrentUser().getUserId(); + List stationIdList = iStationUserService.getStationByUserId(userId); + if(stationIdList == null || stationIdList.size() < 1) { + return 0; + } + Map query = new HashMap(); + int total = 0; + for (String stationId: stationIdList) { + query.put("organizationType", stationId); + List organizationDTOList = iOrganizationService.list(query); + total = total + organizationDTOList.size(); + } + return total; + } + + @Override + public List useCount(Map params) { + /** + * 查出当前人员绑定的考点人员配置 + * 只显示已经绑定考点的信息 + */ + String userId = securityComponent.getCurrentUser().getUserId(); + List stationIdList = iStationUserService.getStationByUserId(userId); + /** + * 防止无权限的人员进行查看 + */ + List resultList = new ArrayList(); + if(stationIdList == null || stationIdList.size() < 1 && !"1".equals(userId)) { + return resultList; + } + Map query = new HashMap(); + Map queryParams = new HashMap(); + for (String stationId: stationIdList) { + query.put("organizationType", stationId); + List organizationDTOList = iOrganizationService.list(query); + for(OrganizationDTO organizationDTO : organizationDTOList) { + queryParams.put("fieldId", organizationDTO.getOrganizationId()); + Integer count = iDistributionFieldService.queryCount(queryParams); + + DistributionFieldProportionDTO countDTO = new DistributionFieldProportionDTO(); + countDTO.setFieldName(organizationDTO.getOrganizationName()); + countDTO.setCount(count); + resultList.add(countDTO); + } + } + return resultList; + } + + @Override + public void updateStatus(String planId, String status) { + Map params = new HashMap(); + params.put("distributionId", planId); + params.put("distributionStatus", status); + distributionDao.updateStatus(params); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examination/distributioncard/impl/DistributionCardServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/distributioncard/impl/DistributionCardServiceImpl.java index e660815..7bdf5d2 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distributioncard/impl/DistributionCardServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examination/distributioncard/impl/DistributionCardServiceImpl.java @@ -152,6 +152,10 @@ public class DistributionCardServiceImpl extends DefaultBaseService implements I j++; } } + /** + * 状态改为已分配监考考试 + */ + distributionService.updateStatus(planId, "2"); } @Override diff --git a/src/main/java/cn/com/tenlion/service/examination/distributionfield/IDistributionFieldService.java b/src/main/java/cn/com/tenlion/service/examination/distributionfield/IDistributionFieldService.java index 8c0f09a..8b14bda 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distributionfield/IDistributionFieldService.java +++ b/src/main/java/cn/com/tenlion/service/examination/distributionfield/IDistributionFieldService.java @@ -195,4 +195,7 @@ public interface IDistributionFieldService { */ Integer count(Map params); + List queryWeekCount(Map queryParams); + + Integer queryCount(Map queryParams); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examination/distributionfield/impl/DistributionFieldServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/distributionfield/impl/DistributionFieldServiceImpl.java index 1353100..b61ae29 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distributionfield/impl/DistributionFieldServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examination/distributionfield/impl/DistributionFieldServiceImpl.java @@ -1,9 +1,12 @@ package cn.com.tenlion.service.examination.distributionfield.impl; import cn.com.tenlion.dao.examination.distributionfield.IDistributionFieldDao; +import cn.com.tenlion.organizationmanagement.pojo.dtos.organization.OrganizationDTO; import cn.com.tenlion.pojo.dtos.distribution.DistributionDTO; +import cn.com.tenlion.pojo.dtos.examinationuser.ExaminationDTO; import cn.com.tenlion.pojo.vos.distributionfield.DistributionFieldSaveVO; import cn.com.tenlion.service.examination.distributionfield.IDistributionFieldService; +import cn.com.tenlion.service.examinationuser.IExaminationService; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResult; @@ -33,6 +36,8 @@ public class DistributionFieldServiceImpl extends DefaultBaseService implements @Autowired private IDistributionFieldDao distributionFieldDao; + @Autowired + private IExaminationService iExaminationService; @Override public void save(DistributionFieldVO distributionFieldVO) { @@ -149,7 +154,16 @@ public class DistributionFieldServiceImpl extends DefaultBaseService implements @Override public List list(Map params) { - return distributionFieldDao.list(params); + List list = distributionFieldDao.list(params); + for(DistributionFieldDTO fieldDTO : list) { + if(!StringUtils.isEmpty(fieldDTO.getInvigilatorId())){ + ExaminationDTO examinationDTO = iExaminationService.get(fieldDTO.getInvigilatorId()); + if(examinationDTO != null) { + fieldDTO.setInvigilatorName(examinationDTO.getName()); + } + } + } + return list; } @Override @@ -176,4 +190,32 @@ public class DistributionFieldServiceImpl extends DefaultBaseService implements return count == null ? 0 : count; } + @Override + public List queryWeekCount(Map queryParams) { + List> distributionFieldDTOs = distributionFieldDao.queryWeekCount(queryParams); + List weekList = new ArrayList(); + for (int i = 1 ; i <= 7 ; i++) { + int count = 0; + b:for(Map weekMap : distributionFieldDTOs) { + if (i == 7) { + if(0 == (Integer.valueOf(weekMap.get("weekWeek").toString())) ){ + count = Integer.valueOf(weekMap.get("weekCount").toString()); + break b; + } + }else if(i == (Integer.valueOf(weekMap.get("weekWeek").toString())) ){ + count = Integer.valueOf(weekMap.get("weekCount").toString()); + break b; + } + } + weekList.add(count); + } + return weekList; + } + + @Override + public Integer queryCount(Map params) { + Integer count = distributionFieldDao.queryCount(params); + return count == null ? 0 : count; + } + } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/distribution/distribution-mapper.xml b/src/main/resources/mybatis/mapper/distribution/distribution-mapper.xml index 81ab6b7..dae795a 100644 --- a/src/main/resources/mybatis/mapper/distribution/distribution-mapper.xml +++ b/src/main/resources/mybatis/mapper/distribution/distribution-mapper.xml @@ -154,6 +154,18 @@ + + UPDATE + e_distribution + SET + + distribution_status = #{distributionStatus}, + + distribution_id = distribution_id + WHERE + distribution_id = #{distributionId} + + UPDATE @@ -341,7 +353,7 @@ ORDER BY - t1.distribution_allot_time DESC + t1.distribution_time DESC @@ -446,6 +458,16 @@ e_distribution t1 WHERE t1.is_delete = 0 + + AND t1.distribution_status = #{distributionStatus} + + + AND + t1.station_id IN + + #{stationIdList[${index}]} + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/distributioncard/distribution-card-mapper.xml b/src/main/resources/mybatis/mapper/distributioncard/distribution-card-mapper.xml index 5946ed6..589eea5 100644 --- a/src/main/resources/mybatis/mapper/distributioncard/distribution-card-mapper.xml +++ b/src/main/resources/mybatis/mapper/distributioncard/distribution-card-mapper.xml @@ -270,6 +270,11 @@ 1 FROM e_distribution_card t1 + + LEFT JOIN + e_distribution t2 + ON + t1.distribution_id = t2.distribution_id WHERE t1.is_delete = 0 @@ -303,7 +308,7 @@ ORDER BY - (t1.distribution_card_number + 0) + t2.distribution_allot_time DESC , (t1.distribution_card_number + 0) diff --git a/src/main/resources/mybatis/mapper/distributionfield/distribution-field-mapper.xml b/src/main/resources/mybatis/mapper/distributionfield/distribution-field-mapper.xml index 36dd105..3d43bff 100644 --- a/src/main/resources/mybatis/mapper/distributionfield/distribution-field-mapper.xml +++ b/src/main/resources/mybatis/mapper/distributionfield/distribution-field-mapper.xml @@ -47,6 +47,37 @@ + + + + + + INSERT INTO e_distribution_field( diff --git a/src/main/resources/mybatis/mapper/stationuser/station-user-mapper.xml b/src/main/resources/mybatis/mapper/stationuser/station-user-mapper.xml index 8f3f5bd..019af14 100644 --- a/src/main/resources/mybatis/mapper/stationuser/station-user-mapper.xml +++ b/src/main/resources/mybatis/mapper/stationuser/station-user-mapper.xml @@ -238,6 +238,9 @@ t1.id LIKE CONCAT('%', #{keywords}, '%') ) + + AND t1.station_user_user_id = #{stationUserUserId} + AND LEFT(t1.gmt_create, 10) = ]]> #{startTime} diff --git a/src/main/resources/static/route/examination/distribution/distributionl.html b/src/main/resources/static/route/examination/distribution/distributionl.html new file mode 100644 index 0000000..4ad6482 --- /dev/null +++ b/src/main/resources/static/route/examination/distribution/distributionl.html @@ -0,0 +1,479 @@ + + + + + + + + + + + + + + +
+ + + +
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
待分配申请
+
0
+
+
+
+
+ +
+
+
考场数量
+
0
+
+
+
+
+ +
+
+
考试总数
+
0
+
+
+
+
+ +
+
+
+
+ 最近待分配申请 +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examination/distribution/list.html b/src/main/resources/static/route/examination/distribution/list.html index 32bce9f..0fb3715 100644 --- a/src/main/resources/static/route/examination/distribution/list.html +++ b/src/main/resources/static/route/examination/distribution/list.html @@ -9,6 +9,11 @@ +
@@ -26,11 +31,12 @@
-
+
- - - - - - - - - - - - - +
@@ -73,6 +83,12 @@ var common = layui.common; var resizeTimeout = null; var tableUrl = 'api/distribution/listpage'; + var distributionStatus = top.restAjax.params(window.location.href).distributionStatus; + if(distributionStatus) { + var select = 'dd[lay-value=' + distributionStatus+ ']'; + $('#distributionStatus').siblings("div.layui-form-select").find('dl').find(select).click(); + tableUrl = tableUrl + "?distributionStatus=" + distributionStatus; + } // 初始化表格 function initTable() { @@ -93,7 +109,7 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'planName', width: 180, title: '计划名称', align:'center', + {field: 'planName', width: 250, title: '考试申请', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -108,10 +124,10 @@ if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } - return rowData + '人'; + return rowData + ''; } }, - {field: 'distributionTime', width: 180, title: '预定考试时间', align:'center', + {field: 'distributionTime', width: 180, title: '预定开始时间', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -120,7 +136,7 @@ return rowData; } }, - {field: 'distributionAllotTime', width: 180, title: '最终分配时间', align:'center', + {field: 'distributionAllotTime', width: 180, title: '最终开始时间', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -129,7 +145,7 @@ return rowData; } }, - {field: 'distributionFields', width: 350, title: '分配考场', align:'center', + {field: 'distributionFields', width: 450, title: '最终分配考场', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -139,27 +155,23 @@ var showData = ""; if(rowDataArray && rowDataArray.length > 0) { for(var i = 0 ; i < rowDataArray.length; i++) { - showData = (showData ? showData + " . " : "") + rowDataArray[i].fieldName + "(" + rowDataArray[i].fieldNumber + "人)"; + showData = (showData ? showData + " . " : "") + rowDataArray[i].fieldName + "(" + rowDataArray[i].fieldNumber + ")"; } } return showData; } }, - {field:'distributionButton',fixed: 'right', width:150, title: '考场分配', align:'center', + {field:'distributionButton',fixed: 'right', width:150, title: '当前状态', align:'center', templet: function(row) { var rowData = row[this.field]; if(row.distributionStatus == '1') { - return '已分配'; - }else{ - return '考场分配'; + return '已分配考场'; + }else if(row.distributionStatus == '0') { + return ' 待分配考场'; + }else { + return '已生成准考证'; } } - }, - {field:'distributionCardButton',fixed: 'right', width:150, title: '准考证信息', align:'center', - templet: function(row) { - var rowData = row[this.field]; - return '准考证信息'; - } } ] ], @@ -228,32 +240,32 @@ initDate(); // 表格行中按钮事件 - table.on('tool(dataTable)', function(obj) { - var layEvent = obj.event; - var data = obj.data; - if(layEvent === 'distributionButton') { - top.dialog.open({ - url: top.restAjax.path('route/examination/distribution/update.html?distributionId={distributionId}', [data.distributionId]), - title: "分配考场 与 确认考试时间", - width: '80%', - height: '80%', - onClose: function() { - reloadTable(); - } - }); - } - if(layEvent === 'distributionCardButton') { - top.dialog.open({ - url: top.restAjax.path('route/examination/distributioncard/list.html?distributionId={distributionId}', [data.distributionId]), - title: "准考证信息", - width: '80%', - height: '80%', - onClose: function() { - reloadTable(); - } - }); - } - }); + // table.on('tool(dataTable)', function(obj) { + // var layEvent = obj.event; + // var data = obj.data; + // if(layEvent === 'distributionButton') { + // top.dialog.open({ + // url: top.restAjax.path('route/examination/distribution/update.html?distributionId={distributionId}', [data.distributionId]), + // title: "分配考场 与 确认考试时间", + // width: '80%', + // height: '80%', + // onClose: function() { + // reloadTable(); + // } + // }); + // } + // if(layEvent === 'distributionCardButton') { + // top.dialog.open({ + // url: top.restAjax.path('route/examination/distributioncard/list.html?distributionId={distributionId}', [data.distributionId]), + // title: "准考证信息", + // width: '80%', + // height: '80%', + // onClose: function() { + // reloadTable(); + // } + // }); + // } + // }); // 事件 - 页面变化 $win.on('resize', function() { @@ -284,11 +296,15 @@ reloadTable(); } }); - } else if(layEvent === 'updateEvent') { + } else if(layEvent === 'showEvent') { + // if(checkDatas[0].distributionStatus == 0) { + // top.dialog.msg('该数据尚未进行考场分配'); + // return; + // } if(checkDatas.length === 0) { - top.dialog.msg(top.dataMessage.table.selectEdit); + top.dialog.msg('请选择要查看的记录'); } else if(checkDatas.length > 1) { - top.dialog.msg(top.dataMessage.table.selectOneEdit); + top.dialog.msg('同时只能查看一条记录'); } else { layer.open({ type: 2, @@ -297,7 +313,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/distribution/update?distributionId={distributionId}', [checkDatas[0].distributionId]), + content: top.restAjax.path('route/examination/distribution/show.html?distributionId={distributionId}', [checkDatas[0].distributionId]), end: function() { reloadTable(); } @@ -316,6 +332,52 @@ } removeData(ids); } + } else if(layEvent === 'distributionButton') { + if(checkDatas.length === 0) { + top.dialog.msg('请选择要分配的记录'); + } else if(checkDatas.length > 1) { + top.dialog.msg('同时只能分配一条记录'); + } else { + if(checkDatas[0].distributionStatus != 0) { + top.layer.msg("该记录已分配了考场"); + return; + } + layer.open({ + type: 2, + title: false, + closeBtn: 0, + area: ['100%', '100%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/examination/distribution/update.html?distributionId={distributionId}', [checkDatas[0].distributionId]), + end: function () { + reloadTable(); + } + }); + } + } else if(layEvent === 'distributionCardButton') { + if(checkDatas.length === 0) { + top.dialog.msg('请选择要查看的记录'); + } else if(checkDatas.length > 1) { + top.dialog.msg('同时只能查看一条记录'); + } else { + if(checkDatas[0].distributionStatus != 2) { + top.layer.msg("该记录尚未生成准考证"); + return; + } + top.layer.open({ + type: 2, + title: "准考证信息", + closeBtn: 1, + area: ['90%', '90%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/examination/distributioncard/list.html?distributionId={distributionId}', [checkDatas[0].distributionId]), + end: function () { + reloadTable(); + } + }); + } } }); }); diff --git a/src/main/resources/static/route/examination/distribution/show.html b/src/main/resources/static/route/examination/distribution/show.html new file mode 100644 index 0000000..cf73779 --- /dev/null +++ b/src/main/resources/static/route/examination/distribution/show.html @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + +
+
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examination/distribution/update.html b/src/main/resources/static/route/examination/distribution/update.html index 0b85080..c49c42a 100644 --- a/src/main/resources/static/route/examination/distribution/update.html +++ b/src/main/resources/static/route/examination/distribution/update.html @@ -35,26 +35,32 @@ +
+ +
+ +
+
- +
- +
- +
- +
@@ -62,7 +68,7 @@
@@ -125,6 +131,7 @@ laydate.render({ elem: '#distributionAllotTime', type: 'datetime', + min:1, trigger: 'click' }); } @@ -133,6 +140,7 @@ laydate.render({ elem: '#distributionAllotEndTime', type: 'datetime', + min:1, trigger: 'click' }); } @@ -195,6 +203,15 @@ for(var i in data) { dataFormData[i] = data[i] +''; } + + if(data.examType == 1) { + dataFormData["examTypeName"] = "理论考试"; + }else if(data.examType == 2) { + dataFormData["examTypeName"] = "实操考试"; + }else{ + dataFormData["examTypeName"] = "理论 + 实操考试"; + } + form.val('dataForm', dataFormData); form.render(null, 'dataForm'); initDistributionAllotTime(); diff --git a/src/main/resources/static/route/examination/field/list.html b/src/main/resources/static/route/examination/field/list.html index 6a805b4..e30d6e1 100644 --- a/src/main/resources/static/route/examination/field/list.html +++ b/src/main/resources/static/route/examination/field/list.html @@ -38,9 +38,13 @@ + +
+
+
@@ -88,7 +92,7 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'organizationImage', width: 180, title: '考场图片', align:'center', + {field: 'organizationImage', width: 100, title: '考场图片', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -97,7 +101,7 @@ var value='
    '; var datas = rowData.split(','); for(var i = 0, item = datas[i]; item = datas[i++];) { - value += '
  • '+ row[
  • '; + value += '
  • '+ row[
  • '; } value += '
'; setTimeout(function() { @@ -135,13 +139,19 @@ return rowData; } }, - {field: 'organizationDesc', width: 180, title: '考场描述', align:'center', + {field: 'organizationDesc', width: 180, title: '考场类型', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } - return rowData; + if(rowData == 1 ) { + return '理论考场'; + }else if(rowData == 2 ){ + return '实操考场'; + }else{ + return '混合考场'; + } } }, diff --git a/src/main/resources/static/route/examination/field/listpage.html b/src/main/resources/static/route/examination/field/listpage.html index a13227c..da1e564 100644 --- a/src/main/resources/static/route/examination/field/listpage.html +++ b/src/main/resources/static/route/examination/field/listpage.html @@ -35,15 +35,21 @@
@@ -97,7 +103,7 @@ return rowData; } }, - {field: 'organizationImage', width: 180, title: '考场图片', align:'center', + {field: 'organizationImage', width: 100, title: '考场图片', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -106,7 +112,7 @@ var value='
    '; var datas = rowData.split(','); for(var i = 0, item = datas[i]; item = datas[i++];) { - value += '
  • ' + row[
  • '; + value += '
  • ' + row[
  • '; } value += '
'; setTimeout(function() { @@ -144,13 +150,19 @@ return rowData; } }, - {field: 'organizationDesc', width: 180, title: '考场描述', align:'center', + {field: 'organizationDesc', width: 180, title: '考场类型', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } - return rowData; + if(rowData == 1 ) { + return '理论考场'; + }else if(rowData == 2 ){ + return '实操考场'; + }else{ + return '混合考场'; + } } }, @@ -216,8 +228,27 @@ } }); } - initTable(); + initDate(); + var stationArray = new Array(); + function initUser() { + top.restAjax.get(top.restAjax.path('api/stationuser/list-user', []), {}, null, function(code, data) { + if(data.length > 0) { + stationArray = data; + initTable(); + }else{ + top.layer.msg("您不在考场机构的人员信息中"); + } + }, 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); + }); + } + initUser(); + // 事件 - 页面变化 $win.on('resize', function() { clearTimeout(resizeTimeout); @@ -255,11 +286,7 @@ } }); }else{ - if(checkDatas.length === 0) { - top.dialog.msg("选择要新增的考试机构"); - } else if(checkDatas.length > 1) { - top.dialog.msg("只能同时新增一个考场"); - } else { + if(stationArray.length > 0 && checkDatas.length === 0) { layer.open({ type: 2, title: false, @@ -267,12 +294,32 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/examination/field/save.html?institutionId={institutionId}', [checkDatas[0].organizationType]), - end: function() { + content: top.restAjax.path('route/examination/field/save.html?institutionId={institutionId}', [stationArray[0]]), + end: function () { reloadTable(); } }); } + // }else{ + // if(checkDatas.length === 0) { + // top.dialog.msg("选择要新增到哪个考试机构"); + // } else if(checkDatas.length > 1) { + // top.dialog.msg("只能同时新增一个考场"); + // } else { + // layer.open({ + // type: 2, + // title: false, + // closeBtn: 0, + // area: ['100%', '100%'], + // shadeClose: true, + // anim: 2, + // content: top.restAjax.path('route/examination/field/save.html?institutionId={institutionId}', [checkDatas[0].organizationType]), + // end: function() { + // reloadTable(); + // } + // }); + // } + // } } } else if(layEvent === 'updateEvent') { if(checkDatas.length === 0) { diff --git a/src/main/resources/static/route/examination/field/save.html b/src/main/resources/static/route/examination/field/save.html index c67c843..c111a71 100644 --- a/src/main/resources/static/route/examination/field/save.html +++ b/src/main/resources/static/route/examination/field/save.html @@ -84,10 +84,12 @@ -
- -
- +
+ +
+ + +
diff --git a/src/main/resources/static/route/examination/field/update.html b/src/main/resources/static/route/examination/field/update.html index f6396a9..18967b6 100644 --- a/src/main/resources/static/route/examination/field/update.html +++ b/src/main/resources/static/route/examination/field/update.html @@ -84,10 +84,18 @@
-
- -
- + + + + + + +
+ +
+ + +
diff --git a/src/main/resources/static/route/examination/station/list.html b/src/main/resources/static/route/examination/station/list.html index 5e31021..023fa01 100644 --- a/src/main/resources/static/route/examination/station/list.html +++ b/src/main/resources/static/route/examination/station/list.html @@ -35,16 +35,30 @@
@@ -87,7 +101,7 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'institutionImage', width: 180, title: '机构图片', align:'center', + {field: 'institutionImage', width: 100, title: '机构图片', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -96,7 +110,7 @@ var value='
    '; var datas = rowData.split(','); for(var i = 0, item = datas[i]; item = datas[i++];) { - value += '
  • ' + row[
  • '; + value += '
  • ' + row[
  • '; } value += '
'; setTimeout(function() { @@ -107,7 +121,7 @@ return value; } }, - {field: 'institutionName', width: 180, title: '机构名称', align:'center', + {field: 'institutionName', width: 230, title: '机构名称', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -116,7 +130,7 @@ return rowData; } }, - {field: 'institutionFoundingTime', width: 180, title: '机构成立时间', align:'center', + {field: 'institutionFoundingTime', width: 150, title: '机构成立时间', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -125,7 +139,7 @@ return rowData; } }, - {field: 'institutionPrincipal', width: 180, title: '机构负责人', align:'center', + {field: 'institutionPrincipal', width: 150, title: '机构负责人', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -142,19 +156,19 @@ } return rowData; } - }, - {field:'institutionButton',fixed: 'right', width:150, title: '考场管理', align:'center', - templet: function(row) { - var rowData = row[this.field]; - return '考场管理'; - } - }, - {field:'institutionUserButton',fixed: 'right', width:150, title: '机构人员管理', align:'center', - templet: function(row) { - var rowData = row[this.field]; - return '机构人员管理'; - } - } + }// }, + // {field:'institutionButton',fixed: 'right', width:150, title: '考场管理', align:'center', + // templet: function(row) { + // var rowData = row[this.field]; + // return '考场管理'; + // } + // }, + // {field:'institutionUserButton',fixed: 'right', width:150, title: '机构管理人员', align:'center', + // templet: function(row) { + // var rowData = row[this.field]; + // return '机构管理人员'; + // } + // } ] ], page: true, @@ -201,7 +215,7 @@ if(layEvent === 'institutionUserButton') { top.dialog.open({ url: top.restAjax.path('route/examination/stationuser/list.html?stationId={stationId}', [data.institutionId]), - title: data.institutionName + "[人员信息]", + title: data.institutionName + "[管理人员]", width: '500px', height: '80%', onClose: function() { @@ -307,6 +321,44 @@ } removeData(ids); } + }else if(layEvent === 'institutionButton') { + if(checkDatas.length === 0) { + top.dialog.msg(top.dataMessage.table.selectEdit); + } else if(checkDatas.length > 1) { + top.dialog.msg(top.dataMessage.table.selectOneEdit); + } else { + top.layer.open({ + type: 2, + title: checkDatas[0].institutionName + " . 考场管理", + closeBtn: 1, + area: ['90%', '90%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/examination/field/list.html?institutionId={institutionId}', [checkDatas[0].institutionId]), + end: function() { + reloadTable(); + } + }); + } + }else if(layEvent === 'institutionUserButton') { + if(checkDatas.length === 0) { + top.dialog.msg(top.dataMessage.table.selectEdit); + } else if(checkDatas.length > 1) { + top.dialog.msg(top.dataMessage.table.selectOneEdit); + } else { + top.layer.open({ + type: 2, + title: checkDatas[0].institutionName + " . 人员管理", + closeBtn: 1, + area: ['500px', '90%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/examination/stationuser/list.html?stationId={stationId}', [checkDatas[0].institutionId]), + end: function() { + reloadTable(); + } + }); + } } }); }); diff --git a/src/main/resources/static/route/examination/stationuser/list.html b/src/main/resources/static/route/examination/stationuser/list.html index b3af117..084e1d4 100644 --- a/src/main/resources/static/route/examination/stationuser/list.html +++ b/src/main/resources/static/route/examination/stationuser/list.html @@ -88,7 +88,7 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'stationUserUserName', width: 308, title: '考点人员姓名', align:'center', + {field: 'stationUserUserName', width: 308, title: '管理人员姓名', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { diff --git a/src/main/resources/templates/index3.html b/src/main/resources/templates/index3.html new file mode 100644 index 0000000..ba063ed --- /dev/null +++ b/src/main/resources/templates/index3.html @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + +
+ + + +
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
待分配申请
+
0
+
+
+
+
+ +
+
+
考场数量
+
0
+
+
+
+
+ +
+
+
考试分配总数
+
0
+
+
+
+
+ +
+
+
+
+ 最近待分配申请 +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file