项目实训—flowable开发(一)

目录

任课老师提交申请

获取任课教师课程

ExcApplyMapper.xml:

ExcApplyMapper:

IExcApplyService:

ExcApplyServiceImpl:

controller文件编写

ExcApplyForm.vue:

健壮性

关联流程

IExcApplyService:

ExcApplyServiceImpl:

健壮性:

提交申请:

ActApplyBtn:

撤回流程:

 健壮性

审批历史

任课老师提交申请

获取任课教师课程

首先要获取任课教师所教课程,让教师申请时更方便地选择

ExcApplyMapper.xml:

首先要写sql语句(

sql查询语句:

id=“”’,方法名

parameterType =“”,对应查询字段(status)的数据类型

resultType=“”,对应的实体文件名

<select id="getCourse" resultType="org.jeecg.modules.demo.LesInfo.entity.LesInfo">
        select *
        from les_info
        where
        tea_id = #{tid} and les_type = "理论课(含实践)" or tea_id = #{tid} and les_type = "集中性实践环节"
    </select>

ExcApplyMapper:

List<LesInfo> getCourse(@Param("tid") String tid);

IExcApplyService:

List<LesInfo> getCourse(String tid);

ExcApplyServiceImpl:

@Override
    public List<LesInfo> getCourse(String tid) {
        return this.baseMapper.getCourse(tid);
    }

controller文件编写

defaultValue=“1”,规定默认参数为1,不需要前端传参
如果需要传参,只需要改为如下:required = true

@RequestMapping(value = "/course",method = RequestMethod.GET)
	 public Result<?> allList(@RequestParam(name="tid",defaultValue="1")String tid){
		 SysUser sysUser = iFlowThirdService.getLoginUser();
		 tid = sysUser.getUsername();
		List<LesInfo> allList = excApplyService.getCourse(tid);
		return Result.ok(allList);
	 }

ExcApplyForm.vue:

前端需要传来教师工号tid,用getAction()方法从后端获取数据:

 getCourse(){
            getAction("/ExcApply/excApply/course",{username:""}).then(res=>{
                if(res.success){
                    this.resultList = res.result;
                    console.log(this.resultList);
                }else{
                    this.$message.error("发送失败")
                }
            })
        },

获取到后端传来的result将其传入自定义的resultList中

v-for属性将教师所授课程展示出来

<a-col :span="24">
            <a-form-model-item label="实验信息" :labelCol="labelCol" :wrapperCol="wrapperCol"  prop="course">
              <a-select  placeholder="请选择" >
                <a-select-option v-for="(item,index) in resultList" :value="item.id" v-on:click="result1(item)" >{
  {item.lesName+" "+item.courseclass+" 实验周次:"+item.exWeek+" 实验周学时:"+item.exWeektime}}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>

选择后用v-on:click = "result1(item)",将选择的信息传入model中,便于后续添加,通过add方法插入到数据库中

result1(itemN){
            this.model.tid = itemN.teaId;
            this.model.coursename = itemN.lesName;
            this.model.classes = itemN.c
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值