Bläddra i källkod

增加一个批量申请 津补贴excel的错误捕获

zmw 4 dagar sedan
förälder
incheckning
c88c645aae
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      app/enterprise/controller/TalentAllowance.php

+ 2 - 2
app/enterprise/controller/TalentAllowance.php

@@ -134,7 +134,7 @@ class TalentAllowance extends EnterpriseController {
             return \StrUtil::back(new Response(Response::ERROR, "没有上传批量申请文档"), "TalentAllowanceInfo.importCallBack");
         }
         if (!isExcelFile($tmp->getMime())) {
-            //return \StrUtil::back(new Response(Response::ERROR, "只能识别Excel文档"), "TalentAllowanceInfo.importCallBack");
+            return \StrUtil::back(new Response(Response::ERROR, "只能识别Excel文档"), "TalentAllowanceInfo.importCallBack");
         }
         if (round($tmp->getSize() / 1024 / 1024, 2) > $maxFileSize) {
             return \StrUtil::back(new Response(Response::ERROR, "文档大小不能超过10MB"), "TalentAllowanceInfo.importCallBack");
@@ -234,7 +234,7 @@ class TalentAllowance extends EnterpriseController {
         for ($i = 0; $i < count($rows); $i++) {
             queue("app\job\TalentAllowance", ["type" => 1, "method" => 2, "data" => $rows[$i], "enterprise" => $this->user, "year" => $batch, "allowanceType" => trim($rows[$i][2]) == "工作津贴" ? 1 : 2]);
         }
-        return \StrUtil::back(new Response(Response::SUCCESS, "已经成功添加到计划任务,请稍候查看申报列表进行确认"), "TalentAllowanceInfo.importCallBack");
+        return \StrUtil::back(new Response(Response::SUCCESS, count($rows) . "行数据已经成功添加到计划任务,请稍候查看申报列表进行确认"), "TalentAllowanceInfo.importCallBack");
     }
 
     private function save($talentAllowance, \think\Request $request) {