This commit is contained in:
weiz 2024-02-19 16:49:09 +08:00
parent 83b7352031
commit 1f940dd8fa
24 changed files with 605 additions and 62 deletions

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\FinanceInvoiceApplyLists;
use app\adminapi\logic\finance\FinanceInvoiceApplyLogic;
use app\adminapi\validate\finance\FinanceInvoiceApplyValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class FinanceInvoiceApplyController extends BaseAdminController
$result = FinanceInvoiceApplyLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',3)->where('name','kpsq')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new FinanceInvoiceApplyValidate())->post()->goCheck('approve');
$result = FinanceInvoiceApplyLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(FinanceInvoiceApplyLogic::getError());
}
}

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\FinancePaymentApplyLists;
use app\adminapi\logic\finance\FinancePaymentApplyLogic;
use app\adminapi\validate\finance\FinancePaymentApplyValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class FinancePaymentApplyController extends BaseAdminController
$result = FinancePaymentApplyLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',3)->where('name','fksq')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new FinancePaymentApplyValidate())->post()->goCheck('approve');
$result = FinancePaymentApplyLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(FinancePaymentApplyLogic::getError());
}
}

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\FinancePaymentPlanLists;
use app\adminapi\logic\finance\FinancePaymentPlanLogic;
use app\adminapi\validate\finance\FinancePaymentPlanValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class FinancePaymentPlanController extends BaseAdminController
$result = FinancePaymentPlanLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',3)->where('name','fkjh')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new FinancePaymentPlanValidate())->post()->goCheck('approve');
$result = FinancePaymentPlanLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(FinancePaymentPlanLogic::getError());
}
}

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\FinanceReceiptRecordLists;
use app\adminapi\logic\finance\FinanceReceiptRecordLogic;
use app\adminapi\validate\finance\FinanceReceiptRecordValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class FinanceReceiptRecordController extends BaseAdminController
$result = FinanceReceiptRecordLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',3)->where('name','spjl')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new FinanceReceiptRecordValidate())->post()->goCheck('approve');
$result = FinanceReceiptRecordLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(FinanceReceiptRecordLogic::getError());
}
}

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\FinanceRefundApplyLists;
use app\adminapi\logic\finance\FinanceRefundApplyLogic;
use app\adminapi\validate\finance\FinanceRefundApplyValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,23 @@ class FinanceRefundApplyController extends BaseAdminController
$result = FinanceRefundApplyLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',3)->where('name','tksq')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new FinanceRefundApplyValidate())->post()->goCheck('approve');
$result = FinanceRefundApplyLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(FinanceRefundApplyLogic::getError());
}
}

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\FinanceRefundRecordLists;
use app\adminapi\logic\finance\FinanceRefundRecordLogic;
use app\adminapi\validate\finance\FinanceRefundRecordValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class FinanceRefundRecordController extends BaseAdminController
$result = FinanceRefundRecordLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',3)->where('name','tkjl')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new FinanceRefundRecordValidate())->post()->goCheck('approve');
$result = FinanceRefundRecordLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(FinanceRefundRecordLogic::getError());
}
}

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\FinanceReturnedMoneyLists;
use app\adminapi\logic\finance\FinanceReturnedMoneyLogic;
use app\adminapi\validate\finance\FinanceReturnedMoneyValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class FinanceReturnedMoneyController extends BaseAdminController
$result = FinanceReturnedMoneyLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',3)->where('name','hkjh')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new FinanceReturnedMoneyValidate())->post()->goCheck('approve');
$result = FinanceReturnedMoneyLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(FinanceReturnedMoneyLogic::getError());
}
}

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\FinanceReturnedRecordLists;
use app\adminapi\logic\finance\FinanceReturnedRecordLogic;
use app\adminapi\validate\finance\FinanceReturnedRecordValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class FinanceReturnedRecordController extends BaseAdminController
$result = FinanceReturnedRecordLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',3)->where('name','hkjl')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new FinanceReturnedRecordValidate())->post()->goCheck('approve');
$result = FinanceReturnedRecordLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(FinanceReturnedRecordLogic::getError());
}
}

@ -178,10 +178,39 @@ class FinanceInvoiceApplyLogic extends BaseLogic
$data['period_text'] = $data->period_text;
$data['tax_rate_text'] = $data->tax_rate_text;
$data['invoice_type_text'] = $data->invoice_type_text;
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\finance\FinanceInvoiceApply')
->where('content_logic','app\adminapi\logic\finance\FinanceInvoiceApplyLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = FinanceInvoiceApply::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'开票申请',
$params['id'],
'app\common\model\finance\FinanceInvoiceApply',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
FinanceInvoiceApply::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

@ -181,10 +181,39 @@ class FinancePaymentApplyLogic extends BaseLogic
$data['contract_name'] = $contract['contract_name'];
$data['period'] = $finance_payment_plan->period_text;
$data['bank_account_info'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\finance\FinancePaymentApply')
->where('content_logic','app\adminapi\logic\finance\FinancePaymentApplyLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = FinancePaymentApply::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'付款申请',
$params['id'],
'app\common\model\finance\FinancePaymentApply',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
FinancePaymentApply::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

@ -140,7 +140,7 @@ class FinancePaymentPlanLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = FinancePaymentPlan::field('id,supplier_id,project_id,contract_id,contract_type,period,pay_date,amount,foreign_currency_remark,status,remark,annex')
$data = FinancePaymentPlan::field('id,supplier_id,project_id,contract_id,contract_type,period,pay_date,amount,foreign_currency_remark,status,remark,annex,approve_id')
->findOrEmpty($params['id']);
$data['period_text'] = $data->period_text;
$data['status_text'] = $data->status_text;
@ -158,10 +158,39 @@ class FinancePaymentPlanLogic extends BaseLogic
}
$data['contract_no'] = $contract['contract_no'];
$data['contract_name'] = $contract['contract_name'];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\finance\FinancePaymentPlan')
->where('content_logic','app\adminapi\logic\finance\FinancePaymentPlanLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = FinancePaymentPlan::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'付款计划',
$params['id'],
'app\common\model\finance\FinancePaymentPlan',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
FinancePaymentPlan::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

@ -151,7 +151,7 @@ class FinanceReceiptRecordLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = FinanceReceiptRecord::field('id,supplier_id,project_id,contract_id,contract_type,invoicing_date,commitor,invoice_type,invoice_no,invoice_amount,invoice_tax_rate,tax_amount,amount_excluding_tax,receipt_date,remark,annex')
$data = FinanceReceiptRecord::field('id,supplier_id,project_id,contract_id,contract_type,invoicing_date,commitor,invoice_type,invoice_no,invoice_amount,invoice_tax_rate,tax_amount,amount_excluding_tax,receipt_date,remark,annex,approve_id')
->findOrEmpty($params['id']);
$data['invoice_type_text'] = $data->invoice_type_text;
$data['invoice_tax_rate_text'] = $data->invoice_tax_rate_text;
@ -170,10 +170,39 @@ class FinanceReceiptRecordLogic extends BaseLogic
$data['contract_no'] = $contract['contract_no'];
$data['contract_name'] = $contract['contract_name'];
$data['contract_cate'] = $data['contract_type'];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\finance\FinanceReceiptRecord')
->where('content_logic','app\adminapi\logic\finance\FinanceReceiptRecordLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = FinanceReceiptRecord::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'收票记录',
$params['id'],
'app\common\model\finance\FinanceReceiptRecord',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
FinanceReceiptRecord::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

@ -130,7 +130,7 @@ class FinanceRefundApplyLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = FinanceRefundApply::field('id,refund_code,project_id,contract_id,refund_date,reason,amount,refund_type,refund_user,remark,annex,collection_bank,collection_account,bank_account_id')
$data = FinanceRefundApply::field('id,refund_code,project_id,contract_id,refund_date,reason,amount,refund_type,refund_user,remark,annex,collection_bank,collection_account,bank_account_id,approve_id')
->findOrEmpty($params['id']);
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
@ -142,10 +142,39 @@ class FinanceRefundApplyLogic extends BaseLogic
$data['contract_code'] = $contract['contract_code'];
$data['refund_type_text'] = $data->refund_type_text;
$data['bank_account_info'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\finance\FinanceRefundApply')
->where('content_logic','app\adminapi\logic\finance\FinanceRefundApplyLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = FinanceRefundApply::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'退款申请',
$params['id'],
'app\common\model\finance\FinanceRefundApply',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
FinanceRefundApply::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

@ -142,7 +142,7 @@ class FinanceRefundRecordLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = FinanceRefundRecord::field('id,supplier_id,project_id,contract_type,contract_id,refund_amount,refund_date,refund_type,reason,remark,annex,bank_account_id')
$data = FinanceRefundRecord::field('id,supplier_id,project_id,contract_type,contract_id,refund_amount,refund_date,refund_type,reason,remark,annex,bank_account_id,approve_id')
->findOrEmpty($params['id']);
$supplier = Supplier::field('supplier_name,supplier_code')->where('id',$data['supplier_id'])->findOrEmpty();
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
@ -161,10 +161,39 @@ class FinanceRefundRecordLogic extends BaseLogic
$data['contract_type_text'] = $data->contract_type_text;
$data['refund_type_text'] = $data->refund_type_text;
$data['bank_account_info'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\finance\FinanceRefundRecord')
->where('content_logic','app\adminapi\logic\finance\FinanceRefundRecordLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = FinanceRefundRecord::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'退款记录',
$params['id'],
'app\common\model\finance\FinanceRefundRecord',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
FinanceRefundRecord::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

@ -122,7 +122,7 @@ class FinanceReturnedMoneyLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = FinanceReturnedMoney::field('id,project_id,contract_id,return_date,period,amount,return_status,return_duty_id,remark,annex')->findOrEmpty($params['id']);
$data = FinanceReturnedMoney::field('id,project_id,contract_id,return_date,period,amount,return_status,return_duty_id,remark,annex,approve_id')->findOrEmpty($params['id']);
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
$contract = Contract::field('contract_name,contract_code')->where('id',$data['contract_id'])->findOrEmpty();
@ -135,10 +135,39 @@ class FinanceReturnedMoneyLogic extends BaseLogic
$data['period_text'] = $data->period_text;
$data['return_status_text'] = $data->return_status_text;
$data['return_duty'] = $return_duty['name'];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\finance\FinanceReturnedMoney')
->where('content_logic','app\adminapi\logic\finance\FinanceReturnedMoneyLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = FinanceReturnedMoney::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'回款计划',
$params['id'],
'app\common\model\finance\FinanceReturnedMoney',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
FinanceReturnedMoney::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

@ -132,7 +132,7 @@ class FinanceReturnedRecordLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = FinanceReturnedRecord::field('id,project_id,contract_id,finance_returned_money_id,return_date,amount,collection_type,invoice_status,pay_type,return_desc,receiver,remark,annex,bank_account_id')
$data = FinanceReturnedRecord::field('id,project_id,contract_id,finance_returned_money_id,return_date,amount,collection_type,invoice_status,pay_type,return_desc,receiver,remark,annex,bank_account_id,approve_id')
->findOrEmpty($params['id']);
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
@ -148,10 +148,39 @@ class FinanceReturnedRecordLogic extends BaseLogic
$data['invoice_status_text'] = $data->invoice_status_text;
$data['pay_type_text'] = $data->pay_type_text;
$data['bank_account_info'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\finance\FinanceReturnedRecord')
->where('content_logic','app\adminapi\logic\finance\FinanceReturnedRecordLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = FinanceReturnedRecord::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'开票申请',
$params['id'],
'app\common\model\finance\FinanceReturnedRecord',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
FinanceReturnedRecord::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

@ -17,6 +17,7 @@ namespace app\adminapi\validate\finance;
use app\common\model\contract\Contract;
use app\common\model\dict\DictData;
use app\common\model\finance\FinanceInvoiceApply;
use app\common\validate\BaseValidate;
@ -33,7 +34,7 @@ class FinanceInvoiceApplyValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'contract_id' => 'require|checkContract',
'invoicing_date' => 'require|dateFormat:Y-m-d',
'invoice_no' => 'require',
@ -42,6 +43,8 @@ class FinanceInvoiceApplyValidate extends BaseValidate
'invoice_type' => 'require|checkInvoiceType',
'invoicing_amount' => 'require|float|gt:0',
'annex' => 'checkAnnex',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -69,7 +72,7 @@ class FinanceInvoiceApplyValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id', true)->remove('invoice_no',true);
return $this->remove('id', true)->remove('invoice_no',true)->remove('flow_id',true)->remove('path',true);
}
@ -80,7 +83,9 @@ class FinanceInvoiceApplyValidate extends BaseValidate
* @date 2023/12/13 15:01
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -106,6 +111,20 @@ class FinanceInvoiceApplyValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = FinanceInvoiceApply::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkContract($value): bool|string
{
$data = Contract::where('id',$value)->findOrEmpty();

@ -19,6 +19,7 @@ use app\common\model\bank\BankAccount;
use app\common\model\contract\ProcurementContract;
use app\common\model\contract\SubcontractingContract;
use app\common\model\dict\DictData;
use app\common\model\finance\FinancePaymentApply;
use app\common\model\finance\FinancePaymentPlan;
use app\common\model\supplier\Supplier;
use app\common\validate\BaseValidate;
@ -37,7 +38,7 @@ class FinancePaymentApplyValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'supplier_id' => 'require|checkSupplier',
'contract_cate' => 'require|in:1,2',
'contract_id' => 'require|checkContract',
@ -52,6 +53,8 @@ class FinancePaymentApplyValidate extends BaseValidate
'payee_account_name' => 'require',
'payee_account' => 'require',
'bank_account_id' => 'require|checkBankAccount',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -85,7 +88,7 @@ class FinancePaymentApplyValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -96,7 +99,9 @@ class FinancePaymentApplyValidate extends BaseValidate
* @date 2023/12/15 13:47
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -122,6 +127,20 @@ class FinancePaymentApplyValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = FinancePaymentApply::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkSupplier($value): bool|string
{
$supplier = Supplier::where('id',$value)->findOrEmpty();

@ -18,6 +18,7 @@ namespace app\adminapi\validate\finance;
use app\common\model\contract\ProcurementContract;
use app\common\model\contract\SubcontractingContract;
use app\common\model\dict\DictData;
use app\common\model\finance\FinancePaymentPlan;
use app\common\model\supplier\Supplier;
use app\common\validate\BaseValidate;
@ -35,7 +36,7 @@ class FinancePaymentPlanValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'supplier_id' => 'require|checkSupplier',
'contract_cate' => 'require|in:1,2',
'contract_id' => 'require|checkContract',
@ -44,6 +45,8 @@ class FinancePaymentPlanValidate extends BaseValidate
'amount' => 'require|float|gt:0',
'status' => 'require|checkStatus',
'annex' => 'checkAnnex',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -71,7 +74,7 @@ class FinancePaymentPlanValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id', true);
return $this->remove('id', true)->remove('flow_id',true)->remove('path',true);
}
@ -82,7 +85,9 @@ class FinancePaymentPlanValidate extends BaseValidate
* @date 2023/12/15 11:14
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -108,6 +113,20 @@ class FinancePaymentPlanValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = FinancePaymentPlan::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkSupplier($value): bool|string
{
$supplier = Supplier::where('id',$value)->findOrEmpty();

@ -17,6 +17,7 @@ namespace app\adminapi\validate\finance;
use app\common\model\contract\ProcurementContract;
use app\common\model\contract\SubcontractingContract;
use app\common\model\dict\DictData;
use app\common\model\finance\FinanceReceiptRecord;
use app\common\model\supplier\Supplier;
use app\common\validate\BaseValidate;
@ -34,7 +35,7 @@ class FinanceReceiptRecordValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'supplier_id' => 'require|checkSupplier',
'contract_cate' => 'require|in:1,2',
'contract_id' => 'require|checkContract',
@ -44,6 +45,8 @@ class FinanceReceiptRecordValidate extends BaseValidate
'invoice_tax_rate' => 'require|checkInvoiceTaxRate',
'receipt_date' => 'require|dateFormat:Y-m-d',
'annex' => 'checkAnnex',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -72,7 +75,7 @@ class FinanceReceiptRecordValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id', true);
return $this->remove('id', true)->remove('flow_id',true)->remove('path',true);
}
@ -83,7 +86,9 @@ class FinanceReceiptRecordValidate extends BaseValidate
* @date 2023/12/15 10:20
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -109,6 +114,20 @@ class FinanceReceiptRecordValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = FinanceReceiptRecord::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkSupplier($value): bool|string
{
$supplier = Supplier::where('id',$value)->findOrEmpty();

@ -18,6 +18,7 @@ namespace app\adminapi\validate\finance;
use app\common\model\bank\BankAccount;
use app\common\model\contract\Contract;
use app\common\model\dict\DictData;
use app\common\model\finance\FinanceRefundApply;
use app\common\validate\BaseValidate;
@ -34,7 +35,7 @@ class FinanceRefundApplyValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'contract_id' => 'require|checkContract',
'refund_date' => 'require|dateFormat:Y-m-d',
'reason' => 'require',
@ -44,6 +45,8 @@ class FinanceRefundApplyValidate extends BaseValidate
'collection_bank' => 'require',
'collection_account' => 'require',
'bank_account_id' => 'require|checkBankAccount',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -72,7 +75,7 @@ class FinanceRefundApplyValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id', true);
return $this->remove('id', true)->remove('flow_id',true)->remove('path',true);
}
@ -83,7 +86,9 @@ class FinanceRefundApplyValidate extends BaseValidate
* @date 2023/12/14 16:58
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -109,6 +114,20 @@ class FinanceRefundApplyValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = FinanceRefundApply::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkContract($value): bool|string
{
$data = Contract::where('id',$value)->findOrEmpty();

@ -19,6 +19,7 @@ use app\common\model\bank\BankAccount;
use app\common\model\contract\ProcurementContract;
use app\common\model\contract\SubcontractingContract;
use app\common\model\dict\DictData;
use app\common\model\finance\FinanceRefundRecord;
use app\common\model\supplier\Supplier;
use app\common\validate\BaseValidate;
@ -36,7 +37,7 @@ class FinanceRefundRecordValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'supplier_id' => 'require|checkSupplier',
'contract_cate' => 'require|in:1,2',
'contract_id' => 'require|checkContract',
@ -45,6 +46,8 @@ class FinanceRefundRecordValidate extends BaseValidate
'refund_type' => 'require|checkRefundType',
'annex' => 'checkAnnex',
'bank_account_id' => 'require|checkBankAccount',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -72,7 +75,7 @@ class FinanceRefundRecordValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -83,7 +86,9 @@ class FinanceRefundRecordValidate extends BaseValidate
* @date 2023/12/15 14:41
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -109,6 +114,20 @@ class FinanceRefundRecordValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = FinanceRefundRecord::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkSupplier($value): bool|string
{
$supplier = Supplier::where('id',$value)->findOrEmpty();

@ -18,6 +18,7 @@ namespace app\adminapi\validate\finance;
use app\common\model\auth\Admin;
use app\common\model\contract\Contract;
use app\common\model\dict\DictData;
use app\common\model\finance\FinanceReturnedMoney;
use app\common\validate\BaseValidate;
@ -42,6 +43,8 @@ class FinanceReturnedMoneyValidate extends BaseValidate
'return_status' => 'require|checkReturnStatus',
'return_duty_id' => 'require|checkReturnDuty',
'annex' => 'checkAnnex',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -68,7 +71,7 @@ class FinanceReturnedMoneyValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id', true);
return $this->remove('id', true)->remove('flow_id',true)->remove('path',true);
}
@ -79,7 +82,9 @@ class FinanceReturnedMoneyValidate extends BaseValidate
* @date 2023/12/13 15:38
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -105,6 +110,20 @@ class FinanceReturnedMoneyValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = FinanceReturnedMoney::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkContract($value): bool|string
{
$data = Contract::where('id',$value)->findOrEmpty();

@ -19,6 +19,7 @@ use app\common\model\bank\BankAccount;
use app\common\model\contract\Contract;
use app\common\model\dict\DictData;
use app\common\model\finance\FinanceReturnedMoney;
use app\common\model\finance\FinanceReturnedRecord;
use app\common\validate\BaseValidate;
@ -35,7 +36,7 @@ class FinanceReturnedRecordValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'contract_id' => 'require|checkContract',
'finance_returned_money_id' => 'require|checkReturnedMoney',
'return_date' => 'require|dateFormat:Y-m-d',
@ -45,6 +46,8 @@ class FinanceReturnedRecordValidate extends BaseValidate
'pay_type' => 'require|checkPayType',
'annex' => 'checkAnnex',
'bank_account_id' => 'require|checkBankAccount',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -73,7 +76,7 @@ class FinanceReturnedRecordValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id', true);
return $this->remove('id', true)->remove('flow_id',true)->remove('path',true);
}
@ -84,7 +87,9 @@ class FinanceReturnedRecordValidate extends BaseValidate
* @date 2023/12/13 16:28
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -110,6 +115,20 @@ class FinanceReturnedRecordValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = FinanceReturnedRecord::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkContract($value): bool|string
{
$data = Contract::where('id',$value)->findOrEmpty();