首页>代码>springboot+mybatis+bootstrap开发员工oa后台管理系统>/jboa/src/main/java/com/example/demo/controller/finance/financeController.java
package com.example.demo.controller.finance;

import com.example.demo.DTO.findAllExpenseDto;
import com.example.demo.DTO.lodingDTO;
import com.example.demo.dataobjece.Result;
import com.example.demo.service.finance.financeService;
import com.example.demo.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

/**
 * Created by zcp on 2018/7/22.
 */
@Controller
@RequestMapping("financeList")
public class financeController {
    @Autowired
    private financeService financeService ;

    /**
     * 查看全部信息
     *
     * @return
     */
    @GetMapping("ShowList")
    @ResponseBody
    public Result financeShowList( HttpSession session,HttpServletResponse response) {

        response.setHeader("Access-Control-Allow-Origin", "*");

        List<findAllExpenseDto> expense = financeService.findExpense();

            return ResultUtil.success(expense);


    }

    /**
     * 按状态查询
     */
    @GetMapping("ShowListByBstatus/{bStatus}")
    @ResponseBody
    public Result ShowListByBstatus(@PathVariable("bStatus") String bStatus,HttpServletResponse response) {
        response.setHeader("Access-Control-Allow-Origin", "*");

        List<findAllExpenseDto> expenseByStatus = financeService.findExpenseByStatus(bStatus);
        return ResultUtil.success(expenseByStatus);
    }

    /**
     * 按状态查询
     */
    @GetMapping("ShowListByBstatusbyTime/{bStatus}/{startTime}/{endTime}")
    @ResponseBody
    public Result ShowListByBstatusbyTime(@PathVariable("bStatus") String bStatus, @PathVariable("startTime") String startTime, @PathVariable("endTime") String endTime,HttpServletResponse response) {
        response.setHeader("Access-Control-Allow-Origin", "*");

        if (bStatus.equals("1")){
            bStatus="";
        }
        List<findAllExpenseDto> expenseByTime = financeService.findExpenseByTime(bStatus, startTime, endTime);

        return ResultUtil.success(expenseByTime);

    }

    /*查询当前报销单信息*/
    @GetMapping("findExpenseById/{id}")
    @ResponseBody
    public Result findExpenseById(@PathVariable("id") Integer id,HttpServletResponse response) {
        response.setHeader("Access-Control-Allow-Origin", "*");

        Map<String, Object> accountById = financeService.findAccountById(id);
        return ResultUtil.success(accountById);
    }
    /*修改当前报销单信息*/
    @PostMapping("updatebizvo/{id}/{result}/{comm}/{status}")
    @ResponseBody
    public Result updatebizvo(@PathVariable("id") Integer id,@PathVariable("result") String result,@PathVariable("comm") String comm,@PathVariable("status") String status,
        HttpSession session,HttpServletResponse response){
        response.setHeader("Access-Control-Allow-Origin", "*");

        lodingDTO loding = (lodingDTO)session.getAttribute("loding");
            String sn = loding.getEsn();
        if(financeService.updateBizClaim(id,sn,result,comm,status)==1){
          return  ResultUtil.success();
      }else{
          return ResultUtil.error();
      }
    }
}
最近下载更多
zhy1989wz  LV6 2023年7月31日
gy_010203  LV2 2023年4月23日
唐唐丶  LV33 2023年3月28日
可是不知道么  LV23 2023年1月3日
呵呵哈哈哈  LV10 2022年9月1日
java萌新sc  LV4 2022年8月8日
crazyAndy  LV7 2022年6月27日
一杯美式  LV5 2022年6月16日
寒江雪2017  LV9 2022年6月8日
local80  LV2 2022年6月8日
最近浏览更多
一个小学码  LV4 4月16日
zolscy  LV12 4月1日
m5433661  LV2 3月28日
jay1992  LV14 3月16日
itxiaobai 1月18日
暂无贡献等级
lvllvl  LV4 1月17日
wwvvvzz 1月9日
暂无贡献等级
admin_z  LV22 2023年12月26日
WBelong  LV7 2023年12月26日
pangzhihui  LV12 2023年12月25日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友