diff --git a/src/main/java/cn/com/tenlion/controller/api/examination/distribution/DistributionController.java b/src/main/java/cn/com/tenlion/controller/api/examination/distribution/DistributionController.java new file mode 100644 index 0000000..b016a5e --- /dev/null +++ b/src/main/java/cn/com/tenlion/controller/api/examination/distribution/DistributionController.java @@ -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 list() { + Map 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> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return distributionService.listPage(page); + } + + @ApiOperation(value = "考场分配统计", notes = "考场分配统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(distributionService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/controller/api/examination/stationuser/StationUserController.java b/src/main/java/cn/com/tenlion/controller/api/examination/stationuser/StationUserController.java new file mode 100644 index 0000000..bfc154e --- /dev/null +++ b/src/main/java/cn/com/tenlion/controller/api/examination/stationuser/StationUserController.java @@ -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 list() { + Map 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> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return stationUserService.listPage(page); + } + + @ApiOperation(value = "统计", notes = "统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(stationUserService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/dao/examination/distribution/IDistributionDao.java b/src/main/java/cn/com/tenlion/dao/examination/distribution/IDistributionDao.java new file mode 100644 index 0000000..d1e054e --- /dev/null +++ b/src/main/java/cn/com/tenlion/dao/examination/distribution/IDistributionDao.java @@ -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 params) throws SaveException; + + /** + * 删除考场分配 + * + * @param params + * @throws RemoveException + */ + void remove(Map params) throws RemoveException; + + /** + * 删除考场分配(物理) + * + * @param params + * @throws RemoveException + */ + void delete(Map params) throws RemoveException; + + /** + * 修改考场分配 + * + * @param params + * @throws UpdateException + */ + void update(Map params) throws UpdateException; + + /** + * 考场分配详情 + * + * @param params + * @return + * @throws SearchException + */ + DistributionDTO get(Map params) throws SearchException; + + /** + * 考场分配详情 + * + * @param params + * @return + * @throws SearchException + */ + DistributionBO getBO(Map params) throws SearchException; + + /** + * 考场分配详情 + * + * @param params + * @return + * @throws SearchException + */ + DistributionPO getPO(Map params) throws SearchException; + + /** + * 考场分配列表 + * + * @param params + * @return + * @throws SearchException + */ + List list(Map params) throws SearchException; + + /** + * 考场分配列表 + * + * @param params + * @return + * @throws SearchException + */ + List listBO(Map params) throws SearchException; + + /** + * 考场分配列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + + /** + * 考场分配统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer count(Map params) throws SearchException; + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/dao/examination/stationuser/IStationUserDao.java b/src/main/java/cn/com/tenlion/dao/examination/stationuser/IStationUserDao.java new file mode 100644 index 0000000..096fc69 --- /dev/null +++ b/src/main/java/cn/com/tenlion/dao/examination/stationuser/IStationUserDao.java @@ -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 params) throws SaveException; + + /** + * 删除 + * + * @param params + * @throws RemoveException + */ + void remove(Map params) throws RemoveException; + + /** + * 删除(物理) + * + * @param params + * @throws RemoveException + */ + void delete(Map params) throws RemoveException; + + /** + * 修改 + * + * @param params + * @throws UpdateException + */ + void update(Map params) throws UpdateException; + + /** + * 详情 + * + * @param params + * @return + * @throws SearchException + */ + StationUserDTO get(Map params) throws SearchException; + + /** + * 详情 + * + * @param params + * @return + * @throws SearchException + */ + StationUserBO getBO(Map params) throws SearchException; + + /** + * 详情 + * + * @param params + * @return + * @throws SearchException + */ + StationUserPO getPO(Map params) throws SearchException; + + /** + * 列表 + * + * @param params + * @return + * @throws SearchException + */ + List list(Map params) throws SearchException; + + /** + * 列表 + * + * @param params + * @return + * @throws SearchException + */ + List listBO(Map params) throws SearchException; + + /** + * 列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + + /** + * 统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer count(Map params) throws SearchException; + + String getStationByUserIdAndStationId(Map params) throws SearchException; + + List getStationByUserId(String userId) throws SearchException; +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/bos/distribution/DistributionBO.java b/src/main/java/cn/com/tenlion/pojo/bos/distribution/DistributionBO.java new file mode 100644 index 0000000..5a47639 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/bos/distribution/DistributionBO.java @@ -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; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/bos/stationuser/StationUserBO.java b/src/main/java/cn/com/tenlion/pojo/bos/stationuser/StationUserBO.java new file mode 100644 index 0000000..0ec3e8b --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/bos/stationuser/StationUserBO.java @@ -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; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/distribution/DistributionDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/distribution/DistributionDTO.java new file mode 100644 index 0000000..7c23eee --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/distribution/DistributionDTO.java @@ -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 distributionFieldList; + + public List getDistributionFieldList() { + return distributionFieldList; + } + + public void setDistributionFieldList(List 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; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/stationuser/StationUserDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/stationuser/StationUserDTO.java new file mode 100644 index 0000000..f55a525 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/stationuser/StationUserDTO.java @@ -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; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/pos/distribution/DistributionPO.java b/src/main/java/cn/com/tenlion/pojo/pos/distribution/DistributionPO.java new file mode 100644 index 0000000..399c2c6 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/pos/distribution/DistributionPO.java @@ -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; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/pos/stationuser/StationUserPO.java b/src/main/java/cn/com/tenlion/pojo/pos/stationuser/StationUserPO.java new file mode 100644 index 0000000..1f058e9 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/pos/stationuser/StationUserPO.java @@ -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; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/vos/distribution/DistributionVO.java b/src/main/java/cn/com/tenlion/pojo/vos/distribution/DistributionVO.java new file mode 100644 index 0000000..c8d4984 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/vos/distribution/DistributionVO.java @@ -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; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/vos/stationuser/StationUserVO.java b/src/main/java/cn/com/tenlion/pojo/vos/stationuser/StationUserVO.java new file mode 100644 index 0000000..c61c159 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/vos/stationuser/StationUserVO.java @@ -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; + } + + +} diff --git a/src/main/java/cn/com/tenlion/service/examination/distribution/IDistributionService.java b/src/main/java/cn/com/tenlion/service/examination/distribution/IDistributionService.java new file mode 100644 index 0000000..e4cae43 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/examination/distribution/IDistributionService.java @@ -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 ids); + + + /** + * 删除考场分配 + * + * @param token + * @param ids id列表 + * @return + */ + void remove(String token, List ids); + + /** + * 删除考场分配(物理删除) + * + * @param ids id列表 + */ + void delete(List 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 params); + + /** + * 考场分配详情 + * + * @param distributionId + * @return + */ + DistributionDTO get(String distributionId); + + /** + * 考场分配详情 + * + * @param params 参数Map + * @return + */ + DistributionBO getBO(Map params); + + /** + * 考场分配详情 + * + * @param distributionId + * @return + */ + DistributionBO getBO(String distributionId); + + /** + * 考场分配详情 + * + * @param params 参数Map + * @return + */ + DistributionPO getPO(Map params); + + /** + * 考场分配详情 + * + * @param distributionId + * @return + */ + DistributionPO getPO(String distributionId); + + /** + * 考场分配列表 + * + * @param params + * @return + */ + List list(Map params); + + /** + * 考场分配列表 + * + * @param params + * @return + */ + List listBO(Map params); + + /** + * 考场分配列表 + * + * @param params + * @return + */ + List listPO(Map params); + + /** + * 考场分配分页列表 + * + * @param page + * @return + */ + SuccessResultList> listPage(ListPage page); + + /** + * 考场分配统计 + * + * @param params + * @return + */ + Integer count(Map params); + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java new file mode 100644 index 0000000..ac59e35 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java @@ -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 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 ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map 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 ids) { + Map 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 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 params) { + return distributionDao.get(params); + } + + @Override + public DistributionDTO get(String distributionId) { + Map params = super.getHashMap(2); + params.put("distributionId", distributionId); + return get(params); + } + + @Override + public DistributionBO getBO(Map params) { + return distributionDao.getBO(params); + } + + @Override + public DistributionBO getBO(String distributionId) { + Map params = super.getHashMap(2); + params.put("distributionId", distributionId); + return getBO(params); + } + + @Override + public DistributionPO getPO(Map params) { + return distributionDao.getPO(params); + } + + @Override + public DistributionPO getPO(String distributionId) { + Map params = super.getHashMap(2); + params.put("distributionId", distributionId); + return getPO(params); + } + + @Override + public List list(Map params) { + return distributionDao.list(params); + } + + @Override + public List listBO(Map params) { + return distributionDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return distributionDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + /** + * 查出当前人员绑定的考点人员配置 + * 只显示已经绑定考点的信息 + */ + String userId = securityComponent.getCurrentUser().getUserId(); + List stationIdList = iStationUserService.getStationByUserId(userId); + /** + * 防止无权限的人员进行查看 + */ + if(stationIdList == null || stationIdList.size() < 1 && !"1".equals(userId)) { + List distributionDTOs = new ArrayList(); + PageInfo pageInfo = new PageInfo<>(distributionDTOs); + return new SuccessResultList<>(distributionDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + page.getParams().put("stationIdList", stationIdList); + List distributionDTOs = list(page.getParams()); + /** + * 回显考场 + */ + for(DistributionDTO dto: distributionDTOs) { + String[] arr = dto.getDistributionFields().split(","); + List distributionFieldList = new ArrayList(); + for(String id: arr) { + OrganizationDTO organizationDTO = iOrganizationService.get(id); + distributionFieldList.add(organizationDTO); + } + dto.setDistributionFieldList(distributionFieldList); + } + PageInfo pageInfo = new PageInfo<>(distributionDTOs); + return new SuccessResultList<>(distributionDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = distributionDao.count(params); + return count == null ? 0 : count; + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examination/stationuser/IStationUserService.java b/src/main/java/cn/com/tenlion/service/examination/stationuser/IStationUserService.java new file mode 100644 index 0000000..39f7683 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/examination/stationuser/IStationUserService.java @@ -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 ids); + + + /** + * 删除 + * + * @param token + * @param ids id列表 + * @return + */ + void remove(String token, List ids); + + /** + * 删除(物理删除) + * + * @param ids id列表 + */ + void delete(List 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 params); + + /** + * 详情 + * + * @param stationUserId + * @return + */ + StationUserDTO get(String stationUserId); + + /** + * 详情 + * + * @param params 参数Map + * @return + */ + StationUserBO getBO(Map params); + + /** + * 详情 + * + * @param stationUserId + * @return + */ + StationUserBO getBO(String stationUserId); + + /** + * 详情 + * + * @param params 参数Map + * @return + */ + StationUserPO getPO(Map params); + + /** + * 详情 + * + * @param stationUserId + * @return + */ + StationUserPO getPO(String stationUserId); + + /** + * 列表 + * + * @param params + * @return + */ + List list(Map params); + + /** + * 列表 + * + * @param params + * @return + */ + List listBO(Map params); + + /** + * 列表 + * + * @param params + * @return + */ + List listPO(Map params); + + /** + * 分页列表 + * + * @param page + * @return + */ + SuccessResultList> listPage(ListPage page); + + /** + * 统计 + * + * @param params + * @return + */ + Integer count(Map params); + + /** + * 将用户存储到对应考试点关系 + * @param stationId + * @param array + * @return + */ + SuccessResult saveUser(String stationId, JSONArray array); + + /** + * 获取该用户可以操作的考试点ID集合 + * @param userId + * @return + */ + List getStationByUserId(String userId); +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examination/stationuser/impl/StationUserServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/stationuser/impl/StationUserServiceImpl.java new file mode 100644 index 0000000..1025f11 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/examination/stationuser/impl/StationUserServiceImpl.java @@ -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 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 ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map 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 ids) { + Map 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 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 params) { + return stationUserDao.get(params); + } + + @Override + public StationUserDTO get(String stationUserId) { + Map params = super.getHashMap(2); + params.put("stationUserId", stationUserId); + return get(params); + } + + @Override + public StationUserBO getBO(Map params) { + return stationUserDao.getBO(params); + } + + @Override + public StationUserBO getBO(String stationUserId) { + Map params = super.getHashMap(2); + params.put("stationUserId", stationUserId); + return getBO(params); + } + + @Override + public StationUserPO getPO(Map params) { + return stationUserDao.getPO(params); + } + + @Override + public StationUserPO getPO(String stationUserId) { + Map params = super.getHashMap(2); + params.put("stationUserId", stationUserId); + return getPO(params); + } + + @Override + public List list(Map params) { + return stationUserDao.list(params); + } + + @Override + public List listBO(Map params) { + return stationUserDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return stationUserDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List stationUserDTOs = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(stationUserDTOs); + return new SuccessResultList<>(stationUserDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map 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 params = new HashMap(); + 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 getStationByUserId(String userId) { + return stationUserDao.getStationByUserId(userId); + } + +} \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/distribution/distribution-mapper.xml b/src/main/resources/mybatis/mapper/distribution/distribution-mapper.xml new file mode 100644 index 0000000..71e5807 --- /dev/null +++ b/src/main/resources/mybatis/mapper/distribution/distribution-mapper.xml @@ -0,0 +1,395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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} + ) + + + + + UPDATE + e_distribution + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + distribution_id IN + + #{distributionIds[${index}]} + + + + + + DELETE FROM + e_distribution + WHERE + distribution_id IN + + #{distributionIds[${index}]} + + + + + + UPDATE + e_distribution + SET + + plan_id = #{planId}, + + + distribution_time = #{distributionTime}, + + + distribution_fields = #{distributionFields}, + + + distribution_status = #{distributionStatus}, + + + distribution_number = #{distributionNumber}, + + + distribution_remark = #{distributionRemark}, + + + distribution_allot_time = #{distributionAllotTime}, + + + station_id = #{stationId}, + + + plan_name = #{planName}, + + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + distribution_id = distribution_id + WHERE + distribution_id = #{distributionId} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/stationuser/station-user-mapper.xml b/src/main/resources/mybatis/mapper/stationuser/station-user-mapper.xml new file mode 100644 index 0000000..8f3f5bd --- /dev/null +++ b/src/main/resources/mybatis/mapper/stationuser/station-user-mapper.xml @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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} + ) + + + + + UPDATE + e_station_user + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + station_user_id IN + + #{stationUserIds[${index}]} + + + + + DELETE FROM + e_station_user + WHERE + station_id = #{stationId} + + + + + + + + + + + DELETE FROM + e_station_user + WHERE + station_user_id IN + + #{stationUserIds[${index}]} + + + + + + UPDATE + e_station_user + SET + + station_id = #{stationId}, + + + station_user_user_id = #{stationUserUserId}, + + + station_user_user_name = #{stationUserUserName}, + + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + station_user_id = station_user_id + WHERE + station_user_id = #{stationUserId} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examination/distribution/list.html b/src/main/resources/static/route/examination/distribution/list.html new file mode 100644 index 0000000..a43a11c --- /dev/null +++ b/src/main/resources/static/route/examination/distribution/list.html @@ -0,0 +1,299 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+ + + + + + + + + + + + + + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examination/distribution/save.html b/src/main/resources/static/route/examination/distribution/save.html new file mode 100644 index 0000000..e0d6f52 --- /dev/null +++ b/src/main/resources/static/route/examination/distribution/save.html @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examination/distribution/update.html b/src/main/resources/static/route/examination/distribution/update.html new file mode 100644 index 0000000..738bd01 --- /dev/null +++ b/src/main/resources/static/route/examination/distribution/update.html @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + +
+
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examination/field/save.html b/src/main/resources/static/route/examination/field/save.html index f7bebc0..5052cc4 100644 --- a/src/main/resources/static/route/examination/field/save.html +++ b/src/main/resources/static/route/examination/field/save.html @@ -67,15 +67,15 @@
- +
- +
- +
diff --git a/src/main/resources/static/route/examination/field/update.html b/src/main/resources/static/route/examination/field/update.html index 27439a6..efa7bb2 100644 --- a/src/main/resources/static/route/examination/field/update.html +++ b/src/main/resources/static/route/examination/field/update.html @@ -67,15 +67,15 @@
- +
- +
- +
diff --git a/src/main/resources/static/route/examination/station/list.html b/src/main/resources/static/route/examination/station/list.html index 9d565d6..58c8095 100644 --- a/src/main/resources/static/route/examination/station/list.html +++ b/src/main/resources/static/route/examination/station/list.html @@ -148,6 +148,12 @@ var rowData = row[this.field]; return '考场管理'; } + }, + {field:'institutionUserButton',fixed: 'right', width:150, title: '人员管理', align:'center', + templet: function(row) { + var rowData = row[this.field]; + return '人员管理'; + } } ] ], @@ -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() { diff --git a/src/main/resources/static/route/examination/station/save.html b/src/main/resources/static/route/examination/station/save.html index 9ce7ce5..fde8cd2 100644 --- a/src/main/resources/static/route/examination/station/save.html +++ b/src/main/resources/static/route/examination/station/save.html @@ -68,13 +68,13 @@
- +
- +
@@ -98,7 +98,7 @@
- +
diff --git a/src/main/resources/static/route/examination/station/update.html b/src/main/resources/static/route/examination/station/update.html index 70b0598..8d4b15b 100644 --- a/src/main/resources/static/route/examination/station/update.html +++ b/src/main/resources/static/route/examination/station/update.html @@ -68,13 +68,13 @@
- +
- +
@@ -98,7 +98,7 @@
- +
diff --git a/src/main/resources/static/route/examination/stationuser/list.html b/src/main/resources/static/route/examination/stationuser/list.html new file mode 100644 index 0000000..b3af117 --- /dev/null +++ b/src/main/resources/static/route/examination/stationuser/list.html @@ -0,0 +1,261 @@ + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + +
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examination/stationuser/save.html b/src/main/resources/static/route/examination/stationuser/save.html new file mode 100644 index 0000000..1094b99 --- /dev/null +++ b/src/main/resources/static/route/examination/stationuser/save.html @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/examination/stationuser/update.html b/src/main/resources/static/route/examination/stationuser/update.html new file mode 100644 index 0000000..86b2bdd --- /dev/null +++ b/src/main/resources/static/route/examination/stationuser/update.html @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file