63002f31 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 63546ee0 a5cfef3e
...@@ -89,6 +89,22 @@ public class PaperController { ...@@ -89,6 +89,22 @@ public class PaperController {
89 } 89 }
90 90
91 91
92 @AutoLog(value = "在线考试-试卷-考试任务")
93 @ApiOperation(value="在线考试-试卷-考试任务", notes="在线考试-试卷-考试任务")
94 @GetMapping(value = "/paperTaskList")
95 public Result<IPage<Paper>> paperTaskList(Paper paper,
96 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
97 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
98 HttpServletRequest req) {
99 Result<IPage<Paper>> result = new Result<IPage<Paper>>();
100 Page<Paper> page = new Page<Paper>(pageNo, pageSize);
101 IPage<Paper> pageList = paperService.queryPaperTaskList(page, paper);
102 result.setSuccess(true);
103 result.setResult(pageList);
104 return result;
105 }
106
107
92 @AutoLog(value = "在线考试-随机组卷试题") 108 @AutoLog(value = "在线考试-随机组卷试题")
93 @ApiOperation(value="在线考试-随机组卷试题", notes="在线考试-随机组卷试题") 109 @ApiOperation(value="在线考试-随机组卷试题", notes="在线考试-随机组卷试题")
94 @PostMapping(value = "/randomQuestion") 110 @PostMapping(value = "/randomQuestion")
...@@ -152,7 +168,7 @@ public class PaperController { ...@@ -152,7 +168,7 @@ public class PaperController {
152 }else { 168 }else {
153 paper.setSendStatus(sendStatus); 169 paper.setSendStatus(sendStatus);
154 paper.setSendTime( new Date()); 170 paper.setSendTime( new Date());
155 boolean ok = paperService.updateById(paper); 171 boolean ok = paperService.publishPaper(paper);
156 //TODO 返回false说明什么? 172 //TODO 返回false说明什么?
157 if(ok) { 173 if(ok) {
158 if("1".equals(sendStatus)){ 174 if("1".equals(sendStatus)){
......
1 package com.skua.modules.edu.controller; 1 package com.skua.modules.edu.controller;
2 2
3 3
4 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 import com.baomidou.mybatisplus.core.metadata.IPage; 4 import com.baomidou.mybatisplus.core.metadata.IPage;
6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 import com.skua.core.api.vo.Result; 6 import com.skua.core.api.vo.Result;
8 import com.skua.core.aspect.annotation.AutoLog; 7 import com.skua.core.aspect.annotation.AutoLog;
9 import com.skua.core.context.BaseContextHandler; 8 import com.skua.core.context.BaseContextHandler;
10 import com.skua.core.util.DateUtils; 9 import com.skua.core.util.DateUtils;
11 import com.skua.modules.common.service.ICommonSqlService;
12 import com.skua.modules.edu.entity.*; 10 import com.skua.modules.edu.entity.*;
13 import com.skua.modules.edu.service.IPaperService; 11 import com.skua.modules.edu.service.IPaperService;
14 import com.skua.modules.edu.service.IUserPaperService; 12 import com.skua.modules.edu.service.IUserPaperService;
15 import com.skua.modules.edu.vo.PaperVO; 13 import com.skua.modules.edu.vo.PaperVO;
16 import com.skua.modules.edu.vo.UserPaperVO; 14 import com.skua.modules.edu.vo.UserPaperVO;
17 import com.skua.modules.equipment.pojo.Equipment;
18 import com.skua.modules.equipment.util.EquipmentUtils;
19 import com.skua.modules.equipment.vo.EquipmentVO;
20 import com.skua.modules.guest.util.DateUtil;
21 import com.skua.tool.util.JoinSqlUtils;
22 import io.swagger.annotations.Api; 15 import io.swagger.annotations.Api;
23 import io.swagger.annotations.ApiOperation; 16 import io.swagger.annotations.ApiOperation;
24 import lombok.extern.slf4j.Slf4j; 17 import lombok.extern.slf4j.Slf4j;
...@@ -37,9 +30,6 @@ import javax.servlet.http.HttpServletResponse; ...@@ -37,9 +30,6 @@ import javax.servlet.http.HttpServletResponse;
37 import java.io.IOException; 30 import java.io.IOException;
38 import java.math.BigInteger; 31 import java.math.BigInteger;
39 import java.net.URLEncoder; 32 import java.net.URLEncoder;
40 import java.util.Date;
41 import java.util.List;
42 import java.util.Map;
43 33
44 @Slf4j 34 @Slf4j
45 @Api(tags="在线考试-用户考试") 35 @Api(tags="在线考试-用户考试")
...@@ -71,33 +61,11 @@ public class UserPaperController { ...@@ -71,33 +61,11 @@ public class UserPaperController {
71 paper.setUserId(BaseContextHandler.getUserId()); 61 paper.setUserId(BaseContextHandler.getUserId());
72 paper.setStartTime(DateUtils.now()); 62 paper.setStartTime(DateUtils.now());
73 paper.setEndTime( DateUtils.now() ); 63 paper.setEndTime( DateUtils.now() );
64 paper.setExamStatus(0);//考试状态是未考试的
74 IPage<Paper> pageList = paperService.queryMyPaperByList(page ,paper); 65 IPage<Paper> pageList = paperService.queryMyPaperByList(page ,paper);
75 result.setSuccess(true); 66 result.setSuccess(true);
76 result.setResult(pageList); 67 result.setResult(pageList);
77 return result; 68 return result;
78 /* String currentDate = DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss");
79 StringBuffer sql = new StringBuffer();
80 sql.append("select aaa.* from ( ");
81 sql.append(" select ifnull(up.user_id ,0) 'user_id', ifnull(count(up.id) ,0) as user_count, d.depart_name , p.* from edu_paper p ");
82 sql.append(" left join edu_user_paper up on p.id = up.paper_id ");
83 sql.append(" left join sys_depart d on p.depart_id = d.id");
84 sql.append(" where p.send_status =1 and p.exam_user_ids like '%"+BaseContextHandler.getUserId()+"%'");
85 if( paper.getDepartId() != null && paper.getDepartId().length() > 0){
86 sql.append(" and p.depart_id= '"+paper.getDepartId()+"' ");
87 }
88 if( paper.getPaperTitle() != null && paper.getPaperTitle().length() > 0){
89 sql.append(" and p.paper_title like '%"+paper.getPaperTitle()+"%' ");
90 }
91 if( paper.getDepartId() != null && paper.getDepartId().length() > 0){
92 sql.append(" and p.depart_id= '"+paper.getDepartId()+"' ");
93 }
94 sql.append(" and p.send_time >= '"+currentDate+"' and and p.send_time <= '"+currentDate+"'");
95 sql.append(" )aaa where aaa.user_id = 0 ");
96 // 分页查询
97 Page<Map<String, Object>> pageList = iCommonSqlService.queryForPage(page, sql.toString());
98 List<Paper> paperList = JoinSqlUtils.multiMaps2Beans(pageList.getRecords(), Paper.class);
99 //List<Paper> paperList = EquipmentUtils.equipEntities2VOs(dataList);
100 */
101 69
102 } 70 }
103 71
...@@ -110,12 +78,29 @@ public class UserPaperController { ...@@ -110,12 +78,29 @@ public class UserPaperController {
110 PaperVO paperVO = paperService.queryById(id); 78 PaperVO paperVO = paperService.queryById(id);
111 if(paperVO == null) { 79 if(paperVO == null) {
112 result.error500("未找到对应实体"); 80 result.error500("未找到对应实体");
113 }else if( paperVO!= null && !"1".equals(paperVO.getSendStatus() ) ) {
114 result.error500("试卷未发布!");
115 }else{ 81 }else{
116 result.setResult(paperVO); 82 result.setResult(paperVO);
117 result.setSuccess(true); 83 result.setSuccess(true);
118 } 84 }
85 /* long currentTimeMillis = System.currentTimeMillis();
86 //校验试卷状态、开始时间、接受时间
87 if(paperVO!= null ){
88 if( !"1".equals(paperVO.getSendStatus() ) ) {
89 result.error500("试卷未发布!");
90 }
91 if(StringUtils.isNotBlank(paperVO.getStartTime())){
92 Long startTime = com.skua.tool.util.DateUtils.dateStr2Sec(paperVO.getStartTime(), "yyyy-MM-dd");
93 if(currentTimeMillis < startTime){
94 result.error500("试卷未开始!");
95 }
96 }
97 if(StringUtils.isNotBlank(paperVO.getStartTime())){
98 Long endTime = com.skua.tool.util.DateUtils.dateStr2Sec(paperVO.getStartTime(), "yyyy-MM-dd");
99 if(currentTimeMillis > endTime){
100 result.error500("试卷已经结束!");
101 }
102 }
103 }*/
119 /* Boolean flag = paperService.checkExamCount(id,BaseContextHandler.getUserId()); 104 /* Boolean flag = paperService.checkExamCount(id,BaseContextHandler.getUserId());
120 if(flag){ 105 if(flag){
121 106
......
1 package com.skua.modules.edu.entity;
2
3 import java.io.Serializable;
4 import java.util.Date;
5 import com.baomidou.mybatisplus.annotation.IdType;
6 import com.baomidou.mybatisplus.annotation.TableId;
7 import com.baomidou.mybatisplus.annotation.TableName;
8 import com.baomidou.mybatisplus.annotation.TableField;
9 import io.swagger.annotations.ApiModel;
10 import io.swagger.annotations.ApiModelProperty;
11 import lombok.Data;
12 import lombok.EqualsAndHashCode;
13 import lombok.experimental.Accessors;
14 import com.fasterxml.jackson.annotation.JsonFormat;
15 import org.springframework.format.annotation.DateTimeFormat;
16 import org.jeecgframework.poi.excel.annotation.Excel;
17
18 /**
19 * 考试任务
20 */
21 @Data
22 @TableName("edu_paper_task")
23 @EqualsAndHashCode(callSuper = false)
24 @Accessors(chain = true)
25 @ApiModel(value="edu_paper_task对象", description="考试任务")
26 public class EduPaperTask {
27
28 /**主键*/
29 @TableId(type = IdType.ID_WORKER_STR)
30 @ApiModelProperty(value = "主键")
31 private String id;
32 /**部门编号*/
33 @Excel(name = "部门编号", width = 15)
34 @ApiModelProperty(value = "部门编号")
35 private String departId;
36 /**试卷编号*/
37 @Excel(name = "试卷编号", width = 15)
38 @ApiModelProperty(value = "试卷编号")
39 private String paperId;
40 /**参考用户编号*/
41 @Excel(name = "参考用户编号", width = 15)
42 @ApiModelProperty(value = "参考用户编号")
43 private String userId;
44
45 /**状态(0 未完成 1 已完成)*/
46 @Excel(name = "状态(0 未完成 1 已完成)", width = 15)
47 @ApiModelProperty(value = "状态(0 未完成 1 已完成)")
48 private String status;
49 /**备注*/
50 @Excel(name = "备注", width = 15)
51 @ApiModelProperty(value = "备注")
52 private String remark;
53 /**上传人*/
54 @Excel(name = "上传人", width = 15)
55 @ApiModelProperty(value = "上传人")
56 private String createBy;
57 /**上传时间*/
58 @Excel(name = "上传时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
59 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
60 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
61 @ApiModelProperty(value = "上传时间")
62 private Date createTime;
63 /**更新人*/
64 @Excel(name = "更新人", width = 15)
65 @ApiModelProperty(value = "更新人")
66 private String updateBy;
67 /**更新时间*/
68 @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
69 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
70 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
71 @ApiModelProperty(value = "更新时间")
72 private Date updateTime;
73 /**厂站ID*/
74 @Excel(name = "厂站ID", width = 15)
75 @ApiModelProperty(value = "厂站ID")
76 private String createDept;
77 /**delFlag*/
78 @Excel(name = "delFlag", width = 15)
79 @ApiModelProperty(value = "delFlag")
80 private Integer delFlag;
81 }
...@@ -131,11 +131,19 @@ public class Paper { ...@@ -131,11 +131,19 @@ public class Paper {
131 @ApiModelProperty(value = "delFlag") 131 @ApiModelProperty(value = "delFlag")
132 private Integer delFlag; 132 private Integer delFlag;
133 133
134
135
134 @ApiModelProperty(value = "考试人次") 136 @ApiModelProperty(value = "考试人次")
135 private Integer userCount ; 137 private Integer userCount ;
136 138
139
140 @TableField(exist=false)
141 @ApiModelProperty(value = "考试任务状态:0 未完成 1 已完成")
142 private Integer examStatus;
143
137 @TableField(exist=false) 144 @TableField(exist=false)
138 @ApiModelProperty(value = "扩展:考试人员") 145 @ApiModelProperty(value = "扩展:考试人员")
146 @Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
139 private String userId; 147 private String userId;
140 148
141 @TableField(exist=false) 149 @TableField(exist=false)
......
1 package com.skua.modules.edu.mapper;
2
3 import java.util.List;
4
5 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.edu.entity.EduPaperTask;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
8
9 /**
10 * 考试任务
11 */
12 public interface EduPaperTaskMapper extends BaseMapper<EduPaperTask> {
13 /***
14 * 根据试卷编号删除考试任务
15 * @param paperId
16 */
17 void delByPaperId( @Param("paperId") String paperId);
18
19 /**
20 * 设置departId
21 * @param paperId
22 */
23 void updateDepartIdByPaperId(@Param("paperId") String paperId);
24
25 /***
26 * 修改考试任务状态
27 * @param paperId
28 * @param userId
29 */
30 void updateStatus(String paperId, String userId);
31 }
...@@ -35,4 +35,11 @@ public interface PaperMapper extends BaseMapper<Paper> { ...@@ -35,4 +35,11 @@ public interface PaperMapper extends BaseMapper<Paper> {
35 */ 35 */
36 List<Paper> queryExamUserIds(@Param("startTime")String startTime,@Param("endTime") String endTime); 36 List<Paper> queryExamUserIds(@Param("startTime")String startTime,@Param("endTime") String endTime);
37 37
38 /***
39 * 分页查询考试任务
40 * @param page
41 * @param paper
42 * @return
43 */
44 IPage<Paper> queryPaperTaskList(Page<Paper> page,@Param("param") Paper paper);
38 } 45 }
......
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.edu.mapper.EduPaperTaskMapper">
4
5
6 <delete id="delByPaperId" >
7 delete from edu_paper_task where status = 0 and paper_id =#{paperId}
8 </delete>
9
10 <update id="updateDepartIdByPaperId">
11
12 update edu_paper_task t ,sys_user_depart ud set t.depart_id = ud.dep_id where t.user_id = ud.user_id and t.paper_id = #{paperId} and t.depart_id > '0'
13 </update>
14
15 <!-- 修改考试任务状态 -->
16 <update id="updateStatus">
17 update edu_paper_task set status = '1' where paper_id =#{paperId} and user_id =#{userId}
18 </update>
19
20 </mapper>
...\ No newline at end of file ...\ No newline at end of file
...@@ -2,6 +2,33 @@ ...@@ -2,6 +2,33 @@
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.edu.mapper.PaperMapper"> 3 <mapper namespace="com.skua.modules.edu.mapper.PaperMapper">
4 4
5
6 <!-- 考试任务 -->
7 <select id="queryPaperTaskList" resultType="com.skua.modules.edu.entity.Paper">
8 select p.* ,t.status 'examStatus' ,t.user_id from edu_paper p ,edu_paper_task t
9 where p.id = t.paper_id and p.send_status =1
10 <if test="param.userId != null and param.userId !=''">
11 and t.user_id = #{param.userId}
12 </if>
13 <if test="param.departId != null and param.departId !=''">
14 and p.depart_id = #{param.departId}
15 </if>
16 <if test="param.paperTitle != null and param.paperTitle !=''">
17 and p.paper_title like CONCAT('%',#{param.paperTitle},'%')
18 </if>
19 <if test="param.departId != null and param.departId !=''">
20 and p.depart_id = #{param.departId}
21 </if>
22
23 <if test="param.startTime != null and param.startTime !=''">
24 and p.start_time &lt;= #{param.startTime}
25 </if>
26 <if test="param.endTime != null and param.endTime !=''">
27 and p.end_time &gt;= #{param.endTime}
28 </if>
29 </select>
30
31
5 <!-- 我的考试列表 --> 32 <!-- 我的考试列表 -->
6 <select id="queryMyPaperByList" resultType="com.skua.modules.edu.entity.Paper"> 33 <select id="queryMyPaperByList" resultType="com.skua.modules.edu.entity.Paper">
7 select d.depart_name ,p.* 34 select d.depart_name ,p.*
......
1 package com.skua.modules.edu.service;
2
3 import com.skua.modules.edu.entity.EduPaperTask;
4 import com.baomidou.mybatisplus.extension.service.IService;
5
6 /**
7 * 考试任务
8 */
9 public interface IEduPaperTaskService extends IService<EduPaperTask> {
10
11 }
...@@ -82,4 +82,19 @@ public interface IPaperService extends IService<Paper> { ...@@ -82,4 +82,19 @@ public interface IPaperService extends IService<Paper> {
82 * @return 82 * @return
83 */ 83 */
84 List<Paper> queryExamUserIds(String startTime, String endTime); 84 List<Paper> queryExamUserIds(String startTime, String endTime);
85
86 /**
87 * 发布试卷
88 * @param paper
89 * @return
90 */
91 boolean publishPaper(Paper paper);
92
93 /**
94 * 分页查询考试任务
95 * @param page
96 * @param paper
97 * @return
98 */
99 IPage<Paper> queryPaperTaskList(Page<Paper> page, Paper paper);
85 } 100 }
......
1 package com.skua.modules.edu.service.impl;
2
3 import com.skua.modules.edu.entity.EduPaperTask;
4 import com.skua.modules.edu.mapper.EduPaperTaskMapper;
5 import com.skua.modules.edu.service.IEduPaperTaskService;
6 import org.springframework.stereotype.Service;
7
8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
10 /**
11 * 考试任务
12 */
13 @Service
14 public class EduPaperTaskServiceImpl extends ServiceImpl<EduPaperTaskMapper, EduPaperTask> implements IEduPaperTaskService {
15
16 }
...@@ -42,6 +42,8 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements ...@@ -42,6 +42,8 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
42 private UserPaperMapper userPaperMapper; 42 private UserPaperMapper userPaperMapper;
43 @Resource 43 @Resource
44 private UserAnswerMapper userAnswerMapper; 44 private UserAnswerMapper userAnswerMapper;
45 @Resource
46 private EduPaperTaskMapper paperTaskMapper;
45 /*** 47 /***
46 * 添加试卷、试卷试题表 48 * 添加试卷、试卷试题表
47 * @param paperVO 49 * @param paperVO
...@@ -172,7 +174,8 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements ...@@ -172,7 +174,8 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
172 * @return 174 * @return
173 */ 175 */
174 public IPage<Paper> queryMyPaperByList(Page<Paper> page, Paper paper){ 176 public IPage<Paper> queryMyPaperByList(Page<Paper> page, Paper paper){
175 return this.baseMapper.queryMyPaperByList(page,paper) ; 177 // return this.baseMapper.queryMyPaperByList(page,paper) ;
178 return this.baseMapper.queryPaperTaskList(page,paper);
176 } 179 }
177 /*** 180 /***
178 * 我的试卷记录 181 * 我的试卷记录
...@@ -192,6 +195,42 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements ...@@ -192,6 +195,42 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
192 public List<Paper> queryExamUserIds(String startTime, String endTime){ 195 public List<Paper> queryExamUserIds(String startTime, String endTime){
193 return this.baseMapper.queryExamUserIds(startTime,endTime) ; 196 return this.baseMapper.queryExamUserIds(startTime,endTime) ;
194 } 197 }
198 /**
199 * 分页查询考试任务
200 * @param page
201 * @param paper
202 * @return
203 */
204 public IPage<Paper> queryPaperTaskList(Page<Paper> page, Paper paper){
205 return this.baseMapper.queryPaperTaskList(page,paper);
206 }
207 /**
208 * 发布试卷
209 * @param paper
210 * @return
211 */
212 @Transactional
213 public boolean publishPaper(Paper paper){
214 //根据试卷删除考试任务
215 this.paperTaskMapper.delByPaperId(paper.getId());
216 //重新生成考试任务
217
218 EduPaperTask paperTask = null;
219 String[] userIdList = paper.getExamUserIds().split(",");
220 for(String userId : userIdList){
221 paperTask = new EduPaperTask();
222 paperTask.setPaperId(paper.getId());
223 paperTask.setUserId(userId);
224 this.paperTaskMapper.insert(paperTask);
225 }
226 //批量修改考试任务表的部门编号
227 this.paperTaskMapper.updateDepartIdByPaperId(paper.getId());
228 //发布试卷
229 this.baseMapper.updateById(paper);
230
231 return true;
232 }
233
195 234
196 /*** 235 /***
197 * 交卷 236 * 交卷
...@@ -243,7 +282,10 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements ...@@ -243,7 +282,10 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
243 paperMapper.updateById( paper ) ; 282 paperMapper.updateById( paper ) ;
244 //计算分数 283 //计算分数
245 // answer.setScore( totalScore ); 284 // answer.setScore( totalScore );
246 // answerMapper.updateById( answer ) ; 285 // answerMapper.updateById( answer )
286 // 修改考试任务的状态
287 paperTaskMapper.updateStatus(userPaper.getPaperId(),userPaper.getUserId());
288
247 return totalScore+""; 289 return totalScore+"";
248 } 290 }
249 /* public String queryPaperScore(String paperId,String userId){ 291 /* public String queryPaperScore(String paperId,String userId){
......
...@@ -312,21 +312,26 @@ public class WorkAnalysisController { ...@@ -312,21 +312,26 @@ public class WorkAnalysisController {
312 } 312 }
313 313
314 private String getSafeProgressSql( String departIds,String startTime, String endTime){ 314 private String getSafeProgressSql( String departIds,String startTime, String endTime){
315 JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); 315 /* JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master");
316 String userIdsSql = "select GROUP_CONCAT( DISTINCT exam_user_ids) 'user_ids' from edu_paper where end_time >='"+startTime+"' and end_time <= '"+endTime+"'"; 316 String userIdsSql = "select GROUP_CONCAT( DISTINCT exam_user_ids) 'user_ids' from edu_paper where end_time >='"+startTime+"' and end_time <= '"+endTime+"'";
317 String userIds = jdbcTemplate.queryForObject(userIdsSql , String.class); 317 String userIds = jdbcTemplate.queryForObject(userIdsSql , String.class);
318 if(StringUtils.isNotEmpty(userIds)){ 318 if(StringUtils.isNotEmpty(userIds)){
319 userIds = JSUtils.quoteEach(userIds,","); 319 userIds = JSUtils.quoteEach(userIds,",");
320 }else{ 320 }else{
321 userIds = "''"; 321 userIds = "''";
322 } 322 }*/
323 String sql = ""; 323 String sql = "";
324 //会议任务 324 //会议任务
325 sql += " left join( select depart_id , count(1) 'count' from ajh_meeting_send where meet_status =2 and meet_time >='"+startTime+"' and meet_time <= '"+endTime+"' group by depart_id )aaa on aaa.depart_id = d.id "; 325 sql += " left join( select depart_id , count(1) 'count' from ajh_meeting_send where meet_status =2 and meet_time >='"+startTime+"' and meet_time <= '"+endTime+"' group by depart_id )aaa on aaa.depart_id = d.id ";
326 sql += " left join (select depart_id , count(1) 'count' from ajh_meeting_send where meet_id in (select id from ajh_meeting where send_time >='"+startTime+"' and send_time <= '"+endTime+"') group by depart_id ) bbb on bbb.depart_id = d.id "; 326 sql += " left join (select depart_id , count(1) 'count' from ajh_meeting_send where meet_id in (select id from ajh_meeting where send_time >='"+startTime+"' and send_time <= '"+endTime+"') group by depart_id ) bbb on bbb.depart_id = d.id ";
327 // 考试任务 327 // 考试任务
328 sql += " left join (select depart_id,count(user_id) 'count' from edu_user_paper where DATE_FORMAT(end_time,'%Y-%m-%d') >='"+startTime+"' and end_time <= '"+endTime+"' and user_id in("+userIds+") group by depart_id )ccc on ccc.depart_id = d.id"; 328 // sql += " left join (select depart_id,count(user_id) 'count' from edu_user_paper where DATE_FORMAT(end_time,'%Y-%m-%d') >='"+startTime+"' and end_time <= '"+endTime+"' and user_id in("+userIds+") group by depart_id )ccc on ccc.depart_id = d.id";
329 sql += " left join ( select dep_id,count(user_id) 'count' from sys_user_depart where user_id in("+userIds+") group by dep_id )ddd on ddd.dep_id = d.id"; 329 // sql += " left join ( select dep_id,count(user_id) 'count' from sys_user_depart where user_id in("+userIds+") group by dep_id )ddd on ddd.dep_id = d.id";
330
331 sql += " left join (select depart_id ,count(id) 'count' from edu_paper_task where DATE_FORMAT(end_time,'%Y-%m-%d') >='"+startTime+"' and DATE_FORMAT(end_time,'%Y-%m-%d') <= '"+endTime+"' and status=1 group by depart_id )ccc on ccc.depart_id = d.id";
332 sql += " left join ( select depart_id ,count(id) 'count' from edu_paper_task where DATE_FORMAT(create_time,'%Y-%m-%d') >='"+startTime+"' and DATE_FORMAT(end_time,'%Y-%m-%d') <= '"+endTime+"' group by depart_id )ddd on ddd.dep_id = d.id";
333
334
330 //风险排查任务 335 //风险排查任务
331 sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and report_date >= '"+startTime+" 00:00:00' and report_date <='"+endTime+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id "; 336 sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and report_date >= '"+startTime+" 00:00:00' and report_date <='"+endTime+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id ";
332 sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where report_date >= '"+startTime+" 00:00:00' and report_date <='"+endTime+" 23:59:59' group by depart_id ) ggg on ggg.depart_id = d.id "; 337 sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where report_date >= '"+startTime+" 00:00:00' and report_date <='"+endTime+" 23:59:59' group by depart_id ) ggg on ggg.depart_id = d.id ";
......
...@@ -713,8 +713,8 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService ...@@ -713,8 +713,8 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
713 if (inspectionPointFillGroupIdList.size() > 0) { 713 if (inspectionPointFillGroupIdList.size() > 0) {
714 QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>(); 714 QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>();
715 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", inspectionTaskIdList); 715 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", inspectionTaskIdList);
716 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", inspectionPointFillGroupIdList); 716 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", new HashSet<>(inspectionPointFillGroupIdList));
717 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",inspectionFillGroupIdList); 717 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",new HashSet<>(inspectionFillGroupIdList));
718 inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id"); 718 inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id");
719 inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", ""); 719 inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", "");
720 inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id"); 720 inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id");
...@@ -883,8 +883,8 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService ...@@ -883,8 +883,8 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
883 if (inspectionPointFillGroupIdList.size() > 0) { 883 if (inspectionPointFillGroupIdList.size() > 0) {
884 QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>(); 884 QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>();
885 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", tempInspectionTaskIdList); 885 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", tempInspectionTaskIdList);
886 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", inspectionPointFillGroupIdList); 886 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", new HashSet<>(inspectionPointFillGroupIdList));
887 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",inspectionFillGroupIdList); 887 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",new HashSet<>(inspectionFillGroupIdList));
888 inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id"); 888 inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id");
889 inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", ""); 889 inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", "");
890 inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id"); 890 inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id");
...@@ -1172,8 +1172,8 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService ...@@ -1172,8 +1172,8 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
1172 if (inspectionPointFillGroupIdList.size() > 0) { 1172 if (inspectionPointFillGroupIdList.size() > 0) {
1173 QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>(); 1173 QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>();
1174 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", inspectionTaskIdList); 1174 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", inspectionTaskIdList);
1175 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", inspectionPointFillGroupIdList); 1175 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", new HashSet<>(inspectionPointFillGroupIdList));
1176 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",inspectionFillGroupIdList); 1176 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",new HashSet<>(inspectionFillGroupIdList));
1177 inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id"); 1177 inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id");
1178 inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", ""); 1178 inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", "");
1179 inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id"); 1179 inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id");
...@@ -1321,8 +1321,8 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService ...@@ -1321,8 +1321,8 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
1321 if (inspectionPointFillGroupIdList.size() > 0) { 1321 if (inspectionPointFillGroupIdList.size() > 0) {
1322 QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>(); 1322 QueryWrapper<InspectionTaskFillContent> inspectionTaskFillContentQueryWrapper = new QueryWrapper<>();
1323 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", tempInspectionTaskIdList); 1323 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_task_id", tempInspectionTaskIdList);
1324 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", inspectionPointFillGroupIdList); 1324 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_point_fill_group_id", new HashSet<>(inspectionPointFillGroupIdList));
1325 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",inspectionFillGroupIdList); 1325 inspectionTaskFillContentQueryWrapper.in("isfc.inspection_fill_group_id",new HashSet<>(inspectionFillGroupIdList));
1326 inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id"); 1326 inspectionTaskFillContentQueryWrapper.isNotNull("itpfg.equip_info_id");
1327 inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", ""); 1327 inspectionTaskFillContentQueryWrapper.ne("itpfg.equip_info_id", "");
1328 inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id"); 1328 inspectionTaskFillContentQueryWrapper.groupBy("itpfg.equip_info_id");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!