From 15df6ad9a3ec5de4a5a98c1c68ab346ec104692f Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Thu, 30 Oct 2025 14:58:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=9C=AA=E8=AE=A4?= =?UTF-8?q?=E9=A2=86=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/FinReceiptService.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/app/common/service/FinReceiptService.php b/app/common/service/FinReceiptService.php index 1f1c731..52e3681 100644 --- a/app/common/service/FinReceiptService.php +++ b/app/common/service/FinReceiptService.php @@ -216,6 +216,9 @@ class FinReceiptService $query->whereNull('payment_apply_id'); } elseif (isset($param['payment_apply']) && $param['payment_apply'] == 'already') { $query->whereNotNull('payment_apply_id'); + } elseif (isset($param['payment_apply']) && $param['payment_apply'] == 'timeout') { //超时未认领 + $query->whereNull('payment_apply_id'); + $query->where('created_at', '<' ,time() - 24*60*60); } if (isset($param['scene']) && $param['scene'] == 'list') { @@ -301,19 +304,4 @@ class FinReceiptService $updated = $this->logicUpdateBy($config, $data); return $this->postProcess(ucfirst($scene), $data); } - - /** - * 收款记录统计 - * @return bool|int - */ - public function statistics() - { - $finReceipt = FinReceipt::find($id); - if(!empty($finReceipt->received_at)){ - throw new BusinessException('该记录已将确认入账'); - } - $res = $this->logic->credit($id); - $this->afterServiceUpdate(['id'=>$id]); - return $res; - } } \ No newline at end of file From 499b0894b7fe374a0711416a80c1c6577c4fa06e Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Thu, 30 Oct 2025 15:24:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B7=B2=E8=AE=A4=E9=A2=86=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/FinReceiptService.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/common/service/FinReceiptService.php b/app/common/service/FinReceiptService.php index 52e3681..3cbc6d2 100644 --- a/app/common/service/FinReceiptService.php +++ b/app/common/service/FinReceiptService.php @@ -65,11 +65,11 @@ class FinReceiptService // 没有付款记录的收款记录 if (isset($p['payment_apply']) && $p['payment_apply'] == 'not') { //未认领 - $config['where']['payment_apply_id'] = ['null']; + $config['where']['payment_apply_id'] = 0; } elseif (isset($p['payment_apply']) && $p['payment_apply'] == 'already') { //已认领 - $config['where']['payment_apply_id'] = ['not null']; + $config['where']['payment_apply_id'] = ['>', 0]; } elseif (isset($p['payment_apply']) && $p['payment_apply'] == 'timeout') { //超时未认领 - $config['where']['payment_apply_id'] = ['not null']; + $config['where']['payment_apply_id'] = 0; $config['where']['created_at'] = ['<' ,time() - 24*60*60]; } @@ -213,11 +213,11 @@ class FinReceiptService // 没有付款记录的收款记录 if (isset($param['payment_apply']) && $param['payment_apply'] == 'not') { - $query->whereNull('payment_apply_id'); + $query->where('payment_apply_id', 0); } elseif (isset($param['payment_apply']) && $param['payment_apply'] == 'already') { - $query->whereNotNull('payment_apply_id'); + $query->where('payment_apply_id', '>', 0); } elseif (isset($param['payment_apply']) && $param['payment_apply'] == 'timeout') { //超时未认领 - $query->whereNull('payment_apply_id'); + $query->where('payment_apply_id', 0); $query->where('created_at', '<' ,time() - 24*60*60); } From f64324fba536356ac882f5ce9f77954ec5d752a8 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Thu, 30 Oct 2025 16:29:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=9C=AA=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=E8=B4=A6=E8=B5=84=E6=96=99=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FinPaymentApplyController.php | 10 ++++++++++ app/common/service/FinPaymentApplyService.php | 20 +++++++++++++++++-- app/common/service/FinReceiptService.php | 2 ++ app/process/Task.php | 4 +++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/common/controller/FinPaymentApplyController.php b/app/common/controller/FinPaymentApplyController.php index 3bf4b15..6f29595 100644 --- a/app/common/controller/FinPaymentApplyController.php +++ b/app/common/controller/FinPaymentApplyController.php @@ -70,6 +70,16 @@ class FinPaymentApplyController extends BaseController $data['enter_file_last'] = date('Y-m-d H:i:s', ($data['claimed_at']+86400)); //入账资料最后提交时间 $data['claimed_at'] = date('Y-m-d H:i:s', $data['claimed_at']); //认领时间 } + if (isset($data['id'])){ + $finPaymentStock = FinPaymentStock::where('payment_apply_id', $data['id'])->get(); + $stock = []; + foreach ($finPaymentStock as $v) { + $stock[$v['pi_no']]['pi_no'] = $v['pi_no']; + $stock[$v['pi_no']]['stock_id'][] = [$v['stock_id']]; + } + $data['stock'] = array_values($stock); + } + return $data; } diff --git a/app/common/service/FinPaymentApplyService.php b/app/common/service/FinPaymentApplyService.php index e5091fd..ce2bbfd 100644 --- a/app/common/service/FinPaymentApplyService.php +++ b/app/common/service/FinPaymentApplyService.php @@ -58,6 +58,11 @@ class FinPaymentApplyService $config['where']['account_id'] = $p['account_id']; } + // 入账资料超时 + if (isset($p['scene']) && $p['scene'] == 'file_timeout') { + $config['where']['claimed_at'] = ['between', [1, time()-24*60*60]]; + } + // 关键字 if (isset($p['keyword']) && $p['keyword']) { $k = '%' . $p['keyword'] . '%'; @@ -156,7 +161,8 @@ class FinPaymentApplyService $param = $request->all(); $where = []; - + $orWhere = []; + // 汇款国家 if (isset($param['country_id']) && !empty($param['country_id'])) { $where[] = ['country_id', $param['country_id']]; @@ -166,6 +172,14 @@ class FinPaymentApplyService $where[] = ['account_id', $param['account_id']]; } + // 入账资料超时 + if (isset($param['scene']) && $param['scene'] == 'file_timeout') { + $where[] = ['claimed_at', '<', time()-24*60*60]; + $where[] = ['claimed_at', '>', 1]; + $orWhere[] = ['submit_files', '[]']; + $orWhere[] = ['submit_files', '']; + } + // 关键字 if (isset($param['keyword']) && $param['keyword']) { $k = '%' . $param['keyword'] . '%'; @@ -173,7 +187,9 @@ class FinPaymentApplyService } // 构建查询 - $query = $this->modelClass::where($where); + $query = $this->modelClass::where($where)->where(function($query) use ($orWhere) { + $query->orWhere($orWhere); + }); // 是否已关联收款记录的筛选 $correlation = $param['correlation']??''; diff --git a/app/common/service/FinReceiptService.php b/app/common/service/FinReceiptService.php index 52e3681..be72fc9 100644 --- a/app/common/service/FinReceiptService.php +++ b/app/common/service/FinReceiptService.php @@ -4,6 +4,7 @@ namespace app\common\service; use app\common\logic\FinReceiptLogic; use app\common\model\FinPaymentApply; +use app\common\model\FinPaymentStock; use app\common\model\FinReceiptHis; use app\common\validate\FinReceiptValidate; use app\common\traits\crud\CrudServiceTrait; @@ -295,6 +296,7 @@ class FinReceiptService $data = $this->preProcess(ucfirst($scene), $data, $request); $config = $this->buildQueryConfig($request, $scene); FinPaymentApply::where('id', $payment_apply_id)->update(['receipt_id' => $id, 'claimed_at' => time(), 'claimed_by' => $request->user->uid]); + FinPaymentStock::where('payment_apply_id', $payment_apply_id)->update(['receipt_id' => $id]); //折让金额 $payment = FinPaymentApply::where('id', $payment_apply_id)->first(); diff --git a/app/process/Task.php b/app/process/Task.php index 47dbb93..7175244 100644 --- a/app/process/Task.php +++ b/app/process/Task.php @@ -55,7 +55,9 @@ class Task ['created_at', '>', time() - 60 * 60 * 48], ['created_at', '<', time() - 60 * 60 * 24], ]; - $payment = FinPaymentApply::where($where)->orWhere($orWhere)->orderBy('id', 'desc')->get(); + $payment = FinPaymentApply::where($where)->where(function($query) use ($orWhere) { + $query->orWhere($orWhere); + })->orderBy('id', 'desc')->get(); foreach ($payment as $item) { Log::info('fin_payment_apply submit_files ', [$item->toArray()]); $notice = [