update
This commit is contained in:
parent
1f940dd8fa
commit
b0da07a99b
@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
|
|||||||
use app\adminapi\lists\bid\BidSecurityApplyLists;
|
use app\adminapi\lists\bid\BidSecurityApplyLists;
|
||||||
use app\adminapi\logic\bid\BidSecurityApplyLogic;
|
use app\adminapi\logic\bid\BidSecurityApplyLogic;
|
||||||
use app\adminapi\validate\bid\BidSecurityApplyValidate;
|
use app\adminapi\validate\bid\BidSecurityApplyValidate;
|
||||||
|
use app\common\model\oa\Flow;
|
||||||
|
use app\common\model\oa\FlowType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -104,5 +106,23 @@ class BidSecurityApplyController extends BaseAdminController
|
|||||||
return $this->data($result);
|
return $this->data($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function flows(): \think\response\Json
|
||||||
|
{
|
||||||
|
$flow_type = FlowType::where('type',3)->where('name','tbbzj')->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 BidSecurityApplyValidate())->post()->goCheck('approve');
|
||||||
|
$result = BidSecurityApplyLogic::approve($params,$this->adminId);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('提交审核信息成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(BidSecurityApplyLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
|
|||||||
use app\adminapi\lists\bid\BidSecurityRefundLists;
|
use app\adminapi\lists\bid\BidSecurityRefundLists;
|
||||||
use app\adminapi\logic\bid\BidSecurityRefundLogic;
|
use app\adminapi\logic\bid\BidSecurityRefundLogic;
|
||||||
use app\adminapi\validate\bid\BidSecurityRefundValidate;
|
use app\adminapi\validate\bid\BidSecurityRefundValidate;
|
||||||
|
use app\common\model\oa\Flow;
|
||||||
|
use app\common\model\oa\FlowType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -104,5 +106,23 @@ class BidSecurityRefundController extends BaseAdminController
|
|||||||
return $this->data($result);
|
return $this->data($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function flows(): \think\response\Json
|
||||||
|
{
|
||||||
|
$flow_type = FlowType::where('type',3)->where('name','ttbbzj')->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 BidSecurityRefundValidate())->post()->goCheck('approve');
|
||||||
|
$result = BidSecurityRefundLogic::approve($params,$this->adminId);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('提交审核信息成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(BidSecurityRefundLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -17,6 +17,7 @@ namespace app\adminapi\logic\bid;
|
|||||||
|
|
||||||
use app\common\model\bid\BidBiddingDecision;
|
use app\common\model\bid\BidBiddingDecision;
|
||||||
use app\common\model\bid\BidSecurityApply;
|
use app\common\model\bid\BidSecurityApply;
|
||||||
|
use app\common\model\oa\FlowApprove;
|
||||||
use app\common\model\project\Project;
|
use app\common\model\project\Project;
|
||||||
use app\common\model\custom\Custom;
|
use app\common\model\custom\Custom;
|
||||||
use app\common\logic\BaseLogic;
|
use app\common\logic\BaseLogic;
|
||||||
@ -124,7 +125,7 @@ class BidSecurityApplyLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
$data = BidSecurityApply::field('id,security_apply_code,project_id,bidding_decision_id,applier,pay_type,refund_date,remark,annex,deposit_bank,account_name,account')
|
$data = BidSecurityApply::field('id,security_apply_code,project_id,bidding_decision_id,applier,pay_type,refund_date,remark,annex,deposit_bank,account_name,account,approve_id')
|
||||||
->findOrEmpty($params['id']);
|
->findOrEmpty($params['id']);
|
||||||
$bidding_decision = BidBiddingDecision::field('code,margin_amount,bidding_time')->where('id',$data['bidding_decision_id'])->findOrEmpty();
|
$bidding_decision = BidBiddingDecision::field('code,margin_amount,bidding_time')->where('id',$data['bidding_decision_id'])->findOrEmpty();
|
||||||
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
|
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
|
||||||
@ -137,6 +138,39 @@ class BidSecurityApplyLogic extends BaseLogic
|
|||||||
$data['margin_amount'] = $bidding_decision['margin_amount'];
|
$data['margin_amount'] = $bidding_decision['margin_amount'];
|
||||||
$data['bidding_time'] = $bidding_decision['bidding_time'];
|
$data['bidding_time'] = $bidding_decision['bidding_time'];
|
||||||
$data['payment_account_info'] = [];
|
$data['payment_account_info'] = [];
|
||||||
|
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
|
||||||
|
$data['approve_check_status'] = $approve_data['check_status'];
|
||||||
return $data->toArray();
|
return $data->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function approve($params,$admin_id): bool{
|
||||||
|
$data = BidSecurityApply::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\bid\BidSecurityApply',
|
||||||
|
$params['path'],
|
||||||
|
$params['flow_id'],
|
||||||
|
$admin_id
|
||||||
|
);
|
||||||
|
if($res){
|
||||||
|
BidSecurityApply::where('id',$params['id'])->update([
|
||||||
|
'approve_id' => $res,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
Db::commit();
|
||||||
|
return true;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
self::setError($e->getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -20,6 +20,7 @@ use app\common\model\bid\BidBiddingDecision;
|
|||||||
use app\common\model\bid\BidSecurityApply;
|
use app\common\model\bid\BidSecurityApply;
|
||||||
use app\common\model\bid\BidSecurityRefund;
|
use app\common\model\bid\BidSecurityRefund;
|
||||||
use app\common\logic\BaseLogic;
|
use app\common\logic\BaseLogic;
|
||||||
|
use app\common\model\oa\FlowApprove;
|
||||||
use app\common\model\project\Project;
|
use app\common\model\project\Project;
|
||||||
use app\common\model\custom\Custom;
|
use app\common\model\custom\Custom;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
@ -119,7 +120,7 @@ class BidSecurityRefundLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
$data = BidSecurityRefund::field('id,project_id,bid_security_apply_id,refund_amount,refund_date,remark,annex,bank_account_id')->findOrEmpty($params['id']);
|
$data = BidSecurityRefund::field('id,project_id,bid_security_apply_id,refund_amount,refund_date,remark,annex,bank_account_id,approve_id')->findOrEmpty($params['id']);
|
||||||
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
|
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
|
||||||
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||||
$bid_security_apply = BidSecurityApply::field('bidding_decision_id,deposit_bank,account_name,account')->where('id',$data['bid_security_apply_id'])->findOrEmpty();
|
$bid_security_apply = BidSecurityApply::field('bidding_decision_id,deposit_bank,account_name,account')->where('id',$data['bid_security_apply_id'])->findOrEmpty();
|
||||||
@ -133,6 +134,39 @@ class BidSecurityRefundLogic extends BaseLogic
|
|||||||
$data['account_name'] = $bid_security_apply['account_name'];
|
$data['account_name'] = $bid_security_apply['account_name'];
|
||||||
$data['account'] = $bid_security_apply['account'];
|
$data['account'] = $bid_security_apply['account'];
|
||||||
$data['bank_account_info'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
|
$data['bank_account_info'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
|
||||||
|
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
|
||||||
|
$data['approve_check_status'] = $approve_data['check_status'];
|
||||||
return $data->toArray();
|
return $data->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function approve($params,$admin_id): bool{
|
||||||
|
$data = BidSecurityRefund::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\bid\BidSecurityRefund',
|
||||||
|
$params['path'],
|
||||||
|
$params['flow_id'],
|
||||||
|
$admin_id
|
||||||
|
);
|
||||||
|
if($res){
|
||||||
|
BidSecurityRefund::where('id',$params['id'])->update([
|
||||||
|
'approve_id' => $res,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
Db::commit();
|
||||||
|
return true;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
self::setError($e->getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -16,6 +16,7 @@ namespace app\adminapi\validate\bid;
|
|||||||
|
|
||||||
|
|
||||||
use app\common\model\bid\BidBiddingDecision;
|
use app\common\model\bid\BidBiddingDecision;
|
||||||
|
use app\common\model\bid\BidSecurityApply;
|
||||||
use app\common\model\dict\DictData;
|
use app\common\model\dict\DictData;
|
||||||
use app\common\validate\BaseValidate;
|
use app\common\validate\BaseValidate;
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ class BidSecurityApplyValidate extends BaseValidate
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require|checkData',
|
||||||
'bidding_decision_id' => 'require|checkBiddingDecision',
|
'bidding_decision_id' => 'require|checkBiddingDecision',
|
||||||
'applier' => 'require',
|
'applier' => 'require',
|
||||||
'pay_type' => 'require|checkPayType',
|
'pay_type' => 'require|checkPayType',
|
||||||
@ -42,6 +43,8 @@ class BidSecurityApplyValidate extends BaseValidate
|
|||||||
'deposit_bank' => 'require',
|
'deposit_bank' => 'require',
|
||||||
'account_name' => 'require',
|
'account_name' => 'require',
|
||||||
'account' => 'require',
|
'account' => 'require',
|
||||||
|
'flow_id' => 'require|checkFlow',
|
||||||
|
'path' => 'require',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -69,7 +72,7 @@ class BidSecurityApplyValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
public function sceneAdd()
|
public function sceneAdd()
|
||||||
{
|
{
|
||||||
return $this->remove('id',true);
|
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,7 +83,9 @@ class BidSecurityApplyValidate extends BaseValidate
|
|||||||
* @date 2023/12/16 10:46
|
* @date 2023/12/16 10:46
|
||||||
*/
|
*/
|
||||||
public function sceneEdit()
|
public function sceneEdit()
|
||||||
{}
|
{
|
||||||
|
return $this->remove('flow_id',true)->remove('path',true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +111,20 @@ class BidSecurityApplyValidate extends BaseValidate
|
|||||||
return $this->only(['id']);
|
return $this->only(['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sceneApprove()
|
||||||
|
{
|
||||||
|
return $this->only(['id','flow_id','path']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function checkData($value): bool|string
|
||||||
|
{
|
||||||
|
$data = BidSecurityApply::where('id',$value)->findOrEmpty();
|
||||||
|
if($data->isEmpty()){
|
||||||
|
return '数据不存在';
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function checkBiddingDecision($value): bool|string
|
public function checkBiddingDecision($value): bool|string
|
||||||
{
|
{
|
||||||
$data = BidBiddingDecision::where('id',$value)->findOrEmpty();
|
$data = BidBiddingDecision::where('id',$value)->findOrEmpty();
|
||||||
|
@ -17,6 +17,7 @@ namespace app\adminapi\validate\bid;
|
|||||||
|
|
||||||
use app\common\model\bank\BankAccount;
|
use app\common\model\bank\BankAccount;
|
||||||
use app\common\model\bid\BidSecurityApply;
|
use app\common\model\bid\BidSecurityApply;
|
||||||
|
use app\common\model\bid\BidSecurityRefund;
|
||||||
use app\common\validate\BaseValidate;
|
use app\common\validate\BaseValidate;
|
||||||
|
|
||||||
|
|
||||||
@ -33,12 +34,14 @@ class BidSecurityRefundValidate extends BaseValidate
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require|checkData',
|
||||||
'bid_security_apply_id' => 'require|checkBidSecurityApply',
|
'bid_security_apply_id' => 'require|checkBidSecurityApply',
|
||||||
'refund_amount' => 'require|float|egt:0',
|
'refund_amount' => 'require|float|egt:0',
|
||||||
'refund_date' => 'require|dateFormat:Y-m-d',
|
'refund_date' => 'require|dateFormat:Y-m-d',
|
||||||
'annex' => 'checkAnnex',
|
'annex' => 'checkAnnex',
|
||||||
'bank_account_id' => 'require|checkBankAccount',
|
'bank_account_id' => 'require|checkBankAccount',
|
||||||
|
'flow_id' => 'require|checkFlow',
|
||||||
|
'path' => 'require',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +66,7 @@ class BidSecurityRefundValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
public function sceneAdd()
|
public function sceneAdd()
|
||||||
{
|
{
|
||||||
return $this->remove('id',true);
|
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -74,7 +77,9 @@ class BidSecurityRefundValidate extends BaseValidate
|
|||||||
* @date 2023/12/18 10:29
|
* @date 2023/12/18 10:29
|
||||||
*/
|
*/
|
||||||
public function sceneEdit()
|
public function sceneEdit()
|
||||||
{}
|
{
|
||||||
|
return $this->remove('flow_id',true)->remove('path',true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,6 +105,20 @@ class BidSecurityRefundValidate extends BaseValidate
|
|||||||
return $this->only(['id']);
|
return $this->only(['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sceneApprove()
|
||||||
|
{
|
||||||
|
return $this->only(['id','flow_id','path']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function checkData($value): bool|string
|
||||||
|
{
|
||||||
|
$data = BidSecurityRefund::where('id',$value)->findOrEmpty();
|
||||||
|
if($data->isEmpty()){
|
||||||
|
return '数据不存在';
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function checkBidSecurityApply($value): bool|string
|
public function checkBidSecurityApply($value): bool|string
|
||||||
{
|
{
|
||||||
$data = BidSecurityApply::where('id',$value)->findOrEmpty();
|
$data = BidSecurityApply::where('id',$value)->findOrEmpty();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user