Browse Source

读取游戏配置表(未测)

master
zy_Java 5 years ago
parent
commit
db2cc98262
  1. 11
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java
  2. 8
      game/src/main/java/com/ccsens/game/api/ScreenController.java
  3. 4
      game/src/main/java/com/ccsens/game/bean/dto/ScreenDto.java
  4. 11
      game/src/main/java/com/ccsens/game/bean/po/GameGroup.java
  5. 70
      game/src/main/java/com/ccsens/game/bean/po/GameGroupExample.java
  6. 12
      game/src/main/java/com/ccsens/game/service/IScreenService.java
  7. 556
      game/src/main/java/com/ccsens/game/service/ScreenService.java
  8. 8
      game/src/main/java/com/ccsens/game/util/GameConstant.java
  9. 25
      game/src/main/resources/mapper_raw/GameGroupMapper.xml
  10. 4
      game/src/main/resources/mbg.xml
  11. 3
      tall/src/main/java/com/ccsens/tall/bean/dto/WpsDto.java
  12. 12
      tall/src/main/java/com/ccsens/tall/service/IWpsService.java
  13. 17
      tall/src/main/java/com/ccsens/tall/service/WpsService.java
  14. 8
      tall/src/main/java/com/ccsens/tall/web/WpsController.java
  15. 3
      util/src/main/java/com/ccsens/util/CodeEnum.java
  16. 1
      util/src/main/java/com/ccsens/util/WebConstant.java

11
cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java

@ -171,6 +171,12 @@ public interface TallFeignClient {
@GetMapping("/wps/wpsId")
JsonResponse<WpsVo.BusinessFileIdAndPath> getPathByWpsId(@RequestParam(name = "wpsId")Long wpsId);
/**
* 通过token获得userId(消息系统用)
*/
@GetMapping("/v1/3rd/getFilePath")
String getWpsFilePath(@RequestParam(name = "businessId") Long businessId,@RequestParam(name = "businessType") byte businessType);
}
@Slf4j
@ -273,6 +279,11 @@ class TallFeignClientFallBack implements FallbackFactory<TallFeignClient> {
public JsonResponse<WpsVo.BusinessFileIdAndPath> getPathByWpsId(Long async) {
return JsonResponse.newInstance().fail();
}
@Override
public String getWpsFilePath(Long businessId, byte businessType) {
return null;
}
};
}

8
game/src/main/java/com/ccsens/game/api/ScreenController.java

@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Slf4j
@Api(tags = "大屏相关api" , description = "ScreenController")
@RestController
@ -83,9 +85,9 @@ public class ScreenController {
@ApiImplicitParams({
})
@RequestMapping(value = "/config", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<String> getConfig(@ApiParam @Validated @RequestBody QueryDto<ScreenDto.MemberRecord> params) throws Exception {
log.info("再玩一次:{}",params);
String url = screenService.getConfig(params);
public JsonResponse<List<String>> getConfig(@ApiParam @Validated @RequestBody QueryDto<ScreenDto.GetConfig> params) throws Exception {
log.info("查询游戏配置信息excel:{}",params);
List<String> url = screenService.getConfig(params);
return JsonResponse.newInstance().ok(url);
}

4
game/src/main/java/com/ccsens/game/bean/dto/ScreenDto.java

@ -60,8 +60,12 @@ public class ScreenDto {
@Data
@ApiModel("查看配置文件")
public static class GetConfig{
@NotNull
@ApiModelProperty("任务id")
private Long taskId;
@NotNull
@ApiModelProperty("要创建的小游戏的类型 例如: SQ:数钱 SP:赛跑 BH:拔河")
private String gameType;
}

11
game/src/main/java/com/ccsens/game/bean/po/GameGroup.java

@ -18,6 +18,8 @@ public class GameGroup implements Serializable {
private Byte recStatus;
private String headPortraitUrl;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -76,6 +78,14 @@ public class GameGroup implements Serializable {
this.recStatus = recStatus;
}
public String getHeadPortraitUrl() {
return headPortraitUrl;
}
public void setHeadPortraitUrl(String headPortraitUrl) {
this.headPortraitUrl = headPortraitUrl == null ? null : headPortraitUrl.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -89,6 +99,7 @@ public class GameGroup implements Serializable {
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", headPortraitUrl=").append(headPortraitUrl);
sb.append("]");
return sb.toString();
}

70
game/src/main/java/com/ccsens/game/bean/po/GameGroupExample.java

@ -544,6 +544,76 @@ public class GameGroupExample {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlIsNull() {
addCriterion("head_portrait_url is null");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlIsNotNull() {
addCriterion("head_portrait_url is not null");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlEqualTo(String value) {
addCriterion("head_portrait_url =", value, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlNotEqualTo(String value) {
addCriterion("head_portrait_url <>", value, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlGreaterThan(String value) {
addCriterion("head_portrait_url >", value, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlGreaterThanOrEqualTo(String value) {
addCriterion("head_portrait_url >=", value, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlLessThan(String value) {
addCriterion("head_portrait_url <", value, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlLessThanOrEqualTo(String value) {
addCriterion("head_portrait_url <=", value, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlLike(String value) {
addCriterion("head_portrait_url like", value, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlNotLike(String value) {
addCriterion("head_portrait_url not like", value, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlIn(List<String> values) {
addCriterion("head_portrait_url in", values, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlNotIn(List<String> values) {
addCriterion("head_portrait_url not in", values, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlBetween(String value1, String value2) {
addCriterion("head_portrait_url between", value1, value2, "headPortraitUrl");
return (Criteria) this;
}
public Criteria andHeadPortraitUrlNotBetween(String value1, String value2) {
addCriterion("head_portrait_url not between", value1, value2, "headPortraitUrl");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

12
game/src/main/java/com/ccsens/game/service/IScreenService.java

@ -39,9 +39,21 @@ public interface IScreenService {
Long getGameTypeId(Long recordId);
/**
* 根据游戏id获取分组信息
* @param recordId 游戏id
* @return 返回分组信息
*/
List<ScreenVo.Group> getGroupByRecordId(Long recordId);
ScreenVo.RecordInfo getRecordByTaskId(Long taskId,String gameType);
Map<String, Object> getGroupTotalScore(Long groupId);
/**
* 查询游戏配置excel
* @param params
* @return
*/
List<String> getConfig(QueryDto<ScreenDto.GetConfig> params)throws Exception;
}

556
game/src/main/java/com/ccsens/game/service/ScreenService.java

@ -1,10 +1,12 @@
package com.ccsens.game.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.ccsens.cloudutil.bean.tall.dto.WpsDto;
import com.ccsens.cloudutil.feign.TallFeignClient;
import com.ccsens.game.bean.dto.ClientDto;
import com.ccsens.game.bean.dto.ScreenDto;
@ -16,22 +18,27 @@ import com.ccsens.game.persist.dao.*;
import com.ccsens.game.util.GameConstant;
import com.ccsens.game.util.SendMsg;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.ExcelUtil;
import com.ccsens.util.RedisUtil;
import com.ccsens.util.WebConstant;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import javax.annotation.Resource;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
/**
* @author zy
@ -40,92 +47,57 @@ import java.util.concurrent.*;
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class ScreenService implements IScreenService {
@Autowired
private ClientService clientService;
@Autowired
@Resource
private GameUserPayDao gameUserPayDao;
@Autowired
@Resource
private GameTypeDao gameTypeDao;
@Autowired
@Resource
private GameRecordDao gameRecordDao;
@Autowired
@Resource
private GameGroupDao gameGroupDao;
@Autowired
@Resource
private GameUserJoinGroupDao gameUserJoinGroupDao;
@Autowired
@Resource
private GameActivityRuleDao activityRuleDao;
@Autowired
@Resource
private GameActivityPrizeDao activityPrizeDao;
@Autowired
@Resource
private GamePrizeInstructionsDao prizeInstructionsDao;
@Autowired
@Resource
private GameUserJoinDao gameUserJoinDao;
@Autowired
@Resource
private TallFeignClient tallFeignClient;
@Autowired
@Resource
private IMessageService messageService;
@Autowired
@Resource
private Snowflake snowflake;
@Autowired
@Resource
private SendMsg sendMsg;
@Autowired
@Resource
private RedisUtil redisUtil;
/**
* 传入用户信息返回游戏大屏路径
* 创建游戏
*
* @return
* @return 返回游戏数据
*/
@Override
public ScreenVo.UrlVo getScreenUrl(QueryDto<ScreenDto.MemberGame> params) throws Exception {
ScreenDto.MemberGame memberGame = params.getParam();
Long userId = params.getUserId();
//查找游戏
GameType gameType = null;
GameTypeExample gameTypeExample = new GameTypeExample();
gameTypeExample.createCriteria().andCodeEqualTo(memberGame.getGameType());
List<GameType> gameTypeList = gameTypeDao.selectByExample(gameTypeExample);
if (CollectionUtil.isNotEmpty(gameTypeList)) {
gameType = gameTypeList.get(0);
}
if (ObjectUtil.isNull(gameType)) {
if (CollectionUtil.isEmpty(gameTypeList)) {
throw new BaseException(CodeEnum.NOT_GAME_TYPE);
}
GameType gameType = gameTypeList.get(0);
//2、查找此用户购买的此游戏的信息,若没有则添加一条记录,默认已付款,结束时间为添加后的一个月,默认次数为10次
GameUserPay gameUserPay = null;
GameUserPayExample gameUserPayExample = new GameUserPayExample();
gameUserPayExample.createCriteria().andUserIdEqualTo(params.getUserId()).andGameTypeIdEqualTo(gameType.getId());
List<GameUserPay> gameUserPayList = gameUserPayDao.selectByExample(gameUserPayExample);
if (CollectionUtil.isNotEmpty(gameUserPayList)) {
gameUserPay = gameUserPayList.get(0);
} else {
gameUserPay = new GameUserPay();
gameUserPay.setId(snowflake.nextId());
gameUserPay.setUserId(params.getUserId());
gameUserPay.setGameTypeId(gameType.getId());
gameUserPay.setTotalCount(10);
gameUserPay.setUsedCount(0);
gameUserPay.setCreatedTime(System.currentTimeMillis());
gameUserPay.setDueTime(gameUserPay.getCreatedTime() + (3600 * 24 * 30));
gameUserPayDao.insertSelective(gameUserPay);
}
//查询该任务下的游戏记录信息
GameUserPay gameUserPay = getGameUserPay(userId, gameType);
//查询该任务下的游戏记录信息 如果还有其他未结束的游戏则返回提示信息
if (ObjectUtil.isNotNull(memberGame.getTaskId())) {
GameRecordExample recordExample = new GameRecordExample();
recordExample.createCriteria().andTaskIdEqualTo(memberGame.getTaskId());
recordExample.setOrderByClause("created_at DESC");
List<GameRecord> recordList = gameRecordDao.selectByExample(recordExample);
if (CollectionUtil.isNotEmpty(recordList)) {
GameRecord record = recordList.get(0);
if(record.getGameStatus() == GameConstant.GAME_PREPARATION ||
record.getGameStatus() == GameConstant.GAME_PROCESSING){
throw new BaseException(CodeEnum.GAME_NO_END);
}
if(record.getGameStatus() == GameConstant.GAME_PENDING){
record.setGameStatus(GameConstant.GAME_COMPLETED);
gameRecordDao.updateByPrimaryKeySelective(record);
}
}
selectOldRecord(memberGame.getTaskId());
}
//3、根据用户购买的记录,添加一场新的游戏记录
@ -143,21 +115,36 @@ public class ScreenService implements IScreenService {
}
gameRecord.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecord.getId());
gameRecord.setQrCodeUrl(gameUrl + gameRecord.getId() + File.separator + gameType.getClientUrl());
//查找此任务下的游戏配置表
byte businessType = 8;
if( GameConstant.GAME_TYPE_SQ.equalsIgnoreCase(memberGame.getGameType())){
businessType = 9;
}else if( GameConstant.GAME_TYPE_BH.equalsIgnoreCase(memberGame.getGameType())){
businessType = 10;
}
String wpsFilePath = tallFeignClient.getWpsFilePath(memberGame.getTaskId(),businessType);
if(StrUtil.isNotEmpty(wpsFilePath)){
//添加配置信息
saveGameRecord(wpsFilePath,gameRecord);
}
//将游戏记录添加数据库
gameRecordDao.insertSelective(gameRecord);
//4、 判断是否有分组,如果是分组游戏,添加两条分组信息
if (gameType.getIsGroup() == 1) {
GameGroup gameGroupRed = new GameGroup();
gameGroupRed.setId(snowflake.nextId());
gameGroupRed.setRecordId(gameRecord.getId());
gameGroupRed.setName(memberGame.getFirstTeam());
gameGroupRed.setCode(GameConstant.FIRST_GROUP);
gameGroupDao.insertSelective(gameGroupRed);
GameGroup gameGroupBlue = new GameGroup();
gameGroupBlue.setId(snowflake.nextId());
gameGroupBlue.setRecordId(gameRecord.getId());
gameGroupBlue.setName(memberGame.getSecondTeam());
gameGroupBlue.setCode(GameConstant.SECOND_GROUP);
gameGroupDao.insertSelective(gameGroupBlue);
//配置表不存在,而且游戏类型默认为分组游戏,默认添加两个分组
if(StrUtil.isEmpty(wpsFilePath) && gameType.getIsGroup() == 1){
if (gameType.getIsGroup() == 1) {
GameGroup gameGroupRed = new GameGroup();
gameGroupRed.setId(snowflake.nextId());
gameGroupRed.setRecordId(gameRecord.getId());
gameGroupRed.setName(memberGame.getFirstTeam());
gameGroupRed.setCode(GameConstant.FIRST_GROUP);
gameGroupDao.insertSelective(gameGroupRed);
GameGroup gameGroupBlue = new GameGroup();
gameGroupBlue.setId(snowflake.nextId());
gameGroupBlue.setRecordId(gameRecord.getId());
gameGroupBlue.setName(memberGame.getSecondTeam());
gameGroupBlue.setCode(GameConstant.SECOND_GROUP);
gameGroupDao.insertSelective(gameGroupBlue);
}
}
//5、查询该游戏的规则
@ -172,7 +159,7 @@ public class ScreenService implements IScreenService {
String url = gameRecord.getUrl() + "&projectId=" + memberGame.getProjectId();
//给所有人发送消息发送消息
ChromeMessageDto chromeMessageDto = new ChromeMessageDto(url, gameRecord.getId(), memberGame.getProjectId(),gameType.getCode());
BaseMessageDto.MessageUser messageUser = null;
BaseMessageDto.MessageUser messageUser;
List<BaseMessageDto.MessageUser> messageUserList = new ArrayList<>();
//获取项目下所有成员
List<Long> memberIdList = tallFeignClient.getMemberIdListByProject(memberGame.getProjectId());
@ -185,14 +172,237 @@ public class ScreenService implements IScreenService {
}
chromeMessageDto.setReceivers(messageUserList);
messageService.sendGameMessageWithGetUrl(chromeMessageDto);
return urlVo;
}
/**
* 根据配置信息创建游戏
* @param wpsFilePath 配置文件的路径
* @param gameRecord 新建的游戏记录信息
*/
private void saveGameRecord(String wpsFilePath,GameRecord gameRecord) throws Exception{
InputStream is = new FileInputStream(new File(wpsFilePath));
//读取excel
XSSFWorkbook wb = new XSSFWorkbook(is);
if(ObjectUtil.isNull(wb)){ throw new BaseException(CodeEnum.NOT_CONFIG_OR_ERR); }
//读取sheet
XSSFSheet sheet = wb.getSheet("游戏配置表");
if(ObjectUtil.isNull(sheet)){ throw new BaseException(CodeEnum.NOT_CONFIG_OR_ERR); }
//比赛模式
XSSFRow gamePatternRow = sheet.getRow(1);
if(ObjectUtil.isNotNull(gamePatternRow)){
String gamePattern = ExcelUtil.getCellValue(gamePatternRow.getCell(1));
if(gamePattern.equalsIgnoreCase(GameConstant.GAME_GROUP)){
gameRecord.setGroup((byte) 1);
}
}
//比赛时长
XSSFRow durationRow = sheet.getRow(2);
if(ObjectUtil.isNotNull(durationRow)){
int duration = Integer.parseInt(ExcelUtil.getCellValue(durationRow.getCell(1)));
gameRecord.setDuration(duration);
}
//人数上限
XSSFRow memberLimitRow = sheet.getRow(3);
if(ObjectUtil.isNotNull(memberLimitRow)){
int memberLimit = Integer.parseInt(ExcelUtil.getCellValue(durationRow.getCell(1)));
gameRecord.setMemberLimit(memberLimit);
}
//排名计算方式
XSSFRow rankRuleRow = sheet.getRow(4);
if(ObjectUtil.isNotNull(rankRuleRow)){
String rankRule = ExcelUtil.getCellValue(rankRuleRow.getCell(1));
if(rankRule.equalsIgnoreCase(GameConstant.GAME_RANK_AVE)) {
gameRecord.setRankRule((byte) 1);
}
}
//添加分组信息
if(gameRecord.getGroup() == 1){
for (int i = 8; i < sheet.getLastRowNum(); i++){
XSSFRow groupRow = sheet.getRow(1);
if(ObjectUtil.isNotNull(groupRow)){
String groupName = ExcelUtil.getCellValue(groupRow.getCell(0));
String groupUrl = ExcelUtil.getCellValue(groupRow.getCell(0));
if(ObjectUtil.isNotNull(groupName)){
GameGroup gameGroup = new GameGroup();
gameGroup.setId(snowflake.nextId());
gameGroup.setRecordId(gameRecord.getId());
gameGroup.setName(groupName);
// gameGroup.setCode(GameConstant.FIRST_GROUP);
if(ObjectUtil.isNotNull(groupUrl)){
gameGroup.setHeadPortraitUrl(groupUrl);
}
gameGroupDao.insertSelective(gameGroup);
}
}
}
}
}
/**
* 查询该任务下的游戏记录信息 如果还有其他未结束的游戏则返回提示信息
* @param taskId 任务id
*/
private void selectOldRecord(Long taskId) {
GameRecordExample recordExample = new GameRecordExample();
recordExample.createCriteria().andTaskIdEqualTo(taskId);
recordExample.setOrderByClause("created_at DESC");
List<GameRecord> recordList = gameRecordDao.selectByExample(recordExample);
if (CollectionUtil.isNotEmpty(recordList)) {
GameRecord record = recordList.get(0);
if(record.getGameStatus() == GameConstant.GAME_PREPARATION ||
record.getGameStatus() == GameConstant.GAME_PROCESSING){
throw new BaseException(CodeEnum.GAME_NO_END);
}
if(record.getGameStatus() == GameConstant.GAME_PENDING){
record.setGameStatus(GameConstant.GAME_COMPLETED);
gameRecordDao.updateByPrimaryKeySelective(record);
}
}
}
/**
* 查找此用户购买的此游戏的信息
* @param userId userId
* @param gameType 游戏类型
* @return 返回购买记录
*/
private GameUserPay getGameUserPay(Long userId, GameType gameType) {
GameUserPay gameUserPay;
GameUserPayExample gameUserPayExample = new GameUserPayExample();
gameUserPayExample.createCriteria().andUserIdEqualTo(userId).andGameTypeIdEqualTo(gameType.getId());
List<GameUserPay> gameUserPayList = gameUserPayDao.selectByExample(gameUserPayExample);
if (CollectionUtil.isNotEmpty(gameUserPayList)) {
gameUserPay = gameUserPayList.get(0);
} else {
gameUserPay = new GameUserPay();
gameUserPay.setId(snowflake.nextId());
gameUserPay.setUserId(userId);
gameUserPay.setGameTypeId(gameType.getId());
gameUserPay.setTotalCount(10);
gameUserPay.setUsedCount(0);
gameUserPay.setCreatedTime(System.currentTimeMillis());
gameUserPay.setDueTime(gameUserPay.getCreatedTime() + (3600 * 24 * 30));
gameUserPayDao.insertSelective(gameUserPay);
}
return gameUserPay;
}
// @Override
// public ScreenVo.UrlVo getScreenUrl(QueryDto<ScreenDto.MemberGame> params) throws Exception {
// ScreenDto.MemberGame memberGame = params.getParam();
// //查找游戏
// GameType gameType = null;
// GameTypeExample gameTypeExample = new GameTypeExample();
// gameTypeExample.createCriteria().andCodeEqualTo(memberGame.getGameType());
// List<GameType> gameTypeList = gameTypeDao.selectByExample(gameTypeExample);
// if (CollectionUtil.isNotEmpty(gameTypeList)) {
// gameType = gameTypeList.get(0);
// }
// if (ObjectUtil.isNull(gameType)) {
// throw new BaseException(CodeEnum.NOT_GAME_TYPE);
// }
// //2、查找此用户购买的此游戏的信息,若没有则添加一条记录,默认已付款,结束时间为添加后的一个月,默认次数为10次
// GameUserPay gameUserPay = null;
// GameUserPayExample gameUserPayExample = new GameUserPayExample();
// gameUserPayExample.createCriteria().andUserIdEqualTo(params.getUserId()).andGameTypeIdEqualTo(gameType.getId());
// List<GameUserPay> gameUserPayList = gameUserPayDao.selectByExample(gameUserPayExample);
// if (CollectionUtil.isNotEmpty(gameUserPayList)) {
// gameUserPay = gameUserPayList.get(0);
// } else {
// gameUserPay = new GameUserPay();
// gameUserPay.setId(snowflake.nextId());
// gameUserPay.setUserId(params.getUserId());
// gameUserPay.setGameTypeId(gameType.getId());
// gameUserPay.setTotalCount(10);
// gameUserPay.setUsedCount(0);
// gameUserPay.setCreatedTime(System.currentTimeMillis());
// gameUserPay.setDueTime(gameUserPay.getCreatedTime() + (3600 * 24 * 30));
// gameUserPayDao.insertSelective(gameUserPay);
// }
// //查询该任务下的游戏记录信息
// if (ObjectUtil.isNotNull(memberGame.getTaskId())) {
// GameRecordExample recordExample = new GameRecordExample();
// recordExample.createCriteria().andTaskIdEqualTo(memberGame.getTaskId());
// recordExample.setOrderByClause("created_at DESC");
// List<GameRecord> recordList = gameRecordDao.selectByExample(recordExample);
// if (CollectionUtil.isNotEmpty(recordList)) {
// GameRecord record = recordList.get(0);
// if(record.getGameStatus() == GameConstant.GAME_PREPARATION ||
// record.getGameStatus() == GameConstant.GAME_PROCESSING){
// throw new BaseException(CodeEnum.GAME_NO_END);
// }
// if(record.getGameStatus() == GameConstant.GAME_PENDING){
// record.setGameStatus(GameConstant.GAME_COMPLETED);
// gameRecordDao.updateByPrimaryKeySelective(record);
// }
// }
// }
//
// //3、根据用户购买的记录,添加一场新的游戏记录
// GameRecord gameRecord = new GameRecord();
// gameRecord.setId(snowflake.nextId());
// gameRecord.setUserPayId(gameUserPay.getId());
// gameRecord.setTaskId(memberGame.getTaskId());
// //添加路径
// String gameUrl = WebConstant.TEST_URL_GAME_SQ;
// switch (gameType.getCode()){
// case GameConstant.GAME_TYPE_SQ: break;
// case GameConstant.GAME_TYPE_SP: gameUrl = WebConstant.TEST_URL_GAME_SP; break;
// case GameConstant.GAME_TYPE_BH: gameUrl = WebConstant.TEST_URL_GAME_BH; break;
// default:break;
// }
// gameRecord.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecord.getId());
// gameRecord.setQrCodeUrl(gameUrl + gameRecord.getId() + File.separator + gameType.getClientUrl());
// gameRecordDao.insertSelective(gameRecord);
// //4、 判断是否有分组,如果是分组游戏,添加两条分组信息
// if (gameType.getIsGroup() == 1) {
// GameGroup gameGroupRed = new GameGroup();
// gameGroupRed.setId(snowflake.nextId());
// gameGroupRed.setRecordId(gameRecord.getId());
// gameGroupRed.setName(memberGame.getFirstTeam());
// gameGroupRed.setCode(GameConstant.FIRST_GROUP);
// gameGroupDao.insertSelective(gameGroupRed);
// GameGroup gameGroupBlue = new GameGroup();
// gameGroupBlue.setId(snowflake.nextId());
// gameGroupBlue.setRecordId(gameRecord.getId());
// gameGroupBlue.setName(memberGame.getSecondTeam());
// gameGroupBlue.setCode(GameConstant.SECOND_GROUP);
// gameGroupDao.insertSelective(gameGroupBlue);
// }
//
// //5、查询该游戏的规则
// List<String> ruleList = getGameActivityRule(gameType.getId());
// //6、返回
// ScreenVo.UrlVo urlVo = new ScreenVo.UrlVo();
// urlVo.setId(gameRecord.getId());
// urlVo.setUrl(gameRecord.getUrl());
// urlVo.setRuleList(ruleList);
//
// //路径(添加项目id)
// String url = gameRecord.getUrl() + "&projectId=" + memberGame.getProjectId();
// //给所有人发送消息发送消息
// ChromeMessageDto chromeMessageDto = new ChromeMessageDto(url, gameRecord.getId(), memberGame.getProjectId(),gameType.getCode());
// BaseMessageDto.MessageUser messageUser = null;
// List<BaseMessageDto.MessageUser> messageUserList = new ArrayList<>();
// //获取项目下所有成员
// List<Long> memberIdList = tallFeignClient.getMemberIdListByProject(memberGame.getProjectId());
// if (CollectionUtil.isNotEmpty(memberIdList)) {
// for (Long memberId : memberIdList) {
// messageUser = new BaseMessageDto.MessageUser();
// messageUser.setUserId(memberId);
// messageUserList.add(messageUser);
// }
// }
// chromeMessageDto.setReceivers(messageUserList);
// messageService.sendGameMessageWithGetUrl(chromeMessageDto);
//
// return urlVo;
// }
/**
* 获取游戏基本信息
*
* @return
* @return 返回游戏基本信息
*/
@Override
public ScreenVo.GameInfoVo getGameInformation(QueryDto<ScreenDto.MemberRecord> params) {
@ -252,12 +462,10 @@ public class ScreenService implements IScreenService {
}
gameInfoVo.setPreparingData(preparingData);
break;
case 2:
break;
case 3:
//查询游戏是否有分组
GameType gameType = gameTypeDao.selectByPrimaryKey(gameUserPay.getGameTypeId());
ScreenVo.CompletedData completedData = null;
ScreenVo.CompletedData completedData;
if (gameType.getIsGroup() == 0) {
completedData = getCompletedData(memberRecord.getMemberRecord());
} else {
@ -271,7 +479,6 @@ public class ScreenService implements IScreenService {
return gameInfoVo;
}
/**
* 获取游戏状态
*/
@ -332,7 +539,7 @@ public class ScreenService implements IScreenService {
}
break;
case GameConstant.GAME_COMPLETED:
ScreenVo.CompletedData completedData = null;
ScreenVo.CompletedData completedData;
if (gameType.getIsGroup() == 0) {
completedData = getCompletedData(memberRecord.getMemberRecord());
} else {
@ -440,12 +647,10 @@ public class ScreenService implements IScreenService {
return groupMap;
}
/**
* 查询总分数总次数平均以及前十名
*
* @param gameRecordId
* @return
* @param gameRecordId 游戏id
*/
private ScreenVo.CompletedData getCompletedData(long gameRecordId) {
ScreenVo.CompletedData completedData = new ScreenVo.CompletedData();
@ -488,9 +693,9 @@ public class ScreenService implements IScreenService {
/**
* 查询参加游戏的用户信息
*
* @param userId
* @param gameRecordId
* @return
* @param userId userID
* @param gameRecordId 游戏id
* @return 返回参加游戏的用户
*/
private GameUserJoin getGameUserJoin(Long userId, Long gameRecordId) {
GameUserJoinExample joinExample = new GameUserJoinExample();
@ -506,13 +711,13 @@ public class ScreenService implements IScreenService {
/**
* 查询游戏信息
*
* @param gameRecordId
* @return
* @param gameRecordId 游戏记录id
* @return 返回游戏信息
*/
@Override
public GameRecord getGameRecord(long gameRecordId) {
String gameRecordStr = (String) redisUtil.get(GameConstant.generateGameStatusKey(gameRecordId));
GameRecord gameRecord = null;
GameRecord gameRecord;
if (StrUtil.isBlank(gameRecordStr)) {
gameRecord = gameRecordDao.selectByPrimaryKey(gameRecordId);
if (ObjectUtil.isNull(gameRecord)) {
@ -527,8 +732,8 @@ public class ScreenService implements IScreenService {
/**
* 查询前十名
*
* @param gameRecordId
* @return
* @param gameRecordId 游戏记录id
* @return 返回前十名信息
*/
private List<ScreenVo.TopUsers> getTopUsers(Long gameRecordId) {
List<ScreenVo.TopUsers> tops;
@ -573,51 +778,57 @@ public class ScreenService implements IScreenService {
throw new BaseException(CodeEnum.NOT_GAME_TYPE);
}
if (gameUserPay.getUsedCount() >= gameUserPay.getTotalCount()) {
throw new BaseException(CodeEnum.GAME_NOT_TIMES);
}
GameRecord gameRecordNew = null;
if (gameRecord.getGameStatus() == 3) {
//添加一场新的游戏记录
gameRecordNew = new GameRecord();
gameRecordNew.setId(snowflake.nextId());
gameRecordNew.setUserPayId(gameUserPay.getId());
//添加路径
String gameUrl = WebConstant.TEST_URL_GAME_SQ;
switch (gameType.getCode()){
case GameConstant.GAME_TYPE_SQ: break;
case GameConstant.GAME_TYPE_SP: gameUrl = WebConstant.TEST_URL_GAME_SP ; break;
case GameConstant.GAME_TYPE_BH: gameUrl = WebConstant.TEST_URL_GAME_BH; break;
default:break;
}
gameRecordNew.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecordNew.getId());
gameRecordNew.setQrCodeUrl(gameUrl+ gameRecordNew.getId() + File.separator + gameType.getClientUrl());
gameRecordDao.insertSelective(gameRecordNew);
//修改购买的游戏的使用次数
gameUserPay.setUsedCount(gameUserPay.getUsedCount() + 1);
gameUserPayDao.updateByPrimaryKeySelective(gameUserPay);
//路径(添加项目id)
String url = gameRecord.getUrl() + "&projectId=" + memberRecord.getProjectId();
//给所有人发送消息发送消息
ChromeMessageDto chromeMessageDto = new ChromeMessageDto(url, gameRecord.getId(), memberRecord.getProjectId(),gameType.getCode());
BaseMessageDto.MessageUser messageUser = null;
List<BaseMessageDto.MessageUser> messageUserList = new ArrayList<>();
//获取项目下所有成员
List<Long> memberIdList = tallFeignClient.getMemberIdListByProject(memberRecord.getProjectId());
if (CollectionUtil.isNotEmpty(memberIdList)) {
for (Long memberId : memberIdList) {
messageUser = new BaseMessageDto.MessageUser();
messageUser.setUserId(memberId);
messageUserList.add(messageUser);
}
}
chromeMessageDto.setReceivers(messageUserList);
messageService.sendGameMessageWithGetUrl(chromeMessageDto);
} else {
// if (gameUserPay.getUsedCount() >= gameUserPay.getTotalCount()) {
// throw new BaseException(CodeEnum.GAME_NOT_TIMES);
// }
//之前的游戏若是准备中或进行中,则返回提示
if(gameRecord.getGameStatus() == GameConstant.GAME_PREPARATION ||
gameRecord.getGameStatus() == GameConstant.GAME_PROCESSING){
throw new BaseException(CodeEnum.GAME_NO_END);
}
//若是未开始,则将之前的游戏状态改成已结束
if(gameRecord.getGameStatus() == GameConstant.GAME_PENDING){
gameRecord.setGameStatus(GameConstant.GAME_COMPLETED);
gameRecordDao.updateByPrimaryKeySelective(gameRecord);
}
GameRecord gameRecordNew;
//添加一场新的游戏记录
gameRecordNew = new GameRecord();
gameRecordNew.setId(snowflake.nextId());
gameRecordNew.setUserPayId(gameUserPay.getId());
//添加路径
String gameUrl = WebConstant.TEST_URL_GAME_SQ;
switch (gameType.getCode()){
case GameConstant.GAME_TYPE_SQ: break;
case GameConstant.GAME_TYPE_SP: gameUrl = WebConstant.TEST_URL_GAME_SP ; break;
case GameConstant.GAME_TYPE_BH: gameUrl = WebConstant.TEST_URL_GAME_BH; break;
default:break;
}
gameRecordNew.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecordNew.getId());
gameRecordNew.setQrCodeUrl(gameUrl+ gameRecordNew.getId() + File.separator + gameType.getClientUrl());
gameRecordDao.insertSelective(gameRecordNew);
//修改购买的游戏的使用次数
gameUserPay.setUsedCount(gameUserPay.getUsedCount() + 1);
gameUserPayDao.updateByPrimaryKeySelective(gameUserPay);
//路径(添加项目id)
String url = gameRecord.getUrl() + "&projectId=" + memberRecord.getProjectId();
//给所有人发送消息发送消息
ChromeMessageDto chromeMessageDto = new ChromeMessageDto(url, gameRecord.getId(), memberRecord.getProjectId(),gameType.getCode());
BaseMessageDto.MessageUser messageUser;
List<BaseMessageDto.MessageUser> messageUserList = new ArrayList<>();
//获取项目下所有成员
List<Long> memberIdList = tallFeignClient.getMemberIdListByProject(memberRecord.getProjectId());
if (CollectionUtil.isNotEmpty(memberIdList)) {
for (Long memberId : memberIdList) {
messageUser = new BaseMessageDto.MessageUser();
messageUser.setUserId(memberId);
messageUserList.add(messageUser);
}
}
chromeMessageDto.setReceivers(messageUserList);
messageService.sendGameMessageWithGetUrl(chromeMessageDto);
return gameRecordNew.getUrl();
}
@ -715,8 +926,8 @@ public class ScreenService implements IScreenService {
/**
* 开始游戏
*
* @param start
* @return
* @param start 游戏记录开始时间
* @return 返回本地开始和结束时间
*/
@Override
public ScreenVo.StartGame startGame(ScreenDto.Start start) {
@ -830,8 +1041,7 @@ public class ScreenService implements IScreenService {
/**
* 推送客户端状态
*
* @param gameRecord
* @param executor
* @param gameRecord 游戏记录
*/
private void pushClient(GameRecord gameRecord, ScheduledExecutorService executor) {
@ -943,4 +1153,66 @@ public class ScreenService implements IScreenService {
}
return recordInfo;
}
@Override
public List<String> getConfig(QueryDto<ScreenDto.GetConfig> params)throws Exception {
ScreenDto.GetConfig getConfig = params.getParam();
//根据游戏类型获取文件类型
byte businessType = 8;
if( GameConstant.GAME_TYPE_SQ.equalsIgnoreCase(getConfig.getGameType())){
businessType = 9;
}else if( GameConstant.GAME_TYPE_BH.equalsIgnoreCase(getConfig.getGameType())){
businessType = 10;
}
//查询该任务是否已有创建的游戏配置
List<String> wpsPath;
WpsDto.VisitWpsUrl visitWpsUrl = new WpsDto.VisitWpsUrl();
visitWpsUrl.setBusinessId(getConfig.getTaskId());
visitWpsUrl.setBusinessType(businessType);
visitWpsUrl.setUserId(params.getUserId());
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl);
//有配置直接返回
if (CollectionUtil.isNotEmpty(wpsPath)) {
return wpsPath;
}
//没有则生成默认模板并返回,
//查找游戏
GameTypeExample gameTypeExample = new GameTypeExample();
gameTypeExample.createCriteria().andCodeEqualTo(getConfig.getGameType());
List<GameType> gameTypeList = gameTypeDao.selectByExample(gameTypeExample);
if (CollectionUtil.isEmpty(gameTypeList)) {
throw new BaseException(CodeEnum.NOT_GAME_TYPE);
}
GameType gameType = gameTypeList.get(0);
//生成excel写入的数据
String templatePath = WebConstant.HOME_STATICREC + "GameConfig.xlsx";
InputStream is = new FileInputStream(new File(templatePath));
Workbook wb = new XSSFWorkbook(is);
//生成文件
String name = gameType.getName() + "游戏配置表.xlsx";
String fileName = "game/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx";
String path = WebConstant.UPLOAD_PATH_BASE + File.separator + fileName;
File tmpFile = new File(path);
if (!tmpFile.getParentFile().exists()) {
tmpFile.getParentFile().mkdirs();
}
OutputStream stream = new FileOutputStream(tmpFile);
wb.write(stream);
stream.close();
//关联wps
WpsDto.Business business = new WpsDto.Business();
business.setBusinessId(getConfig.getTaskId());
business.setBusinessType(businessType);
business.setUserId(params.getUserId());
business.setFileName(name);
business.setFilePath(fileName);
business.setFileSize(tmpFile.length());
business.setOperation(WebConstant.Wps.USER_OPERATION_NEW);
business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_WRITE);
tallFeignClient.saveWpsFile(business);
return tallFeignClient.queryVisitUrls(visitWpsUrl);
}
}

8
game/src/main/java/com/ccsens/game/util/GameConstant.java

@ -37,6 +37,14 @@ public class GameConstant {
public static final long GAME_TIME = 60*1000;
/**再来一次*/
public static final byte GAME_RESTART_STATUS = 1;
/**个人*/
public static final String GAME_INDIVIDUAL = "个人";
/**团体*/
public static final String GAME_GROUP = "团体";
/**按人均分排名*/
public static final String GAME_RANK_AVE = "按人均分排名";
/**按总分排名*/
public static final String GAME_RANK_TOTAL = "按总分排名";
/**
* 生成游戏key

25
game/src/main/resources/mapper_raw/GameGroupMapper.xml

@ -9,6 +9,7 @@
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="head_portrait_url" jdbcType="VARCHAR" property="headPortraitUrl" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -69,7 +70,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, record_id, code, name, created_at, updated_at, rec_status
id, record_id, code, name, created_at, updated_at, rec_status, head_portrait_url
</sql>
<select id="selectByExample" parameterType="com.ccsens.game.bean.po.GameGroupExample" resultMap="BaseResultMap">
select
@ -104,10 +105,10 @@
<insert id="insert" parameterType="com.ccsens.game.bean.po.GameGroup">
insert into t_game_group (id, record_id, code,
name, created_at, updated_at,
rec_status)
rec_status, head_portrait_url)
values (#{id,jdbcType=BIGINT}, #{recordId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{recStatus,jdbcType=TINYINT}, #{headPortraitUrl,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.game.bean.po.GameGroup">
insert into t_game_group
@ -133,6 +134,9 @@
<if test="recStatus != null">
rec_status,
</if>
<if test="headPortraitUrl != null">
head_portrait_url,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -156,6 +160,9 @@
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="headPortraitUrl != null">
#{headPortraitUrl,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.game.bean.po.GameGroupExample" resultType="java.lang.Long">
@ -188,6 +195,9 @@
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.headPortraitUrl != null">
head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -201,7 +211,8 @@
name = #{record.name,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
rec_status = #{record.recStatus,jdbcType=TINYINT},
head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -227,6 +238,9 @@
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="headPortraitUrl != null">
head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -237,7 +251,8 @@
name = #{name,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
rec_status = #{recStatus,jdbcType=TINYINT},
head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

4
game/src/main/resources/mbg.xml

@ -57,14 +57,14 @@
</javaClientGenerator>
<!-- <table tableName="t_game_type" domainObjectName="GameType"></table>-->
<!--<table tableName="t_game_user_pay" domainObjectName="GameUserPay"></table>-->
<table tableName="t_game_record" domainObjectName="GameRecord"></table>
<!-- <table tableName="t_game_record" domainObjectName="GameRecord"></table>-->
<!-- <table tableName="t_game_user_join" domainObjectName="GameUserJoin"></table>-->
<!--<table tableName="t_game_score_log" domainObjectName="GameScoreLog"></table>-->
<!--<table tableName="t_game_activity_rule" domainObjectName="GameActivityRule"></table>-->
<!--<table tableName="t_game_activity_prize" domainObjectName="GameActivityPrize"></table>-->
<!--<table tableName="t_game_prize_instructions" domainObjectName="GamePrizeInstructions"></table>-->
<!-- <table tableName="t_game_user_join_group" domainObjectName="GameUserJoinGroup"></table>-->
<!-- <table tableName="t_game_group" domainObjectName="GameGroup"></table>-->
<table tableName="t_game_group" domainObjectName="GameGroup"></table>
<!-- 有些表的字段需要指定java类型

3
tall/src/main/java/com/ccsens/tall/bean/dto/WpsDto.java

@ -167,7 +167,8 @@ public class WpsDto {
private Long businessId;
@ApiModelProperty("wps文件ID")
private Long wpsFileId;
@ApiModelProperty("业务类型 0项目WBS 1交付物 2会议记录")
@ApiModelProperty("业务类型 0: 项目ID 1:交付物ID 2会议记录 3产品依据表" +
",4产品收入表,5成本表,6损益表,7现金流表,8数钱游戏配置,9赛跑游戏配置,10拔河游戏配置")
private Byte businessType;
@ApiModelProperty("用户ID")
private Long userId;

12
tall/src/main/java/com/ccsens/tall/service/IWpsService.java

@ -104,9 +104,15 @@ public interface IWpsService {
WpsVo.BusinessFileIdAndPath getPathById(Long fileId);
/**
*
* @param wpsPower
* @return
* 获取文件的读取权限
* @param wpsPower 业务id 业务类型wpsiduserId
* @return 返回读取类型
*/
String getWpsPower(WpsDto.WpsPower wpsPower);
/**
* 通过业务类型和业务id查找文件的路径
* @return 返回文件路径
*/
String getFilePath(Long businessId,byte businessType);
}

17
tall/src/main/java/com/ccsens/tall/service/WpsService.java

@ -474,4 +474,21 @@ public class WpsService implements IWpsService {
log.info("权限为只读");
return WebConstant.Wps.PERMISSION_READ;
}
@Override
public String getFilePath(Long businessId,byte businessType) {
String filePath = null;
if(ObjectUtil.isNotNull(businessId) && ObjectUtil.isNotNull(businessType)){
ProProjectFileExample projectFileExample = new ProProjectFileExample();
projectFileExample.createCriteria().andBusinessIdEqualTo(businessId).andBusinessTypeEqualTo(businessType);
List<ProProjectFile> projectFileList = proProjectFileMapper.selectByExample(projectFileExample);
if(CollectionUtil.isNotEmpty(projectFileList)){
WpsFile wpsFile = wpsFileDao.selectByPrimaryKey(projectFileList.get(0).getWpsFileId());
if(ObjectUtil.isNotNull(wpsFile)){
filePath = wpsFile.getSaveUrl();
}
}
}
return filePath;
}
}

8
tall/src/main/java/com/ccsens/tall/web/WpsController.java

@ -180,6 +180,14 @@ public class WpsController {
return wpsService.getWpsPower(wpsPower);
}
@ApiOperation(value = "通过业务id和业务类型查找文件路径",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/getFilePath", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public String getFilePath(HttpServletRequest request,@ApiParam @RequestParam Long businessId,byte businessType){
return wpsService.getFilePath(businessId,businessType);
}
@Data
@ApiModel("wps通用请求头参数")
private static class WpsHeader{

3
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -136,7 +136,8 @@ public enum CodeEnum {
NOT_TOPIC(114,"找不到该题目",true),
NOT_GROUP(115,"找不到该组信息",true),
VOTE_COMPLETED(116,"投票已结束",true),
VOTE_NOT_START(116,"投票未开始",true),
VOTE_NOT_START(117,"投票未开始",true),
NOT_CONFIG_OR_ERR(118,"缺少配置信息,或配置信息异常",true),
;

1
util/src/main/java/com/ccsens/util/WebConstant.java

@ -172,6 +172,7 @@ public class WebConstant {
public static final String UPLOAD_PATH_BASE_PIMS = "/home/cloud/pims/uploads";
public static final String UPLOAD_PATH_BASE_MT_JUDGE = "mt";
public static final String UPLOAD_PATH_BASE_WBS = "wbs";
public static final String HOME_STATICREC = "/home/staticrec/";
public static final String UPLOAD_PATH_DELIVER = UPLOAD_PATH_BASE + File.separator + "delivers";
public static final String UPLOAD_PATH_DELIVER1 ="delivers";

Loading…
Cancel
Save