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 io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
@ -169,10 +166,10 @@ public class CompeteController {
String enrollPlayInfoList= competeService.enrollPlayInfoWps(params); String enrollPlayInfoList= competeService.enrollPlayInfoWps(params);
return JsonResponse.newInstance().ok(enrollPlayInfoList); return JsonResponse.newInstance().ok(enrollPlayInfoList);
} }
@MustLogin
@ApiOperation(value = "报名表详情表", notes = "") @ApiOperation(value = "报名表详情表下载", notes = "")
@RequestMapping(value = "/enroll", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "/enroll", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse enrollPlayInfo(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.CompeteType> params) throws Exception { public JsonResponse enrollPlayInfo(@ApiParam CompeteDto.CompeteType params) throws Exception {
log.info("查询各个项目报名人员信息:{}",params); log.info("查询各个项目报名人员信息:{}",params);
String enrollPlayInfoList= competeService.enrollPlayInfo(params); String enrollPlayInfoList= competeService.enrollPlayInfo(params);
return JsonResponse.newInstance().ok(enrollPlayInfoList); 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 @Override
public String enrollPlayInfo(QueryDto<CompeteDto.CompeteType> params) throws Exception { public String enrollPlayInfo(CompeteDto.CompeteType params) throws Exception {
CompeteDto.CompeteType competeType = params.getParam(); // CompeteDto.CompeteType competeType = params.getParam();
List<CompeteVo.EnrollPlayInfo> arrayList = getEnrollPlayInfos(competeType); List<CompeteVo.EnrollPlayInfo> arrayList = getEnrollPlayInfos(params);
String path = getExcelFilePath(arrayList); String path = getExcelFilePath(arrayList);
return PropUtil.domain + "file/download/know?path="+path; 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 项目类型信息 * @param params 项目类型信息
* @return 返回参赛者的详细信息 * @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: spring:
profiles: profiles:
active: prod active: dev
include: common, util-prod 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 @Override
public List<LabelVo.SelectLabel> taskAddLabel(Long currentUserId, LabelDto.TaskLabel taskLabel) { public List<LabelVo.SelectLabel> taskAddLabel(Long currentUserId, LabelDto.TaskLabel taskLabel) {
// Long taskId = taskLabel.getTaskId(); Long taskId = taskLabel.getTaskId();
// ProTaskSubTime proTaskSubTime = taskSubTimeMapper.selectByPrimaryKey(taskLabel.getTaskId()); ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(taskLabel.getTaskId());
// if (ObjectUtil.isNotNull(proTaskSubTime)) { if (ObjectUtil.isNotNull(proTaskSubTime)) {
// taskId = proTaskSubTime.getTaskDetailId(); taskId = proTaskSubTime.getTaskDetailId();
// } }
// List<LabelVo.SelectLabel> selectLabelList; List<LabelVo.SelectLabel> selectLabelList;
// ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId); ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
// if (ObjectUtil.isNull(taskDetail)) { if (ObjectUtil.isNull(taskDetail)) {
// throw new BaseException(CodeEnum.NOT_TASK); throw new BaseException(CodeEnum.NOT_TASK);
// } }
// if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) { if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) {
// Long finalTaskId = taskId; Long finalTaskId = taskId;
// taskLabel.getLabelList().forEach(labelId -> { taskLabel.getLabelList().forEach(labelId -> {
// SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId); SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
// if (ObjectUtil.isNull(sysLabel)) { if (ObjectUtil.isNull(sysLabel)) {
// throw new BaseException(CodeEnum.NOT_LABEL); throw new BaseException(CodeEnum.NOT_LABEL);
// } }
// if (sysLabel.getUserId().longValue() != currentUserId) { if (sysLabel.getUserId().longValue() != currentUserId) {
// throw new BaseException(CodeEnum.NOT_POWER); throw new BaseException(CodeEnum.NOT_POWER);
// } }
// //添加项目和标签的关联信息 //添加项目和标签的关联信息
// ProTaskLabel proTaskLabel = new ProTaskLabel(); ProTaskLabel proTaskLabel = new ProTaskLabel();
// proTaskLabel.setId(snowflake.nextId()); proTaskLabel.setId(snowflake.nextId());
// proTaskLabel.setTaskDetailId(finalTaskId); proTaskLabel.setTaskDetailId(finalTaskId);
// proTaskLabel.setLabelId(labelId); proTaskLabel.setLabelId(labelId);
// proTaskLabelMapper.insertSelective(proTaskLabel); proTaskLabelMapper.insertSelective(proTaskLabel);
// }); });
// } }
// //查询项目内的标签信息 //查询项目内的标签信息
// selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId); selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId);
// return selectLabelList; return selectLabelList;
return null;
} }
@Override @Override
public List<LabelVo.SelectLabel> taskRemoveLabel(Long currentUserId, LabelDto.TaskLabel taskLabel) { public List<LabelVo.SelectLabel> taskRemoveLabel(Long currentUserId, LabelDto.TaskLabel taskLabel) {
// Long taskId = taskLabel.getTaskId(); Long taskId = taskLabel.getTaskId();
// ProTaskSubTime proTaskSubTime = taskSubTimeMapper.selectByPrimaryKey(taskLabel.getTaskId()); ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(taskLabel.getTaskId());
// if (ObjectUtil.isNotNull(proTaskSubTime)) { if (ObjectUtil.isNotNull(proTaskSubTime)) {
// taskId = proTaskSubTime.getTaskDetailId(); taskId = proTaskSubTime.getTaskDetailId();
// } }
// List<LabelVo.SelectLabel> selectLabelList; List<LabelVo.SelectLabel> selectLabelList;
// ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId); ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
// if (ObjectUtil.isNull(taskDetail)) { if (ObjectUtil.isNull(taskDetail)) {
// throw new BaseException(CodeEnum.NOT_TASK); throw new BaseException(CodeEnum.NOT_TASK);
// } }
// if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) { if (CollectionUtil.isNotEmpty(taskLabel.getLabelList())) {
// Long finalTaskId = taskId; Long finalTaskId = taskId;
// taskLabel.getLabelList().forEach(labelId -> { taskLabel.getLabelList().forEach(labelId -> {
// SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId); SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
// if (ObjectUtil.isNull(sysLabel)) { if (ObjectUtil.isNull(sysLabel)) {
// throw new BaseException(CodeEnum.NOT_LABEL); throw new BaseException(CodeEnum.NOT_LABEL);
// } }
// if (sysLabel.getUserId().longValue() != currentUserId) { if (sysLabel.getUserId().longValue() != currentUserId) {
// throw new BaseException(CodeEnum.NOT_POWER); throw new BaseException(CodeEnum.NOT_POWER);
// } }
// //项目和标签的关联信息 //项目和标签的关联信息
// ProTaskLabelExample taskLabelExample = new ProTaskLabelExample(); ProTaskLabelExample taskLabelExample = new ProTaskLabelExample();
// taskLabelExample.createCriteria().andTaskDetailIdEqualTo(finalTaskId).andLabelIdEqualTo(labelId); taskLabelExample.createCriteria().andTaskDetailIdEqualTo(finalTaskId).andLabelIdEqualTo(labelId);
// List<ProTaskLabel> proTaskLabelList = proTaskLabelMapper.selectByExample(taskLabelExample); List<ProTaskLabel> proTaskLabelList = proTaskLabelMapper.selectByExample(taskLabelExample);
// if (CollectionUtil.isNotEmpty(proTaskLabelList)) { if (CollectionUtil.isNotEmpty(proTaskLabelList)) {
// proTaskLabelList.forEach(label -> { proTaskLabelList.forEach(label -> {
// label.setRecStatus((byte) 2); label.setRecStatus((byte) 2);
// proTaskLabelMapper.updateByPrimaryKeySelective(label); proTaskLabelMapper.updateByPrimaryKeySelective(label);
// }); });
// } }
// }); });
// } }
// //查询项目内的标签信息 //查询项目内的标签信息
// selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId); selectLabelList = sysLabelDao.selectLabelByTaskId(currentUserId, taskId);
// return selectLabelList; return selectLabelList;
return null;
} }
} }

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

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

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

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: dev active: test
include: util-dev,common 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="selectLabelByUserId" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.LabelVo$SelectLabel">
select select
*
id, id,
`name`, `name`,
code, 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=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 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 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 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 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(); QRCodeWriter qrCodeWriter = new QRCodeWriter();

Loading…
Cancel
Save