浏览代码

财务报销

zhaoxian 3 年之前
父节点
当前提交
8e0e2acd79

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

@@ -12,6 +12,7 @@ import cn.com.ctop.reimburse.mondule.service.IReimburseApplyService;
 import cn.com.ctop.reimburse.mondule.service.IReimburseProjectService;
 import cn.hutool.core.util.RandomUtil;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -115,8 +116,15 @@ public class ReimburseApplyServiceImpl extends ServiceImpl<ReimburseApplyMapper,
         boolean isFinancialReview = false;
         ReimburseApply apply = JSONObject.parseObject(data.toJSONString(), ReimburseApply.class);
         Long id = apply.getId();
-        List<String> ids = JSONObject.parseArray(data.getJSONArray("ids").toJSONString(), String.class);
-        List<ReimburseProject> projects = projectService.getByIds(ids);
+        List<ReimburseProject> projects = null;
+        if (Check.isNull(data.getJSONArray("ids"))) {
+            QueryWrapper<ReimburseProject> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("apply_id", id);
+            projects = projectService.list(queryWrapper);
+        } else {
+            List<String> ids = JSONObject.parseArray(data.getJSONArray("ids").toJSONString(), String.class);
+            projects = projectService.getByIds(ids);
+        }
         if (!Check.isNull(projects)) {
             Integer invoices = 0;
             Double amount = 0.0;