考点分配功能, 考场信息功能

This commit is contained in:
cuibaocheng 2021-05-02 18:23:26 +08:00
parent deef8cb07e
commit a849dff02f
29 changed files with 4327 additions and 14 deletions

View File

@ -0,0 +1,110 @@
package cn.com.tenlion.controller.api.examination.distribution;
import cn.com.tenlion.pojo.dtos.distribution.DistributionDTO;
import cn.com.tenlion.pojo.vos.distribution.DistributionVO;
import cn.com.tenlion.service.examination.distribution.IDistributionService;
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: DistributionController
* @Description: 考场分配
* @Author: CodeFactory
* @Date: 2021-05-02 10:59:28
* @Version: 3.0
**/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "考场分配接口")
@RestController
@RequestMapping(ISystemConstant.API_PREFIX + "/distribution")
public class DistributionController extends DefaultBaseController {
@Autowired
private IDistributionService distributionService;
@ApiOperation(value = "新增考场分配", notes = "新增考场分配接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save")
@CheckRequestBodyAnnotation
public SuccessResult save(@RequestBody DistributionVO distributionVO) {
distributionService.save(distributionVO);
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) {
distributionService.remove(Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}
@ApiOperation(value = "修改考场分配", notes = "修改考场分配接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "distributionId", value = "考场分配ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update/{distributionId}")
@CheckRequestBodyAnnotation
public SuccessResult update(@PathVariable("distributionId") String distributionId, @RequestBody DistributionVO distributionVO) {
distributionService.update(distributionId, distributionVO);
return new SuccessResult();
}
@ApiOperation(value = "考场分配详情", notes = "考场分配详情接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "distributionId", value = "考场分配ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{distributionId}")
public DistributionDTO get(@PathVariable("distributionId") String distributionId) {
return distributionService.get(distributionId);
}
@ApiOperation(value = "考场分配列表", notes = "考场分配列表接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list")
public List<DistributionDTO> list() {
Map<String, Object> params = requestParams();
return distributionService.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("listpage")
public SuccessResultList<List<DistributionDTO>> listPage(ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return distributionService.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<>(distributionService.count(params));
}
}

View File

@ -0,0 +1,113 @@
package cn.com.tenlion.controller.api.examination.stationuser;
import cn.com.tenlion.service.examination.stationuser.IStationUserService;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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 cn.com.tenlion.pojo.dtos.stationuser.StationUserDTO;
import cn.com.tenlion.pojo.vos.stationuser.StationUserVO;
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: StationUserController
* @Description:
* @Author: CodeFactory
* @Date: 2021-05-02 15:19:56
* @Version: 3.0
**/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口")
@RestController
@RequestMapping(ISystemConstant.API_PREFIX + "/stationuser")
public class StationUserController extends DefaultBaseController {
@Autowired
private IStationUserService stationUserService;
@ApiOperation(value = "新增", notes = "新增接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save/{stationId}")
@CheckRequestBodyAnnotation
public SuccessResult save(@PathVariable("stationId") String stationId, @RequestBody JSONObject obj) {
JSONArray array = obj.getJSONArray("stationUserVOList");
stationUserService.saveUser(stationId, array);
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) {
stationUserService.remove(Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}
@ApiOperation(value = "修改", notes = "修改接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "stationUserId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update/{stationUserId}")
@CheckRequestBodyAnnotation
public SuccessResult update(@PathVariable("stationUserId") String stationUserId, @RequestBody StationUserVO stationUserVO) {
stationUserService.update(stationUserId, stationUserVO);
return new SuccessResult();
}
@ApiOperation(value = "详情", notes = "详情接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "stationUserId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{stationUserId}")
public StationUserDTO get(@PathVariable("stationUserId") String stationUserId) {
return stationUserService.get(stationUserId);
}
@ApiOperation(value = "列表", notes = "列表接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list")
public List<StationUserDTO> list() {
Map<String, Object> params = requestParams();
return stationUserService.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("listpage")
public SuccessResultList<List<StationUserDTO>> listPage(ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return stationUserService.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<>(stationUserService.count(params));
}
}

View File

@ -0,0 +1,120 @@
package cn.com.tenlion.dao.examination.distribution;
import cn.com.tenlion.pojo.bos.distribution.DistributionBO;
import cn.com.tenlion.pojo.dtos.distribution.DistributionDTO;
import cn.com.tenlion.pojo.pos.distribution.DistributionPO;
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: IDistributionDao
* @Description: 考场分配
* @Author: CodeFactory
* @Date: 2021-05-02 10:59:28
* @Version: 3.0
**/
@Repository
public interface IDistributionDao {
/**
* 新增考场分配
*
* @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
*/
DistributionDTO get(Map<String, Object> params) throws SearchException;
/**
* 考场分配详情
*
* @param params
* @return
* @throws SearchException
*/
DistributionBO getBO(Map<String, Object> params) throws SearchException;
/**
* 考场分配详情
*
* @param params
* @return
* @throws SearchException
*/
DistributionPO getPO(Map<String, Object> params) throws SearchException;
/**
* 考场分配列表
*
* @param params
* @return
* @throws SearchException
*/
List<DistributionDTO> list(Map<String, Object> params) throws SearchException;
/**
* 考场分配列表
*
* @param params
* @return
* @throws SearchException
*/
List<DistributionBO> listBO(Map<String, Object> params) throws SearchException;
/**
* 考场分配列表
*
* @param params
* @return
* @throws SearchException
*/
List<DistributionPO> listPO(Map<String, Object> params) throws SearchException;
/**
* 考场分配统计
*
* @param params
* @return
* @throws SearchException
*/
Integer count(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,123 @@
package cn.com.tenlion.dao.examination.stationuser;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import cn.com.tenlion.pojo.bos.stationuser.StationUserBO;
import cn.com.tenlion.pojo.pos.stationuser.StationUserPO;
import cn.com.tenlion.pojo.dtos.stationuser.StationUserDTO;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IStationUserDao
* @Description:
* @Author: CodeFactory
* @Date: 2021-05-02 15:19:56
* @Version: 3.0
**/
@Repository
public interface IStationUserDao {
/**
* 新增
*
* @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
*/
StationUserDTO get(Map<String, Object> params) throws SearchException;
/**
* 详情
*
* @param params
* @return
* @throws SearchException
*/
StationUserBO getBO(Map<String, Object> params) throws SearchException;
/**
* 详情
*
* @param params
* @return
* @throws SearchException
*/
StationUserPO getPO(Map<String, Object> params) throws SearchException;
/**
* 列表
*
* @param params
* @return
* @throws SearchException
*/
List<StationUserDTO> list(Map<String, Object> params) throws SearchException;
/**
* 列表
*
* @param params
* @return
* @throws SearchException
*/
List<StationUserBO> listBO(Map<String, Object> params) throws SearchException;
/**
* 列表
*
* @param params
* @return
* @throws SearchException
*/
List<StationUserPO> listPO(Map<String, Object> params) throws SearchException;
/**
* 统计
*
* @param params
* @return
* @throws SearchException
*/
Integer count(Map<String, Object> params) throws SearchException;
String getStationByUserIdAndStationId(Map<String, Object> params) throws SearchException;
List<String> getStationByUserId(String userId) throws SearchException;
}

View File

@ -0,0 +1,152 @@
package cn.com.tenlion.pojo.bos.distribution;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: DistributionBO
* @Description: 考场分配
* @Author: CodeFactory
* @Date: 2021-05-02 10:59:28
* @Version: 3.0
**/
public class DistributionBO {
private String distributionId;
private String planId;
private String distributionTime;
private String distributionFields;
private String distributionStatus;
private Integer distributionNumber;
private String distributionRemark;
private String creator;
private String gmtCreate;
private String modifier;
private String gmtModified;
private Integer isDelete;
private String planName;
private String stationId;
private String distributionAllotTime;
public String getPlanName() {
return planName == null ? "" : planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public String getStationId() {
return stationId == null ? "" : stationId;
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getDistributionAllotTime() {
return distributionAllotTime == null ? "" : distributionAllotTime;
}
public void setDistributionAllotTime(String distributionAllotTime) {
this.distributionAllotTime = distributionAllotTime;
}
public String getDistributionId() {
return distributionId == null ? "" : distributionId.trim();
}
public void setDistributionId(String distributionId) {
this.distributionId = distributionId;
}
public String getPlanId() {
return planId == null ? "" : planId.trim();
}
public void setPlanId(String planId) {
this.planId = planId;
}
public String getDistributionTime() {
return distributionTime == null ? "" : distributionTime.trim();
}
public void setDistributionTime(String distributionTime) {
this.distributionTime = distributionTime;
}
public String getDistributionFields() {
return distributionFields == null ? "" : distributionFields.trim();
}
public void setDistributionFields(String distributionFields) {
this.distributionFields = distributionFields;
}
public String getDistributionStatus() {
return distributionStatus == null ? "" : distributionStatus.trim();
}
public void setDistributionStatus(String distributionStatus) {
this.distributionStatus = distributionStatus;
}
public Integer getDistributionNumber() {
return distributionNumber == null ? 0 : distributionNumber;
}
public void setDistributionNumber(Integer distributionNumber) {
this.distributionNumber = distributionNumber;
}
public String getDistributionRemark() {
return distributionRemark == null ? "" : distributionRemark.trim();
}
public void setDistributionRemark(String distributionRemark) {
this.distributionRemark = distributionRemark;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,96 @@
package cn.com.tenlion.pojo.bos.stationuser;
/**
*
* @ClassName: StationUserBO
* @Description:
* @Author: CodeFactory
* @Date: 2021-05-02 15:19:56
* @Version: 3.0
**/
public class StationUserBO {
private String stationUserId;
private String stationId;
private String stationUserUserId;
private String stationUserUserName;
private String creator;
private String gmtCreate;
private String modifier;
private String gmtModified;
private Integer isDelete;
public String getStationUserId() {
return stationUserId == null ? "" : stationUserId.trim();
}
public void setStationUserId(String stationUserId) {
this.stationUserId = stationUserId;
}
public String getStationId() {
return stationId == null ? "" : stationId.trim();
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getStationUserUserId() {
return stationUserUserId == null ? "" : stationUserUserId.trim();
}
public void setStationUserUserId(String stationUserUserId) {
this.stationUserUserId = stationUserUserId;
}
public String getStationUserUserName() {
return stationUserUserName == null ? "" : stationUserUserName.trim();
}
public void setStationUserUserName(String stationUserUserName) {
this.stationUserUserName = stationUserUserName;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,182 @@
package cn.com.tenlion.pojo.dtos.distribution;
import cn.com.tenlion.organizationmanagement.pojo.dtos.organization.OrganizationDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/**
*
* @ClassName: DistributionDTO
* @Description: 考场分配
* @Author: CodeFactory
* @Date: 2021-05-02 10:59:28
* @Version: 3.0
**/
@ApiModel
public class DistributionDTO {
@ApiModelProperty(name = "distributionId", value = "考场分配")
private String distributionId;
@ApiModelProperty(name = "planId", value = "计划ID")
private String planId;
@ApiModelProperty(name = "distributionTime", value = "最终分配时间")
private String distributionTime;
@ApiModelProperty(name = "distributionFields", value = "最终分配考场,多个")
private String distributionFields;
@ApiModelProperty(name = "distributionStatus", value = "1:分配成功,0:分配退回")
private String distributionStatus;
@ApiModelProperty(name = "distributionNumber", value = "考试人数")
private Integer distributionNumber;
@ApiModelProperty(name = "distributionRemark", value = "备注信息")
private String distributionRemark;
@ApiModelProperty(name = "creator", value = "")
private String creator;
@ApiModelProperty(name = "gmtCreate", value = "")
private String gmtCreate;
@ApiModelProperty(name = "modifier", value = "")
private String modifier;
@ApiModelProperty(name = "gmtModified", value = "")
private String gmtModified;
@ApiModelProperty(name = "isDelete", value = "")
private Integer isDelete;
@ApiModelProperty(name = "planName", value = "")
private String planName;
@ApiModelProperty(name = "stationId", value = "")
private String stationId;
@ApiModelProperty(name = "distributionAllotTime", value = "")
private String distributionAllotTime;
@ApiModelProperty(name = "distributionFieldList", value = "")
private List<OrganizationDTO> distributionFieldList;
public List<OrganizationDTO> getDistributionFieldList() {
return distributionFieldList;
}
public void setDistributionFieldList(List<OrganizationDTO> distributionFieldList) {
this.distributionFieldList = distributionFieldList;
}
public String getPlanName() {
return planName == null ? "" : planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public String getStationId() {
return stationId == null ? "" : stationId;
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getDistributionAllotTime() {
return distributionAllotTime == null ? "" : distributionAllotTime;
}
public void setDistributionAllotTime(String distributionAllotTime) {
this.distributionAllotTime = distributionAllotTime;
}
public String getDistributionId() {
return distributionId == null ? "" : distributionId.trim();
}
public void setDistributionId(String distributionId) {
this.distributionId = distributionId;
}
public String getPlanId() {
return planId == null ? "" : planId.trim();
}
public void setPlanId(String planId) {
this.planId = planId;
}
public String getDistributionTime() {
return distributionTime == null ? "" : distributionTime.trim();
}
public void setDistributionTime(String distributionTime) {
this.distributionTime = distributionTime;
}
public String getDistributionFields() {
return distributionFields == null ? "" : distributionFields.trim();
}
public void setDistributionFields(String distributionFields) {
this.distributionFields = distributionFields;
}
public String getDistributionStatus() {
return distributionStatus == null ? "" : distributionStatus.trim();
}
public void setDistributionStatus(String distributionStatus) {
this.distributionStatus = distributionStatus;
}
public Integer getDistributionNumber() {
return distributionNumber == null ? 0 : distributionNumber;
}
public void setDistributionNumber(Integer distributionNumber) {
this.distributionNumber = distributionNumber;
}
public String getDistributionRemark() {
return distributionRemark == null ? "" : distributionRemark.trim();
}
public void setDistributionRemark(String distributionRemark) {
this.distributionRemark = distributionRemark;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,109 @@
package cn.com.tenlion.pojo.dtos.stationuser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: StationUserDTO
* @Description:
* @Author: CodeFactory
* @Date: 2021-05-02 15:19:56
* @Version: 3.0
**/
@ApiModel
public class StationUserDTO {
@ApiModelProperty(name = "stationUserId", value = "考点人员中间表")
private String stationUserId;
@ApiModelProperty(name = "stationId", value = "考点ID")
private String stationId;
@ApiModelProperty(name = "stationUserUserId", value = "考点人员ID")
private String stationUserUserId;
@ApiModelProperty(name = "stationUserUserName", value = "考点人员姓名")
private String stationUserUserName;
@ApiModelProperty(name = "creator", value = "")
private String creator;
@ApiModelProperty(name = "gmtCreate", value = "")
private String gmtCreate;
@ApiModelProperty(name = "modifier", value = "")
private String modifier;
@ApiModelProperty(name = "gmtModified", value = "")
private String gmtModified;
@ApiModelProperty(name = "isDelete", value = "")
private Integer isDelete;
public String getStationUserId() {
return stationUserId == null ? "" : stationUserId.trim();
}
public void setStationUserId(String stationUserId) {
this.stationUserId = stationUserId;
}
public String getStationId() {
return stationId == null ? "" : stationId.trim();
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getStationUserUserId() {
return stationUserUserId == null ? "" : stationUserUserId.trim();
}
public void setStationUserUserId(String stationUserUserId) {
this.stationUserUserId = stationUserUserId;
}
public String getStationUserUserName() {
return stationUserUserName == null ? "" : stationUserUserName.trim();
}
public void setStationUserUserName(String stationUserUserName) {
this.stationUserUserName = stationUserUserName;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,152 @@
package cn.com.tenlion.pojo.pos.distribution;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: DistributionPO
* @Description: 考场分配
* @Author: CodeFactory
* @Date: 2021-05-02 10:59:28
* @Version: 3.0
**/
public class DistributionPO {
private String distributionId;
private String planId;
private String distributionTime;
private String distributionFields;
private String distributionStatus;
private Integer distributionNumber;
private String distributionRemark;
private String creator;
private String gmtCreate;
private String modifier;
private String gmtModified;
private Integer isDelete;
private String planName;
private String stationId;
private String distributionAllotTime;
public String getStationId() {
return stationId == null ? "" : stationId;
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getDistributionAllotTime() {
return distributionAllotTime == null ? "" : distributionAllotTime;
}
public void setDistributionAllotTime(String distributionAllotTime) {
this.distributionAllotTime = distributionAllotTime;
}
public String getPlanName() {
return planName == null ? "" : planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public String getDistributionId() {
return distributionId == null ? "" : distributionId.trim();
}
public void setDistributionId(String distributionId) {
this.distributionId = distributionId;
}
public String getPlanId() {
return planId == null ? "" : planId.trim();
}
public void setPlanId(String planId) {
this.planId = planId;
}
public String getDistributionTime() {
return distributionTime == null ? "" : distributionTime.trim();
}
public void setDistributionTime(String distributionTime) {
this.distributionTime = distributionTime;
}
public String getDistributionFields() {
return distributionFields == null ? "" : distributionFields.trim();
}
public void setDistributionFields(String distributionFields) {
this.distributionFields = distributionFields;
}
public String getDistributionStatus() {
return distributionStatus == null ? "" : distributionStatus.trim();
}
public void setDistributionStatus(String distributionStatus) {
this.distributionStatus = distributionStatus;
}
public Integer getDistributionNumber() {
return distributionNumber == null ? 0 : distributionNumber;
}
public void setDistributionNumber(Integer distributionNumber) {
this.distributionNumber = distributionNumber;
}
public String getDistributionRemark() {
return distributionRemark == null ? "" : distributionRemark.trim();
}
public void setDistributionRemark(String distributionRemark) {
this.distributionRemark = distributionRemark;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,96 @@
package cn.com.tenlion.pojo.pos.stationuser;
/**
*
* @ClassName: StationUserPO
* @Description:
* @Author: CodeFactory
* @Date: 2021-05-02 15:19:56
* @Version: 3.0
**/
public class StationUserPO {
private String stationUserId;
private String stationId;
private String stationUserUserId;
private String stationUserUserName;
private String creator;
private String gmtCreate;
private String modifier;
private String gmtModified;
private Integer isDelete;
public String getStationUserId() {
return stationUserId == null ? "" : stationUserId.trim();
}
public void setStationUserId(String stationUserId) {
this.stationUserId = stationUserId;
}
public String getStationId() {
return stationId == null ? "" : stationId.trim();
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getStationUserUserId() {
return stationUserUserId == null ? "" : stationUserUserId.trim();
}
public void setStationUserUserId(String stationUserUserId) {
this.stationUserUserId = stationUserUserId;
}
public String getStationUserUserName() {
return stationUserUserName == null ? "" : stationUserUserName.trim();
}
public void setStationUserUserName(String stationUserUserName) {
this.stationUserUserName = stationUserUserName;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,112 @@
package cn.com.tenlion.pojo.vos.distribution;
import ink.wgink.annotation.CheckEmptyAnnotation;
import ink.wgink.annotation.CheckNumberAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: DistributionVO
* @Description: 考场分配
* @Author: CodeFactory
* @Date: 2021-05-02 10:59:28
* @Version: 3.0
**/
@ApiModel
public class DistributionVO {
@ApiModelProperty(name = "planId", value = "计划ID")
private String planId;
@ApiModelProperty(name = "distributionTime", value = "最终分配时间")
private String distributionTime;
@ApiModelProperty(name = "distributionFields", value = "最终分配考场,多个")
private String distributionFields;
@ApiModelProperty(name = "distributionStatus", value = "1:分配成功,0:分配退回")
private String distributionStatus;
@ApiModelProperty(name = "distributionNumber", value = "考试人数")
@CheckNumberAnnotation(name = "考试人数")
private Integer distributionNumber;
@ApiModelProperty(name = "distributionRemark", value = "备注信息")
private String distributionRemark;
@ApiModelProperty(name = "planName", value = "")
private String planName;
@ApiModelProperty(name = "stationId", value = "")
private String stationId;
@ApiModelProperty(name = "distributionAllotTime", value = "")
private String distributionAllotTime;
public String getPlanName() {
return planName == null ? "" : planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public String getStationId() {
return stationId == null ? "" : stationId;
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getDistributionAllotTime() {
return distributionAllotTime == null ? "" : distributionAllotTime;
}
public void setDistributionAllotTime(String distributionAllotTime) {
this.distributionAllotTime = distributionAllotTime;
}
public String getPlanId() {
return planId == null ? "" : planId.trim();
}
public void setPlanId(String planId) {
this.planId = planId;
}
public String getDistributionTime() {
return distributionTime == null ? "" : distributionTime.trim();
}
public void setDistributionTime(String distributionTime) {
this.distributionTime = distributionTime;
}
public String getDistributionFields() {
return distributionFields == null ? "" : distributionFields.trim();
}
public void setDistributionFields(String distributionFields) {
this.distributionFields = distributionFields;
}
public String getDistributionStatus() {
return distributionStatus == null ? "" : distributionStatus.trim();
}
public void setDistributionStatus(String distributionStatus) {
this.distributionStatus = distributionStatus;
}
public Integer getDistributionNumber() {
return distributionNumber == null ? 0 : distributionNumber;
}
public void setDistributionNumber(Integer distributionNumber) {
this.distributionNumber = distributionNumber;
}
public String getDistributionRemark() {
return distributionRemark == null ? "" : distributionRemark.trim();
}
public void setDistributionRemark(String distributionRemark) {
this.distributionRemark = distributionRemark;
}
}

View File

@ -0,0 +1,51 @@
package cn.com.tenlion.pojo.vos.stationuser;
import ink.wgink.annotation.CheckEmptyAnnotation;
import ink.wgink.annotation.CheckNumberAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: StationUserVO
* @Description:
* @Author: CodeFactory
* @Date: 2021-05-02 15:19:56
* @Version: 3.0
**/
@ApiModel
public class StationUserVO {
@ApiModelProperty(name = "stationId", value = "考点ID")
private String stationId;
@ApiModelProperty(name = "stationUserUserId", value = "考点人员ID")
private String stationUserUserId;
@ApiModelProperty(name = "stationUserUserName", value = "考点人员姓名")
private String stationUserUserName;
public String getStationId() {
return stationId == null ? "" : stationId.trim();
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getStationUserUserId() {
return stationUserUserId == null ? "" : stationUserUserId.trim();
}
public void setStationUserUserId(String stationUserUserId) {
this.stationUserUserId = stationUserUserId;
}
public String getStationUserUserName() {
return stationUserUserName == null ? "" : stationUserUserName.trim();
}
public void setStationUserUserName(String stationUserUserName) {
this.stationUserUserName = stationUserUserName;
}
}

View File

@ -0,0 +1,187 @@
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.pos.distribution.DistributionPO;
import cn.com.tenlion.pojo.vos.distribution.DistributionVO;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResultList;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IDistributionService
* @Description: 考场分配
* @Author: CodeFactory
* @Date: 2021-05-02 10:59:28
* @Version: 3.0
**/
public interface IDistributionService {
/**
* 新增考场分配
*
* @param distributionVO
* @return
*/
void save(DistributionVO distributionVO);
/**
* 新增考场分配
*
* @param token
* @param distributionVO
* @return
*/
void save(String token, DistributionVO distributionVO);
/**
* 新增考场分配
*
* @param distributionVO
* @return distributionId
*/
String saveReturnId(DistributionVO distributionVO);
/**
* 新增考场分配
*
* @param token
* @param distributionVO
* @return distributionId
*/
String saveReturnId(String token, DistributionVO distributionVO);
/**
* 删除考场分配
*
* @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 distributionId
* @param distributionVO
* @return
*/
void update(String distributionId, DistributionVO distributionVO);
/**
* 修改考场分配
*
* @param token
* @param distributionId
* @param distributionVO
* @return
*/
void update(String token, String distributionId, DistributionVO distributionVO);
/**
* 考场分配详情
*
* @param params 参数Map
* @return
*/
DistributionDTO get(Map<String, Object> params);
/**
* 考场分配详情
*
* @param distributionId
* @return
*/
DistributionDTO get(String distributionId);
/**
* 考场分配详情
*
* @param params 参数Map
* @return
*/
DistributionBO getBO(Map<String, Object> params);
/**
* 考场分配详情
*
* @param distributionId
* @return
*/
DistributionBO getBO(String distributionId);
/**
* 考场分配详情
*
* @param params 参数Map
* @return
*/
DistributionPO getPO(Map<String, Object> params);
/**
* 考场分配详情
*
* @param distributionId
* @return
*/
DistributionPO getPO(String distributionId);
/**
* 考场分配列表
*
* @param params
* @return
*/
List<DistributionDTO> list(Map<String, Object> params);
/**
* 考场分配列表
*
* @param params
* @return
*/
List<DistributionBO> listBO(Map<String, Object> params);
/**
* 考场分配列表
*
* @param params
* @return
*/
List<DistributionPO> listPO(Map<String, Object> params);
/**
* 考场分配分页列表
*
* @param page
* @return
*/
SuccessResultList<List<DistributionDTO>> listPage(ListPage page);
/**
* 考场分配统计
*
* @param params
* @return
*/
Integer count(Map<String, Object> params);
}

View File

@ -0,0 +1,204 @@
package cn.com.tenlion.service.examination.distribution.impl;
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.distribution.DistributionDTO;
import cn.com.tenlion.pojo.pos.distribution.DistributionPO;
import cn.com.tenlion.pojo.vos.distribution.DistributionVO;
import cn.com.tenlion.service.examination.distribution.IDistributionService;
import cn.com.tenlion.service.examination.stationuser.IStationUserService;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.common.component.SecurityComponent;
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: DistributionServiceImpl
* @Description: 考场分配
* @Author: CodeFactory
* @Date: 2021-05-02 10:59:28
* @Version: 3.0
**/
@Service
public class DistributionServiceImpl extends DefaultBaseService implements IDistributionService {
@Autowired
private IDistributionDao distributionDao;
@Autowired
private IStationUserService iStationUserService;
@Autowired
private IOrganizationService iOrganizationService;
@Override
public void save(DistributionVO distributionVO) {
saveReturnId(distributionVO);
}
@Override
public void save(String token, DistributionVO distributionVO) {
saveReturnId(token, distributionVO);
}
@Override
public String saveReturnId(DistributionVO distributionVO) {
return saveReturnId(null, distributionVO);
}
@Override
public String saveReturnId(String token, DistributionVO distributionVO) {
String distributionId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(distributionVO);
params.put("distributionId", distributionId);
if (StringUtils.isBlank(token)) {
setSaveInfo(params);
} else {
setAppSaveInfo(token, params);
}
distributionDao.save(params);
return distributionId;
}
@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("distributionIds", ids);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
distributionDao.remove(params);
}
@Override
public void delete(List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("distributionIds", ids);
distributionDao.delete(params);
}
@Override
public void update(String distributionId, DistributionVO distributionVO) {
update(null, distributionId, distributionVO);
}
@Override
public void update(String token, String distributionId, DistributionVO distributionVO) {
Map<String, Object> params = HashMapUtil.beanToMap(distributionVO);
params.put("distributionId", distributionId);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
distributionDao.update(params);
}
@Override
public DistributionDTO get(Map<String, Object> params) {
return distributionDao.get(params);
}
@Override
public DistributionDTO get(String distributionId) {
Map<String, Object> params = super.getHashMap(2);
params.put("distributionId", distributionId);
return get(params);
}
@Override
public DistributionBO getBO(Map<String, Object> params) {
return distributionDao.getBO(params);
}
@Override
public DistributionBO getBO(String distributionId) {
Map<String, Object> params = super.getHashMap(2);
params.put("distributionId", distributionId);
return getBO(params);
}
@Override
public DistributionPO getPO(Map<String, Object> params) {
return distributionDao.getPO(params);
}
@Override
public DistributionPO getPO(String distributionId) {
Map<String, Object> params = super.getHashMap(2);
params.put("distributionId", distributionId);
return getPO(params);
}
@Override
public List<DistributionDTO> list(Map<String, Object> params) {
return distributionDao.list(params);
}
@Override
public List<DistributionBO> listBO(Map<String, Object> params) {
return distributionDao.listBO(params);
}
@Override
public List<DistributionPO> listPO(Map<String, Object> params) {
return distributionDao.listPO(params);
}
@Override
public SuccessResultList<List<DistributionDTO>> listPage(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
/**
* 查出当前人员绑定的考点人员配置
* 只显示已经绑定考点的信息
*/
String userId = securityComponent.getCurrentUser().getUserId();
List<String> stationIdList = iStationUserService.getStationByUserId(userId);
/**
* 防止无权限的人员进行查看
*/
if(stationIdList == null || stationIdList.size() < 1 && !"1".equals(userId)) {
List<DistributionDTO> distributionDTOs = new ArrayList<DistributionDTO>();
PageInfo<DistributionDTO> pageInfo = new PageInfo<>(distributionDTOs);
return new SuccessResultList<>(distributionDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
page.getParams().put("stationIdList", stationIdList);
List<DistributionDTO> distributionDTOs = list(page.getParams());
/**
* 回显考场
*/
for(DistributionDTO dto: distributionDTOs) {
String[] arr = dto.getDistributionFields().split(",");
List<OrganizationDTO> distributionFieldList = new ArrayList<OrganizationDTO>();
for(String id: arr) {
OrganizationDTO organizationDTO = iOrganizationService.get(id);
distributionFieldList.add(organizationDTO);
}
dto.setDistributionFieldList(distributionFieldList);
}
PageInfo<DistributionDTO> pageInfo = new PageInfo<>(distributionDTOs);
return new SuccessResultList<>(distributionDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer count(Map<String, Object> params) {
Integer count = distributionDao.count(params);
return count == null ? 0 : count;
}
}

View File

@ -0,0 +1,204 @@
package cn.com.tenlion.service.examination.stationuser;
import com.alibaba.fastjson.JSONArray;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import cn.com.tenlion.pojo.dtos.stationuser.StationUserDTO;
import cn.com.tenlion.pojo.vos.stationuser.StationUserVO;
import cn.com.tenlion.pojo.bos.stationuser.StationUserBO;
import cn.com.tenlion.pojo.pos.stationuser.StationUserPO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IStationUserService
* @Description:
* @Author: CodeFactory
* @Date: 2021-05-02 15:19:56
* @Version: 3.0
**/
public interface IStationUserService {
/**
* 新增
*
* @param stationUserVO
* @return
*/
void save(StationUserVO stationUserVO);
/**
* 新增
*
* @param token
* @param stationUserVO
* @return
*/
void save(String token, StationUserVO stationUserVO);
/**
* 新增
*
* @param stationUserVO
* @return stationUserId
*/
String saveReturnId(StationUserVO stationUserVO);
/**
* 新增
*
* @param token
* @param stationUserVO
* @return stationUserId
*/
String saveReturnId(String token, StationUserVO stationUserVO);
/**
* 删除
*
* @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 stationUserId
* @param stationUserVO
* @return
*/
void update(String stationUserId, StationUserVO stationUserVO);
/**
* 修改
*
* @param token
* @param stationUserId
* @param stationUserVO
* @return
*/
void update(String token, String stationUserId, StationUserVO stationUserVO);
/**
* 详情
*
* @param params 参数Map
* @return
*/
StationUserDTO get(Map<String, Object> params);
/**
* 详情
*
* @param stationUserId
* @return
*/
StationUserDTO get(String stationUserId);
/**
* 详情
*
* @param params 参数Map
* @return
*/
StationUserBO getBO(Map<String, Object> params);
/**
* 详情
*
* @param stationUserId
* @return
*/
StationUserBO getBO(String stationUserId);
/**
* 详情
*
* @param params 参数Map
* @return
*/
StationUserPO getPO(Map<String, Object> params);
/**
* 详情
*
* @param stationUserId
* @return
*/
StationUserPO getPO(String stationUserId);
/**
* 列表
*
* @param params
* @return
*/
List<StationUserDTO> list(Map<String, Object> params);
/**
* 列表
*
* @param params
* @return
*/
List<StationUserBO> listBO(Map<String, Object> params);
/**
* 列表
*
* @param params
* @return
*/
List<StationUserPO> listPO(Map<String, Object> params);
/**
* 分页列表
*
* @param page
* @return
*/
SuccessResultList<List<StationUserDTO>> listPage(ListPage page);
/**
* 统计
*
* @param params
* @return
*/
Integer count(Map<String, Object> params);
/**
* 将用户存储到对应考试点关系
* @param stationId
* @param array
* @return
*/
SuccessResult saveUser(String stationId, JSONArray array);
/**
* 获取该用户可以操作的考试点ID集合
* @param userId
* @return
*/
List<String> getStationByUserId(String userId);
}

View File

@ -0,0 +1,196 @@
package cn.com.tenlion.service.examination.stationuser.impl;
import cn.com.tenlion.dao.examination.stationuser.IStationUserDao;
import cn.com.tenlion.service.examination.stationuser.IStationUserService;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
import cn.com.tenlion.pojo.dtos.stationuser.StationUserDTO;
import cn.com.tenlion.pojo.vos.stationuser.StationUserVO;
import cn.com.tenlion.pojo.bos.stationuser.StationUserBO;
import cn.com.tenlion.pojo.pos.stationuser.StationUserPO;
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: StationUserServiceImpl
* @Description:
* @Author: CodeFactory
* @Date: 2021-05-02 15:19:56
* @Version: 3.0
**/
@Service
public class StationUserServiceImpl extends DefaultBaseService implements IStationUserService {
@Autowired
private IStationUserDao stationUserDao;
@Override
public void save(StationUserVO stationUserVO) {
saveReturnId(stationUserVO);
}
@Override
public void save(String token, StationUserVO stationUserVO) {
saveReturnId(token, stationUserVO);
}
@Override
public String saveReturnId(StationUserVO stationUserVO) {
return saveReturnId(null, stationUserVO);
}
@Override
public String saveReturnId(String token, StationUserVO stationUserVO) {
String stationUserId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(stationUserVO);
params.put("stationUserId", stationUserId);
if (StringUtils.isBlank(token)) {
setSaveInfo(params);
} else {
setAppSaveInfo(token, params);
}
stationUserDao.save(params);
return stationUserId;
}
@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("stationUserIds", ids);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
stationUserDao.remove(params);
}
@Override
public void delete(List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("stationUserIds", ids);
stationUserDao.delete(params);
}
@Override
public void update(String stationUserId, StationUserVO stationUserVO) {
update(null, stationUserId, stationUserVO);
}
@Override
public void update(String token, String stationUserId, StationUserVO stationUserVO) {
Map<String, Object> params = HashMapUtil.beanToMap(stationUserVO);
params.put("stationUserId", stationUserId);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
stationUserDao.update(params);
}
@Override
public StationUserDTO get(Map<String, Object> params) {
return stationUserDao.get(params);
}
@Override
public StationUserDTO get(String stationUserId) {
Map<String, Object> params = super.getHashMap(2);
params.put("stationUserId", stationUserId);
return get(params);
}
@Override
public StationUserBO getBO(Map<String, Object> params) {
return stationUserDao.getBO(params);
}
@Override
public StationUserBO getBO(String stationUserId) {
Map<String, Object> params = super.getHashMap(2);
params.put("stationUserId", stationUserId);
return getBO(params);
}
@Override
public StationUserPO getPO(Map<String, Object> params) {
return stationUserDao.getPO(params);
}
@Override
public StationUserPO getPO(String stationUserId) {
Map<String, Object> params = super.getHashMap(2);
params.put("stationUserId", stationUserId);
return getPO(params);
}
@Override
public List<StationUserDTO> list(Map<String, Object> params) {
return stationUserDao.list(params);
}
@Override
public List<StationUserBO> listBO(Map<String, Object> params) {
return stationUserDao.listBO(params);
}
@Override
public List<StationUserPO> listPO(Map<String, Object> params) {
return stationUserDao.listPO(params);
}
@Override
public SuccessResultList<List<StationUserDTO>> listPage(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
List<StationUserDTO> stationUserDTOs = list(page.getParams());
PageInfo<StationUserDTO> pageInfo = new PageInfo<>(stationUserDTOs);
return new SuccessResultList<>(stationUserDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer count(Map<String, Object> params) {
Integer count = stationUserDao.count(params);
return count == null ? 0 : count;
}
@Override
public SuccessResult saveUser(String stationId, JSONArray array) {
for(int i = 0 ; i < array.size() ; i++) {
JSONObject obj = array.getJSONObject(i);
String stationUserId = UUIDUtil.getUUID();
Map<String, Object> params = new HashMap<String, Object>();
params.put("stationUserId", stationUserId);
params.put("stationId", stationId);
params.put("stationUserUserId", obj.getString("stationUserUserId"));
params.put("stationUserUserName", obj.getString("stationUserUserName"));
setSaveInfo(params);
String stationUser = stationUserDao.getStationByUserIdAndStationId(params);
if(StringUtils.isEmpty(stationUser)) {
stationUserDao.save(params);
}
}
return new SuccessResult();
}
@Override
public List<String> getStationByUserId(String userId) {
return stationUserDao.getStationByUserId(userId);
}
}

View File

@ -0,0 +1,395 @@
<?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.distribution.IDistributionDao">
<resultMap id="distributionDTO" type="cn.com.tenlion.pojo.dtos.distribution.DistributionDTO">
<result column="distribution_id" property="distributionId"/>
<result column="plan_id" property="planId"/>
<result column="distribution_time" property="distributionTime"/>
<result column="distribution_fields" property="distributionFields"/>
<result column="distribution_status" property="distributionStatus"/>
<result column="distribution_number" property="distributionNumber"/>
<result column="distribution_remark" property="distributionRemark"/>
<result column="plan_name" property="planName"/>
<result column="station_id" property="stationId"/>
<result column="distribution_allot_time" property="distributionAllotTime"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="distributionBO" type="cn.com.tenlion.pojo.bos.distribution.DistributionBO">
<result column="distribution_id" property="distributionId"/>
<result column="plan_id" property="planId"/>
<result column="distribution_time" property="distributionTime"/>
<result column="distribution_fields" property="distributionFields"/>
<result column="distribution_status" property="distributionStatus"/>
<result column="distribution_number" property="distributionNumber"/>
<result column="distribution_remark" property="distributionRemark"/>
<result column="plan_name" property="planName"/>
<result column="station_id" property="stationId"/>
<result column="distribution_allot_time" property="distributionAllotTime"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="distributionPO" type="cn.com.tenlion.pojo.pos.distribution.DistributionPO">
<result column="distribution_id" property="distributionId"/>
<result column="plan_id" property="planId"/>
<result column="distribution_time" property="distributionTime"/>
<result column="distribution_fields" property="distributionFields"/>
<result column="distribution_status" property="distributionStatus"/>
<result column="distribution_number" property="distributionNumber"/>
<result column="distribution_remark" property="distributionRemark"/>
<result column="plan_name" property="planName"/>
<result column="station_id" property="stationId"/>
<result column="distribution_allot_time" property="distributionAllotTime"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<!-- 新增考场分配 -->
<insert id="save" parameterType="map">
INSERT INTO e_distribution(
distribution_id,
plan_id,
distribution_time,
distribution_fields,
distribution_status,
distribution_number,
distribution_remark,
plan_name,
station_id
distribution_allot_time,
creator,
gmt_create,
modifier,
gmt_modified,
is_delete
) VALUES(
#{distributionId},
#{planId},
#{distributionTime},
#{distributionFields},
#{distributionStatus},
#{distributionNumber},
#{distributionRemark},
#{planName},
#{stationId},
#{distributionAllotTime},
#{creator},
#{gmtCreate},
#{modifier},
#{gmtModified},
#{isDelete}
)
</insert>
<!-- 删除考场分配 -->
<update id="remove" parameterType="map">
UPDATE
e_distribution
SET
gmt_modified = #{gmtModified},
modifier = #{modifier},
is_delete = 1
WHERE
distribution_id IN
<foreach collection="distributionIds" index="index" open="(" separator="," close=")">
#{distributionIds[${index}]}
</foreach>
</update>
<!-- 删除考场分配(物理) -->
<update id="delete" parameterType="map">
DELETE FROM
e_distribution
WHERE
distribution_id IN
<foreach collection="distributionIds" index="index" open="(" separator="," close=")">
#{distributionIds[${index}]}
</foreach>
</update>
<!-- 修改考场分配 -->
<update id="update" parameterType="map">
UPDATE
e_distribution
SET
<if test="planId != null and planId != ''">
plan_id = #{planId},
</if>
<if test="distributionTime != null and distributionTime != ''">
distribution_time = #{distributionTime},
</if>
<if test="distributionFields != null and distributionFields != ''">
distribution_fields = #{distributionFields},
</if>
<if test="distributionStatus != null and distributionStatus != ''">
distribution_status = #{distributionStatus},
</if>
<if test="distributionNumber != null">
distribution_number = #{distributionNumber},
</if>
<if test="distributionRemark != null and distributionRemark != ''">
distribution_remark = #{distributionRemark},
</if>
<if test="distributionAllotTime != null and distributionAllotTime != ''">
distribution_allot_time = #{distributionAllotTime},
</if>
<if test="stationId != null and stationId != ''">
station_id = #{stationId},
</if>
<if test="planName != null and planName != ''">
plan_name = #{planName},
</if>
gmt_modified = #{gmtModified},
modifier = #{modifier},
distribution_id = distribution_id
WHERE
distribution_id = #{distributionId}
</update>
<!-- 考场分配详情 -->
<select id="get" parameterType="map" resultMap="distributionDTO">
SELECT
t1.plan_id,
t1.distribution_time,
t1.distribution_fields,
t1.distribution_status,
t1.distribution_number,
t1.distribution_remark,
t1.distribution_id,
t1.plan_name,
t1.station_id,
t1.distribution_allot_time
FROM
e_distribution t1
WHERE
t1.is_delete = 0
<if test="distributionId != null and distributionId != ''">
AND
t1.distribution_id = #{distributionId}
</if>
</select>
<!-- 考场分配详情 -->
<select id="getBO" parameterType="map" resultMap="distributionBO">
SELECT
t1.distribution_id,
t1.plan_id,
t1.distribution_time,
t1.distribution_fields,
t1.distribution_status,
t1.distribution_number,
t1.distribution_remark,
t1.plan_name,
t1.station_id,
t1.distribution_allot_time,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_distribution t1
WHERE
t1.is_delete = 0
<if test="distributionId != null and distributionId != ''">
AND
t1.distribution_id = #{distributionId}
</if>
</select>
<!-- 考场分配详情 -->
<select id="getPO" parameterType="map" resultMap="distributionPO">
SELECT
t1.distribution_id,
t1.plan_id,
t1.distribution_time,
t1.distribution_fields,
t1.distribution_status,
t1.distribution_number,
t1.distribution_remark,
t1.plan_name,
t1.station_id,
t1.distribution_allot_time,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_distribution t1
WHERE
t1.is_delete = 0
<if test="distributionId != null and distributionId != ''">
AND
t1.distribution_id = #{distributionId}
</if>
</select>
<!-- 考场分配列表 -->
<select id="list" parameterType="map" resultMap="distributionDTO">
SELECT
t1.distribution_id,
t1.plan_id,
t1.distribution_time,
t1.distribution_fields,
t1.distribution_status,
t1.distribution_number,
t1.distribution_remark,
t1.plan_name,
t1.station_id,
t1.distribution_allot_time,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete,
1
FROM
e_distribution 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="stationIdList != null and stationIdList.size > 0">
AND
t1.station_id IN
<foreach collection="stationIdList" index="index" open="(" separator="," close=")">
#{stationIdList[${index}]}
</foreach>
</if>
<if test="distributionIds != null and distributionIds.size > 0">
AND
t1.distribution_id IN
<foreach collection="distributionIds" index="index" open="(" separator="," close=")">
#{distributionIds[${index}]}
</foreach>
</if>
ORDER BY
t1.distribution_allot_time DESC
</select>
<!-- 考场分配列表 -->
<select id="listBO" parameterType="map" resultMap="distributionBO">
SELECT
t1.distribution_id,
t1.plan_id,
t1.distribution_time,
t1.distribution_fields,
t1.distribution_status,
t1.distribution_number,
t1.distribution_remark,
t1.plan_name,
t1.station_id,
t1.distribution_allot_time,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_distribution 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="distributionIds != null and distributionIds.size > 0">
AND
t1.distribution_id IN
<foreach collection="distributionIds" index="index" open="(" separator="," close=")">
#{distributionIds[${index}]}
</foreach>
</if>
</select>
<!-- 考场分配列表 -->
<select id="listPO" parameterType="map" resultMap="distributionPO">
SELECT
t1.distribution_id,
t1.plan_id,
t1.distribution_time,
t1.distribution_fields,
t1.distribution_status,
t1.distribution_number,
t1.distribution_remark,
t1.plan_name,
t1.station_id,
t1.distribution_allot_time,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_distribution 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="distributionIds != null and distributionIds.size > 0">
AND
t1.distribution_id IN
<foreach collection="distributionIds" index="index" open="(" separator="," close=")">
#{distributionIds[${index}]}
</foreach>
</if>
</select>
<!-- 考场分配统计 -->
<select id="count" parameterType="map" resultType="Integer">
SELECT
COUNT(*)
FROM
e_distribution t1
WHERE
t1.is_delete = 0
</select>
</mapper>

View File

@ -0,0 +1,349 @@
<?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.stationuser.IStationUserDao">
<resultMap id="stationUserDTO" type="cn.com.tenlion.pojo.dtos.stationuser.StationUserDTO">
<result column="station_user_id" property="stationUserId"/>
<result column="station_id" property="stationId"/>
<result column="station_user_user_id" property="stationUserUserId"/>
<result column="station_user_user_name" property="stationUserUserName"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="stationUserBO" type="cn.com.tenlion.pojo.bos.stationuser.StationUserBO">
<result column="station_user_id" property="stationUserId"/>
<result column="station_id" property="stationId"/>
<result column="station_user_user_id" property="stationUserUserId"/>
<result column="station_user_user_name" property="stationUserUserName"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="stationUserPO" type="cn.com.tenlion.pojo.pos.stationuser.StationUserPO">
<result column="station_user_id" property="stationUserId"/>
<result column="station_id" property="stationId"/>
<result column="station_user_user_id" property="stationUserUserId"/>
<result column="station_user_user_name" property="stationUserUserName"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<!-- 新增 -->
<insert id="save" parameterType="map">
INSERT INTO e_station_user(
station_user_id,
station_id,
station_user_user_id,
station_user_user_name,
creator,
gmt_create,
modifier,
gmt_modified,
is_delete
) VALUES(
#{stationUserId},
#{stationId},
#{stationUserUserId},
#{stationUserUserName},
#{creator},
#{gmtCreate},
#{modifier},
#{gmtModified},
#{isDelete}
)
</insert>
<!-- 删除 -->
<update id="remove" parameterType="map">
UPDATE
e_station_user
SET
gmt_modified = #{gmtModified},
modifier = #{modifier},
is_delete = 1
WHERE
station_user_id IN
<foreach collection="stationUserIds" index="index" open="(" separator="," close=")">
#{stationUserIds[${index}]}
</foreach>
</update>
<update id="deleteByStationId" parameterType="map">
DELETE FROM
e_station_user
WHERE
station_id = #{stationId}
</update>
<select id="getStationByUserIdAndStationId" parameterType="map" resultType="java.lang.String">
SELECT
t1.station_user_id
FROM
e_station_user t1
WHERE
t1.is_delete = 0 AND t1.station_id = #{stationId} AND t1.station_user_user_id = #{stationUserUserId}
</select>
<select id="getStationByUserId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
t1.station_id
FROM
e_station_user t1
WHERE
t1.is_delete = 0 AND t1.station_user_user_id = #{stationUserUserId}
GROUP BY
t1.station_id
</select>
<select id="listByStationId" parameterType="map" resultMap="stationUserDTO">
SELECT
t1.station_user_id,
t1.station_id,
t1.station_user_user_id,
t1.station_user_user_name,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_station_user t1
WHERE
t1.is_delete = 0 AND t1.station_id = #{stationId}
</select>
<!-- 删除(物理) -->
<update id="delete" parameterType="map">
DELETE FROM
e_station_user
WHERE
station_user_id IN
<foreach collection="stationUserIds" index="index" open="(" separator="," close=")">
#{stationUserIds[${index}]}
</foreach>
</update>
<!-- 修改 -->
<update id="update" parameterType="map">
UPDATE
e_station_user
SET
<if test="stationId != null and stationId != ''">
station_id = #{stationId},
</if>
<if test="stationUserUserId != null and stationUserUserId != ''">
station_user_user_id = #{stationUserUserId},
</if>
<if test="stationUserUserName != null and stationUserUserName != ''">
station_user_user_name = #{stationUserUserName},
</if>
gmt_modified = #{gmtModified},
modifier = #{modifier},
station_user_id = station_user_id
WHERE
station_user_id = #{stationUserId}
</update>
<!-- 详情 -->
<select id="get" parameterType="map" resultMap="stationUserDTO">
SELECT
t1.station_id,
t1.station_user_user_id,
t1.station_user_user_name,
t1.station_user_id
FROM
e_station_user t1
WHERE
t1.is_delete = 0
<if test="stationUserId != null and stationUserId != ''">
AND
t1.station_user_id = #{stationUserId}
</if>
</select>
<!-- 详情 -->
<select id="getBO" parameterType="map" resultMap="stationUserBO">
SELECT
t1.station_user_id,
t1.station_id,
t1.station_user_user_id,
t1.station_user_user_name,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_station_user t1
WHERE
t1.is_delete = 0
<if test="stationUserId != null and stationUserId != ''">
AND
t1.station_user_id = #{stationUserId}
</if>
</select>
<!-- 详情 -->
<select id="getPO" parameterType="map" resultMap="stationUserPO">
SELECT
t1.station_user_id,
t1.station_id,
t1.station_user_user_id,
t1.station_user_user_name,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_station_user t1
WHERE
t1.is_delete = 0
<if test="stationUserId != null and stationUserId != ''">
AND
t1.station_user_id = #{stationUserId}
</if>
</select>
<!-- 列表 -->
<select id="list" parameterType="map" resultMap="stationUserDTO">
SELECT
t1.station_user_id,
t1.station_id,
t1.station_user_user_id,
t1.station_user_user_name,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete,
1
FROM
e_station_user 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="stationUserIds != null and stationUserIds.size > 0">
AND
t1.station_user_id IN
<foreach collection="stationUserIds" index="index" open="(" separator="," close=")">
#{stationUserIds[${index}]}
</foreach>
</if>
<if test="stationId != null and stationId != '' ">
AND t1.station_id = #{stationId}
</if>
</select>
<!-- 列表 -->
<select id="listBO" parameterType="map" resultMap="stationUserBO">
SELECT
t1.station_user_id,
t1.station_id,
t1.station_user_user_id,
t1.station_user_user_name,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_station_user 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="stationUserIds != null and stationUserIds.size > 0">
AND
t1.station_user_id IN
<foreach collection="stationUserIds" index="index" open="(" separator="," close=")">
#{stationUserIds[${index}]}
</foreach>
</if>
</select>
<!-- 列表 -->
<select id="listPO" parameterType="map" resultMap="stationUserPO">
SELECT
t1.station_user_id,
t1.station_id,
t1.station_user_user_id,
t1.station_user_user_name,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
e_station_user 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="stationUserIds != null and stationUserIds.size > 0">
AND
t1.station_user_id IN
<foreach collection="stationUserIds" index="index" open="(" separator="," close=")">
#{stationUserIds[${index}]}
</foreach>
</if>
</select>
<!-- 统计 -->
<select id="count" parameterType="map" resultType="Integer">
SELECT
COUNT(*)
FROM
e_station_user t1
WHERE
t1.is_delete = 0
</select>
</mapper>

View File

@ -0,0 +1,299 @@
<!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>-->
<!-- </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/distribution/listpage?distributionStatus=1';
// 初始化表格
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: 'planId', width: 180, title: '计划名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'distributionNumber', width: 180, title: '考试人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'distributionTime', width: 180, title: '预定考试时间', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'distributionAllotTime', width: 180, title: '最终分配时间', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'distributionFields', width: 180, title: '分配考场', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
var rowDataArray = row['distributionFieldList'];
var showData = "";
if(rowDataArray && rowDataArray.length > 0) {
for(var i = 0 ; i < rowDataArray.length; i++) {
showData = showData + " . " + rowDataArray[i].organizationName;
}
}
return showData;
}
},
{field:'distributionButton',fixed: 'right', width:150, title: '考场分配', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(row.distributionStatus == '1') {
return '<a href="javascript:void(0);" class="layui-btn layui-btn-xs layui-btn-danger layui-btn-radius">已分配</a>';
}else{
return '<a href="javascript:void(0);" class="layui-btn layui-btn-xs layui-btn-radius" lay-event="distributionButton">考场分配</a>';
}
}
}
]
],
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/distribution/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();
// 表格行中按钮事件
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();
}
});
}
});
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 事件 - 增删改
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/distribution/save', []),
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/distribution/update?distributionId={distributionId}', [checkDatas[0].distributionId]),
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['distributionId'];
}
removeData(ids);
}
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,190 @@
<!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">计划ID</label>
<div class="layui-input-block">
<input type="text" id="planId" name="planId" class="layui-input" value="" placeholder="请输入计划ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">最终分配时间</label>
<div class="layui-input-block">
<input type="text" id="distributionTime" name="distributionTime" class="layui-input" value="" placeholder="请输入最终分配时间" maxlength="25">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">最终分配考场,多个</label>
<div class="layui-input-block">
<input type="text" id="distributionFields" name="distributionFields" class="layui-input" value="" placeholder="请输入最终分配考场,多个" maxlength="500">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">1:分配成功,0:分配退回</label>
<div class="layui-input-block">
<input type="text" id="distributionStatus" name="distributionStatus" class="layui-input" value="" placeholder="请输入1:分配成功,0:分配退回" maxlength="1">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考试人数</label>
<div class="layui-input-block">
<input type="number" id="distributionNumber" name="distributionNumber" class="layui-input" value="" placeholder="请输入考试人数" lay-verify="required">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注信息</label>
<div class="layui-input-block">
<textarea id="distributionRemark" name="distributionRemark" class="layui-textarea" placeholder="请输入备注信息"></textarea>
</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/distribution/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>

View File

@ -0,0 +1,232 @@
<!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">
<input type="hidden" readonly id="stationId" name="stationId" class="layui-input" value="" maxlength="36">
<div class="layui-form-item">
<label class="layui-form-label">计划名称</label>
<div class="layui-input-block">
<input type="text" readonly id="planName" name="planName" class="layui-input" value="" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考试人数</label>
<div class="layui-input-block">
<input type="text" readonly id="distributionNumber" name="distributionNumber" class="layui-input" value="" placeholder="请输入考试人数" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">预定考试</label>
<div class="layui-input-block">
<input type="text" readonly id="distributionTime" name="distributionTime" class="layui-input" value="" placeholder="请输入预定考试时间" maxlength="25">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">最终分配<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="text" id="distributionAllotTime" name="distributionAllotTime" class="layui-input" value="" placeholder="请输入最终分配时间" maxlength="25" lay-verify="required">
</div>
</div>
<div class="layui-form-item" pane="">
<label class="layui-form-label">分配考场<span style="color:red">*</span></label>
<div class="layui-input-block layui-form" id="distributionFieldsBox" lay-filter="distributionFieldsBox" pane=""></div>
<script id="distributionFieldsBoxTemplate" type="text/html">
{{# for(var i = 0, item; item = d[i++];) { }}
<input type="checkbox" name="distributionFields[{{item.organizationId}}]" value="{{item.organizationId}}" title="{{item.organizationName}}" lay-verify="required">
{{# } }}
</script>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注信息</label>
<div class="layui-input-block">
<textarea id="distributionRemark" name="distributionRemark" class="layui-textarea" placeholder="请输入备注信息"></textarea>
</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 distributionId = top.restAjax.params(window.location.href).distributionId;
var wangEditor = window.wangEditor;
var wangEditorObj = {};
var viewerObj = {};
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
// 初始化考场
function initDistributionFields(stationId) {
top.restAjax.get(top.restAjax.path('api/organization/list?organizationType={organizationType}', [stationId]), {}, null, function(code, data, args) {
laytpl(document.getElementById('distributionFieldsBoxTemplate').innerHTML).render(data, function(html) {
document.getElementById('distributionFieldsBox').innerHTML = html;
});
form.render('checkbox', 'distributionFieldsBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化成立日期时间戳
function initDistributionAllotTime() {
laydate.render({
elem: '#distributionAllotTime',
type: 'datetime',
min:3,
trigger: 'click'
});
}
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/distribution/get/{distributionId}', [distributionId]), {}, null, function(code, data) {
var dataFormData = {};
for(var i in data) {
dataFormData[i] = data[i] +'';
}
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
initDistributionAllotTime();
initDistributionFields(dataFormData.stationId);
}, 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.layer.msg("分配后不可修改,是否确定提交", {
time: 0,
btnAlign: 'c',
btn: ['确定', '取消'],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
var loadLayerIndex;
formData.field['distributionFields'] = top.restAjax.checkBoxToString(formData.field, 'distributionFields');
formData.field.distributionStatus = "1";
top.restAjax.put(top.restAjax.path('api/distribution/update/{distributionId}', [distributionId]), formData.field, null, function(code, data) {
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);
});
},
btn1: function () {
}
});
});
$('.close').on('click', function() {
closeBox();
});
// 校验
form.verify({
});
});
</script>
</body>
</html>

View File

@ -67,15 +67,15 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考场名称</label>
<label class="layui-form-label">考场名称<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="text" id="organizationName" name="organizationName" class="layui-input" value="" placeholder="请输入考场名称" maxlength="255" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">容纳人数</label>
<label class="layui-form-label">容纳人数<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="number" id="organizationUserNum" name="organizationUserNum" class="layui-input" value="" placeholder="请输入容纳人数" >
<input type="number" id="organizationUserNum" name="organizationUserNum" class="layui-input" value="" lay-verify="required" placeholder="请输入容纳人数" >
</div>
</div>
<div class="layui-form-item">

View File

@ -67,15 +67,15 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考场名称</label>
<label class="layui-form-label">考场名称<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="text" id="organizationName" name="organizationName" class="layui-input" value="" placeholder="请输入考场名称" maxlength="255" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">容纳人数</label>
<label class="layui-form-label">容纳人数<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="number" id="organizationUserNum" name="organizationUserNum" class="layui-input" value="" placeholder="请输入容纳人数" >
<input type="number" id="organizationUserNum" name="organizationUserNum" class="layui-input" value="" placeholder="请输入容纳人数" lay-verify="required">
</div>
</div>
<div class="layui-form-item">

View File

@ -148,6 +148,12 @@
var rowData = row[this.field];
return '<a href="javascript:void(0);" class="layui-btn layui-btn-xs layui-btn-radius" lay-event="institutionButton">考场管理</a>';
}
},
{field:'institutionUserButton',fixed: 'right', width:150, title: '人员管理', align:'center',
templet: function(row) {
var rowData = row[this.field];
return '<a href="javascript:void(0);" class="layui-btn layui-btn-xs layui-btn-radius" lay-event="institutionUserButton">人员管理</a>';
}
}
]
],
@ -192,6 +198,17 @@
}
});
}
if(layEvent === 'institutionUserButton') {
top.dialog.open({
url: top.restAjax.path('route/examination/stationuser/list.html?stationId={stationId}', [data.institutionId]),
title: data.institutionName + "[人员信息]",
width: '500px',
height: '80%',
onClose: function() {
reloadTable();
}
});
}
});
// 初始化日期
function initDate() {

View File

@ -68,13 +68,13 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考点名称</label>
<label class="layui-form-label">考点名称<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="text" id="institutionName" name="institutionName" class="layui-input" value="" placeholder="请输入考点名称" maxlength="255" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">成立日期</label>
<label class="layui-form-label">成立日期<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="text" id="institutionFoundingTime" name="institutionFoundingTime" class="layui-input" value="" placeholder="请选择成立日期" readonly style="cursor: pointer;" lay-verify="required">
</div>
@ -98,7 +98,7 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">行政区划</label>
<label class="layui-form-label">行政区划<span style="color:red">*</span></label>
<div class="layui-input-inline">
<select name="institutionRegionProvince" id="institutionRegionProvince" lay-filter="institutionRegionProvince">
<option value="">请选择省</option>
@ -126,7 +126,7 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考点详细地址</label>
<label class="layui-form-label">详细地址<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="hidden" id="institutionX" name="institutionX" value="" placeholder="请输入考点经度">
<input type="hidden" id="institutionY" name="institutionY" value="" placeholder="请输入考点纬度">

View File

@ -68,13 +68,13 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考点名称</label>
<label class="layui-form-label">考点名称<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="text" id="institutionName" name="institutionName" class="layui-input" value="" placeholder="请输入考点名称" maxlength="255" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">成立日期</label>
<label class="layui-form-label">成立日期<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="text" id="institutionFoundingTime" name="institutionFoundingTime" class="layui-input" value="" placeholder="请选择成立日期" readonly style="cursor: pointer;" lay-verify="required">
</div>
@ -98,7 +98,7 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">行政区划</label>
<label class="layui-form-label">行政区划<span style="color:red">*</span></label>
<div class="layui-input-inline">
<select name="institutionRegionProvince" id="institutionRegionProvince" lay-filter="institutionRegionProvince">
<option value="">请选择省</option>
@ -126,7 +126,7 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考点详细地址</label>
<label class="layui-form-label">详细地址<span style="color:red">*</span></label>
<div class="layui-input-block">
<input type="hidden" id="institutionX" name="institutionX" value="" placeholder="请输入考点经度">
<input type="hidden" id="institutionY" name="institutionY" value="" placeholder="请输入考点纬度">

View File

@ -0,0 +1,261 @@
<!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>
</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 stationId = top.restAjax.params(window.location.href).stationId;
var tableUrl = 'api/stationuser/listpage?stationId=' + stationId;
// 初始化表格
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',
defaultToolbar: [],
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: 'stationUserUserName', width: 308, 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/stationuser/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);
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []),
title: '选择用户',
width: '500px',
height: '500px',
onClose: function() {
var selectedUsers = top.dialog.dialogData.selectedDepartmentUsers;
if(selectedUsers != null && selectedUsers.length > 0) {
var ids = [];
for (var i = 0, item; item = selectedUsers[i++];) {
ids.push({stationUserUserId:item.userId , stationUserUserName:item.userName});
}
top.restAjax.post(top.restAjax.path('api/stationuser/save/{stationId}', [stationId]), {
stationUserVOList: ids
}, null, function (code, data) {
top.dialog.msg(top.dataMessage.updated);
reloadTable();
}, function (code, data) {
top.dialog.msg(data.msg);
}, function () {
loadLayerIndex = top.dialog.msg(top.dataMessage.updating, {
icon: 16,
time: 0,
shade: 0.3
});
}, function () {
top.dialog.close(loadLayerIndex);
});
}
}
});
// layer.open({
// type: 2,
// title: false,
// closeBtn: 0,
// area: ['100%', '100%'],
// shadeClose: true,
// anim: 2,
// content: top.restAjax.path('route/examination/stationuser/save.html?stationId={stationId}', [stationId]),
// 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/stationuser/update.html?stationUserId={stationUserId}', [checkDatas[0].stationUserId]),
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['stationUserId'];
}
removeData(ids);
}
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,174 @@
<!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">考点ID</label>
<div class="layui-input-block">
<input type="text" id="stationId" name="stationId" class="layui-input" value="" placeholder="请输入考点ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考点人员ID</label>
<div class="layui-input-block">
<input type="text" id="stationUserUserId" name="stationUserUserId" class="layui-input" value="" placeholder="请输入考点人员ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考点人员姓名</label>
<div class="layui-input-block">
<input type="text" id="stationUserUserName" name="stationUserUserName" class="layui-input" value="" placeholder="请输入考点人员姓名" maxlength="500">
</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 = {};
var stationId = top.restAjax.params(window.location.href).stationId;
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;
formData.field.stationId = stationId;
top.restAjax.post(top.restAjax.path('api/stationuser/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>

View 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">考点ID</label>
<div class="layui-input-block">
<input type="text" id="stationId" name="stationId" class="layui-input" value="" placeholder="请输入考点ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考点人员ID</label>
<div class="layui-input-block">
<input type="text" id="stationUserUserId" name="stationUserUserId" class="layui-input" value="" placeholder="请输入考点人员ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考点人员姓名</label>
<div class="layui-input-block">
<input type="text" id="stationUserUserName" name="stationUserUserName" class="layui-input" value="" placeholder="请输入考点人员姓名" maxlength="500">
</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 stationUserId = top.restAjax.params(window.location.href).stationUserId;
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/stationuser/get/{stationUserId}', [stationUserId]), {}, 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/stationuser/update/{stationUserId}', [stationUserId]), 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>