Browse Source

wbs表插件名支持逗号分隔

master
zhangye 6 years ago
parent
commit
bafc67d712
  1. 4
      game/src/main/java/com/ccsens/game/api/ClientController.java
  2. 2
      game/src/main/java/com/ccsens/game/service/IScreenService.java
  3. 24
      game/src/main/java/com/ccsens/game/service/ScreenService.java
  4. 3
      tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java
  5. 9
      tall/src/main/java/com/ccsens/tall/service/ExcelService.java
  6. 4
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  7. 2
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  8. 2
      tall/src/main/resources/mapper_dao/SysProjectDao.xml

4
game/src/main/java/com/ccsens/game/api/ClientController.java

@ -96,9 +96,9 @@ public class ClientController {
@ApiImplicitParams({ @ApiImplicitParams({
}) })
@RequestMapping(value = "task", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "task", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ScreenVo.RecordInfo> getRecordByTaskId(@ApiParam @RequestParam Long taskId) throws Exception { public JsonResponse<ScreenVo.RecordInfo> getRecordByTaskId(@ApiParam @RequestParam Long taskId,String gameType) throws Exception {
log.info("根据游戏id获取分组信息:{}",taskId); log.info("根据游戏id获取分组信息:{}",taskId);
ScreenVo.RecordInfo recordInfo = screenService.getRecordByTaskId(taskId); ScreenVo.RecordInfo recordInfo = screenService.getRecordByTaskId(taskId,gameType);
return JsonResponse.newInstance().ok(recordInfo); return JsonResponse.newInstance().ok(recordInfo);
} }
} }

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

@ -40,5 +40,5 @@ public interface IScreenService {
List<ScreenVo.Group> getGroupByRecordId(Long recordId); List<ScreenVo.Group> getGroupByRecordId(Long recordId);
ScreenVo.RecordInfo getRecordByTaskId(Long taskId); ScreenVo.RecordInfo getRecordByTaskId(Long taskId,String gameType);
} }

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

@ -109,16 +109,18 @@ public class ScreenService implements IScreenService{
gameUserPayDao.insertSelective(gameUserPay); gameUserPayDao.insertSelective(gameUserPay);
} }
//查询该任务下的游戏记录信息 //查询该任务下的游戏记录信息
if(ObjectUtil.isNotNull(memberGame.getTaskId())) {
GameRecordExample recordExample = new GameRecordExample(); GameRecordExample recordExample = new GameRecordExample();
recordExample.createCriteria().andTaskIdEqualTo(memberGame.getTaskId()); recordExample.createCriteria().andTaskIdEqualTo(memberGame.getTaskId());
recordExample.setOrderByClause("created_at DESC"); recordExample.setOrderByClause("created_at DESC");
List<GameRecord> recordList = gameRecordDao.selectByExample(recordExample); List<GameRecord> recordList = gameRecordDao.selectByExample(recordExample);
if(CollectionUtil.isNotEmpty(recordList)){ if (CollectionUtil.isNotEmpty(recordList)) {
GameRecord record = recordList.get(0); GameRecord record = recordList.get(0);
if(record.getGameStatus() != GameConstant.GAME_COMPLETED){ if (record.getGameStatus() != GameConstant.GAME_COMPLETED) {
throw new BaseException(CodeEnum.GAME_NO_END); throw new BaseException(CodeEnum.GAME_NO_END);
} }
} }
}
//3、根据用户购买的记录,添加一场新的游戏记录 //3、根据用户购买的记录,添加一场新的游戏记录
GameRecord gameRecord = new GameRecord(); GameRecord gameRecord = new GameRecord();
@ -138,7 +140,7 @@ public class ScreenService implements IScreenService{
GameGroup gameGroupBlue = new GameGroup(); GameGroup gameGroupBlue = new GameGroup();
gameGroupBlue.setId(snowflake.nextId()); gameGroupBlue.setId(snowflake.nextId());
gameGroupBlue.setRecordId(gameRecord.getId()); gameGroupBlue.setRecordId(gameRecord.getId());
gameGroupBlue.setName(memberGame.getFirstTeam()); gameGroupBlue.setName(memberGame.getSecondTeam());
gameGroupDao.insertSelective(gameGroupBlue); gameGroupDao.insertSelective(gameGroupBlue);
} }
@ -863,7 +865,7 @@ public class ScreenService implements IScreenService{
} }
@Override @Override
public ScreenVo.RecordInfo getRecordByTaskId(Long taskId) { public ScreenVo.RecordInfo getRecordByTaskId(Long taskId,String gameType) {
ScreenVo.RecordInfo recordInfo = new ScreenVo.RecordInfo(); ScreenVo.RecordInfo recordInfo = new ScreenVo.RecordInfo();
GameRecordExample recordExample = new GameRecordExample(); GameRecordExample recordExample = new GameRecordExample();
@ -871,9 +873,23 @@ public class ScreenService implements IScreenService{
recordExample.setOrderByClause("created_at DESC"); recordExample.setOrderByClause("created_at DESC");
List<GameRecord> gameRecordList = gameRecordDao.selectByExample(recordExample); List<GameRecord> gameRecordList = gameRecordDao.selectByExample(recordExample);
if(CollectionUtil.isNotEmpty(gameRecordList)){ if(CollectionUtil.isNotEmpty(gameRecordList)){
if(StrUtil.isNotEmpty(gameType)) {
for (GameRecord record : gameRecordList) {
GameUserPay gameUserPay = gameUserPayDao.selectByPrimaryKey(record.getUserPayId());
if (ObjectUtil.isNotNull(gameUserPay)) {
GameType gameType1 = gameTypeDao.selectByPrimaryKey(gameUserPay.getGameTypeId());
if (ObjectUtil.isNotNull(gameType1) && gameType.equalsIgnoreCase(gameType1.getCode())) {
recordInfo.setId(record.getId());
recordInfo.setGameStatus(record.getGameStatus());
break;
}
}
}
}else {
recordInfo.setId(gameRecordList.get(0).getId()); recordInfo.setId(gameRecordList.get(0).getId());
recordInfo.setGameStatus(gameRecordList.get(0).getGameStatus()); recordInfo.setGameStatus(gameRecordList.get(0).getGameStatus());
} }
}
return recordInfo; return recordInfo;
} }
} }

3
tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java

@ -105,11 +105,12 @@ public class ProjectVo {
private boolean mine; private boolean mine;
@ApiModelProperty("是否是当前角色的奖惩干系人") @ApiModelProperty("是否是当前角色的奖惩干系人")
private boolean stakeholder; private boolean stakeholder;
@ApiModelProperty("该角色是否显示")
private Boolean isShow;
@ApiModelProperty("成员信息") @ApiModelProperty("成员信息")
private List<ProMemberVo> members; private List<ProMemberVo> members;
@JsonIgnore @JsonIgnore
private Long parentId; //一级角色Id private Long parentId; //一级角色Id
@JsonIgnore @JsonIgnore
private String proRoleName; //一级角色名 private String proRoleName; //一级角色名
@JsonIgnore @JsonIgnore

9
tall/src/main/java/com/ccsens/tall/service/ExcelService.java

@ -1129,8 +1129,9 @@ public class ExcelService implements IExcelService {
} }
for (int a = 2; a < roleRow.getLastCellNum(); a++) { for (int a = 2; a < roleRow.getLastCellNum(); a++) {
String plugin = ExcelUtil.getCellValue(pluginRow.getCell(a)); String plugin = StringUtil.replaceComma(ExcelUtil.getCellValue(pluginRow.getCell(a)));
if (StrUtil.isNotEmpty(plugin)) { if (StrUtil.isNotEmpty(plugin)) {
String[] plugins = plugin.split(",");
//获取memberRoleId //获取memberRoleId
String roleCell = ExcelUtil.getCellValue(roleRow.getCell(a)); String roleCell = ExcelUtil.getCellValue(roleRow.getCell(a));
if (StrUtil.isNotEmpty(roleCell) && CollectionUtil.isNotEmpty(proRoles)) { if (StrUtil.isNotEmpty(roleCell) && CollectionUtil.isNotEmpty(proRoles)) {
@ -1141,10 +1142,10 @@ public class ExcelService implements IExcelService {
} }
} }
} }
for(int p = 0 ; p < plugins.length; p++){
Long sysPluginId = null; Long sysPluginId = null;
for (SysPlugin sysPlugin : sysPluginList) { for (SysPlugin sysPlugin : sysPluginList) {
if (plugin.equalsIgnoreCase(sysPlugin.getName())) { if (plugins[p].equalsIgnoreCase(sysPlugin.getName())) {
sysPluginId = sysPlugin.getId(); sysPluginId = sysPlugin.getId();
break; break;
} }
@ -1170,6 +1171,8 @@ public class ExcelService implements IExcelService {
taskPluginService.savePlugin(taskPlugin); taskPluginService.savePlugin(taskPlugin);
} }
} }
}
} }
} }
} else { } else {

4
tall/src/main/java/com/ccsens/tall/service/ProRoleService.java

@ -95,15 +95,17 @@ public class ProRoleService implements IProRoleService {
//是否mine(若是用户是关注者,则所有角色都暂时属于关注者) //是否mine(若是用户是关注者,则所有角色都暂时属于关注者)
for (ProjectVo.RoleInfo memberRole : memberRoleList) { for (ProjectVo.RoleInfo memberRole : memberRoleList) {
if(isAttention){ if(isAttention){
memberRole.setMine(true); memberRole.setIsShow(true);
continue; continue;
} }
for (ProRole role : roleList) { for (ProRole role : roleList) {
if (memberRole.getId().equals(role.getId())) { if (memberRole.getId().equals(role.getId())) {
memberRole.setMine(true); memberRole.setMine(true);
memberRole.setIsShow(true);
break; break;
} else { } else {
memberRole.setMine(false); memberRole.setMine(false);
memberRole.setIsShow(false);
} }
} }
} }

2
tall/src/main/java/com/ccsens/tall/service/ProjectService.java

@ -144,7 +144,7 @@ public class ProjectService implements IProjectService {
Map<String, Long> timeMap = new HashMap<>(); Map<String, Long> timeMap = new HashMap<>();
timeMap = DateUtil.projectFormatDateTime(date); timeMap = DateUtil.projectFormatDateTime(date);
Long startMillisTime = timeMap.get("startMillisTime"); Long startMillisTime = timeMap.get("startMillisTime");
Long endMillisTime = timeMap.get("endMillisTime"); Long endMillisTime = timeMap.get("endMillisTime")+1;
//查找此用户关注的项目 //查找此用户关注的项目
List<SysProject> projectList = sysProjectDao.findProjectIdByUserId(currentUserId, startMillisTime, endMillisTime); List<SysProject> projectList = sysProjectDao.findProjectIdByUserId(currentUserId, startMillisTime, endMillisTime);
projectInfoList = projectInfoByProject(projectList, currentUserId); projectInfoList = projectInfoByProject(projectList, currentUserId);

2
tall/src/main/resources/mapper_dao/SysProjectDao.xml

@ -47,6 +47,8 @@
(p.begin_time &lt;= #{startTime} and p.end_time &gt;= #{endTime}) (p.begin_time &lt;= #{startTime} and p.end_time &gt;= #{endTime})
OR OR
(p.begin_time &gt;= #{startTime} and p.begin_time &lt;= #{endTime}) (p.begin_time &gt;= #{startTime} and p.begin_time &lt;= #{endTime})
OR
(p.end_time &gt;= #{startTime} and p.end_time &lt;= #{endTime})
) )
</if> </if>
</if> </if>

Loading…
Cancel
Save