liusheng
3 天以前 fdc9651c4b83c18e044a3a9ac6b5e019ffa6328d
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -20,7 +20,6 @@
import com.ruoyi.project.domain.vo.SpFinancialExpensesIn;
import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut;
import com.ruoyi.project.service.*;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.controller.enums.PersonType;
@@ -104,7 +103,7 @@
     * 查询报销申请列表
     */
    @ApiOperation("查询报销申请列表")
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:list')")
    //// @PreAuthorize("@ss.hasPermi('project:reimbursement:list')")
    @Log(title = "查询报销申请列表", businessType = BusinessType.OTHER)
    @GetMapping("/list")
    public TableDataInfo list(ServiceReimbursement serviceReimbursement) {
@@ -165,6 +164,7 @@
        if (APPLICATIONENDTIME == null) {
            APPLICATIONENDTIME = "";
        }
        //startPage();
        List<SpFinancialExpensesReimbursementOut> list = serviceReimbursementService.getListBypower(loginUser.getUsername(), 1, APPLICANT, APPLICATIONBEGTIME, APPLICATIONENDTIME, loginUser.getDeptId().toString(), CHECKFLAG, APPLYTYPE, checkstatus, donorname);
        //根据经办人筛选
@@ -175,6 +175,10 @@
        if (spFinancialExpensesIn.getMoney() != null) {
            list = list.stream().filter(reimbursementOut -> new BigDecimal(reimbursementOut.getAmountrequested()).compareTo(new BigDecimal(spFinancialExpensesIn.getMoney())) == 0).collect(Collectors.toList());
        }
        //根据业务组筛选
        if (StringUtils.isNotBlank(spFinancialExpensesIn.getDeptnos())) {
            list = list.stream().filter(reimbursementOut -> reimbursementOut.getDeptmentno().contains(spFinancialExpensesIn.getDeptnos())).collect(Collectors.toList()); // 按name字段过滤
        }
        //根据创建时间排序
        Collections.sort(list, new Comparator<SpFinancialExpensesReimbursementOut>() {
@@ -190,7 +194,7 @@
     * 导出报销申请列表
     */
    @ApiOperation("导出报销申请列表")
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:export')")
    //// @PreAuthorize("@ss.hasPermi('project:reimbursement:export')")
    @Log(title = "报销申请", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceReimbursement serviceReimbursement) {
@@ -203,7 +207,7 @@
     * 获取报销申请详细信息
     */
    @ApiOperation("获取报销申请详细信息")
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:query')")
    //// @PreAuthorize("@ss.hasPermi('project:reimbursement:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceReimbursementService.getById(id));
@@ -223,7 +227,7 @@
     * 新增报销申请
     */
    @ApiOperation("新增报销申请")
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:add')")
    //// @PreAuthorize("@ss.hasPermi('project:reimbursement:add')")
    @Log(title = "报销申请", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @RepeatSubmit
@@ -316,7 +320,6 @@
                    serviceReimbursement.setFlowlevel(0L);
                    serviceReimbursement.setBackflowlevel(0L);
                }
            }
            if (!postids.contains(2) && (serviceReimbursement.getBackflowlevel() == null || serviceReimbursement.getBackflowlevel() == 0)) {
@@ -331,6 +334,32 @@
                serviceFundflow.setFlowlevel(serviceFundflowrules.get(0).getFlowlevel() - 1);
                serviceFundflowService.save(serviceFundflow);
                SysUser sysUser = null;
                if (serviceReimbursement.getFlowlevel() == 0L) {
                    //组长信息
                    SysUser su = new SysUser();
                    su.setNickName(serviceReimbursement.getManagername());
                    List<SysUser> sysUserList = sysUserService.selectUserList(su);
                    if (sysUserList.size() > 0) {
                        sysUser = sysUserList.get(0);
                    }
                } else if (serviceReimbursement.getFlowlevel() == 1L) {
                    //陈慕华信息
                    sysUser = sysUserService.selectUserByUserName("047");
                }
                ConcurrentHashMap map = new ConcurrentHashMap();
                ArrayList<ConcurrentHashMap<String, Object>> contentList = new ArrayList<>();
                map.put("提交人:", loginUser.getUser().getUserName());
                map.put("提交时间:", new Date());
                map.put("内容:", serviceReimbursement.getReason());
                contentList.add(map);
                DingTalkReqVo dingTalkReqVo = new DingTalkReqVo();
                dingTalkReqVo.setTitle("差旅审批信息");
                dingTalkReqVo.setNumber(sysUser != null ? sysUser.getPhonenumber() : "");
                dingTalkReqVo.setContents(contentList);
                dingTalkService.sendNotification(dingTalkReqVo);
            }
            serviceReimbursementService.updateById(serviceReimbursement);
@@ -489,8 +518,8 @@
                }
            }
            //001审批通过之后,就需要把“办公室主任”的名字填上
            if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("001")) {
            //053审批通过之后,就需要把“办公室主任”的名字填上
            if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("053")) {
                serviceReimbursement.setOfficedirector(user.getNickName());
                serviceReimbursement.setUploadStates(1);
            }
@@ -539,7 +568,7 @@
     * 修改报销申请
     */
    @ApiOperation("修改报销申请")
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:edit')")
    //// @PreAuthorize("@ss.hasPermi('project:reimbursement:edit')")
    @Log(title = "报销申请", businessType = BusinessType.UPDATE)
    @PostMapping("/reimbursementEdit")
    @RepeatSubmit
@@ -555,7 +584,7 @@
     * 修改报销申请
     */
    @ApiOperation("修改报销申请")
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:edit')")
    //// @PreAuthorize("@ss.hasPermi('project:reimbursement:edit')")
    @Log(title = "审核费用", businessType = BusinessType.OTHER)
    @PostMapping("/editMoney")
    public AjaxResult editMoney(@RequestBody List<ReimbursementService> serviceReimbursement) {
@@ -570,7 +599,7 @@
     * 删除报销申请
     */
    @ApiOperation("删除报销申请")
    //@PreAuthorize("@ss.hasPermi('project:reimbursement:remove')")
    //// @PreAuthorize("@ss.hasPermi('project:reimbursement:remove')")
    @Log(title = "报销申请")
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
@@ -762,7 +791,7 @@
            throw new ServiceException("下载失败,用户信息出错", HttpStatus.NO_CONTENT);
        }
        Date dt = rdInfoByItem.get(0).getCreateTime();
        Date dt = rdInfoByItem.get(0).getApplyTime();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date = formatter.format(dt);
        String time = date.substring(0, 10);