123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\Db;
- class Contract extends Base
- {
- // 合同详情
- public function detail(){
- $applyId = input('id/d',0);
- $ret = model('Contract')->info($applyId);
- HelpHander::success($ret);
- }
- // 打印合同详情
- public function detail2(){
- $applyId1 = input('id1/d',0);
- $applyId2 = input('id2/d',0);
- $applyId3 = input('id3/d',0);
- $lists = [];
- if($applyId1){
- $ret1 = model('Contract')->info($applyId1);
- $lists[] = $ret1;
- }
- if($applyId2){
- $ret2 = model('Contract')->info($applyId2);
- $lists[] = $ret2;
- }
- if($applyId3){
- $ret3 = model('Contract')->info($applyId3);
- $lists[] = $ret3;
- }
- HelpHander::success($lists);
- }
- // 列表
- public function list(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $contractSn = input('contractSn','','trim');
- $programSn = input('programSn','','trim');
- $title = input('title','','trim');
- $ispay = input('ispay/d',0);
- $programId = input('programId/d',0);
- $companyId = input('companyId/d',0);
- $startTime = input('startTime','','trim');
- $endTime = input('endTime','','trim');
- $company2 = input('company2','','trim');
- $ret = model('Contract')->lists($page,$size,$this->userId,$contractSn,$programSn,$title,$ispay,$programId,$companyId,$startTime,$endTime,$company2);
- HelpHander::success($ret);
- }
- // 导出列表
- public function exportList(){
- $contractSn = input('contractSn','','trim');
- $programSn = input('programSn','','trim');
- $title = input('title','','trim');
- $ispay = input('ispay/d',0);
- $programId = input('programId/d',0);
- $companyId = input('companyId/d',0);
- $startTime = input('startTime','','trim');
- $endTime = input('endTime','','trim');
- $company2 = input('company2','','trim');
- $ret = model('Contract')->exportlists($this->userId,$contractSn,$programSn,$title,$ispay,$programId,$companyId,$startTime,$endTime,$company2);
- HelpHander::success($ret);
- }
- // app全部合同列表
- public function applist(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $ret = model('Contract')->applists($page,$size,$this->userId);
- HelpHander::success($ret);
- }
- // 追加合同
- public function appendlist(){
- $applyId = input('applyId/d',0);
- $ret = model('Contract')->appendLists($applyId);
- HelpHander::success($ret);
- }
- // 支付或收款记录
- public function paylist(){
- $applyId = input('applyId/d',0);
- $ret = model('ContractPay')->payLists($applyId);
- HelpHander::success($ret);
- }
- // 财务支付或收款记录
- public function paylist2(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $title = input('title','','trim');
- $contractSn = input('contractSn','','trim');
- $fileStatus = input('fileStatus/d',-1);
- $qrStatus = input('qrStatus/d',-1);
- $ret = model('ContractPay')->payLists2($page,$size,$title,$contractSn,$qrStatus);
- HelpHander::success($ret);
- }
- public function payPrint(){
- $applyId = input('applyId/d',0);
- $ret = model('ContractPay')->payPrint($applyId);
- HelpHander::success($ret);
- }
- public function payConfirm(){
- $id = input('id/d',0);
- model('ContractPay')->payConfirm($id,$this->userId);
- HelpHander::success([],'操作成功');
- }
- public function payUpdates(){
- $id = input('id/d',0);
- $sdFile = input('file','','trim');
- model('ContractPay')->payupdates($id,$sdFile);
- HelpHander::success([],'操作成功');
- }
- public function stampLists(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $contractSn = input('contractSn','','trim');
- $programSn = input('programSn','','trim');
- $title = input('title','','trim');
- $status = input('status/d',-1);
- $startTime = input('startTime','','trim');
- $endTime = input('endTime','','trim');
- $type = input('type/d',0);
- $companyId = input('companyId/d',0);
- $sbStatus = input('sbStatus','','trim');
- $print = input('print','','trim');
- $ret = model('Contract')->stamplists($page,$size,$contractSn,$programSn,$title,$status,$startTime,$endTime,$type,$companyId,$sbStatus,$print);
- HelpHander::success($ret);
- }
- public function stampListsExport(){
- $contractSn = input('contractSn','','trim');
- $programSn = input('programSn','','trim');
- $title = input('title','','trim');
- $status = input('status/d',-1);
- $startTime = input('startTime','','trim');
- $endTime = input('endTime','','trim');
- $type = input('type/d',0);
- $companyId = input('companyId/d',0);
- $sbStatus = input('sbStatus','','trim');
- $print = input('print','','trim');
- $ret = model('Contract')->stampListsExport($contractSn,$programSn,$title,$status,$startTime,$endTime,$type,$companyId,$sbStatus,$print);
- HelpHander::success($ret);
- }
- public function stampUpdates(){
- $id = input('id/d',0);
- $sdFile = input('sdFile','','trim');
- model('Contract')->stampupdates($id,$sdFile);
- HelpHander::success([],'操作成功');
- }
- public function stampConfirm(){
- $id = input('id/d',0);
- model('Contract')->stampConfirm($id,$this->userId);
- HelpHander::success([],'操作成功');
- }
- public function confirm(){
- $id = input('id/d',0);
- model('Contract')->confirm($id);
- HelpHander::success([],'操作成功');
- }
- public function transferred(){
- $id = input('id/d',0);
- model('Contract')->transferred($id);
- HelpHander::success([],'操作成功');
- }
- public function appstatis(){
- $ret = model('Contract')->appstatis();
- HelpHander::success($ret,'操作成功');
- }
- // 修改印花税
- public function modifyStamp(){
- $contractId = input('contractId/d',0);
- $sdid = input('sdid/d',0);
- $money = input('money/f',0);
- model('Contract')->modifyStamp($contractId,$sdid,$money,$this->userId);
- HelpHander::success([],'操作成功');
- }
- // 打回
- public function backStamp(){
- $contractId = input('contractId/d',0);
- $sdReason = input('sdReason','','trim');
- if(!$sdReason){
- HelpHander::error('未填写打回原因');
- }
- model('Contract')->backStamp($contractId,$sdReason);
- HelpHander::success([],'操作成功');
- }
- public function stampLogList(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $contractId = input('contractId/d',0);
- $ret = model('Contract')->stampLogList($page,$size,$contractId);
- HelpHander::success($ret);
- }
- // 合同标记为已打印
- public function prints(){
- $applyIds = input('ids','','trim');
- if($applyIds){
- Db::name('contract')->where('apply_id','in',explode(',',$applyIds))->setField('print',1);
- }
- HelpHander::success([],'操作成功');
- }
- // 合同标记为已申报
- public function sbStatus(){
- $applyId = input('id','','trim');
- $ret = Db::name('contract')->where('apply_id',$applyId)->setField('sb_status',1);
- if(!$ret){
- HelpHander::error('操作失败');
- }
- HelpHander::success([],'操作成功');
- }
- public function renew(){
- $ret = model('Contract')->renew();
- HelpHander::success($ret);
- }
- public function renewConfirm(){
- $id = input('id','','trim');
- $renew = input('renew/d',0);
- $ret = model('Contract')->renewConfirm($id,$renew,$this->userId);
- if(!$ret){
- HelpHander::error('操作失败');
- }
- HelpHander::success([],'操作成功');
- }
- public function renewExport(){
- $ret = model('Contract')->renewExport();
- HelpHander::success($ret);
- }
- }
|