zxa %!s(int64=3) %!d(string=hai) anos
pai
achega
39b8399ec3
Modificáronse 14 ficheiros con 194 adicións e 314 borrados
  1. 30 145
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/controller/ReimburseApplyController.java
  2. 27 41
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/controller/ReimburseDictController.java
  3. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/controller/ReimburseExpressController.java
  4. 25 123
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/controller/ReimburseProjectController.java
  5. 11 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/entity/ReimburseApply.java
  6. 6 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/entity/ReimburseProject.java
  7. 3 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/mapper/ReimburseApplyMapper.java
  8. 4 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/mapper/ReimburseProjectMapper.java
  9. 23 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/mapper/xml/ReimburseApplyMapper.xml
  10. 7 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/mapper/xml/ReimburseProjectMapper.xml
  11. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/service/IReimburseApplyService.java
  12. 3 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/service/IReimburseProjectService.java
  13. 43 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/service/impl/ReimburseApplyServiceImpl.java
  14. 6 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/service/impl/ReimburseProjectServiceImpl.java

+ 30 - 145
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/controller/ReimburseApplyController.java

@@ -1,109 +1,66 @@
 package cn.com.ctop.reimburse.mondule.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import cn.com.ctop.reimburse.mondule.entity.ReimburseApply;
 import cn.com.ctop.reimburse.mondule.service.IReimburseApplyService;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-
-import java.util.Date;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.extern.slf4j.Slf4j;
-
-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.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Arrays;
 
 /**
  * 报销申请提交表
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2022-11-21
  */
 @Slf4j
 @Api(tags = "报销申请提交表")
 @RestController
-@RequestMapping("/ctop_reimburse_apply/reimburseApply")
+@RequestMapping("/reimburse/apply")
 public class ReimburseApplyController {
     @Autowired
     private IReimburseApplyService reimburseApplyService;
 
     /**
      * 分页列表查询
-     *
-     * @param reimburseApply
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
      */
-    @ApiOperation(value = "报销申请提交表-分页列表查询", notes = "报销申请提交表-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<IPage<ReimburseApply>> queryPageList(ReimburseApply reimburseApply,
-                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                       HttpServletRequest req) {
-        Result<IPage<ReimburseApply>> result = new Result<>();
-        QueryWrapper<ReimburseApply> queryWrapper = QueryGenerator.initQueryWrapper(reimburseApply, req.getParameterMap());
-        Page<ReimburseApply> page = new Page<ReimburseApply>(pageNo, pageSize);
-        IPage<ReimburseApply> pageList = reimburseApplyService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
+    public Result<Object> queryPageList(ReimburseApply reimburseApply,
+                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize
+    ) {
+        try {
+            return reimburseApplyService.queryPageList(reimburseApply, pageNo, pageSize);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("查询失败!");
+        }
     }
 
     /**
      * 添加
-     *
-     * @param reimburseApply
-     * @return
      */
-    @ApiOperation(value = "报销申请提交表-添加", notes = "报销申请提交表-添加")
     @PostMapping(value = "/add")
-    public Result<ReimburseApply> add(@RequestBody ReimburseApply reimburseApply) {
-        Result<ReimburseApply> result = new Result<>();
+    public Result<Object> add(@RequestBody JSONObject data) {
         try {
-            reimburseApplyService.save(reimburseApply);
-            result.success("添加成功!");
+            return reimburseApplyService.add(data);
         } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
+            e.printStackTrace();
+            return Result.error("添加失败!");
         }
-        return result;
     }
 
     /**
      * 编辑
-     *
-     * @param reimburseApply
-     * @return
      */
-    @ApiOperation(value = "报销申请提交表-编辑", notes = "报销申请提交表-编辑")
-    @PutMapping(value = "/edit")
+    @PostMapping(value = "/edit")
     public Result<ReimburseApply> edit(@RequestBody ReimburseApply reimburseApply) {
         Result<ReimburseApply> result = new Result<ReimburseApply>();
         ReimburseApply reimburseApplyEntity = reimburseApplyService.getById(reimburseApply.getId());
@@ -121,12 +78,8 @@ public class ReimburseApplyController {
 
     /**
      * 通过id删除
-     *
-     * @param id
-     * @return
      */
-    @ApiOperation(value = "报销申请提交表-通过id删除", notes = "报销申请提交表-通过id删除")
-    @DeleteMapping(value = "/delete")
+    @GetMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id") String id) {
         try {
             reimburseApplyService.removeById(id);
@@ -144,7 +97,7 @@ public class ReimburseApplyController {
      * @return
      */
     @ApiOperation(value = "报销申请提交表-批量删除", notes = "报销申请提交表-批量删除")
-    @DeleteMapping(value = "/deleteBatch")
+    @GetMapping(value = "/deleteBatch")
     public Result<ReimburseApply> deleteBatch(@RequestParam(name = "ids") String ids) {
         Result<ReimburseApply> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
@@ -175,72 +128,4 @@ public class ReimburseApplyController {
         }
         return result;
     }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<ReimburseApply> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                ReimburseApply reimburseApply = JSON.parseObject(deString, ReimburseApply.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(reimburseApply, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<ReimburseApply> pageList = reimburseApplyService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "报销申请提交表列表");
-        mv.addObject(NormalExcelConstants.CLASS, ReimburseApply.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("报销申请提交表列表数据", "导出人:Jeecg", "导出信息"));
-        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
-        return mv;
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
-     */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-            MultipartFile file = entity.getValue();
-            ImportParams params = new ImportParams();
-            params.setTitleRows(2);
-            params.setHeadRows(1);
-            params.setNeedSave(true);
-            try {
-                List<ReimburseApply> listReimburseApplys = ExcelImportUtil.importExcel(file.getInputStream(), ReimburseApply.class, params);
-                reimburseApplyService.saveBatch(listReimburseApplys);
-                return Result.ok("文件导入成功!数据行数:" + listReimburseApplys.size());
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                return Result.error("文件导入失败:" + e.getMessage());
-            } finally {
-                try {
-                    file.getInputStream().close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return Result.ok("文件导入失败!");
-    }
-
 }

+ 27 - 41
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/controller/ReimburseDictController.java

@@ -1,41 +1,42 @@
 package cn.com.ctop.reimburse.mondule.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import cn.com.ctop.reimburse.mondule.entity.ReimburseDict;
 import cn.com.ctop.reimburse.mondule.service.IReimburseDictService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
-
-import java.util.Date;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.extern.slf4j.Slf4j;
-
 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.*;
+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.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+
+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;
 
 /**
  * 报销申请字典表
@@ -47,33 +48,18 @@ import io.swagger.annotations.ApiOperation;
 @Slf4j
 @Api(tags = "报销申请字典表")
 @RestController
-@RequestMapping("/ctop_reimburse_apply/reimburseDict")
+@RequestMapping("/reimburse/dict")
 public class ReimburseDictController {
     @Autowired
     private IReimburseDictService reimburseDictService;
 
     /**
      * 分页列表查询
-     *
-     * @param reimburseDict
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
      */
-    @ApiOperation(value = "报销申请字典表-分页列表查询", notes = "报销申请字典表-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<IPage<ReimburseDict>> queryPageList(ReimburseDict reimburseDict,
-                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                      HttpServletRequest req) {
-        Result<IPage<ReimburseDict>> result = new Result<>();
-        QueryWrapper<ReimburseDict> queryWrapper = QueryGenerator.initQueryWrapper(reimburseDict, req.getParameterMap());
-        Page<ReimburseDict> page = new Page<ReimburseDict>(pageNo, pageSize);
-        IPage<ReimburseDict> pageList = reimburseDictService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
+    public Result<Object> queryPageList(ReimburseDict reimburseDict) {
+        List<ReimburseDict> list = reimburseDictService.list();
+        return Result.ok(list);
     }
 
     /**

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

@@ -50,7 +50,7 @@ import java.util.Map;
 @Slf4j
 @Api(tags = "报销申请——快递记录表")
 @RestController
-@RequestMapping("/reimburse.mondule/reimburseExpress")
+@RequestMapping("/reimburse/express")
 public class ReimburseExpressController {
     @Autowired
     private IReimburseExpressService reimburseExpressService;

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

@@ -1,41 +1,27 @@
 package cn.com.ctop.reimburse.mondule.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.reimburse.mondule.entity.ReimburseProject;
 import cn.com.ctop.reimburse.mondule.service.IReimburseProjectService;
-
-import java.util.Date;
-
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
-
-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.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * 报销申请项目表
@@ -47,21 +33,14 @@ import io.swagger.annotations.ApiOperation;
 @Slf4j
 @Api(tags = "报销申请项目表")
 @RestController
-@RequestMapping("/reimburse.mondule/reimburseProject")
+@RequestMapping("/reimburse/project")
 public class ReimburseProjectController {
     @Autowired
     private IReimburseProjectService reimburseProjectService;
 
     /**
      * 分页列表查询
-     *
-     * @param reimburseProject
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
      */
-    @ApiOperation(value = "报销申请项目表-分页列表查询", notes = "报销申请项目表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<ReimburseProject>> queryPageList(ReimburseProject reimburseProject,
                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -78,11 +57,7 @@ public class ReimburseProjectController {
 
     /**
      * 添加
-     *
-     * @param reimburseProject
-     * @return
      */
-    @ApiOperation(value = "报销申请项目表-添加", notes = "报销申请项目表-添加")
     @PostMapping(value = "/add")
     public Result<ReimburseProject> add(@RequestBody ReimburseProject reimburseProject) {
         Result<ReimburseProject> result = new Result<>();
@@ -98,12 +73,8 @@ public class ReimburseProjectController {
 
     /**
      * 编辑
-     *
-     * @param reimburseProject
-     * @return
      */
-    @ApiOperation(value = "报销申请项目表-编辑", notes = "报销申请项目表-编辑")
-    @PutMapping(value = "/edit")
+    @PostMapping(value = "/edit")
     public Result<ReimburseProject> edit(@RequestBody ReimburseProject reimburseProject) {
         Result<ReimburseProject> result = new Result<ReimburseProject>();
         ReimburseProject reimburseProjectEntity = reimburseProjectService.getById(reimburseProject.getId());
@@ -121,12 +92,8 @@ public class ReimburseProjectController {
 
     /**
      * 通过id删除
-     *
-     * @param id
-     * @return
      */
-    @ApiOperation(value = "报销申请项目表-通过id删除", notes = "报销申请项目表-通过id删除")
-    @DeleteMapping(value = "/delete")
+    @GetMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id") String id) {
         try {
             reimburseProjectService.removeById(id);
@@ -139,12 +106,8 @@ public class ReimburseProjectController {
 
     /**
      * 批量删除
-     *
-     * @param ids
-     * @return
      */
-    @ApiOperation(value = "报销申请项目表-批量删除", notes = "报销申请项目表-批量删除")
-    @DeleteMapping(value = "/deleteBatch")
+    @GetMapping(value = "/deleteBatch")
     public Result<ReimburseProject> deleteBatch(@RequestParam(name = "ids") String ids) {
         Result<ReimburseProject> result = new Result<>();
         if (ids == null || "".equals(ids.trim())) {
@@ -158,11 +121,7 @@ public class ReimburseProjectController {
 
     /**
      * 通过id查询
-     *
-     * @param id
-     * @return
      */
-    @ApiOperation(value = "报销申请项目表-通过id查询", notes = "报销申请项目表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<ReimburseProject> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<ReimburseProject> result = new Result<>();
@@ -177,70 +136,13 @@ public class ReimburseProjectController {
     }
 
     /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<ReimburseProject> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                ReimburseProject reimburseProject = JSON.parseObject(deString, ReimburseProject.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(reimburseProject, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<ReimburseProject> pageList = reimburseProjectService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "报销申请项目表列表");
-        mv.addObject(NormalExcelConstants.CLASS, ReimburseProject.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("报销申请项目表列表数据", "导出人:Jeecg", "导出信息"));
-        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
-        return mv;
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
+     * 通过id查询
      */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-            MultipartFile file = entity.getValue();
-            ImportParams params = new ImportParams();
-            params.setTitleRows(2);
-            params.setHeadRows(1);
-            params.setNeedSave(true);
-            try {
-                List<ReimburseProject> listReimburseProjects = ExcelImportUtil.importExcel(file.getInputStream(), ReimburseProject.class, params);
-                reimburseProjectService.saveBatch(listReimburseProjects);
-                return Result.ok("文件导入成功!数据行数:" + listReimburseProjects.size());
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                return Result.error("文件导入失败:" + e.getMessage());
-            } finally {
-                try {
-                    file.getInputStream().close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return Result.ok("文件导入失败!");
+    @PostMapping(value = "/queryByIds")
+    public Result<Object> queryByIds(@RequestBody JSONArray data) {
+        List<String> ids = JSONObject.parseArray(data.toJSONString(), String.class);
+        List<ReimburseProject> list = reimburseProjectService.getByIds(ids);
+        return Result.ok(list);
     }
 
 }

+ 11 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/entity/ReimburseApply.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.reimburse.mondule.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
@@ -105,10 +106,10 @@ public class ReimburseApply {
     @ApiModelProperty(value = "报销金额")
     private String amount;
     /**
-     * 状态 1-使用 0-停用
+     * 状态 1待审核、2审核通过、3审核拒绝、4审核中、5部分拒绝
      */
-    @Excel(name = "状态 1-使用 0-停用", width = 15)
-    @ApiModelProperty(value = "状态 1-使用 0-停用")
+    @Excel(name = "状态  1待审核、2审核通过、3审核拒绝、4审核中、5部分拒绝", width = 15)
+    @ApiModelProperty(value = "状态  1待审核、2审核通过、3审核拒绝、4审核中、5部分拒绝")
     private String status;
     /**
      * 创建时间
@@ -120,4 +121,11 @@ public class ReimburseApply {
      */
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
+
+    @TableField(exist = false)
+    private String startDate;
+
+    @TableField(exist = false)
+    private String endDate;
+
 }

+ 6 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/entity/ReimburseProject.java

@@ -94,4 +94,10 @@ public class ReimburseProject {
      */
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
+    /**
+     * 状态 1-使用 0-停用
+     */
+    @Excel(name = "状态 1-使用 0-停用", width = 15)
+    @ApiModelProperty(value = "状态 1-使用 0-停用")
+    private String status;
 }

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/mapper/ReimburseApplyMapper.java

@@ -2,9 +2,11 @@ package cn.com.ctop.reimburse.mondule.mapper;
 
 import java.util.List;
 
+import com.alibaba.fastjson.JSONObject;
 import org.apache.ibatis.annotations.Param;
 import cn.com.ctop.reimburse.mondule.entity.ReimburseApply;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.common.api.vo.Result;
 
 /**
  * 报销申请提交表
@@ -14,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ReimburseApplyMapper extends BaseMapper<ReimburseApply> {
 
+    List<ReimburseApply> queryPageList(ReimburseApply reimburseApply);
 }

+ 4 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/mapper/ReimburseProjectMapper.java

@@ -2,6 +2,9 @@ package cn.com.ctop.reimburse.mondule.mapper;
 
 import cn.com.ctop.reimburse.mondule.entity.ReimburseProject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 报销申请项目表
@@ -12,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ReimburseProjectMapper extends BaseMapper<ReimburseProject> {
 
+    List<ReimburseProject> getByIds(@Param("ids") List<String> ids);
 }

+ 23 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/mapper/xml/ReimburseApplyMapper.xml

@@ -2,4 +2,27 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.reimburse.mondule.mapper.ReimburseApplyMapper">
 
+    <select id="queryPageList" resultType="cn.com.ctop.reimburse.mondule.entity.ReimburseApply">
+        SELECT * FROM ctop_reimburse_apply
+        where
+        ( user_id = #{userId}
+        OR
+        leader_id = #{userId})
+        <if test="companyId != null and companyId != ''">
+            AND company_id =#{companyId}
+        </if>
+        <if test="media != null and media != ''">
+            AND media =#{media}
+        </if>
+        <if test="type != null and type != ''">
+            AND `type` =#{type}
+        </if>
+        <if test="status != null and status != ''">
+            AND status =#{status}
+        </if>
+        <if test="startDate != null and startDate != ''">
+            AND stat_date >=#{startDate}
+            AND stat_date &lt;=#{endDate}
+        </if>
+    </select>
 </mapper>

+ 7 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/mapper/xml/ReimburseProjectMapper.xml

@@ -1,5 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.reimburse.mondule.mapper.ReimburseProjectMapper">
-
+    <select id="getByIds" resultType="cn.com.ctop.reimburse.mondule.entity.ReimburseProject">
+        select * from ctop_reimburse_project
+        where id in
+        <foreach item="id" collection="ids" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </select>
 </mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/service/IReimburseApplyService.java

@@ -1,7 +1,9 @@
 package cn.com.ctop.reimburse.mondule.service;
 
 import cn.com.ctop.reimburse.mondule.entity.ReimburseApply;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
 
 /**
  * 报销申请提交表
@@ -12,4 +14,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IReimburseApplyService extends IService<ReimburseApply> {
 
+    Result<Object> queryPageList(ReimburseApply reimburseApply, Integer pageNo, Integer pageSize);
+
+    Result<Object> add(JSONObject data);
 }

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/service/IReimburseProjectService.java

@@ -3,6 +3,8 @@ package cn.com.ctop.reimburse.mondule.service;
 import cn.com.ctop.reimburse.mondule.entity.ReimburseProject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * 报销申请项目表
  *
@@ -12,4 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IReimburseProjectService extends IService<ReimburseProject> {
 
+    List<ReimburseProject> getByIds(List<String> ids);
 }

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

@@ -1,11 +1,21 @@
 package cn.com.ctop.reimburse.mondule.service.impl;
 
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.reimburse.mondule.entity.ReimburseApply;
+import cn.com.ctop.reimburse.mondule.entity.ReimburseProject;
 import cn.com.ctop.reimburse.mondule.mapper.ReimburseApplyMapper;
 import cn.com.ctop.reimburse.mondule.service.IReimburseApplyService;
+import cn.com.ctop.reimburse.mondule.service.IReimburseProjectService;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 报销申请提交表
  *
@@ -16,4 +26,37 @@ import org.springframework.stereotype.Service;
 @Service
 public class ReimburseApplyServiceImpl extends ServiceImpl<ReimburseApplyMapper, ReimburseApply> implements IReimburseApplyService {
 
+    @Autowired
+    private IReimburseProjectService projectService;
+
+    @Override
+    public Result<Object> queryPageList(ReimburseApply reimburseApply, Integer pageNo, Integer pageSize) {
+        PageHelper.startPage(pageNo, pageSize);
+        List<ReimburseApply> list = baseMapper.queryPageList(reimburseApply);
+        return Result.ok(new PageInfo<>(list));
+    }
+
+    @Override
+    public Result<Object> add(JSONObject data) {
+        ReimburseApply apply = JSONObject.parseObject(data.toJSONString(), ReimburseApply.class);
+        List<String> ids = JSONObject.parseArray(data.getJSONArray("ids").toJSONString(), String.class);
+        List<ReimburseProject> byIds = projectService.getByIds(ids);
+        if (Check.isNull(byIds)) {
+            Integer invoices = 0;
+            Double amount = 0.0;
+            for (ReimburseProject project : byIds) {
+                invoices += project.getInvoices();
+                amount += Double.valueOf(project.getAmount());
+            }
+            apply.setInvoices(invoices);
+            apply.setAmount(amount.toString());
+        }
+        this.save(apply);
+        for (ReimburseProject project : byIds) {
+            project.setApplyId(apply.getId());
+            projectService.updateById(project);
+        }
+        return Result.ok();
+    }
+
 }

+ 6 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/reimburse/mondule/service/impl/ReimburseProjectServiceImpl.java

@@ -6,6 +6,8 @@ import cn.com.ctop.reimburse.mondule.service.IReimburseProjectService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 报销申请项目表
  *
@@ -16,4 +18,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class ReimburseProjectServiceImpl extends ServiceImpl<ReimburseProjectMapper, ReimburseProject> implements IReimburseProjectService {
 
+    @Override
+    public List<ReimburseProject> getByIds(List<String> ids) {
+        return baseMapper.getByIds(ids);
+    }
 }