Bladeren bron

2.0.0 no.1 up

likeku 7 jaren geleden
bovenliggende
commit
2324170da9
32 gewijzigde bestanden met toevoegingen van 336 en 96 verwijderingen
  1. 5 0
      protected/class/actmeasure.php
  2. 5 0
      protected/class/attfile.php
  3. 0 1
      protected/class/itemfile.php
  4. 21 0
      protected/class/itemmeasurenum.php
  5. 14 0
      protected/class/measureauditact.php
  6. 3 0
      protected/class/measureconcerner.php
  7. 4 0
      protected/class/numofperact.php
  8. 28 3
      protected/class/sign.php
  9. 31 15
      protected/class/sms.php
  10. 5 7
      protected/config/routes.conf.php
  11. 5 1
      protected/config/sms.conf.php
  12. 9 2
      protected/controller/AppController.php
  13. 1 1
      protected/controller/ClientController.php
  14. 12 7
      protected/controller/ProjectController.php
  15. 17 5
      protected/controller/RProjectController.php
  16. 36 6
      protected/controller/SProjectController.php
  17. 5 6
      protected/controller/SignController.php
  18. 1 1
      protected/controller/UserController.php
  19. 33 8
      protected/module/admin/controller/ProController.php
  20. 0 17
      protected/module/admin/controller/ServiceController.php
  21. 5 0
      protected/module/admin/model/ameasure.php
  22. 0 1
      protected/module/admin/view/admin-editUser.html
  23. 1 1
      protected/view/edit-app.html
  24. 3 0
      protected/view/edit-profile-sms.html
  25. 2 2
      protected/view/r-project-section.html
  26. 1 1
      protected/view/r-project.html
  27. 84 5
      protected/view/s-project-section.html
  28. 1 1
      protected/view/s-project.html
  29. 1 1
      protected/view/sign-view-page.html
  30. 1 1
      protected/view/sign-view-set_signer.html
  31. 0 1
      protected/view/sign-view-signer_sign.html
  32. 2 2
      protected/view/w-project.html

+ 5 - 0
protected/class/actmeasure.php

@@ -160,4 +160,9 @@ class actMeasure
     {
         return $this->__mmeasure->count(array('where' => 'pmid=?', 'param' => array($pmid)));
     }
+
+    public function del($pmid)
+    {
+        return $this->__mmeasure->delete(array('where' => 'pmid=?', 'param' => array($pmid)));
+    }
 }

+ 5 - 0
protected/class/attfile.php

@@ -177,6 +177,11 @@ class attFile
         return $this->__file->delete(array('where' => 'mpid=?', 'param' => array($mpid)));
     }
 
+    public function delAllTimesFile3($pmid)
+    {
+        return $this->__file->delete(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
+    }
+
     public function getLastFileAid($pmid,$numpname,$times){
         $result = $this->__file->getOne(array('select' => 'aid', 'where' => 'pmid=? and numpname=? and times=?', 'param' => array($pmid, $numpname, $times), 'desc' => 'aid', 'asArray' => TRUE));
         return !empty($result) ? $result['aid'] : '';

+ 0 - 1
protected/class/itemfile.php

@@ -61,7 +61,6 @@ class ItemFile
     {
         return $pmid ? $this->__itemfile->find(array('where' => 'pmid=?', 'groupby' => 'ownerid', 'param' => array($pmid), 'asArray' => TRUE)) : FALSE;
     }
-
 }
 
 ?>

+ 21 - 0
protected/class/itemmeasurenum.php

@@ -116,4 +116,25 @@ class ItemMeasureNumpofper
     {
         return $this->__itemMeasureNum->delete(array('where' => 'iaid=?', 'param' => array($iaid)));
     }
+
+    public function delItembyPmid($pmid)
+    {
+        $list = $this->__itemMeasureNum->find(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
+        if(!empty($list)){
+            Doo::loadClass('itemfile');
+            include (DOO::conf()->SITE_PATH . 'protected/plugin/io.han.php');
+            foreach($list as $k => $v){
+                $itemfile = new ItemFile();
+                //删除附件文件、数据库记录
+                $itemfile_arr = $itemfile->getItemFile($v['iaid']);
+                if($itemfile_arr){
+                    $this->IoHandler = new IoHandler();
+                    $path = DOO::conf()->SITE_PATH.$itemfile_arr['filepath'];
+                    $this->IoHandler->DeleteFile($path);
+                    $itemfile->delItem($v['iaid']);
+                }
+                $this->delItemFields($v['imnid']);
+            }
+        }
+    }
 }

+ 14 - 0
protected/class/measureauditact.php

@@ -127,6 +127,12 @@ class MeasureauditAct
         return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=? and times=? order by maid asc', 'param' => array($bid, $num, $maxtimesArray['maxtimes']), 'asArray' => TRUE));
     }
 
+    public function getUserAuditLast2($bid, $num)
+    {
+        $maxtimesArray = $this->getMaxTimes($bid, $num);
+        return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=? and times=? order by last desc,maid asc', 'param' => array($bid, $num, $maxtimesArray['maxtimes']), 'asArray' => TRUE));
+    }
+
     public function getRowbyUID($audituid)
     {
         return $this->__measureaudit->find(array('where' => 'auditoruid=?', 'param' => array($audituid), 'asArray' => TRUE));
@@ -383,4 +389,12 @@ class MeasureauditAct
 
     }
 
+    public function delMeasureAuditListbyPmid($pmid){
+        return $this->__measureaudit->delete(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
+    }
+
+    public function delAuditUserPyPid($pid){
+        return $this->__measureaudit->delete(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
+    }
+
 }

+ 3 - 0
protected/class/measureconcerner.php

@@ -42,5 +42,8 @@ class MeasureConcerner
         return $this->__measureconcern->find(array('where' => 'uid=?', 'param' => array($uid), 'asArray' => TRUE));
     }
 
+    public function delMeasureConcernListbyPmid($pmid){
+        return $this->__measureconcern->delete(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
+    }
 
 }

+ 4 - 0
protected/class/numofperact.php

@@ -327,4 +327,8 @@ class NumofperAct {
 //        return $this->__numofperact->find(array('select' => 'sum(curralltotal) as currtotal,FROM_UNIXTIME(intime,"%Y-%m") as month', 'where' => 'stid=? and currstatus!=\'checkno\''
 //        , 'param' => array($stid), 'groupby' => 'FROM_UNIXTIME(intime,"%Y-%m")', 'asc' => 'intime', 'asArray' => TRUE));
     }
+
+    public function delMeasureNumofperListbyPmid($pmid) {
+        return $this->__numofperact->delete(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
+    }
 }

+ 28 - 3
protected/class/sign.php

@@ -194,9 +194,11 @@ class Signn
             $this->_signaudit->delete();
 
             $attlist = $this->getSignAttList($sid);
-            foreach ($attlist as $key => $value) {
-                $this->_signauditatt->said = $value['said'];
-                $this->_signauditatt->delete();
+            if(!empty($attlist)){
+                foreach ($attlist as $key => $value) {
+                    $this->_signauditatt->said = $value['said'];
+                    $this->_signauditatt->delete();
+                }
             }
         }
 
@@ -235,4 +237,27 @@ class Signn
         return $this->_sign->update();
     }
 
+    public function updateSignStatusbyPmid($pmid){
+//        $this->_sign->tender = $pmid;
+        $this->_sign->status = 'del';
+        return $this->_sign->update(array('where' => 'tender=?', 'param' => array($pmid)));
+    }
+
+    public function delSignbyTenderAndPhaseno($tender,$phaseno = ''){
+
+        $phasenolist = !empty($phaseno) && is_numeric($phaseno) ? ' and phaseno='. $phaseno : '';
+        $signlist = $this->_sign->find(array('where' => 'tender=?'.$phasenolist, 'param' => array($tender), 'asArray' => TRUE));
+
+        if(!empty($signlist)){
+            include (DOO::conf()->SITE_PATH . 'protected/plugin/io.han.php');
+            foreach($signlist as $k => $v){
+                $this->delSignbysid($v['sid'],'checking');
+
+                $this->IoHandler = new IoHandler();
+                $path = DOO::conf()->SITE_PATH."signs/".$v['sid'];
+                $this->IoHandler->RemoveDir($path);
+            }
+        }
+    }
+
 }

+ 31 - 15
protected/class/sms.php

@@ -2,12 +2,14 @@
 
 class Sms
 {
-    private $api_url, $auth_key, $errorMsg;
+    private $api_url, $account, $password, $extno, $errorMsg;
 
-    function __construct($api_url, $auth_key)
+    function __construct($api_url, $account,$password,$extno)
     {
         $this->api_url = $api_url;
-        $this->auth_key = $auth_key;
+        $this->account = $account;
+        $this->password = $password;
+        $this->extno = $extno;
     }
 
     /**
@@ -17,21 +19,38 @@ class Sms
     public function sendSms($mobile, $code)
     {
         $send = array(
-            'apikey' => $this->auth_key,
+            'action' => 'send',
+            'account' => $this->account,
+            'password' => $this->password,
             'mobile' => $mobile,
-            'text' => $code
+            'content' => $code,
+            'extno' => $this->extno
         );
         $data = http_build_query($send);
-        $res = json_decode($this->_httpClient($this->api_url, $data));
+        $res = simplexml_load_string($this->_httpClient($this->api_url,$data));
         $resArr = $this->objectToArray($res);
-        if (!empty($resArr) && $resArr["code"] == 0) {
-            return true;
-        } else {
-            if (empty($this->errorMsg)) $this->errorMsg = isset($resArr["msg"]) ? $resArr["msg"] : '未知错误';
+        $resultcode = !empty($resArr) ? explode('#@#',$resArr['resplist']['resp'])[2] : '';
+        if ($resultcode == '0') return true;
+        else {
+            if (empty($this->errorMsg)) $this->errorMsg = !empty($resultcode) ? $this->getErrorMsg($resultcode) : '未知错误';
             return false;
         }
     }
 
+    function getErrorMsg($code){
+        $msg = '';
+        switch($code){
+            case 6: $msg = '错误代码:6,请联系我们客服';break;
+            case 10: $msg = '错误代码:10,请联系我们客服';break;
+            case 12: $msg = '检查接收短信手机号码格式是否正确';break;
+            case 15: $msg = '错误代码:15,请联系我们客服';break;
+            case 16: $msg = '一天时间内同一个手机号码不能太频繁接收短信';break;
+            case 17: $msg = '错误代码:17,请联系我们客服';break;
+            default : $msg = '错误代码:400,请联系我们客服';break;
+        }
+        return $msg;
+    }
+
     //对象转数组,使用get_object_vars返回对象属性组成的数组
     function objectToArray($array)
     {
@@ -55,13 +74,10 @@ class Sms
     {
         try {
             $ch = curl_init();
-            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept:text/plain;charset=utf-8', 'Content-Type:application/x-www-form-urlencoded', 'charset=utf-8'));
-            curl_setopt($ch, CURLOPT_URL, $api_url);
+            curl_setopt($ch, CURLOPT_URL,$api_url.$data);
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-            curl_setopt($ch, CURLOPT_POST, 1);
+            curl_setopt($ch, CURLOPT_HEADER, 0);
             curl_setopt($ch, CURLOPT_TIMEOUT, 10);
-            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-            curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
             $res = curl_exec($ch);
             curl_close($ch);
             return $res;

+ 5 - 7
protected/config/routes.conf.php

@@ -57,7 +57,7 @@ $route['*']['/rproject/:pid/section/:pmid/files/page/:pindex/user/:userid/num/:n
 
 // S
 $route['get']['/sproject/index'] = array('SProjectController', 'index');
-$route['get']['/sproject/:pid/section'] = array('SProjectController', 'proSection');
+$route['*']['/sproject/:pid/section'] = array('SProjectController', 'proSection');
 $route['get']['/sproject/:pid/section/:pmid/detail'] = array('SProjectController', 'proDetail');
 $route['get']['/sproject/:pid/section/measure'] = array('SProjectController', 'proMeasure');
 $route['*']['/sproject/:pid/section/:pmid/files'] = array('SProjectController', 'proSectionFiles');
@@ -226,11 +226,10 @@ $route['*']['/api/upgrade/v1/set/switch/:onoff'] = array('UpgradeController', 's
 $route['*']['/api/upgrade/v1/set/upgrade/info'] = array('UpgradeController', 'setUpgradeInfo');
 $route['*']['/api/upgrade/v1/get/version/status'] = array('UpgradeController', 'getVersionAndStatus');
 
-
-$route['*']['/user/add/:username/:realname'] = array('[admin]UserController', 'ZGaddUser');
-$route['*']['/service/user'] = array('[admin]ServiceController', 'ZGServer');
-$route['*']['/service/getwsdl'] = array('[admin]ServiceController', 'getWSDL');
-$route['*']['/service/testsoap'] = array('[admin]ServiceController', 'testSoap');
+//$route['*']['/user/add/:username/:realname'] = array('[admin]UserController', 'ZGaddUser');
+//$route['*']['/service/user'] = array('[admin]ServiceController', 'ZGServer');
+//$route['*']['/service/getwsdl'] = array('[admin]ServiceController', 'getWSDL');
+//$route['*']['/service/testsoap'] = array('[admin]ServiceController', 'testSoap');
 
 // App api
 $route['*']['/api/app/serverlogin'] = array('AppController', 'ServerLogin');
@@ -316,7 +315,6 @@ $route['*']['/sign/list/project/:pid/tender/:pmid/:nosign/page/:pindex'] = array
 $route['*']['/sign/list/project/:pid/tender/:pmid/phaseno/:mpid/:nosign'] = array('SignController', 'signList');
 $route['*']['/sign/list/project/:pid/tender/:pmid/phaseno/:mpid/:nosign/page/:pindex'] = array('SignController', 'signList');
 
-
 $route['*']['/sign/set/:sid'] = array('SignController', 'signSignSet');
 $route['*']['/sign/upsigner'] = array('SignController', 'signUpSigner');
 $route['*']['/sign/view/:sid'] = array('SignController', 'signView');

File diff suppressed because it is too large
+ 5 - 1
protected/config/sms.conf.php


+ 9 - 2
protected/controller/AppController.php

@@ -51,7 +51,7 @@ class AppController extends DooController {
         $this->modelconfig = new AConfig();
         $this->itemMeasureNum = new ItemMeasureNumpofper();
         $this->aconfig = new AConfig();
-        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_ACCOUNT, DOO::conf()->SMS_PASSWORD, DOO::conf()->SMS_EXTNO);
         $this->__hashids = new Hashids\Hashids('jlzfuserid', 8);
     }
 
@@ -366,11 +366,18 @@ class AppController extends DooController {
                 //获取并改变上一个审批人为审批中状态
                 $lastmeasureauditact = $this->measureauditact->getMyAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times'], $_POST['last']);
                 $this->measureauditact->updateMastatus2($lastmeasureauditact['maid']);
+                //退回必须删除上一个上报人的文件数据并更改前一个文件为最新2
+                $this->attfile->delMyAttFile($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times'], $_POST['last']);
+
+                $lastaid = $this->attfile->getLastFileAid($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times']);
+                if(!empty($lastaid)){
+                    $this->attfile->updateIsNew2($lastaid);
+                }
                 // SMS Start
                 $TenderArray = $this->actmeasure->getRowByPmid($lastRowArray['pmid']);
                 $userProArray = $this->profile->getProWithUid($_POST['last']);
                 if (isset($userProArray) && ($userProArray['mobile'])) {// // XXXX(标段名),陈特,已审批通过。请您继续审批。
-                    $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '"' . $TenderArray["pmname"] .'"'. Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR4"]);
+                    $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . $TenderArray["pmname"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR8"]);
                 }
                 // SMS End
                 echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);

+ 1 - 1
protected/controller/ClientController.php

@@ -81,7 +81,7 @@ class ClientController extends DooController
         $this->aconfig = new AConfig();
         $this->sign = new signn();
         $this->concern = new MeasureConcerner();
-        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_ACCOUNT, DOO::conf()->SMS_PASSWORD, DOO::conf()->SMS_EXTNO);
     }
 
     public function ClientSignin()

+ 12 - 7
protected/controller/ProjectController.php

@@ -107,7 +107,7 @@ class ProjectController extends DooController
         if (isset($_POST['proid']) && is_numeric($_POST['proid']) && isset($_POST['delpro'])) {
             if($this->actmeasure->getMearsureCount($_POST['proid']) == 0){
                 $this->project->del($_POST['proid']);
-                //空的标段类型也要删
+                //空的标段类型,未上报的审批人列表也要删
                 $stArr = $this->contractact->getRowByPid($_POST['proid']);
                 if(!empty($stArr)){
                     foreach($stArr as $k => $v){
@@ -115,6 +115,7 @@ class ProjectController extends DooController
                         $cont->del($v['stid']);
                     }
                 }
+                $this->measureauditact->delAuditUserPyPid($_POST['proid']);
 
             }
             return Doo::conf()->APP_URL . 'project/index';
@@ -366,6 +367,9 @@ class ProjectController extends DooController
                 } else {
                     $statusStr = '';
                 }
+                $displayPercentSnTotalProgresswidth = floatval($displayPercentSnTotalProgress) >= 100 ? '100%' : $displayPercentSnTotalProgress;
+                $displayPercentCurrTotalProgresswidth = floatval($displayPercentCurrTotalProgress) >= 100 ? '100%' : $displayPercentCurrTotalProgress;
+                $displayPercentLessTotalProgresswidth = floatval($displayPercentLessTotalProgress) >= 100 ? '100%' : $displayPercentLessTotalProgress;
                 $bdhtmlstr .= '
 				<tr>
 					<td><a href="/project/' . $this->params['pid'] . '/section/' . $value['pmid'] . '/detail">' . $value['pmname'] . '</a></td>
@@ -373,9 +377,9 @@ class ProjectController extends DooController
 					<td class="taR">¥' . $totalmoney . '</td>
 					<td>
 					    <div class="progress">
-						<div class="progress-bar progress-bar-success" style="width: ' . $displayPercentSnTotalProgress . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期完成:¥' . $nTotalProgress . '">' . $displayPercentSnTotalProgress . '</div>
-						<div class="progress-bar" style="width:' . $displayPercentCurrTotalProgress . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥' . $ncurrTotalProgress . '">' . $displayPercentCurrTotalProgress . '</div>
-						<div class="progress-bar progress-bar-gary" style="width:' . $displayPercentLessTotalProgress . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $nlessTotalProgress . '">' . $displayPercentLessTotalProgress . '</div>
+						<div class="progress-bar progress-bar-success" style="width: ' . $displayPercentSnTotalProgresswidth . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期完成:¥' . $nTotalProgress . '">' . $displayPercentSnTotalProgress . '</div>
+						<div class="progress-bar" style="width:' . $displayPercentCurrTotalProgresswidth . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥' . $ncurrTotalProgress . '">' . $displayPercentCurrTotalProgress . '</div>
+						<div class="progress-bar progress-bar-gary" style="width:' . $displayPercentLessTotalProgresswidth . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $nlessTotalProgress . '">' . $displayPercentLessTotalProgress . '</div>
 					    </div>
 					</td>
 				    </tr>';
@@ -391,7 +395,8 @@ class ProjectController extends DooController
             }
             $delstidhtml =  $this->actmeasure->getCountMeasure($v['stid']) == 0 ? '<a id="idst_' . $v['stid'] . '" stid="' . $v['stid'] . '" stname="' . $v['stname'] . '" href="#del-confirm-2" data-toggle="modal" title="删除类型">
 									<span data-icon="U" aria-hidden="true" class="colRed" data-placement="bottom" data-toggle="tooltip" data-original-title="删除类型" style="font-size:18px"></span></a>' : '';
-
+            $progresswidth = floatval($progress) >= 100 ? '100%' : $progress;
+            $otherprogresswidth = floatval($otherprogress) >= 100 ? '100%' : $otherprogress;
             $htmlstr .= '<div class="project">
 			<div class="proSection">
 			    <table class="table">
@@ -400,8 +405,8 @@ class ProjectController extends DooController
 					<td width="150"><span aria-hidden="true" data-icon="u"></span> ' . $v['stname'] . '<a id="idt_' . $v['stid'] . '" href="#secoption" data-toggle="modal" title="编辑/查看KEY" stid="' . $v['stid'] . '" proname="' . $v['stname'] . '" key="' . $v['stkey'] . '"><span data-icon="S" aria-hidden="true" class="closePanel" data-placement="bottom" data-toggle="tooltip" data-original-title="查看KEY" style="font-size:18px"></span></a>' .$delstidhtml. '</td>
 					<td width="90">总价:</td><td width="165">¥<b style="font-size:16px">' . $biaoduantotalmoney . '</b></td>
 					<td width="60">完成进度:</td><td><div class="progress">
-						<div class="progress-bar progress-bar-success" style="width:' . $progress . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="累计完成:¥' . $nprogress . '">' . $progress . '</div>
-						<div class="progress-bar progress-bar-danger" style="width:' . $otherprogress . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $notherprogress . '">' . $otherprogress . '</div>
+						<div class="progress-bar progress-bar-success" style="width:' . $progresswidth . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="累计完成:¥' . $nprogress . '">' . $progress . '</div>
+						<div class="progress-bar progress-bar-danger" style="width:' . $otherprogresswidth . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $notherprogress . '">' . $otherprogress . '</div>
 					    </div></td>
 				    </tr>
 				</thead>

+ 17 - 5
protected/controller/RProjectController.php

@@ -43,7 +43,8 @@ class RProjectController extends DooController
         $this->itemfle = new ItemFile();
         $this->att = new attachment();
         $this->sign = new Signn();
-        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
+
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_ACCOUNT, DOO::conf()->SMS_PASSWORD, DOO::conf()->SMS_EXTNO);
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'r';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
@@ -177,6 +178,9 @@ class RProjectController extends DooController
                         $dispstopnowtotal = $pstopnowtotal . '%';
                         $pnowtotal = 100 - $pcurrdone - $pstopnowtotal;
                         $dispnowtotal = $pnowtotal . '%';
+                        $dispstopnowtotalwidth = $pstopnowtotal >= 100 ? '100%' : $dispstopnowtotal;
+                        $dispcurrdonewidth = $pcurrdone >= 100 ? '100%' : $dispcurrdone;
+                        $dispnowtotalwidth = $pnowtotal >= 100 ? '100%' : $dispnowtotal;
                         $countNum = $this->numofperact->getLastNew2($v['pmid'])['numpname'];
                         if (!isset($countNum)) {
                             $countNum = 0;
@@ -197,9 +201,9 @@ class RProjectController extends DooController
                                     <td class="taR">¥' . number_format($v['contracttotal'], 2, '.', ',') . '</td>
                                     <td>
                                         <div class="progress">
-                                        <div class="progress-bar progress-bar-success" style="width: ' . $dispstopnowtotal . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期完成:¥' . $nstopnowtotal . '">' . $dispstopnowtotal . '</div>
-                                        <div class="progress-bar" style="width:' . $dispcurrdone . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥' . $ncurrdone . '">' . $dispcurrdone . '</div>
-                                        <div class="progress-bar progress-bar-gary" style="width:' . $dispnowtotal . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $nnowtotal . '">' . $dispnowtotal . '</div>
+                                        <div class="progress-bar progress-bar-success" style="width: ' . $dispstopnowtotalwidth . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期完成:¥' . $nstopnowtotal . '">' . $dispstopnowtotal . '</div>
+                                        <div class="progress-bar" style="width:' . $dispcurrdonewidth . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥' . $ncurrdone . '">' . $dispcurrdone . '</div>
+                                        <div class="progress-bar progress-bar-gary" style="width:' . $dispnowtotalwidth . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $nnowtotal . '">' . $dispnowtotal . '</div>
                                         </div>
                                     </td>
                                     </tr>';
@@ -860,11 +864,19 @@ class RProjectController extends DooController
             //获取并改变上一个审批人为审批中状态
             $lastmeasureauditact = $this->measureauditact->getMyAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times'], $_POST['last']);
             $this->measureauditact->updateMastatus2($lastmeasureauditact['maid']);
+            //退回必须删除上一个上报人的文件数据并更改前一个文件为最新2
+            $this->attfile->delMyAttFile($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times'], $_POST['last']);
+
+            $lastaid = $this->attfile->getLastFileAid($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times']);
+            if(!empty($lastaid)){
+                $this->attfile->updateIsNew2($lastaid);
+            }
+
             // SMS Start
             $TenderArray = $this->actmeasure->getRowByPmid($lastRowArray['pmid']);
             $userProArray = $this->profile->getProWithUid($_POST['last']);
             if (isset($userProArray) && ($userProArray['mobile'])) {// // XXXX(标段名),陈特,已审批通过。请您继续审批。
-                $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '"' . $TenderArray["pmname"] .'"'. Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR8"]);
+                $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . $TenderArray["pmname"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR8"]);
             }
             // SMS End
             echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);

+ 36 - 6
protected/controller/SProjectController.php

@@ -13,6 +13,7 @@ Doo::loadClass('attachment');
 Doo::loadHelper('DooPager');
 Doo::loadClass('sign');
 Doo::loadModelAt('aconfig', 'admin');
+Doo::loadClass('measureconcerner');
 
 /**
  * MainController
@@ -23,7 +24,7 @@ Doo::loadModelAt('aconfig', 'admin');
 class SProjectController extends DooController
 {
 
-    private $aconfig,$data, $sign, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $measureauditact, $itemmeasurenum, $itemfle, $att;
+    private $aconfig,$data, $sign, $concern, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $measureauditact, $itemmeasurenum, $itemfle, $att;
 
     public function beforeRun($resource, $action)
     {
@@ -56,6 +57,7 @@ class SProjectController extends DooController
         $this->itemfle = new ItemFile();
         $this->att = new attachment();
         $this->sign = new Signn();
+        $this->concern = new MeasureConcerner();
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 's';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
@@ -136,6 +138,27 @@ class SProjectController extends DooController
 
     public function proSection()
     {
+        //删除标段
+        if(isset($_POST['secid']) && is_numeric($_POST['secid'])){
+            //删除标段关注人、审批人、期数、文件数据表、附件的内容,并更改签署表的状态为‘del’
+            if((isset($_POST['delsec']) && isset($_POST['text']) && trim($_POST['text']) == '删除标段') || isset($_POST['delsec2'])){
+
+                $mcresult = $this->concern->delMeasureConcernListbyPmid($_POST['secid']);
+
+                $maresult = $this->measureauditact->delMeasureAuditListbyPmid($_POST['secid']);
+
+                $attresult = $this->attfile->delAllTimesFile3($_POST['secid']);
+
+                $this->itemmeasurenum->delItembyPmid($_POST['secid']);
+
+                $muresult = $this->numofperact->delMeasureNumofperListbyPmid($_POST['secid']);
+
+                $signresult = $this->sign->updateSignStatusbyPmid($_POST['secid']);
+
+                $this->actmeasure->del($_POST['secid']);
+            }
+            return Doo::conf()->APP_URL . 'sproject/' . $this->params['pid'] . '/section';
+        }
         $this->data['currproArray'] = $this->data['allproArray'] = NULL;
         $proArray = $this->actmeasure->getGroupProject($this->auth->getUid());
         foreach ($proArray as $v) {
@@ -166,6 +189,8 @@ class SProjectController extends DooController
         // 标段
         // 搜索有没有相应的月份,有就把实际赋值,没有就为零
         $this->data['MeasureArray'] = $this->actmeasure->getRowsByPid($this->params['pid']);
+        $this->data['MyMeasureArray'] = array();
+        $i = 0;
         $totalstid = 0;
         $monthArray = [];
         foreach ($this->data['MeasureArray'] as $key => $value) {
@@ -227,6 +252,11 @@ class SProjectController extends DooController
             foreach ($month1 as $k => $v) {
                 $allmonth1[] = $v;
             }
+
+            if($value['uid'] == $this->auth->getUid()){
+                $this->data['MyMeasureArray'][$i] = $this->data['MeasureArray'][$key];
+                $i++;
+            }
         }
 
         // 中文表述年月
@@ -257,10 +287,10 @@ class SProjectController extends DooController
             }
         }
         foreach ($total as $value2) {
-            $total3[] = round(($value2 / $totalstid) * 100);
+            $total3[] = $totalstid != 0 ? round(($value2 / $totalstid) * 100) : 0;
         }
         foreach ($total1 as $value11) {
-            $total4[] = round(($value11 / $totalstid) * 100);
+            $total4[] = $totalstid != 0 ? round(($value11 / $totalstid) * 100) : 0;
         }
         $this->data['projectDate'] = implode(',', $cnymArray);
         $this->data['t1'] = implode(',', $total3);
@@ -305,7 +335,7 @@ class SProjectController extends DooController
         // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
-        $actmeasureArray = $this->actmeasure->getAll();
+        $actmeasureArray = $this->actmeasure->getRowUser($this->auth->getUid());
         foreach ($actmeasureArray as $kkkk => $vvvv) {
             if ($vvvv['stid'] == $measureArray['stid']) {
                 if (($vvvv['pmid'] == $this->params['pmid'])) {
@@ -476,7 +506,7 @@ class SProjectController extends DooController
 // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
-        $actmeasureArray = $this->actmeasure->getAll();
+        $actmeasureArray = $this->actmeasure->getRowUser($this->auth->getUid());
         foreach ($actmeasureArray as $kkkk => $vvvv) {
             if ($vvvv['stid'] == $measureArray['stid']) {
                 if (($vvvv['pmid'] == $this->params['pmid'])) {
@@ -597,7 +627,7 @@ class SProjectController extends DooController
 // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
-        $actmeasureArray = $this->actmeasure->getAll();
+        $actmeasureArray = $this->actmeasure->getRowUser($this->auth->getUid());
         foreach ($actmeasureArray as $kkkk => $vvvv) {
             if ($vvvv['stid'] == $measureArray['stid']) {
                 if (($vvvv['pmid'] == $this->params['pmid'])) {

+ 5 - 6
protected/controller/SignController.php

@@ -50,8 +50,7 @@ class SignController extends DooController
         $this->numofperact = new NumofperAct();
         $this->measureauditact = new MeasureauditAct();
         $this->sign = new Signn();
-        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
-//        $this->pdf = new FPDF('P','mm','A4');
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_ACCOUNT, DOO::conf()->SMS_PASSWORD, DOO::conf()->SMS_EXTNO);
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'sign';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
@@ -97,7 +96,7 @@ class SignController extends DooController
     public function index()
     {
         //获取我发起的签署数目
-        $this->data['mySignNum'] = $this->sign->getMySignNumbyUid($this->auth->getUid());
+        $this->data['mySignNum'] = $this->sign->getMySignNumbyUid($this->auth->getUid(),'status!="del"');
 
         //获取关于我的正在签署数目
         $this->data['doingSignNum'] = $this->sign->getDoingSignNumbyUid($this->auth->getUid());
@@ -349,7 +348,7 @@ class SignController extends DooController
     public function signMyList(){
         Doo::loadHelper('DooPager');
         $pagestr = '';
-        $sqlstr = ' 1';
+        $sqlstr = 'status!="del"';
         $this->data['project'] = '';
         $this->data['tender'] = '';
         $this->data['phaseno'] = '';
@@ -728,7 +727,7 @@ class SignController extends DooController
         $this->data['nosign'] = '';
 
         //获取项目信息
-        $searchsql = '(`isinter`=0 OR `isinter`=3) AND (`ownuid`='.$this->auth->getUid().' OR `audituid`='.$this->auth->getUid().' OR sid IN (SELECT sid FROM jl_sign_audit WHERE jl_sign_audit.audituid='.$this->auth->getUid().'))';
+        $searchsql = 'status!="del" AND (`isinter`=0 OR `isinter`=3) AND (`ownuid`='.$this->auth->getUid().' OR `audituid`='.$this->auth->getUid().' OR sid IN (SELECT sid FROM jl_sign_audit WHERE jl_sign_audit.audituid='.$this->auth->getUid().'))';
         $itemlist = $this->sign->getSignGroupByProject($searchsql);
         if(!empty($itemlist)){
             foreach($itemlist as $ik => $iv){
@@ -827,7 +826,7 @@ class SignController extends DooController
         $signmsg = $this->sign->getOneSignbysid($this->params['sid']);
 
         //获取标段审批人列表
-        $auditactlist = $this->measureauditact->getUserAuditLast($signmsg['tender'],$signmsg['phaseno']);
+        $auditactlist = $this->measureauditact->getUserAuditLast2($signmsg['tender'],$signmsg['phaseno']);
         $userlist = array();
         if(!empty($auditactlist)){
             foreach($auditactlist as $k => $v){

+ 1 - 1
protected/controller/UserController.php

@@ -55,7 +55,7 @@ class UserController extends DooController
         $this->numofperact = new NumofperAct();
         $this->user = new User();
         $this->ph = new PasswordHash(8, FALSE);
-        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_ACCOUNT, DOO::conf()->SMS_PASSWORD, DOO::conf()->SMS_EXTNO);
         $this->aconfig = new AConfig();
         $this->measureauditact = new MeasureauditAct();
         $this->sign = new signn();

File diff suppressed because it is too large
+ 33 - 8
protected/module/admin/controller/ProController.php


+ 0 - 17
protected/module/admin/controller/ServiceController.php

@@ -62,23 +62,6 @@ class ServiceController extends DooController
         $soap->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '');
     }
 
-    public function testSoap(){
-        ini_set("soap.wsdl_cache_enabled", "0");
-        $client=new soapclient(Doo::conf()->APP_URL . '/service/user');
-        var_dump($client);
-        exit;
-        $client->soap_defencoding = 'UTF-8';
-        $paras=array('username' => "测试soap",'realname' => "测试soap");
-        $result=$client->call("addUser",$paras);
-        if (!$err=$client->getError()) {
-            echo "返回结果:",$result;
-        } else {
-            echo "调用出错:",$err;
-        }
-
-//        $server->handle();
-    }
-
     function addUser($username, $realname)
     {
         if (isset($username) && isset($realname)) {

+ 5 - 0
protected/module/admin/model/ameasure.php

@@ -53,6 +53,11 @@ class Ameasure extends DooModel
         return $this->delete(array('where' => 'pmid=?', 'param' => array($pmid)));
     }
 
+    public function getOneRow($pmid)
+    {
+        return $this->getOne(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
+    }
+
 }
 
 ?>

+ 0 - 1
protected/module/admin/view/admin-editUser.html

@@ -97,7 +97,6 @@
                                 <h4 class="modal-title">更新电子签名</h4>
                             </div>
                             <div class="modal-body">
-
                                 <div class="form">
                                     <form class="form-horizontal">
                                         <div class="form-group">

+ 1 - 1
protected/view/edit-app.html

@@ -28,7 +28,7 @@
 				<legend>下载APP</legend>
 				<div class="app-code-item clearfix">
 					<h1>扫码下载APP</h1>
-					<div class="code-img"><img src="{{rootUrl}}global/images/android-code.png"></div>
+					<div class="code-img"><img src="http://vc.6jlzf.cn/global/QRCode.png" width="154px"></div>
 					<br>
 					<h1>APP扫码快捷登录</h1>
 					<div class="code-img"><a class="btn btn-link" data-toggle="modal" href="#app-help"><span class="glyphicon glyphicon-question-sign"></span> 如何快捷登录</a><br><img src="{{rootUrl}}{{qrcode}}"></div>

+ 3 - 0
protected/view/edit-profile-sms.html

@@ -85,6 +85,9 @@
                             <label class="checkbox-inline">
                                 <input type="checkbox" checked value="option1" disabled> 标段审批不通过(上报人接收)
                             </label>
+                            <label class="checkbox-inline">
+                                <input type="checkbox" checked value="option1" disabled> 标段审批退回(上一审批人)
+                            </label>
                         </div>
                     </div>
                     <!--正常使用-->

+ 2 - 2
protected/view/r-project-section.html

@@ -48,8 +48,8 @@
 					<td width="60">完成进度:</td>
 					<td>
 					    <div class="progress">
-						<div class="progress-bar progress-bar-success" style="width:{{conArray' value.phetongTotal}};" data-placement="bottom" data-toggle="tooltip" data-original-title="累计完成:¥{{conArray' value.nhetongTotal}}">{{conArray' value.phetongTotal}}</div>
-						<div class="progress-bar progress-bar-danger" style="width:{{conArray' value.phetongTotal2}};" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥{{conArray' value.ncurrdoneInt}}">{{conArray' value.phetongTotal2}}</div>
+						<div class="progress-bar progress-bar-success" style="width:<!-- if tofloat({{conArray' value.phetongTotal}}) >= 100 -->100%<!-- else -->{{conArray' value.phetongTotal}}<!-- endif -->;" data-placement="bottom" data-toggle="tooltip" data-original-title="累计完成:¥{{conArray' value.nhetongTotal}}">{{conArray' value.phetongTotal}}</div>
+						<div class="progress-bar progress-bar-danger" style="width:<!-- if tofloat({{conArray' value.phetongTotal2}}) >= 100 -->100%<!-- else -->{{conArray' value.phetongTotal2}}<!-- endif -->;" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥{{conArray' value.ncurrdoneInt}}">{{conArray' value.phetongTotal2}}</div>
 					    </div>
 					</td>
 				    </tr>

+ 1 - 1
protected/view/r-project.html

@@ -43,7 +43,7 @@
 				<div class="title fL"><h5><a href="{{rootUrl}}rproject/{{proArray' value.pid}}/section">{{proArray' value.pname}}</a></h5>{{formatDate(proArray' value.intime,'Y-m-d')}}</div>
 				<div class="detail fR"><p data-original-title="总价:¥{{proArray' value.bcontracttotal}} 变更:+¥{{proArray' value.bchangTotal}}" data-placement="bottom" data-toggle="tooltip">总价:¥{{proArray' value.bcontracttotal}}元 (<span class="colRed">+¥{{proArray' value.bchangTotal}}</span>)</p>
 				    <div class="progress">
-					<div class="progress-bar progress-bar-success" style="width: {{proArray' value.pcurrdone}};">{{proArray' value.pcurrdone}}</div>
+					<div class="progress-bar progress-bar-success" style="width: <!-- if tofloat({{proArray' value.pcurrdone}}) >= 100 -->100%<!-- else -->{{proArray' value.pcurrdone}}<!-- endif -->;">{{proArray' value.pcurrdone}}</div>
 				    </div>
 				</div>
 				<!-- if {{proArray' value.numofchecking}} > 0 --><div class="detail2 fR"><p style="margin:0 0 5px 0" class="colOrange">有 <b>{{proArray' value.numofchecking}}</b> 个标段需要审批</p></div><!-- endif -->

File diff suppressed because it is too large
+ 84 - 5
protected/view/s-project-section.html


+ 1 - 1
protected/view/s-project.html

@@ -45,7 +45,7 @@
 				<div class="title fL"><h5><a href="{{rootUrl}}sproject/{{conArray' value.pid}}/section">{{conArray' value.pname}}</a>({{conArray' value.countTotalMeasureInt}}个标段)</h5>{{formatDate(conArray' value.intime,'Y-m-d')}}</div>
 				<div class="detail fR"><p data-original-title="总价:¥{{pros' value.bcontracttotal}} 变更:+¥{{pros' value.bchangTotal}}" data-placement="bottom" data-toggle="tooltip">总价:¥{{conArray' value.bcontracttotal}}元 (<span class="colRed">+¥{{conArray' value.bchangTotal}}</span>)</p>
 				    <div class="progress">
-					<div class="progress-bar progress-bar-success" style="width: {{conArray' value.pcurrdone}};">{{conArray' value.pcurrdone}}</div>
+					<div class="progress-bar progress-bar-success" style="width: <!-- if tofloat({{conArray' value.pcurrdone}}) >= 100 -->100%<!-- else -->{{conArray' value.pcurrdone}}<!-- endif -->;">{{conArray' value.pcurrdone}}</div>
 				    </div></div>
 				<div class="detail2 fR"><p>业主单位:{{conArray' value.company}}</p><p>我的标段:{{conArray' value.countmeasure}}</p></div>
 			    </div>

+ 1 - 1
protected/view/sign-view-page.html

@@ -7,7 +7,7 @@
     <meta name=copyright content=smartcost.com.cn>
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
-    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css?20170828>
     <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
     <script src={{rootUrl}}global/js/bootstrap.js></script>
     <script src={{rootUrl}}global/js/jl.js></script>

+ 1 - 1
protected/view/sign-view-set_signer.html

@@ -7,7 +7,7 @@
     <meta name=copyright content=smartcost.com.cn>
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
-    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css?20170828>
     <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
     <script src={{rootUrl}}global/js/bootstrap.js></script>
     <script src={{rootUrl}}global/js/jl.js></script>

+ 0 - 1
protected/view/sign-view-signer_sign.html

@@ -66,7 +66,6 @@
                         <!-- loop attlist -->
                         <div class="page" id="pageContainer{{attlist' value.curnum}}" style="background: url('{{rootUrl}}{{attlist' value.filepath}}') no-repeat 0 0;background-size:cover;padding:10px">
                             <img src="{{rootUrl}}{{attlist' value.filepath}}" style="display: none">
-                            <!--<img src="{{rootUrl}}{{attlist' value.filepath}}">-->
                             <!-- if !empty({{attlist' value.auditatt}}) -->
                             <!-- loop attlist' value.auditatt -->
                             <div class="user-sign" style="z-index:10;{{attlist' auditatt' value.position}}">

File diff suppressed because it is too large
+ 2 - 2
protected/view/w-project.html