修改bug
This commit is contained in:
parent
0f7e6fdabc
commit
341655b377
|
@ -598,7 +598,7 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
queryWrapper.eq("c.KCAPZBBH",zyInfo.getRwbh());
|
||||
queryWrapper.eq("c.xh",sysUser.getUsername());
|
||||
queryWrapper.orderByDesc("a.sort");
|
||||
queryWrapper.orderByDesc("a.sort - 0");
|
||||
IPage<ZyInfo> pageList = zyInfoService.stuList(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
@ -950,4 +950,42 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="统计作业测试使用情况", notes="统计作业测试使用情况")
|
||||
@GetMapping(value = "/sysStaticNo")
|
||||
public Result<Map<String,Object>> sysStaticNo(ZyInfoSys zyInfoSys,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//-------------获取当前登陆人是否是管理员角色,如果不是都按照教务秘书处理---------------------------
|
||||
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
|
||||
String adminRole = "1";//0 admin 1教务秘书
|
||||
for(String role :roleList){
|
||||
if(org.apache.commons.lang.StringUtils.equals("admin",role)){
|
||||
adminRole = "0";
|
||||
break;
|
||||
}
|
||||
}
|
||||
QueryWrapper<ZyInfoSys> queryWrapper = new QueryWrapper<ZyInfoSys>();
|
||||
if(org.apache.commons.lang.StringUtils.equals("1",adminRole)){
|
||||
QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapperCon = new QueryWrapper<KcExportConfigTpkwcqkjzglx>();
|
||||
queryWrapperCon.eq("gh",sysUser.getUsername());
|
||||
queryWrapperCon.orderByDesc("create_time");
|
||||
queryWrapperCon.last("limit 1");
|
||||
KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx = kcExportConfigTpkwcqkjzglxService.getOne(queryWrapperCon);
|
||||
zyInfoSys.setKkdw(kcExportConfigTpkwcqkjzglx.getDwmc());
|
||||
}
|
||||
|
||||
if(com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(zyInfoSys.getXqxn())){
|
||||
KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
|
||||
zyInfoSys.setXqxn(kcSysConfig.getFlag1());
|
||||
}
|
||||
|
||||
Map<String,Object> pageList = zyInfoService.sysStaticNo(zyInfoSys);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,4 +56,8 @@ public class ZyInfoSys implements Serializable {
|
|||
|
||||
private String jgh;
|
||||
private String ywId;
|
||||
|
||||
private String type;
|
||||
private String count;
|
||||
private String rownum;
|
||||
}
|
||||
|
|
|
@ -32,4 +32,10 @@ public interface ZyInfoMapper extends BaseMapper<ZyInfo> {
|
|||
IPage<ZyInfoSys> sysStaticList(Page<ZyInfoSys> page,@Param("zyInfoSys") ZyInfoSys zyInfoSys);
|
||||
|
||||
IPage<ZyInfo> listOther(Page<ZyInfo> page,@Param("zyInfo") ZyInfo zyInfo);
|
||||
|
||||
List<ZyInfoSys> getZyStaticNo(@Param("zyInfoSys") ZyInfoSys zyInfoSys);
|
||||
|
||||
List<ZyInfoSys> getZyTopList(@Param("zyInfoSys") ZyInfoSys zyInfoSys);
|
||||
|
||||
List<ZyInfoSys> getCyTopList(@Param("zyInfoSys") ZyInfoSys zyInfoSys);
|
||||
}
|
||||
|
|
|
@ -143,4 +143,39 @@
|
|||
and a.teacher_no = #{zyInfo.teacherNo}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getZyStaticNo" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select count(*) as count,'1' as type from zy_info where xnxq = #{zyInfoSys.xqxn} and zy_status in (1,2)
|
||||
union all
|
||||
select count(*) as count,'2' as type from zy_info where xnxq = #{zyInfoSys.xqxn} and zy_status in (1,2) and xshpkg = '1'
|
||||
union all
|
||||
select count(*) as count,'3' as type from zy_info where xnxq = #{zyInfoSys.xqxn} and zy_status in (2)
|
||||
union all
|
||||
select count(*) as count,'4' as type from zy_info where (update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and zy_status in (1,2)
|
||||
union all
|
||||
select count(*) as count,'5' as type from zy_info where (update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and zy_status in (1,2) and xshpkg = '1'
|
||||
union all
|
||||
select count(*) as count,'6' as type from zy_info where (update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and zy_status in (2)
|
||||
union all
|
||||
select count(*) as count,'7' as type from wjx_wjxx where xqxn = #{zyInfoSys.xqxn} and qpublish in (1,2)
|
||||
union all
|
||||
select count(*) as count,'8' as type from wjx_wjxx where xqxn = #{zyInfoSys.xqxn} and qpublish = '2'
|
||||
union all
|
||||
select count(*) as count,'9' as type from wjx_wjxx where (update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and qpublish in (1,2)
|
||||
union all
|
||||
select count(*) as count,'10' as type from wjx_wjxx where (update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and qpublish = '2'
|
||||
</select>
|
||||
|
||||
<select id="getZyTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select (@rownum:=@rownum + 1) AS rownum,t.* from (
|
||||
select a.create_by,count(*) as count,b.xm as skjs,b.dwmc as kkdw from zy_info a,xxhbuser b where a.create_by = b.gh and xnxq = #{zyInfoSys.xqxn} and zy_status in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc
|
||||
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc limit 10
|
||||
</select>
|
||||
|
||||
<select id="getCyTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select (@rownum:=@rownum + 1) AS rownum,t.* from (
|
||||
select a.create_by,count(*) as count,b.xm as skjs,b.dwmc as kkdw from wjx_wjxx a,xxhbuser b where a.create_by = b.gh and xqxn = #{zyInfoSys.xqxn} and qpublish in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc
|
||||
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc limit 10
|
||||
</select>
|
||||
</mapper>
|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 作业发布
|
||||
|
@ -32,4 +33,6 @@ public interface IZyInfoService extends IService<ZyInfo> {
|
|||
IPage<ZyInfoSys> sysStaticList(Page<ZyInfoSys> page, ZyInfoSys zyInfoSys);
|
||||
|
||||
IPage<ZyInfo> listOther(Page<ZyInfo> page, ZyInfo zyInfo);
|
||||
|
||||
Map<String,Object> sysStaticNo(ZyInfoSys zyInfoSys);
|
||||
}
|
||||
|
|
|
@ -27,10 +27,7 @@ import org.springframework.stereotype.Service;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 作业发布
|
||||
|
@ -167,6 +164,65 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
|
|||
return baseMapper.listOther(page, zyInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,Object> sysStaticNo(ZyInfoSys zyInfoSys) {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
|
||||
String xn_zy_syzcs = "0";
|
||||
String xn_zy_hpzcs = "0";
|
||||
String xn_zy_ywczcs = "0";
|
||||
String xn_cy_syzcs = "0";
|
||||
String xn_cy_ywczcs = "0";
|
||||
String jr_zy_syzcs = "0";
|
||||
String jr_zy_hpzcs = "0";
|
||||
String jr_zy_ywczcs = "0";
|
||||
String jr_cy_syzcs = "0";
|
||||
String jr_cy_ywczcs = "0";
|
||||
|
||||
List<ZyInfoSys> list = baseMapper.getZyStaticNo(zyInfoSys);
|
||||
for(ZyInfoSys par : list){
|
||||
if(StringUtils.equals("1",par.getType())){
|
||||
xn_zy_syzcs = par.getCount();
|
||||
}else if(StringUtils.equals("2",par.getType())){
|
||||
xn_zy_hpzcs = par.getCount();
|
||||
}else if(StringUtils.equals("3",par.getType())){
|
||||
xn_zy_ywczcs = par.getCount();
|
||||
}else if(StringUtils.equals("4",par.getType())){
|
||||
jr_zy_syzcs = par.getCount();
|
||||
}else if(StringUtils.equals("5",par.getType())){
|
||||
jr_zy_hpzcs = par.getCount();
|
||||
}else if(StringUtils.equals("6",par.getType())){
|
||||
jr_zy_ywczcs = par.getCount();
|
||||
}else if(StringUtils.equals("7",par.getType())){
|
||||
xn_cy_syzcs = par.getCount();
|
||||
}else if(StringUtils.equals("8",par.getType())){
|
||||
xn_cy_ywczcs = par.getCount();
|
||||
}else if(StringUtils.equals("9",par.getType())){
|
||||
jr_cy_syzcs = par.getCount();
|
||||
}else if(StringUtils.equals("10",par.getType())){
|
||||
jr_cy_ywczcs = par.getCount();
|
||||
}
|
||||
}
|
||||
|
||||
List<ZyInfoSys> list1 = baseMapper.getZyTopList(zyInfoSys);
|
||||
List<ZyInfoSys> list2 = baseMapper.getCyTopList(zyInfoSys);
|
||||
list.add(zyInfoSys);
|
||||
|
||||
map.put("xn_zy_syzcs",xn_zy_syzcs);//本学年作业使用总次数:
|
||||
map.put("xn_zy_hpzcs",xn_zy_hpzcs);//本学年作业互评总次数:
|
||||
map.put("xn_zy_ywczcs",xn_zy_ywczcs);//本学年作业已完成总次数:
|
||||
map.put("xn_cy_syzcs",xn_cy_syzcs);//本学年测验使用总次数:
|
||||
map.put("xn_cy_ywczcs",xn_cy_ywczcs);//本学年测验已完成总次数:
|
||||
map.put("jr_zy_syzcs",jr_zy_syzcs);//今日作业使用总次数:
|
||||
map.put("jr_zy_hpzcs",jr_zy_hpzcs);//今日作业互评总次数:
|
||||
map.put("jr_zy_ywczcs",jr_zy_ywczcs);//今日作业已完成总次数:
|
||||
map.put("jr_cy_syzcs",jr_cy_syzcs);//今日测验使用总次数:
|
||||
map.put("jr_cy_ywczcs",jr_cy_ywczcs);//今日测验已完成总次数:
|
||||
map.put("xntop10",list1);//本学年作业使用排行TOP10
|
||||
map.put("jrtop10",list2);//本学年测验使用排行TOP10
|
||||
return map;
|
||||
}
|
||||
|
||||
// appId
|
||||
private static final String appId = "wx031697a8ca09a5ce";//东师
|
||||
|
||||
|
|
|
@ -688,17 +688,17 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
|||
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//20241107新增判断,看原来是否有数据,防止重复添加
|
||||
// QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper = new QueryWrapper<>();
|
||||
// zyInfoStudentQueryWrapper.eq("create_by",user.getUsername());
|
||||
// zyInfoStudentQueryWrapper.eq("main_id",zyInfoStudent.getMainId());
|
||||
// zyInfoStudentQueryWrapper.last("limit 1");
|
||||
// ZyInfoStudent zyInfoStudent2 = zyInfoStudentService.getOne(zyInfoStudentQueryWrapper);
|
||||
// if(zyInfoStudent2!=null){
|
||||
// //20241107新增判断,看原来是否有数据,防止重复添加,将原来的id赋值到请求数据里
|
||||
// zyInfoStudent.setId(zyInfoStudent2.getId());
|
||||
// stuPar.setFilePath(zyInfoStudent.getFilePath());
|
||||
// zyInfoStudent =stuPar;
|
||||
// }else{
|
||||
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper = new QueryWrapper<>();
|
||||
zyInfoStudentQueryWrapper.eq("a.create_by",user.getUsername());
|
||||
zyInfoStudentQueryWrapper.eq("a.main_id",zyInfoStudent.getMainId());
|
||||
zyInfoStudentQueryWrapper.last("limit 1");
|
||||
ZyInfoStudent zyInfoStudent2 = zyInfoStudentService.getOne(zyInfoStudentQueryWrapper);
|
||||
if(zyInfoStudent2!=null){
|
||||
//20241107新增判断,看原来是否有数据,防止重复添加,将原来的id赋值到请求数据里
|
||||
stuPar = zyInfoStudent2;
|
||||
stuPar.setFilePath(zyInfoStudent.getFilePath());
|
||||
zyInfoStudent =stuPar;
|
||||
}else{
|
||||
ZyInfoStudent zyInfoStudent1 = new ZyInfoStudent();
|
||||
zyInfoStudent1.setMainId(zyInfo.getId());
|
||||
zyInfoStudent1.setCreateBy(user.getUsername());
|
||||
|
@ -708,7 +708,7 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
|||
zyInfoStudentService.save(zyInfoStudent1);
|
||||
stuPar =zyInfoStudent1;
|
||||
zyInfoStudent =zyInfoStudent1;
|
||||
// }
|
||||
}
|
||||
|
||||
}else{
|
||||
stuPar.setFilePath(zyInfoStudent.getFilePath());
|
||||
|
|
Loading…
Reference in New Issue