From b6dd47b05107fc36d8ff4f7f29a4446521f95503 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期四, 02 一月 2025 18:44:28 +0800 Subject: [PATCH] 代码提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java | 57 +++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 35 insertions(+), 22 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java index bf99142..e8adf33 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java @@ -1,30 +1,28 @@ 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.MergeFilesToPDFUtils; 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; @@ -42,6 +40,7 @@ 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; @@ -79,10 +78,10 @@ private IServiceFundflowService serviceFundflowService; @Autowired - private ISysDeptService sysDeptService; + private DingTalkService dingTalkService; @Autowired - private IBaseOnlyvalueService baseOnlyvalueService; + private ISysUserService sysUserService; @Autowired private ISysPostService postService; @@ -105,7 +104,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) { @@ -181,7 +180,7 @@ Collections.sort(list, new Comparator<SpFinancialExpensesReimbursementOut>() { @Override public int compare(SpFinancialExpensesReimbursementOut o1, SpFinancialExpensesReimbursementOut o2) { - return o1.getCreateTime().compareTo(o2.getCreateTime()); + return o1.getApplyTime().compareTo(o2.getApplyTime()); } }); return getCustomDataTable(list, pageNum, pageSize); @@ -191,7 +190,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) { @@ -204,7 +203,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)); @@ -224,7 +223,7 @@ * 鏂板鎶ラ攢鐢宠 */ @ApiOperation("鏂板鎶ラ攢鐢宠") - //@PreAuthorize("@ss.hasPermi('project:reimbursement:add')") + //// @PreAuthorize("@ss.hasPermi('project:reimbursement:add')") @Log(title = "鎶ラ攢鐢宠", businessType = BusinessType.INSERT) @PostMapping("/add") @RepeatSubmit @@ -233,6 +232,7 @@ 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); @@ -402,7 +402,7 @@ serviceReimbursement.setFlowlevel(serviceFundflowrules.get(0).getTotallevel().longValue()); serviceReimbursement.setRecordstatus(99); - serviceReimbursement.setUploadStates(0); + serviceReimbursement.setUploadStates(1); boolean b = serviceReimbursementService.updateById(serviceReimbursement); log.info("鏄惁淇敼鎴愬姛:{}", b); @@ -438,8 +438,19 @@ 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); @@ -478,10 +489,10 @@ } } - //001瀹℃壒閫氳繃涔嬪悗锛屽氨闇�瑕佹妸鈥滃姙鍏涓讳换鈥濈殑鍚嶅瓧濉笂 - if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("001")) { + //053瀹℃壒閫氳繃涔嬪悗锛屽氨闇�瑕佹妸鈥滃姙鍏涓讳换鈥濈殑鍚嶅瓧濉笂 + if (checkFundVO.getFlowconclusion() == 1 && user.getUserName().equals("053")) { serviceReimbursement.setOfficedirector(user.getNickName()); - serviceReimbursement.setUploadStates(0); + serviceReimbursement.setUploadStates(1); } serviceReimbursementService.updateById(serviceReimbursement); @@ -495,12 +506,14 @@ 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); //杩欎竴鍧楁斁瀹氭椂浠诲姟閲屽仛 @@ -511,7 +524,7 @@ } 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); @@ -526,7 +539,7 @@ * 淇敼鎶ラ攢鐢宠 */ @ApiOperation("淇敼鎶ラ攢鐢宠") - //@PreAuthorize("@ss.hasPermi('project:reimbursement:edit')") + //// @PreAuthorize("@ss.hasPermi('project:reimbursement:edit')") @Log(title = "鎶ラ攢鐢宠", businessType = BusinessType.UPDATE) @PostMapping("/reimbursementEdit") @RepeatSubmit @@ -542,7 +555,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) { @@ -557,7 +570,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) { -- Gitblit v1.9.3