Commit b2831a2e by 梅存智

修改BUG

parent e38d1aab
......@@ -76,6 +76,9 @@ public class LeaveWordVo extends Model<LeaveWordVo> {
@ApiModelProperty(value = "业务类型:1-功能异常、2-体验问题、3-产品建议、4-其他")
private Integer bizType;
@ApiModelProperty(value = "姓名")
private String fullName;
@Override
protected Serializable pkVal() {
return this.id;
......
......@@ -84,6 +84,11 @@ public class TpStudentEnrollPassedController {
e.printStackTrace();
}
}
//判断是否要签到,不要签到就完成项目
if(tp.getEnableSign() == 0){
trainingProjectService.trainingProjectFinished(projrctId, requestContext.getSiteId(), requestContext.getAccountId());
}
return tep.getId();
}
......
......@@ -497,7 +497,7 @@ public class TrainingProjectController {
@PostMapping("/api/detail/progress/get")
public TrainingProjectDetailVo getTpDetailWithProgress(@RequestBody BaseModel<Long> model) throws ParseException {
TrainingProjectDetailVo vo = trainingProjectService.getTpDetail(model.getObj(), model.getContext(), model.getDate(), true);
if (null != vo.getIntroductionVo().getEnroll()) {
if (vo != null && null != vo.getIntroductionVo().getEnroll()) {
vo.getIntroductionVo().setEnrollLimit(vo.getIntroductionVo().getEnroll().getLimit());
}
return vo;
......
......@@ -3,9 +3,12 @@ package com.yizhi.training.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.training.application.domain.LeaveWord;
import com.yizhi.training.application.vo.domain.AuthzUserGroupVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* com.yizhi.training.application.mapper
......@@ -20,4 +23,7 @@ public interface LeaveWordMapper extends BaseMapper<LeaveWord> {
AuthzUserGroupVo getUserGroupById(@Param("groupId") Long groupId);
List<AuthzUserGroupVo> queryUserGroupByIds(@Param("groupIds") List<Long> groupIds);
@MapKey("id")
Map<Long, Map<Long, String>> queryAccountNameByIds(@Param("accountIds") List<Long> accountIds);
}
......@@ -47,4 +47,18 @@
where
aug.id = #{groupId}
</select>
<select id="queryAccountNameByIds" resultType="java.util.Map">
select
a.id,
a.full_name AS fullName
from
cloud_system.account a
where
a.id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
AND a.deleted=0
</select>
</mapper>
\ No newline at end of file
......@@ -36,12 +36,17 @@ public class LeaveWordServiceImpl extends ServiceImpl<LeaveWordMapper, LeaveWord
@Autowired
private IdGenerator idGenerator;
@Autowired
private
LeaveWordMapper leaveWordMapper;
@Override
public Page<LeaveWordVo> page(LeaveWordParamVo paramVo){
Page<LeaveWordVo> page = new Page(paramVo.getPageNo(), paramVo.getPageSize());
Page<LeaveWord> paramPage = new Page(paramVo.getPageNo(), paramVo.getPageSize());
EntityWrapper<LeaveWord> map = new EntityWrapper<LeaveWord>();
RequestContext context = ContextHolder.get();
RequestContext context = new RequestContext();//ContextHolder.get();
context.setSiteId(1635853066584846336L);
map.eq("site_id",context.getSiteId());
if(ObjectUtil.isNotEmpty(paramVo.getName())){
map.like("name", paramVo.getName());
......@@ -76,6 +81,8 @@ public class LeaveWordServiceImpl extends ServiceImpl<LeaveWordMapper, LeaveWord
groupVoMap = authzUserGroupVoList.stream().collect(Collectors.toMap(AuthzUserGroupVo::getId,a->a));
}
}
List<Long> accountIds = new ArrayList<Long>();
Map<Long, AuthzUserGroupVo> finalGroupVoMap = groupVoMap;
leaveWordList.stream().forEach(leaveWord -> {
LeaveWordVo leaveWordVo = new LeaveWordVo();
......@@ -85,8 +92,22 @@ public class LeaveWordServiceImpl extends ServiceImpl<LeaveWordMapper, LeaveWord
leaveWordVo.setGroupName(groupVo.getName());
leaveWordVo.setOrgName(groupVo.getDescription());
leaveWordVoList.add(leaveWordVo);
accountIds.add(leaveWordVo.getCreateById());
}
});
//设置姓名
if(CollUtil.isNotEmpty(accountIds)) {
Map<Long, Map<Long, String>> accountMap = leaveWordMapper.queryAccountNameByIds(accountIds);
if(accountMap != null){
leaveWordVoList.stream().forEach(leaveWord -> {
if(accountMap.get(leaveWord.getCreateById()) != null){
leaveWord.setFullName(accountMap.get(leaveWord.getCreateById()).get("fullName"));
}
});
}
}
}
page.setRecords(leaveWordVoList);
}
......
......@@ -607,7 +607,7 @@ public class TrainingProjectServiceImpl extends ServiceImpl<TrainingProjectMappe
vo.setActivityStateCode(TrEnrollStatusEnum.ACT_NO_ENROLL.getCode());
vo.setActivityStateName(TrEnrollStatusEnum.ACT_NO_ENROLL.getValue());
}
} else {
} else if(tr.getEnableSign() == 1) {
//查询签到记录
List<Long> passSignTpIds = tpStudentEnrollPassedMapper.selectSignTpIds(context.getAccountId());
if (CollectionUtils.isEmpty(passSignTpIds) || !passSignTpIds.contains(tr.getId())) {
......@@ -804,6 +804,9 @@ public class TrainingProjectServiceImpl extends ServiceImpl<TrainingProjectMappe
* 设置活动状态: 1、先根据项目的开始和结束时间设置活动状态
*/
com.yizhi.training.application.vo.domain.TrainingProjectVo tr = trainingProjectMapper.selectTrainingProjectTime(context.getSiteId(), trainingProjectId);
if(tr == null){
return null;
}
TrEnrollStatusEnum state = compareTime(tr.getStartTime(), tr.getEndTime());
introductionVo.setActivityStateCode(state.getCode());
introductionVo.setActivityStateName(state.getValue());
......@@ -844,7 +847,7 @@ public class TrainingProjectServiceImpl extends ServiceImpl<TrainingProjectMappe
introductionVo.setActivityStateCode(TrEnrollStatusEnum.ACT_NO_ENROLL.getCode());
introductionVo.setActivityStateName(TrEnrollStatusEnum.ACT_NO_ENROLL.getValue());
}
} else {
} else if(tr.getEnableSign() == 1) {
// 查询签到记录
List<Long> passSignTpIds = tpStudentEnrollPassedMapper.selectSignTpIds(context.getAccountId());
if (CollectionUtils.isEmpty(passSignTpIds) || !passSignTpIds.contains(tr.getId())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment