Merge branch 'develop' into feature/mzl_dev

This commit is contained in:
mzl
2025-10-30 16:43:01 +08:00
4 changed files with 41 additions and 23 deletions
@@ -70,6 +70,16 @@ class FinPaymentApplyController extends BaseController
$data['enter_file_last'] = date('Y-m-d H:i:s', ($data['claimed_at']+86400)); //入账资料最后提交时间 $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']); //认领时间 $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; return $data;
} }
+17 -1
View File
@@ -58,6 +58,11 @@ class FinPaymentApplyService
$config['where']['account_id'] = $p['account_id']; $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']) { if (isset($p['keyword']) && $p['keyword']) {
$k = '%' . $p['keyword'] . '%'; $k = '%' . $p['keyword'] . '%';
@@ -156,6 +161,7 @@ class FinPaymentApplyService
$param = $request->all(); $param = $request->all();
$where = []; $where = [];
$orWhere = [];
// 汇款国家 // 汇款国家
if (isset($param['country_id']) && !empty($param['country_id'])) { if (isset($param['country_id']) && !empty($param['country_id'])) {
@@ -166,6 +172,14 @@ class FinPaymentApplyService
$where[] = ['account_id', $param['account_id']]; $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']) { if (isset($param['keyword']) && $param['keyword']) {
$k = '%' . $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']??''; $correlation = $param['correlation']??'';
+10 -20
View File
@@ -4,6 +4,7 @@ namespace app\common\service;
use app\common\logic\FinReceiptLogic; use app\common\logic\FinReceiptLogic;
use app\common\model\FinPaymentApply; use app\common\model\FinPaymentApply;
use app\common\model\FinPaymentStock;
use app\common\model\FinReceiptHis; use app\common\model\FinReceiptHis;
use app\common\validate\FinReceiptValidate; use app\common\validate\FinReceiptValidate;
use app\common\traits\crud\CrudServiceTrait; use app\common\traits\crud\CrudServiceTrait;
@@ -65,11 +66,11 @@ class FinReceiptService
// 没有付款记录的收款记录 // 没有付款记录的收款记录
if (isset($p['payment_apply']) && $p['payment_apply'] == 'not') { //未认领 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') { //已认领 } 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') { //超时未认领 } 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]; $config['where']['created_at'] = ['<' ,time() - 24*60*60];
} }
@@ -213,9 +214,12 @@ class FinReceiptService
// 没有付款记录的收款记录 // 没有付款记录的收款记录
if (isset($param['payment_apply']) && $param['payment_apply'] == 'not') { 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') { } 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->where('payment_apply_id', 0);
$query->where('created_at', '<' ,time() - 24*60*60);
} }
if (isset($param['scene']) && $param['scene'] == 'list') { if (isset($param['scene']) && $param['scene'] == 'list') {
@@ -292,6 +296,7 @@ class FinReceiptService
$data = $this->preProcess(ucfirst($scene), $data, $request); $data = $this->preProcess(ucfirst($scene), $data, $request);
$config = $this->buildQueryConfig($request, $scene); $config = $this->buildQueryConfig($request, $scene);
FinPaymentApply::where('id', $payment_apply_id)->update(['receipt_id' => $id, 'claimed_at' => time(), 'claimed_by' => $request->user->uid]); 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(); $payment = FinPaymentApply::where('id', $payment_apply_id)->first();
@@ -301,19 +306,4 @@ class FinReceiptService
$updated = $this->logicUpdateBy($config, $data); $updated = $this->logicUpdateBy($config, $data);
return $this->postProcess(ucfirst($scene), $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;
}
} }
+3 -1
View File
@@ -62,7 +62,9 @@ class Task
['created_at', '>', time() - 60 * 60 * 48], ['created_at', '>', time() - 60 * 60 * 48],
['created_at', '<', time() - 60 * 60 * 24], ['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) { foreach ($payment as $item) {
Log::info('fin_payment_apply submit_files ', [$item->toArray()]); Log::info('fin_payment_apply submit_files ', [$item->toArray()]);
$notice = [ $notice = [