| | |
| | | package com.ruoyi.web.controller.project; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.annotation.NotRepeatCommit; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.*; |
| | | import com.ruoyi.project.domain.dto.ServiceReimbursementDto; |
| | | import com.ruoyi.project.domain.vo.CheckFundVO; |
| | | import com.ruoyi.project.domain.vo.DingTalkReqVo; |
| | | 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; |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Autowired |
| | | private IServiceReimbursementService serviceReimbursementService; |
| | | |
| | | // @Autowired |
| | | // private MergeFilesToPDFUtils mergeFilesToPDFUtils; |
| | | |
| | | @Autowired |
| | | private IServiceReimbursementSharedService serviceReimbursementSharedService; |
| | | |
| | |
| | | private IServiceFundflowService serviceFundflowService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService sysDeptService; |
| | | private DingTalkService dingTalkService; |
| | | |
| | | @Autowired |
| | | private IBaseOnlyvalueService baseOnlyvalueService; |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Autowired |
| | | private ISysPostService postService; |
| | |
| | | if (!Objects.isNull(serviceReimbursement)) { |
| | | serviceReimbursement.setCreateTime(new Date()); |
| | | serviceReimbursement.setCheckstatus(serviceReimbursement.getCheckstatus() == null ? 1 : serviceReimbursement.getCheckstatus()); |
| | | serviceReimbursement.setUploadStates(0); |
| | | boolean b = serviceReimbursementService.save(serviceReimbursement); |
| | | Long id = serviceReimbursement.getId(); |
| | | return AjaxResult.success(id); |
| | | } |
| | | return error(); |
| | | } |
| | | |
| | | // /** |
| | | // * 差旅费上报 |
| | | // */ |
| | | // @ApiOperation("差旅费上报") |
| | | // @Log(title = "差旅费上报", businessType = BusinessType.OTHER) |
| | | // @PostMapping("/test") |
| | | // public AjaxResult test(@RequestBody CheckFundVO checkFundVO) { |
| | | // mergeFilesToPDFUtils.generatePdf(checkFundVO.getFileNames(), checkFundVO.getOutputFile()); |
| | | // return AjaxResult.success(200); |
| | | // } |
| | | |
| | | |
| | | /** |
| | |
| | | ServiceFundflowrule serviceFundflowrule = new ServiceFundflowrule(); |
| | | serviceFundflowrule.setApplytype("0"); |
| | | serviceFundflowrule.setMustAudite(1); |
| | | serviceFundflowrule.setDel_flag(0); |
| | | List<ServiceFundflowrule> serviceFundflowrules = serviceFundflowruleService.queryList(serviceFundflowrule); |
| | | log.info("reimbursement必审人的等级为:{}", serviceFundflowrules.get(0).getFlowlevel()); |
| | | |
| | |
| | | |
| | | return success(); |
| | | } else if (serviceReimbursement.getBackflowlevel() >= Long.valueOf(serviceFundflowrules.get(0).getFlowlevel())) { |
| | | //聂科退回的,也需要走出纳那里 |
| | | //必审人领导退回的,也需要走必审人那里 |
| | | serviceReimbursement.setFlowlevel(Long.valueOf(serviceFundflowrules.get(0).getFlowlevel() - 1)); |
| | | serviceReimbursement.setRecordstatus(2); |
| | | serviceReimbursementService.updateById(serviceReimbursement); |
| | |
| | | //说明是财务退回再提交的.需要出纳再看一遍,没问题之后,往分享表里新增 |
| | | // serviceReimbursementService.addSharedData(serviceReimbursement.getId()); |
| | | |
| | | serviceReimbursement.setFlowlevel(Long.valueOf(serviceFundflowrules.get(0).getTotallevel())); |
| | | serviceReimbursement.setFlowlevel(100L); |
| | | serviceReimbursement.setFlowlevel(serviceFundflowrules.get(0).getTotallevel().longValue()); |
| | | serviceReimbursement.setRecordstatus(99); |
| | | serviceReimbursement.setUploadStates(1); |
| | | boolean b = serviceReimbursementService.updateById(serviceReimbursement); |
| | | log.info("是否修改成功:{}", b); |
| | | |
| | |
| | | FlowLevel = 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | SysUser sysUser = sysUserService.selectUserByUserName(serviceReimbursement.getUserno()); |
| | | ArrayList<ConcurrentHashMap<String, Object>> contentList = new ArrayList<>(); |
| | | ConcurrentHashMap map = new ConcurrentHashMap(); |
| | | map.put("审批人:", loginUser.getUser().getUserName()); |
| | | map.put("审批时间:", new Date()); |
| | | map.put("意见:", "不通过"); |
| | | if (StringUtils.isNotBlank(checkFundVO.getFlowcontent())) map.put("意见:", checkFundVO.getFlowcontent()); |
| | | contentList.add(map); |
| | | DingTalkReqVo dingTalkReqVo = new DingTalkReqVo(); |
| | | dingTalkReqVo.setTitle("财务系统驳回信息"); |
| | | dingTalkReqVo.setNumber(sysUser.getPhonenumber()); |
| | | dingTalkReqVo.setContents(contentList); |
| | | dingTalkService.sendNotification(dingTalkReqVo); |
| | | } |
| | | |
| | | serviceReimbursement.setRecordstatus(RecordStatus); |
| | |
| | | //001审批通过之后,就需要把“办公室主任”的名字填上 |
| | | if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("001")) { |
| | | serviceReimbursement.setOfficedirector(user.getNickName()); |
| | | serviceReimbursement.setUploadStates(1); |
| | | } |
| | | |
| | | serviceReimbursementService.updateById(serviceReimbursement); |
| | |
| | | serviceSystemmessage.setReceiveusername(serviceReimbursement.getUsername()); |
| | | serviceSystemmessage.setIsread(0); |
| | | serviceSystemmessage.setMessagetype(1); |
| | | serviceSystemmessage.setUpdateTime(new Date()); |
| | | serviceSystemmessage.setUpdateBy(user.getNickName()); |
| | | serviceSystemmessage.setRelevantno(serviceReimbursement.getId()); |
| | | log.info("CheckFlag的值 : {}", CheckFlag); |
| | | if (CheckFlag == 1) { |
| | | //通过 |
| | | serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "级审核通过"); |
| | | serviceSystemmessage.setMessagecontent("您" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime()) + "提交的关于捐献案例【" + serviceReimbursement.getDonorname() + "】的差旅费申请已通过" + (OriginalFlowLevel + 1) + "级审核"); |
| | | serviceSystemmessage.setMessagecontent("您" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime()) + "提交的差旅报销单申请已通过"); |
| | | log.info("totalLevel的值 : {}, OriginalFlowLevel的值:{}", totalLevel, OriginalFlowLevel); |
| | | |
| | | //这一块放定时任务里做 |
| | |
| | | } else { |
| | | //驳回 |
| | | serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "级审核驳回"); |
| | | serviceSystemmessage.setMessagecontent("您" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime()) + "提交的关于捐献案例【" + serviceReimbursement.getDonorname() + "】的差旅费申请已被" + (OriginalFlowLevel + 1) + "级审核驳回,原因为" + checkFundVO.getFlowcontent() + ""); |
| | | serviceSystemmessage.setMessagecontent("您" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime()) + "提交的差旅报销单申请被驳回,原因:" + checkFundVO.getFlowcontent() + ""); |
| | | } |
| | | ServiceSystemmessage.save(serviceSystemmessage); |
| | | |