Commit fa94ee31 by “Kongxiangkun”

活动投票状态筛选优化

parent 02867073
......@@ -142,6 +142,10 @@ public interface ResearchClient {
@PostMapping("/research/state/check")
Integer checkResearchState(@RequestBody CheckResearchStateVo checkResearchStateVo);
@PostMapping("/research/state/checkTPlan")
Integer checkTPlanResearchState(@RequestBody CheckResearchStateVo checkResearchStateVo);
/**
* 获取管理端报表列表
*
......
......@@ -259,6 +259,13 @@ public class ResearchController {
}
@PostMapping("/state/checkTPlan")
Integer checkTPlanResearchState(@RequestBody CheckResearchStateVo checkResearchStateVo) {
return researchService.checkTPlanResearchState
(checkResearchStateVo.getResearchId(), checkResearchStateVo.getContext());
}
/**
* 调研报表列表
*
......
......@@ -129,4 +129,7 @@ public interface ResearchMapper extends BaseMapper<Research> {
* @return
*/
ResearchVo selectResearchDetails(@Param("id") Long id, @Param("accountId") Long accountId, @Param("siteId") Long siteId);
int checkTPlanResearchState(@Param("idsInRange") List<Long> idsInRange, @Param("id") Long id,
@Param("siteId") Long siteId);
}
......@@ -643,4 +643,17 @@
where tb.id=#{id} and tb.deleted = 0 and tb.site_id = #{siteId}
]]>
</select>
<select id="checkTPlanResearchState" resultType="Integer">
select count(*) from research tb
where tb.state = 1 and tb.deleted = 0 and tb.site_id = #{siteId} and tb.id = #{id}
and tb.end_time <![CDATA[>]]> DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%s') and
tb.start_time <![CDATA[<]]> DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%s')
and (tb.visible_range = 1
<if test="idsInRange != null and idsInRange.size > 0">
or (tb.visible_range = 2 and tb.id in
(<foreach collection="idsInRange" separator="," item="id">#{id}</foreach>))
</if>
)
</select>
</mapper>
......@@ -120,6 +120,14 @@ public interface IResearchService extends IService<Research> {
*/
Integer checkResearchState(Long researchId,RequestContext context);
/**
* 检查某个活动中某个调研状态
* @param researchId
* @param context
* @return
*/
Integer checkTPlanResearchState(Long researchId, RequestContext context);
Page<Research> getResearchList(String startDate, String endDate, String kwd,Integer pageSize, Integer pageNo,List<Long> orgIds, Long companyId, Long siteId);
Research getResearchView(Long researchId);
......
......@@ -918,4 +918,14 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
return research;
}
@Override
public Integer checkTPlanResearchState(Long researchId, RequestContext context) {
// 查出指定学员可见的调研id
List<Long> researchIdsInRange = null;
if (!CollectionUtils.isEmpty(context.getRelationIds())) {
researchIdsInRange = researchAuthorizeMapper.getResearchIdsInRange(context.getRelationIds());
}
return researchMapper.checkTPlanResearchState(researchIdsInRange, researchId, context.getSiteId());
}
}
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