Browse Source

20201017

tiaosheng
zy_Java 5 years ago
parent
commit
5142a9dc7e
  1. 13
      mt/src/main/java/com/ccsens/mt/api/CompeteController.java
  2. 6
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  3. 2
      mt/src/main/java/com/ccsens/mt/service/ICompeteService.java
  4. 4
      mt/src/main/resources/application.yml
  5. 134
      tall/src/main/java/com/ccsens/tall/service/LabelService.java
  6. 18
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  7. 4
      tall/src/main/resources/application.yml
  8. 1
      tall/src/main/resources/mapper_dao/SysLabelDao.xml
  9. 6
      util/src/test/java/com/ccsens/util/TestQrCord.java

13
mt/src/main/java/com/ccsens/mt/api/CompeteController.java

@ -11,10 +11,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.IOException;
@ -169,10 +166,10 @@ public class CompeteController {
String enrollPlayInfoList= competeService.enrollPlayInfoWps(params);
return JsonResponse.newInstance().ok(enrollPlayInfoList);
}
@MustLogin
@ApiOperation(value = "报名表详情表", notes = "")
@RequestMapping(value = "/enroll", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse enrollPlayInfo(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.CompeteType> params) throws Exception {
@ApiOperation(value = "报名表详情表下载", notes = "")
@RequestMapping(value = "/enroll", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse enrollPlayInfo(@ApiParam CompeteDto.CompeteType params) throws Exception {
log.info("查询各个项目报名人员信息:{}",params);
String enrollPlayInfoList= competeService.enrollPlayInfo(params);
return JsonResponse.newInstance().ok(enrollPlayInfoList);

6
mt/src/main/java/com/ccsens/mt/service/CompeteService.java

@ -608,9 +608,9 @@ public class CompeteService implements ICompeteService {
}
@Override
public String enrollPlayInfo(QueryDto<CompeteDto.CompeteType> params) throws Exception {
CompeteDto.CompeteType competeType = params.getParam();
List<CompeteVo.EnrollPlayInfo> arrayList = getEnrollPlayInfos(competeType);
public String enrollPlayInfo(CompeteDto.CompeteType params) throws Exception {
// CompeteDto.CompeteType competeType = params.getParam();
List<CompeteVo.EnrollPlayInfo> arrayList = getEnrollPlayInfos(params);
String path = getExcelFilePath(arrayList);
return PropUtil.domain + "file/download/know?path="+path;

2
mt/src/main/java/com/ccsens/mt/service/ICompeteService.java

@ -120,7 +120,7 @@ public interface ICompeteService {
* @param params 项目类型信息
* @return 返回参赛者的详细信息
*/
String enrollPlayInfo(QueryDto<CompeteDto.CompeteType> params) throws IOException, Exception;
String enrollPlayInfo(CompeteDto.CompeteType params) throws IOException, Exception;
/**
* 根据项目类型查询参赛者信息

4
mt/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: prod
include: common, util-prod
active: dev
include: common, util-dev

134
tall/src/main/java/com/ccsens/tall/service/LabelService.java

@ -222,77 +222,75 @@ public class LabelService implements ILabelService {
@Override
public List<LabelVo.SelectLabel> taskAddLabel(Long currentUserId, LabelDto.TaskLabel taskLabel) {
// Long taskId = taskLabel.getTaskId();
// ProTaskSubTime proTaskSubTime = taskSubTimeMapper.selectByPrimaryKey(taskLabel.getTaskId());
// if (ObjectUtil.isNotNull(proTaskSubTime)) {
// taskId = proTaskSubTime.getTaskDetailId();
// }
// List<LabelVo.SelectLabel> selectLabelList;
// ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
// if (ObjectUtil.isNull(taskDetail)) {
// throw new BaseException(CodeEnum.NOT_TASK);
// }
// if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) {
// Long finalTaskId = taskId;
// taskLabel.getLabelList().forEach(labelId -> {
// SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
// if (ObjectUtil.isNull(sysLabel)) {
// throw new BaseException(CodeEnum.NOT_LABEL);
// }
// if (sysLabel.getUserId().longValue() != currentUserId) {
// throw new BaseException(CodeEnum.NOT_POWER);
// }
// //添加项目和标签的关联信息
// ProTaskLabel proTaskLabel = new ProTaskLabel();
// proTaskLabel.setId(snowflake.nextId());
// proTaskLabel.setTaskDetailId(finalTaskId);
// proTaskLabel.setLabelId(labelId);
// proTaskLabelMapper.insertSelective(proTaskLabel);
// });
// }
// //查询项目内的标签信息
// selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId);
// return selectLabelList;
return null;
Long taskId = taskLabel.getTaskId();
ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(taskLabel.getTaskId());
if (ObjectUtil.isNotNull(proTaskSubTime)) {
taskId = proTaskSubTime.getTaskDetailId();
}
List<LabelVo.SelectLabel> selectLabelList;
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
if (ObjectUtil.isNull(taskDetail)) {
throw new BaseException(CodeEnum.NOT_TASK);
}
if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) {
Long finalTaskId = taskId;
taskLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
if (ObjectUtil.isNull(sysLabel)) {
throw new BaseException(CodeEnum.NOT_LABEL);
}
if (sysLabel.getUserId().longValue() != currentUserId) {
throw new BaseException(CodeEnum.NOT_POWER);
}
//添加项目和标签的关联信息
ProTaskLabel proTaskLabel = new ProTaskLabel();
proTaskLabel.setId(snowflake.nextId());
proTaskLabel.setTaskDetailId(finalTaskId);
proTaskLabel.setLabelId(labelId);
proTaskLabelMapper.insertSelective(proTaskLabel);
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId);
return selectLabelList;
}
@Override
public List<LabelVo.SelectLabel> taskRemoveLabel(Long currentUserId, LabelDto.TaskLabel taskLabel) {
// Long taskId = taskLabel.getTaskId();
// ProTaskSubTime proTaskSubTime = taskSubTimeMapper.selectByPrimaryKey(taskLabel.getTaskId());
// if (ObjectUtil.isNotNull(proTaskSubTime)) {
// taskId = proTaskSubTime.getTaskDetailId();
// }
// List<LabelVo.SelectLabel> selectLabelList;
// ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
// if (ObjectUtil.isNull(taskDetail)) {
// throw new BaseException(CodeEnum.NOT_TASK);
// }
// if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) {
// Long finalTaskId = taskId;
// taskLabel.getLabelList().forEach(labelId -> {
// SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
// if (ObjectUtil.isNull(sysLabel)) {
// throw new BaseException(CodeEnum.NOT_LABEL);
// }
// if (sysLabel.getUserId().longValue() != currentUserId) {
// throw new BaseException(CodeEnum.NOT_POWER);
// }
// //项目和标签的关联信息
// ProTaskLabelExample taskLabelExample = new ProTaskLabelExample();
// taskLabelExample.createCriteria().andTaskDetailIdEqualTo(finalTaskId).andLabelIdEqualTo(labelId);
// List<ProTaskLabel> proTaskLabelList = proTaskLabelMapper.selectByExample(taskLabelExample);
// if (CollectionUtil.isNotEmpty(proTaskLabelList)) {
// proTaskLabelList.forEach(label -> {
// label.setRecStatus((byte) 2);
// proTaskLabelMapper.updateByPrimaryKeySelective(label);
// });
// }
// });
// }
// //查询项目内的标签信息
// selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId);
// return selectLabelList;
return null;
Long taskId = taskLabel.getTaskId();
ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(taskLabel.getTaskId());
if (ObjectUtil.isNotNull(proTaskSubTime)) {
taskId = proTaskSubTime.getTaskDetailId();
}
List<LabelVo.SelectLabel> selectLabelList;
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
if (ObjectUtil.isNull(taskDetail)) {
throw new BaseException(CodeEnum.NOT_TASK);
}
if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) {
Long finalTaskId = taskId;
taskLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
if (ObjectUtil.isNull(sysLabel)) {
throw new BaseException(CodeEnum.NOT_LABEL);
}
if (sysLabel.getUserId().longValue() != currentUserId) {
throw new BaseException(CodeEnum.NOT_POWER);
}
//项目和标签的关联信息
ProTaskLabelExample taskLabelExample = new ProTaskLabelExample();
taskLabelExample.createCriteria().andTaskDetailIdEqualTo(finalTaskId).andLabelIdEqualTo(labelId);
List<ProTaskLabel> proTaskLabelList = proTaskLabelMapper.selectByExample(taskLabelExample);
if (CollectionUtil.isNotEmpty(proTaskLabelList)) {
proTaskLabelList.forEach(label -> {
label.setRecStatus((byte) 2);
proTaskLabelMapper.updateByPrimaryKeySelective(label);
});
}
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId);
return selectLabelList;
}
}

18
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -142,6 +142,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
}
return proTaskShow;
}
/**
* 查看任务 项目经理
*/
@ -552,11 +553,15 @@ public class ProTaskDetailService implements IProTaskDetailService {
@Override
public TaskVo.NormalTask getTaskInfoByTaskId(Long currentUserId, Long projectId, Long taskId, Integer imitation) throws Exception {
ProTaskSubTime subTime = taskSubTimeDao.selectByPrimaryKey(taskId);
TaskVo.NormalTask taskDetail = null;
if (ObjectUtil.isNotNull(subTime)) {
ProTaskDetail task = taskDetailDao.selectByPrimaryKey(subTime.getTaskDetailId());
taskDetail = taskDetailDao.selectTaskByTaskId(subTime.getId(), subTime.getTaskDetailId(),task.getExecutorRole());
taskId = subTime.getTaskDetailId();
}
TaskVo.NormalTask taskDetail;
ProTaskDetail task = taskDetailDao.selectByPrimaryKey(taskId);
if (ObjectUtil.isNull(task)) {
throw new BaseException(CodeEnum.NOT_TASK);
}
taskDetail = taskDetailDao.selectTaskByTaskId(null, taskId, task.getExecutorRole());
if (ObjectUtil.isNotNull(taskDetail)) {
//处理查询到的任务的插件
managePlugin(currentUserId, task.getExecutorRole(), taskDetail, imitation);
@ -575,7 +580,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
taskDetail.setProTaskConfig(getProTaskShow(taskDetail.getDetailId()));
//添加项目信息
normalTaskAddPlugin(subTime.getTaskDetailId(), taskDetail);
normalTaskAddPlugin(taskId, taskDetail);
List<TaskVo.NormalTask> groupTaskList = new ArrayList<>();
//提醒信息
@ -620,7 +625,6 @@ public class ProTaskDetailService implements IProTaskDetailService {
}
}
}
return taskDetail;
}
@ -1284,6 +1288,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
robotService.changeTaskRobotSend(currentUserId, normalTask);
return normalTask;
}
private void changeTime(ProTaskDetail taskDetail, Long beginTime, Long endTime, SysProject project) {
if ((ObjectUtil.isNotNull(beginTime) && beginTime >= project.getEndTime()) ||
(ObjectUtil.isNotNull(endTime) && endTime <= project.getBeginTime())) {
@ -1361,6 +1366,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
}
}
}
private void partTaskSubTime(ProTaskDetail taskDetail) {
//cycle为空或者组任务,只加一条数据
if (StrUtil.isEmpty(taskDetail.getCycle()) || taskDetail.getHasGroup() == 1) {

4
tall/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: util-dev,common
active: test
include: util-test,common

1
tall/src/main/resources/mapper_dao/SysLabelDao.xml

@ -4,7 +4,6 @@
<select id="selectLabelByUserId" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.LabelVo$SelectLabel">
select
*
id,
`name`,
code,

6
util/src/test/java/com/ccsens/util/TestQrCord.java

@ -31,8 +31,10 @@ public class TestQrCord {
// String text = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7af1bf1e14facf82&redirect_uri=http://www.tall.wiki/pt-dev/vote&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
// String text = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7af1bf1e14facf82&redirect_uri=https://www.tall.wiki/compete-province&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
// String fileName = "zzz/" + "远程比赛-省赛(生产).png";
String text = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7af1bf1e14facf82&redirect_uri=https://www.tall.wiki/compete-people&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
String fileName = "zzz/" + "远程比赛-全民健身跳绳大赛(生产).png";
// String text = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7af1bf1e14facf82&redirect_uri=https://www.tall.wiki/compete-people&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
// String fileName = "zzz/" + "远程比赛-全民健身跳绳大赛(生产).png";
String text = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7af1bf1e14facf82&redirect_uri=https://test.tall.wiki/compete-people&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
String fileName = "zzz/" + "远程比赛-全民健身跳绳大赛(测试)1.png";
QRCodeWriter qrCodeWriter = new QRCodeWriter();

Loading…
Cancel
Save