| | |
| | | import cn.hutool.extra.servlet.ServletUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.alibaba.fastjson2.JSONWriter; |
| | | import com.alibaba.fastjson2.filter.SimplePropertyPreFilter; |
| | | import com.gkhy.exam.common.annotation.Log; |
| | | import com.gkhy.exam.common.domain.entity.SysUser; |
| | |
| | | webLog.put("method",request.getMethod()); |
| | | Object params=getParameter(method, joinPoint.getArgs()); |
| | | |
| | | webLog.put("parameter",params); |
| | | if (params != null) { |
| | | if (params instanceof MultipartFile || params.toString().contains("MultipartFile")) { |
| | | webLog.put("parameter", "文件上传接口,参数不打印"); |
| | | } else { |
| | | webLog.put("parameter", params); |
| | | } |
| | | } else { |
| | | webLog.put("parameter", params); |
| | | } |
| | | webLog.put("uri",request.getRequestURI()); |
| | | webLog.put("url",requestURL.toString()); |
| | | if(user!=null) { |
| | | webLog.put("userName", user.getName()); |
| | | } |
| | | log.info(webLog.toString()); |
| | | log.info(JSON.toJSONString(webLog, JSONWriter.Feature.IgnoreErrorGetter)); |
| | | Object result = joinPoint.proceed(); |
| | | if (result == null) { |
| | | //如果切到了 没有返回类型的void方法,这里直接返回 |
| | |
| | | long endTime = System.currentTimeMillis(); |
| | | webLog.put("result",StringUtils.sub(JSON.toJSONString(result),0,2000)); |
| | | webLog.put("spendTime",endTime - startTime); |
| | | log.info(webLog.toString()); |
| | | log.info(JSON.toJSONString(webLog, JSONWriter.Feature.IgnoreErrorGetter)); |
| | | return result; |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.gkhy.exam.common.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; |
| | | |
| | |
| | | @TableField(exist = false) |
| | | private Long period; |
| | | |
| | | @ApiModelProperty(value = "截止时间") |
| | | @TableField("stop_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime stopTime; |
| | | |
| | | |
| | | } |
| | |
| | | if(courseChapterPeriod.getCompanyId()!=null&&!currentUser.getCompanyId().equals(courseChapterPeriod.getCompanyId())){ |
| | | throw new ApiException("没有权限操作其他企业课程"); |
| | | } |
| | | int state=courseMapper.selectCourseState(courseChapterPeriod.getCourseId()); |
| | | if(state== ApproveStatusEnum.APPROVED.getCode()){ |
| | | throw new ApiException("已审批的课程不能再操作"); |
| | | } |
| | | if(state== ApproveStatusEnum.APPROVING.getCode()){ |
| | | throw new ApiException("待审批的课程不能再操作"); |
| | | } |
| | | // int state=courseMapper.selectCourseState(courseChapterPeriod.getCourseId()); |
| | | // if(state== ApproveStatusEnum.APPROVED.getCode()){ |
| | | // throw new ApiException("已审批的课程不能再操作"); |
| | | // } |
| | | // if(state== ApproveStatusEnum.APPROVING.getCode()){ |
| | | // throw new ApiException("待审批的课程不能再操作"); |
| | | // } |
| | | } |
| | | |
| | | } |
| | |
| | | if(courseChapter.getCompanyId()!=null&&!currentUser.getCompanyId().equals(courseChapter.getCompanyId())){ |
| | | throw new ApiException("没有权限操作其他企业课程"); |
| | | } |
| | | int state=courseMapper.selectCourseState(courseChapter.getCourseId()); |
| | | if(state==ApproveStatusEnum.APPROVED.getCode()){ |
| | | throw new ApiException("已审批的课程不能再操作"); |
| | | } |
| | | if(state==ApproveStatusEnum.APPROVING.getCode()){ |
| | | throw new ApiException("待审批的课程不能再操作"); |
| | | } |
| | | // int state=courseMapper.selectCourseState(courseChapter.getCourseId()); |
| | | // if(state==ApproveStatusEnum.APPROVED.getCode()){ |
| | | // throw new ApiException("已审批的课程不能再操作"); |
| | | // } |
| | | // if(state==ApproveStatusEnum.APPROVING.getCode()){ |
| | | // throw new ApiException("待审批的课程不能再操作"); |
| | | // } |
| | | |
| | | } |
| | | } |
| | |
| | | if(coursePhase.getCompanyId()!=null&&!currentUser.getCompanyId().equals(coursePhase.getCompanyId())){ |
| | | throw new ApiException("没有权限操作其他企业批次"); |
| | | } |
| | | int level=coursePhase.getLevel(); |
| | | if((level==1 ||level==4) && currentUser.getUserType()>UserTypeEnum.COMPANY_USER.getCode()){ |
| | | throw new ApiException("当前账户无权限新增公司级批次"); |
| | | } |
| | | if(level==2 && currentUser.getUserType()>UserTypeEnum.DEPART_USER.getCode()){ |
| | | throw new ApiException("当前账户无权限新增事业部级级批次"); |
| | | } |
| | | // int level=coursePhase.getLevel(); |
| | | // if((level==1 ||level==4) && (currentUser.getUserType().equals(UserTypeEnum.COMPANY_USER.getCode()) |
| | | // || currentUser.getUserType().equals(UserTypeEnum.COMPANY_ADMIN.getCode()) |
| | | // || currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode()) ) ){ |
| | | // throw new ApiException("当前账户无权限新增公司级批次"); |
| | | // } |
| | | // if(level==2 && currentUser.getUserType()>UserTypeEnum.DEPART_USER.getCode()){ |
| | | // throw new ApiException("当前账户无权限新增事业部级级批次"); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | checkUserAllowed(course); |
| | | if(SecurityUtils.getLoginUser().getUser().getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())){ |
| | | course.setState(ApproveStatusEnum.APPROVED.getCode()); |
| | | course.setPrivatize(PrivatizeEnum.PUBLIC.getCode()); |
| | | }else{ |
| | | course.setState(ApproveStatusEnum.TEMPORARY.getCode()); |
| | | } |
| | | // else{ |
| | | // course.setState(ApproveStatusEnum.TEMPORARY.getCode()); |
| | | // } |
| | | course.setState(ApproveStatusEnum.APPROVED.getCode()); |
| | | int row =baseMapper.insert(course); |
| | | if(row<1){ |
| | | throw new ApiException("新增课程失败"); |
| | |
| | | if(!currentUser.getCompanyId().equals(course.getCompanyId())){ |
| | | throw new ApiException("没有权限操作其他企业课程"); |
| | | } |
| | | if(course.getId()!=null){ |
| | | if(course.getState().equals(ApproveStatusEnum.APPROVING.getCode())){ |
| | | throw new ApiException("课程待审批状态不能再操作"); |
| | | } |
| | | if(course.getState().equals(ApproveStatusEnum.APPROVED.getCode())){ |
| | | throw new ApiException("已审批的课程不能再操作"); |
| | | } |
| | | } |
| | | // if(course.getId()!=null){ |
| | | // if(course.getState().equals(ApproveStatusEnum.APPROVING.getCode())){ |
| | | // throw new ApiException("课程待审批状态不能再操作"); |
| | | // } |
| | | // if(course.getState().equals(ApproveStatusEnum.APPROVED.getCode())){ |
| | | // throw new ApiException("已审批的课程不能再操作"); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | |
| | | if(!currentUser.getCompanyId().equals(dbCourse.getCompanyId())){ |
| | | throw new ApiException("没有权限操作其他企业课程"); |
| | | } |
| | | if(dbCourse.getState().equals(ApproveStatusEnum.APPROVED.getCode())){ |
| | | throw new ApiException("已审批的课程不能再操作"); |
| | | } |
| | | // if(dbCourse.getState().equals(ApproveStatusEnum.APPROVED.getCode())){ |
| | | // throw new ApiException("已审批的课程不能再操作"); |
| | | // } |
| | | } |
| | | if(StringUtils.isBlank(course.getMessage())){ |
| | | course.setMessage(""); |
| | |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="companyId" column="company_id" /> |
| | | <result property="privatize" column="privatize" /> |
| | | <result property="stopTime" column="stop_time" /> |
| | | <result property="message" column="message" /> |
| | | <result property="version" column="version" /> |
| | | <result property="createBy" column="create_by" /> |
| | |
| | | |
| | | <sql id="selectCourseVo"> |
| | | select a.id, a.name, a.category_id, a.status, a.logo,a.sort,a.introduce,a.state,a.company_id,a.message, |
| | | a.privatize,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,b.name as company_name,c.name as category_name |
| | | a.privatize,a.stop_time,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,b.name as company_name,c.name as category_name |
| | | from ex_course a |
| | | left join sys_company b on b.id=a.company_id |
| | | left join sys_category c on c.id=a.category_id |
| | |
| | | and b.phone like concat('%',#{studentPhone},'%') |
| | | </if> |
| | | <if test="studentId!=null"> |
| | | and a.student_id=#{studentId} |
| | | and a.student_id=#{studentId} and (d.stop_time is null or d.stop_time > now()) |
| | | </if> |
| | | </where> |
| | | order by a.id desc |