瀏覽代碼

财务报销

zhaoxian 3 年之前
父節點
當前提交
b7df450561

+ 3 - 21
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/controller/ReimburseExpressController.java

@@ -4,7 +4,6 @@ import cn.com.ctop.common.module.service.ISysUserService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.reimburse.mondule.entity.ReimburseExpress;
 import cn.com.ctop.reimburse.mondule.service.IReimburseExpressService;
-import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -14,35 +13,18 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.entity.SysUser;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
 
 /**
  * 报销申请——快递记录表
@@ -79,14 +61,14 @@ public class ReimburseExpressController {
                                                          HttpServletRequest req) {
         Result<IPage<ReimburseExpress>> result = new Result<>();
         String statDate = reimburseExpress.getStatDate();
-        String userId = reimburseExpress.getUserId();
+        String userName = reimburseExpress.getUserName();
         reimburseExpress = new ReimburseExpress();
         QueryWrapper<ReimburseExpress> queryWrapper = QueryGenerator.initQueryWrapper(reimburseExpress, req.getParameterMap());
         if (!Check.isNull(statDate)) {
             queryWrapper.likeLeft("stat_date", statDate);
         }
-        if (!Check.isNull(userId)) {
-            queryWrapper.likeLeft("user_id", userId);
+        if (!Check.isNull(userName)) {
+            queryWrapper.like("user_name", userName);
         }
 
         Page<ReimburseExpress> page = new Page<ReimburseExpress>(pageNo, pageSize);

+ 21 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/controller/ReimburseProjectController.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.reimburse.mondule.controller;
 
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.reimburse.mondule.entity.ReimburseProject;
 import cn.com.ctop.reimburse.mondule.service.IReimburseProjectService;
 import com.alibaba.fastjson.JSONArray;
@@ -21,7 +22,9 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 /**
  * 报销申请项目表
@@ -118,6 +121,24 @@ public class ReimburseProjectController {
     }
 
     /**
+     * 通过审核下的所有附件
+     */
+    @GetMapping(value = "/queryByApplyId")
+    public Result<Object> queryByApplyId(Long applyId) {
+        QueryWrapper<ReimburseProject> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("apply_id", applyId);
+        List<ReimburseProject> list = reimburseProjectService.list(queryWrapper);
+        Set<Object> urls = new HashSet<>();
+        for (ReimburseProject project : list) {
+            if (!Check.isNull(project.getFileUrls())) {
+                List<String> fileUrls = JSONArray.parseArray(project.getFileUrls().toString(), String.class);
+                urls.addAll(fileUrls);
+            }
+        }
+        return Result.ok(urls);
+    }
+
+    /**
      * 通过id查询
      */
     @GetMapping(value = "/queryById")

+ 2 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/service/impl/ReimburseApplyServiceImpl.java

@@ -79,6 +79,7 @@ public class ReimburseApplyServiceImpl extends ServiceImpl<ReimburseApplyMapper,
             }
             apply.setInvoices(invoices);
             apply.setAmount(amount.toString());
+            apply.setType(projects.get(0).getType());
         }
         String leader = getLeader(data.getString("userId"));
         apply.setLeaderId(leader);
@@ -281,7 +282,7 @@ public class ReimburseApplyServiceImpl extends ServiceImpl<ReimburseApplyMapper,
                 }
                 text.append("请及时修改报销内容,以免耽误您的报销!");
             }
-//            sendMessageService.sendMessage(userId, text.toString());
+            sendMessageService.sendMessage(userId, text.toString());
             log.info("发送报销提醒,userId:{}  msg:{}", userId, text.toString());
         } catch (Exception e) {
             e.printStackTrace();