【SSM-报销单】6.报销单-提交报销单

本文介绍了一个基于Java的企业报销系统中员工提交报销单的自动化流程,包括使用MyBatis进行数据库操作,通过DAO层的selectByDepartmentAndPost方法查询部门及岗位信息,以及在Controller层处理报销单提交请求,更新状态并记录处理记录。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在这里插入图片描述

1.Employee 添加

//提交报销单
    List<Employee> selectByDepartmentAndPost(@Param("dsn") String dsn, @Param("post") String post);

2.Employee xml

  <select id="selectByDepartmentAndPost" resultMap="employee">
        select e.*,d.sn dsn,d.name dname from employee e left join department d on d.sn=e.department_sn
        where e.sn is not NULL
        <if test="dsn!=null">
            and e.department_sn=#{dsn}
        </if>
        <if test="post!=null">
            and e.post=#{post}
        </if>
    </select>

3.C biz

 public void submit(int id) {
        ClaimVoucher claimVoucher = claimVoucherDao.select(id);
        Employee employee = employeeDao.select(claimVoucher.getCreateSn());

        claimVoucher.setStatus(Contant.CLAIMVOUCHER_SUBMIT);
        claimVoucher.setNextDealSn(employeeDao.selectByDepartmentAndPost(employee.getDepartmentSn(),Contant.POST_FM).get(0).getSn());
        claimVoucherDao.update(claimVoucher);

        DealRecord dealRecord = new DealRecord();
        dealRecord.setDealWay(Contant.DEAL_SUBMIT);
        dealRecord.setDealSn(employee.getSn());
        dealRecord.setClaimVoucherId(id);
        dealRecord.setDealResult(Contant.CLAIMVOUCHER_SUBMIT);
        dealRecord.setDealTime(new Date());
        dealRecord.setComment("无");
        dealRecordDao.insert(dealRecord);
    }

4.Controller

 @RequestMapping("/submit")
    public String submit(int id){
        claimVoucherBiz.submit(id);
        return "redirect:deal";
    }

5.修改 deal.jsp上的

<a href="/claim_voucher/submit?id=${cv.id}">提交</a>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值