Compare commits

...

2 Commits

  1. 4
      common/src/main/java/com/huoran/common/entity/ProjectManage.java
  2. 14
      nakadai/src/main/java/com/huoran/nakadai/controller/MallProjectConfigController.java
  3. 8
      nakadai/src/main/java/com/huoran/nakadai/controller/ServiceConfigurationController.java
  4. 27
      nakadai/src/main/java/com/huoran/nakadai/entity/req/ProjectListOfSystemReq.java
  5. 2
      nakadai/src/main/java/com/huoran/nakadai/mapper/MallProjectConfigMapper.java
  6. 12
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/MallProjectConfigMapper.xml
  7. 3
      nakadai/src/main/java/com/huoran/nakadai/service/MallProjectConfigService.java
  8. 19
      nakadai/src/main/java/com/huoran/nakadai/service/impl/MallProjectConfigServiceImpl.java
  9. 7
      occupationlab/src/main/java/com/huoran/occupationlab/controller/ProjectManageController.java
  10. 15
      occupationlab/src/main/java/com/huoran/occupationlab/controller/StudentArchitectureController.java
  11. 4
      occupationlab/src/main/java/com/huoran/occupationlab/entity/req/OrganizationStudentReq.java
  12. 2
      occupationlab/src/main/java/com/huoran/occupationlab/mapper/ProjectManageMapper.java
  13. 215
      occupationlab/src/main/java/com/huoran/occupationlab/mapper/xml/ProjectManageMapper.xml
  14. 42
      occupationlab/src/main/java/com/huoran/occupationlab/service/impl/ProjectManageServiceImpl.java

@ -183,5 +183,9 @@ public class ProjectManage implements Serializable {
@TableField(exist = false)
private Double score;
@ApiModelProperty(value = "用户名称")
@TableField(exist = false)
private String userName;
}

@ -3,13 +3,12 @@ package com.huoran.nakadai.controller;
import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.entity.req.ProjectListOfSystemReq;
import com.huoran.nakadai.service.MallProjectConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotNull;
@ -39,13 +38,12 @@ public class MallProjectConfigController {
@ApiOperation(value = "大赛中 系统id查询商品关联项目")
@GetMapping("/getProjectListOfSystem")
@PostMapping("/getProjectListOfSystem")
public R getProjectListOfSystem(
@NotNull(message = "系统id不能为空") Integer systemId,
Integer pageNum,Integer pageSize,
HttpServletRequest request) {
@RequestBody ProjectListOfSystemReq projectListOfSystemReq, HttpServletRequest request) {
Integer schoolId = TokenUtils.getSchoolIdByJwtToken(request);
return mallProjectConfigService.getProjectListOfSystem(schoolId,systemId,pageNum,pageSize);
projectListOfSystemReq.setSchoolId(schoolId);
return mallProjectConfigService.getProjectListOfSystem(projectListOfSystemReq);
}
}

@ -48,7 +48,13 @@ public class ServiceConfigurationController {
@ApiOperation(value = "获取不同类型系统")
@GetMapping("/getServiceOfType")
public R getServiceOfType(@NotNull(message = "系统类型") Integer type) {
List<ServiceConfiguration> serviceList = serviceConfigurationService.list(new QueryWrapper<ServiceConfiguration>().eq("type",type));
QueryWrapper<ServiceConfiguration> queryWrapper = new QueryWrapper<>();
if (type == 1) {
queryWrapper.eq("type", 1).or().eq("type", 0);
}else {
queryWrapper.eq("type", type);
}
List<ServiceConfiguration> serviceList = serviceConfigurationService.list(queryWrapper);
return R.ok().put("serviceList",serviceList);
}

@ -0,0 +1,27 @@
package com.huoran.nakadai.entity.req;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ProjectListOfSystemReq {
@ApiModelProperty(value = "模糊查询", example = "1")
private String keyword;
@ApiModelProperty(value = "系统id", example = "1")
private Integer systemId;
@ApiModelProperty(value = "页码")
private Integer pageNum;
@ApiModelProperty(value = "页数")
private Integer pageSize;
@ApiModelProperty(value = "类型(实训1、理论3)")
private Integer type;
@ApiModelProperty(hidden = true)
private Integer schoolId;
}

@ -23,5 +23,5 @@ public interface MallProjectConfigMapper extends BaseMapper<MallProjectConfig> {
List<MallProjectConfigRes> getSystemListOfMall(@Param("schoolId")Integer schoolId,@Param("type")Integer type);
IPage<MallProjectConfigRes> getProjectListOfSystem(Page<MallProjectConfigRes> page, @Param("schoolId")Integer schoolId, @Param("systemId")Integer systemId);
IPage<MallProjectConfigRes> getProjectListOfSystem(Page<MallProjectConfigRes> page, @Param("schoolId")Integer schoolId, @Param("systemIdList")List<Integer> systemIdList, @Param("keyword")String keyword);
}

@ -119,7 +119,17 @@
AND c.school_id = #{schoolId}
AND o.order_status = 1
AND pc.is_del = 0
AND pc.system_id = #{systemId}
<if test="keyword != null and keyword != ''">
AND (
(pc.project_id IS NOT NULL AND m.project_name LIKE CONCAT('%', #{keyword}, '%'))
OR
(pc.paper_id IS NOT NULL AND p.NAME LIKE CONCAT('%', #{keyword}, '%'))
)
</if>
AND pc.system_id in
<foreach collection="systemIdList" item="systemId" open="(" separator="," close=")">
#{systemId}
</foreach>
AND o.order_status = 1 and unix_timestamp(ot.start_time) <![CDATA[ <= ]]> unix_timestamp(NOW()) and unix_timestamp(ot.end_time) <![CDATA[ >= ]]> unix_timestamp(NOW())
ORDER BY
pc.sort

@ -3,6 +3,7 @@ package com.huoran.nakadai.service;
import com.huoran.common.response.R;
import com.huoran.nakadai.entity.MallProjectConfig;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huoran.nakadai.entity.req.ProjectListOfSystemReq;
/**
* <p>
@ -16,5 +17,5 @@ public interface MallProjectConfigService extends IService<MallProjectConfig> {
R getSystemListOfMall(Integer schoolId,Integer type);
R getProjectListOfSystem(Integer schoolId, Integer systemId,Integer pageNum,Integer pageSize);
R getProjectListOfSystem(ProjectListOfSystemReq projectListOfSystemReq);
}

@ -5,12 +5,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huoran.common.response.R;
import com.huoran.nakadai.entity.MallProjectConfig;
import com.huoran.nakadai.entity.req.ProjectListOfSystemReq;
import com.huoran.nakadai.entity.res.MallProjectConfigRes;
import com.huoran.nakadai.mapper.MallProjectConfigMapper;
import com.huoran.nakadai.service.MallProjectConfigService;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
@ -30,9 +33,19 @@ public class MallProjectConfigServiceImpl extends ServiceImpl<MallProjectConfigM
}
@Override
public R getProjectListOfSystem(Integer schoolId, Integer systemId,Integer pageNum,Integer pageSize) {
Page<MallProjectConfigRes> page = new Page<>(pageNum, pageSize);
IPage<MallProjectConfigRes> mallProjectConfigRes = baseMapper.getProjectListOfSystem(page,schoolId,systemId);
public R getProjectListOfSystem(ProjectListOfSystemReq projectListOfSystemReq) {
List<Integer> systemIdList = new ArrayList<>();
if (projectListOfSystemReq.getSystemId()==null){
List<MallProjectConfigRes> mallProjectConfigRes = baseMapper.getSystemListOfMall(projectListOfSystemReq.getSchoolId(),projectListOfSystemReq.getType());
// 使用流 API 提取 systemId 并转换为 List
systemIdList = mallProjectConfigRes.stream()
.map(MallProjectConfigRes::getSystemId)
.collect(Collectors.toList());
}
systemIdList.add(projectListOfSystemReq.getSystemId());
Page<MallProjectConfigRes> page = new Page<>(projectListOfSystemReq.getPageNum(), projectListOfSystemReq.getPageSize());
IPage<MallProjectConfigRes> mallProjectConfigRes = baseMapper.getProjectListOfSystem(page,projectListOfSystemReq.getSchoolId(),systemIdList,projectListOfSystemReq.getKeyword());
return R.ok().put("data",mallProjectConfigRes);
}
}

@ -204,9 +204,10 @@ public class ProjectManageController {
@ApiOperation(value = "根据系统id、项目权限获取系统内置项目")
@GetMapping("/getInternalProjectBySystemId")
public List<ProjectManage> getInternalProjectBySystemId(@RequestParam List<Integer> systemId,
@RequestParam @ApiParam(value = "项目权限(0、练习 1、考核 2、竞赛)", name = "permissions") Integer permissions,
@RequestParam(required = false) @ApiParam(value = "关键词", name = "keyword", required = false) String keyword) {
public List<ProjectManage> getInternalProjectBySystemId(
@RequestParam List<Integer> systemId,
@RequestParam @ApiParam(value = "项目权限(0、练习 1、考核 2、竞赛)", name = "permissions") Integer permissions,
@RequestParam(required = false) @ApiParam(value = "关键词", name = "keyword", required = false) String keyword) {
return projectManageService.getInternalProjectBySystemId(systemId, permissions, keyword);
}

@ -643,14 +643,12 @@ public class StudentArchitectureController {
@ApiOperation(value = "导出学生全部数据")
@PostMapping(value = "/excelExportStudentList", produces = "application/json;multipart/form-data;charset=utf-8")
public void excelExport(
@ApiParam(name = "studentList", value = "导出学生列表数据", required = false)
@RequestBody(required = false) List<StudentInfoResp> studentList,
@ApiParam(name = "req", value = "组织架构导出筛选条件", required = false)
@RequestBody(required = false) OrganizationStudentReq req,
HttpServletRequest request, HttpServletResponse response) throws IOException {
List<StudentInfoResp> studentList = req.getStudentList();
Integer schoolId = TokenUtils.getSchoolIdByJwtToken(request);
if (req!=null){
if (req.getLevel()!=null){
req.setSchoolId(schoolId);
//1.专业 2.年级 3.班级
switch (req.getLevel()) {
@ -671,10 +669,8 @@ public class StudentArchitectureController {
continue;
}
req.setClassList(getClass);
studentList.addAll(studentService.organizationalExportStudentList(req));
}
case 2:
//选择年级时
QueryWrapper<Class> classQueryWrapper = new QueryWrapper<>();
@ -682,16 +678,13 @@ public class StudentArchitectureController {
List<Class> getClass = classService.list(classQueryWrapper);
req.setClassList(getClass);
studentList = studentService.organizationalExportStudentList(req);
case 3:
List<Class> classList = new ArrayList<>();
Class classes = new Class();
classes.setId(req.getArchitectureId());
classList.add(classes);
req.setClassList(classList);
studentList = studentService.organizationalExportStudentList(req);
}
}else {
if (studentList==null || studentList.isEmpty()){
@ -723,7 +716,6 @@ public class StudentArchitectureController {
@ApiOperation(value = "移除学生", response = StudentInfoResp.class)
public R removeStudent(HttpServletRequest request, @ApiParam(name = "classId", value = "要移除的班级id", required = true) @RequestParam String classId,
@ApiParam(name = "stuAccountId", value = "要移除的学生账号id", required = true) @RequestParam String stuAccountId) {
String accountId = TokenUtils.getIdByJwtToken(request);
Integer schoolId = TokenUtils.getSchoolIdByJwtToken(request);
QueryWrapper<Student> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_del", DelConstant.NOT_DEL);
@ -766,7 +758,6 @@ public class StudentArchitectureController {
) {
boolean ret = false;
String accountId = TokenUtils.getIdByJwtToken(request);
Integer schoolId = TokenUtils.getSchoolIdByJwtToken(request); if (accountIds != null && accountIds.size() != 0) {
for (Integer stuAccountId : accountIds) {
//修改学生表删除状态为已删除 同时班级id设置为1表示无指定班级
@ -892,7 +883,6 @@ public class StudentArchitectureController {
@PostMapping("/importStudent")
@ApiOperation("批量导入学生")
public R importStudent(@RequestParam(name = "file") MultipartFile file, HttpServletRequest request) throws IOException {
String accountId = TokenUtils.getIdByJwtToken(request);
Integer schoolId = TokenUtils.getSchoolIdByJwtToken(request); Map<String, String> map = studentService.uploadStudent(file, schoolId);
return R.ok().put("data", map);
}
@ -920,7 +910,6 @@ public class StudentArchitectureController {
@ApiOperation(value = "根据组织架构筛选学生列表", response = StudentInfoResp.class)
public R organizationalStudentList(@RequestBody OrganizationStudentReq req,
HttpServletRequest request) {
String accountId = TokenUtils.getIdByJwtToken(request);
Integer schoolId = TokenUtils.getSchoolIdByJwtToken(request); req.setSchoolId(schoolId);
req.setPageNum((req.getPageNum() - 1) * req.getPageSize());
req.setPageSize(req.getPageSize());

@ -1,10 +1,10 @@
package com.huoran.occupationlab.entity.req;
import com.huoran.occupationlab.entity.Class;
import com.huoran.occupationlab.entity.resp.StudentInfoResp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
@ -30,4 +30,6 @@ public class OrganizationStudentReq extends PageReq {
@ApiModelProperty(hidden = true)
private List<Class> classList;
private List<StudentInfoResp> studentList;
}

@ -143,4 +143,6 @@ public interface ProjectManageMapper extends BaseMapper<ProjectManage> {
IPage<ProjectManage> getTestPaperByCourseByPage(Page<ProjectManage> page,@Param("req") ProjectManageReq req);
IPage<ProjectManage> selectAllProjectByCompetition(Page<ProjectManage> page, @Param("req")ProjectManageReq projectManageReq);
}

@ -417,57 +417,7 @@
and p.project_name like CONCAT('%',#{keyword},'%')
</if>
</select>
<select id="selectProjectAssessmentByCompetition"
resultType="com.huoran.common.entity.ProjectManage">
SELECT
sort,
m.*,
'系统内置' AS schoolName,
'系统内置' AS createUser,
IFNULL(
(
SELECT
GROUP_CONCAT( role_name ) AS roleName
FROM
nakadai.acl_user_role ur
INNER JOIN nakadai.acl_role r ON r.id = ur.role_id
WHERE
account_id = m.account_id
AND r.platform_id = 1
AND is_del = 0
),
'中台超管'
) AS roleName,sc.system_name
FROM
nakadai.curriculum_configure cc
INNER JOIN nakadai.curriculum c ON c.cid = cc.cid
INNER JOIN ol_project_manage m ON m.project_id = cc.project_id
left join nakadai.service_configuration sc on sc.system_id = m.system_id
WHERE
cc.is_show = 0
AND cc.is_del = 0
AND m.is_del = 0
AND m.zt_del = 0
AND zt_open = 0
AND FIND_IN_SET( c.cid, #{req.cid} )
AND m.founder = 0
<if test="req.systemId !=null">
AND FIND_IN_SET(m.system_id ,#{req.systemId})
</if>
<if test="req.permissions !=null">
and m.permissions = #{req.permissions}
</if>
<if test="req.state !=null">
and m.state = #{req.state}
</if>
<if test="req.projectName !=null and req.projectName != ''">
and m.project_name LIKE CONCAT('%',#{req.projectName},'%')
</if>
ORDER BY
cc.sort ASC,cc.config_id asc
</select>
<select id="selectSystemName" resultType="java.lang.String">
select system_name from nakadai.service_configuration where system_id = #{systemId}
</select>
@ -585,7 +535,7 @@
sort,
m.*,
'系统内置' AS schoolName,
'系统内置' AS createUser,
'系统内置' AS createUser,u.user_name,
IFNULL(
(
SELECT
@ -604,6 +554,8 @@
nakadai.curriculum_configure cc
INNER JOIN nakadai.curriculum c ON c.cid = cc.cid
INNER JOIN ol_project_manage m ON m.project_id = cc.project_id
left JOIN nakadai.hr_user_account ua ON ua.id = m.account_id
left JOIN nakadai.hr_user_info u ON u.user_id = ua.user_id
left join nakadai.service_configuration sc on sc.system_id = m.system_id
WHERE
cc.is_show = 0
@ -812,4 +764,165 @@
</select>
<select id="selectProjectAssessmentByCompetition"
resultType="com.huoran.common.entity.ProjectManage">
SELECT
sort,
m.*,u.user_name,
'系统内置' AS schoolName,
'系统内置' AS createUser,
IFNULL(
(
SELECT
GROUP_CONCAT( role_name ) AS roleName
FROM
nakadai.acl_user_role ur
INNER JOIN nakadai.acl_role r ON r.id = ur.role_id
WHERE
account_id = m.account_id
AND r.platform_id = 1
AND is_del = 0
),
'中台超管'
) AS roleName,sc.system_name
FROM
nakadai.curriculum_configure cc
INNER JOIN nakadai.curriculum c ON c.cid = cc.cid
INNER JOIN ol_project_manage m ON m.project_id = cc.project_id
left JOIN nakadai.hr_user_account ua ON ua.id = m.account_id
left JOIN nakadai.hr_user_info u ON u.user_id = ua.user_id
left join nakadai.service_configuration sc on sc.system_id = m.system_id
WHERE
cc.is_show = 0
AND cc.is_del = 0
AND m.is_del = 0
AND m.zt_del = 0
AND zt_open = 0
AND FIND_IN_SET( c.cid, #{req.cid} )
AND m.founder = 0
<if test="req.systemId !=null">
AND FIND_IN_SET(m.system_id ,#{req.systemId})
</if>
<if test="req.permissions !=null">
and m.permissions = #{req.permissions}
</if>
<if test="req.state !=null">
and m.state = #{req.state}
</if>
<if test="req.projectName !=null and req.projectName != ''">
and m.project_name LIKE CONCAT('%',#{req.projectName},'%')
</if>
ORDER BY
cc.sort ASC,cc.config_id asc
</select>
<select id="selectAllProjectByCompetition" resultType="com.huoran.common.entity.ProjectManage">
SELECT
NULL AS sort,
m.project_id,
m.project_name,
m.permissions,
m.system_id,
m.account_id,
m.school_id,
m.founder,
m.state,
m.remark,
m.mall_id,
u.user_name,
s.school_name AS schoolName,
'老师' AS roleName,
sc.system_name,m.create_time
FROM
ol_project_manage m
LEFT JOIN nakadai.service_configuration sc ON sc.system_id = m.system_id
LEFT JOIN nakadai.hr_user_account ua ON ua.id = m.account_id
LEFT JOIN nakadai.hr_user_info u ON u.user_id = ua.user_id
LEFT JOIN nakadai.school s ON s.school_id = m.school_id
WHERE
m.is_del = 0
AND m.school_id = #{req.schoolId}
AND m.zt_del = 0
AND m.zt_open = 0
AND m.is_open = 0
<if test="req.systemId !=null">
AND FIND_IN_SET(m.system_id ,#{req.systemId})
</if>
<if test="req.permissions !=null">
and m.permissions = #{req.permissions}
</if>
<if test="req.state !=null">
and m.state = #{req.state}
</if>
<if test="req.projectName !=null and req.projectName != ''">
and m.project_name LIKE CONCAT('%',#{req.projectName},'%')
</if>
UNION ALL
SELECT
sort,
m.project_id,
m.project_name,
m.permissions,
m.system_id,
m.account_id,
m.school_id,
m.founder,
m.state,
m.remark,
m.mall_id,
'系统' AS userName,
'系统内置' AS schoolName,
IFNULL(
(
SELECT
GROUP_CONCAT(role_name) AS roleName
FROM
nakadai.acl_user_role ur
INNER JOIN nakadai.acl_role r ON r.id = ur.role_id
WHERE
account_id = m.account_id
AND r.platform_id = 1
AND is_del = 0
),
'中台超管'
) AS roleName,
sc.system_name,m.create_time
FROM
nakadai.curriculum_configure cc
INNER JOIN nakadai.curriculum c ON c.cid = cc.cid
INNER JOIN ol_project_manage m ON m.project_id = cc.project_id
LEFT JOIN nakadai.hr_user_account ua ON ua.id = m.account_id
LEFT JOIN nakadai.hr_user_info u ON u.user_id = ua.user_id
LEFT JOIN nakadai.service_configuration sc ON sc.system_id = m.system_id
WHERE
cc.is_show = 0
AND cc.is_del = 0
AND m.is_del = 0
AND m.zt_del = 0
AND zt_open = 0
AND FIND_IN_SET( c.cid, #{req.cid} )
<if test="req.systemId !=null">
AND FIND_IN_SET(m.system_id ,#{req.systemId})
</if>
<if test="req.permissions !=null">
and m.permissions = #{req.permissions}
</if>
<if test="req.state !=null">
and m.state = #{req.state}
</if>
<if test="req.projectName !=null and req.projectName != ''">
and m.project_name LIKE CONCAT('%',#{req.projectName},'%')
</if>
AND m.founder = 0
ORDER BY
sort ASC
</select>
</mapper>

@ -1003,26 +1003,28 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P
projectManageReq.setSystemId(req.getSystemId());
BeanUtils.copyProperties(req, projectManageReq);
projectManageReq.setPermissions(2);
iPage = baseMapper.selectProjectAssessmentByCompetition(page, projectManageReq);
if (req.getSchoolId() != null) {
//教师端创建的竞赛类项目
List<ProjectManage> projectManages = projectManageMapper
.selectList(new QueryWrapper<ProjectManage>()
// .eq("system_id", systemId)
.eq("school_id", req.getSchoolId())
.eq("permissions", 2)
.eq("zt_del", DelConstant.NOT_DEL)
.eq("is_del", DelConstant.NOT_DEL)
.eq("zt_open", 0)
.eq("is_open", 0).in("system_id", req.getSystemId())
);
for (ProjectManage projectManage : projectManages) {
String name = baseMapper.selectSystemName(projectManage.getSystemId());
projectManage.setSystemName(name);
}
iPage.getRecords().addAll(projectManages);
}
// iPage = baseMapper.selectProjectAssessmentByCompetition(page, projectManageReq);
//合并sql语句
iPage = baseMapper.selectAllProjectByCompetition(page, projectManageReq);
// if (req.getSchoolId() != null) {
// //教师端创建的竞赛类项目
// List<ProjectManage> projectManages = projectManageMapper
// .selectList(new QueryWrapper<ProjectManage>()
//// .eq("system_id", systemId)
// .eq("school_id", req.getSchoolId())
// .eq("permissions", 2)
// .eq("zt_del", DelConstant.NOT_DEL)
// .eq("is_del", DelConstant.NOT_DEL)
// .eq("zt_open", 0)
// .eq("is_open", 0).in("system_id", req.getSystemId())
// );
// for (ProjectManage projectManage : projectManages) {
// String name = baseMapper.selectSystemName(projectManage.getSystemId());
// projectManage.setSystemName(name);
// }
// iPage.getRecords().addAll(projectManages);
// }
return R.ok().put("data", iPage);
}

Loading…
Cancel
Save