|
@@ -15,6 +15,8 @@ Doo::loadClass('measureauditact');
|
|
Doo::loadClass('itemfile');
|
|
Doo::loadClass('itemfile');
|
|
Doo::loadModel('users');
|
|
Doo::loadModel('users');
|
|
Doo::loadClass('itemmeasurenum');
|
|
Doo::loadClass('itemmeasurenum');
|
|
|
|
+Doo::loadModelAt('aconfig', 'admin');
|
|
|
|
+Doo::loadClass('sms');
|
|
|
|
|
|
/**
|
|
/**
|
|
* MainController
|
|
* MainController
|
|
@@ -25,7 +27,7 @@ Doo::loadClass('itemmeasurenum');
|
|
class ClientController extends DooController
|
|
class ClientController extends DooController
|
|
{
|
|
{
|
|
|
|
|
|
- private $data, $client, $auth, $att, $file, $zip, $actmeasure, $contractact, $project, $profile, $numofperact, $measureauditact, $attfile, $users, $itemfile, $itemMeasureNum;
|
|
|
|
|
|
+ private $data, $client, $auth, $att, $file, $zip, $actmeasure, $contractact, $project, $profile, $numofperact, $measureauditact, $attfile, $users, $itemfile, $aconfig, $sms, $itemfile, $itemMeasureNum;
|
|
private $statusArray = array('uncheck' => '1', 'checking' => '2', 'checked' => '3', 'checkno' => '4');
|
|
private $statusArray = array('uncheck' => '1', 'checking' => '2', 'checked' => '3', 'checkno' => '4');
|
|
private $fileTypeArray = array('台帐附件');
|
|
private $fileTypeArray = array('台帐附件');
|
|
|
|
|
|
@@ -46,6 +48,8 @@ class ClientController extends DooController
|
|
$this->users = new Users();
|
|
$this->users = new Users();
|
|
$this->itemfile = new ItemFile();
|
|
$this->itemfile = new ItemFile();
|
|
$this->itemMeasureNum = new ItemMeasureNumpofper();
|
|
$this->itemMeasureNum = new ItemMeasureNumpofper();
|
|
|
|
+ $this->aconfig = new AConfig();
|
|
|
|
+ $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
|
|
}
|
|
}
|
|
|
|
|
|
public function ClientSignin()
|
|
public function ClientSignin()
|
|
@@ -742,25 +746,32 @@ class ClientController extends DooController
|
|
if ($this->measureauditact->setStatusTo($auditArray['maid'], 3, $auditcontent)) {
|
|
if ($this->measureauditact->setStatusTo($auditArray['maid'], 3, $auditcontent)) {
|
|
// 更新下一个人的状态
|
|
// 更新下一个人的状态
|
|
$countAudit = count($auditUserArray);
|
|
$countAudit = count($auditUserArray);
|
|
- if ($auditArray['last'] == '1') {
|
|
|
|
|
|
+ if ($auditArray['last'] == '1') {// 根据标志位判断是否为最后一个审核人{ 判断当前审核人是什么角色 } 利用post发送的UID 与 当前期数参与的所有人比较
|
|
$this->measureauditact->setStatusTo($auditUserArray[0]['maid'], 3);
|
|
$this->measureauditact->setStatusTo($auditUserArray[0]['maid'], 3);
|
|
$this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checked', $iniTimes);
|
|
$this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checked', $iniTimes);
|
|
echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
die();
|
|
die();
|
|
- } else {
|
|
|
|
- if (($countAudit == 2) && ($auditUserArray[0]['last'] == 1) && ($auditUserArray[1]['maid'] == $auditArray['maid'])) {
|
|
|
|
|
|
+ } else {// 不是最后一个审核人根据不同审核人数量变更状态 {当前用户不是最后一个审核人}
|
|
|
|
+ if (($countAudit == 2) && ($auditUserArray[0]['last'] == 1) && ($auditUserArray[1]['maid'] == $auditArray['maid'])) {// 如果审核人为两个,第一个是最后审核人角色,第二个为当前审核人,设置审核中状态 {就是当前用户POST UID}
|
|
$this->measureauditact->updateMastatus($auditUserArray[0]['maid']);
|
|
$this->measureauditact->updateMastatus($auditUserArray[0]['maid']);
|
|
$this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checking', $iniTimes);
|
|
$this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checking', $iniTimes);
|
|
echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
die();
|
|
die();
|
|
}
|
|
}
|
|
- if (($countAudit > 2)) {
|
|
|
|
|
|
+ if (($countAudit > 2)) {// 审核人总数大于2时,
|
|
foreach ($auditUserArray as $k => $v) {
|
|
foreach ($auditUserArray as $k => $v) {
|
|
- if ($v['maid'] == $auditArray['maid']) {
|
|
|
|
|
|
+ if ($v['maid'] == $auditArray['maid']) {// 找到当前用户
|
|
if ($k == ($countAudit - 1)) {//如果是最后一个
|
|
if ($k == ($countAudit - 1)) {//如果是最后一个
|
|
$this->measureauditact->updateMastatus($auditUserArray[0]['maid']);
|
|
$this->measureauditact->updateMastatus($auditUserArray[0]['maid']);
|
|
} else {
|
|
} else {
|
|
- $this->measureauditact->updateMastatus($auditUserArray[$k + 1]['maid']);
|
|
|
|
|
|
+ $this->measureauditact->updateMastatus($auditUserArray[$k + 1]['maid']);//变更下一个状态
|
|
|
|
+ // SMS Start
|
|
|
|
+ $verifyUserArray = $this->profile->getVerifiedMobile($auditUserArray[$k + 1]['auditoruid']);
|
|
|
|
+ $pmnameArray = $this->actmeasure->getRowByPmid($auditUserArray[$k + 1]['pmid']);
|
|
|
|
+ if (isset($verifyUserArray) && ($verifyUserArray['mobile'])) {
|
|
|
|
+ $this->__auditNotice($verifyUserArray['mobile'], $pmnameArray["pmname"] . ',' . $verifyUserArray["name"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR"]);
|
|
|
|
+ }
|
|
|
|
+ // SMS End
|
|
}
|
|
}
|
|
$this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checking', $iniTimes);
|
|
$this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checking', $iniTimes);
|
|
echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
@@ -799,7 +810,7 @@ class ClientController extends DooController
|
|
$MeasureArray = $this->actmeasure->getRowByPmid($this->params['tenderid']);
|
|
$MeasureArray = $this->actmeasure->getRowByPmid($this->params['tenderid']);
|
|
if (isset($updateArray['filepath'])) {
|
|
if (isset($updateArray['filepath'])) {
|
|
$pathinfo = pathinfo($updateArray['filepath']);
|
|
$pathinfo = pathinfo($updateArray['filepath']);
|
|
- $downfileurl[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . '/' . $pathinfo ['filename'] . '/ProjectFile.rmf', 'MD5_Jl' => $updateArray['filehashcode'], 'proName' => $projectArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $projectArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
|
|
|
|
|
|
+ $downfileurl[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . ' / ' . $pathinfo ['filename'] . ' / ProjectFile . rmf', 'MD5_Jl' => $updateArray['filehashcode'], 'proName' => $projectArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $projectArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
|
|
echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downfileurl), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downfileurl), JSON_UNESCAPED_UNICODE);
|
|
die();
|
|
die();
|
|
} else {
|
|
} else {
|
|
@@ -860,7 +871,7 @@ class ClientController extends DooController
|
|
$attfileArray = $this->attfile->getLastData($value['stid']);
|
|
$attfileArray = $this->attfile->getLastData($value['stid']);
|
|
foreach ($attfileArray as $k => $v) {
|
|
foreach ($attfileArray as $k => $v) {
|
|
$pathinfo = pathinfo($v['filepath']);
|
|
$pathinfo = pathinfo($v['filepath']);
|
|
- $retArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . '/' . $pathinfo ['filename'] . '/ProjectFile.rmf', 'proName' => $proArray['pname'], 'stName' => $value['stname'], 'MD5_Jl' => $v['filehashcode']);
|
|
|
|
|
|
+ $retArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . ' / ' . $pathinfo ['filename'] . ' / ProjectFile . rmf', 'proName' => $proArray['pname'], 'stName' => $value['stname'], 'MD5_Jl' => $v['filehashcode']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $retArray), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $retArray), JSON_UNESCAPED_UNICODE);
|
|
@@ -874,7 +885,7 @@ class ClientController extends DooController
|
|
$attfileArray = $this->contractact->getRowByStid($attArray['stid']);
|
|
$attfileArray = $this->contractact->getRowByStid($attArray['stid']);
|
|
$pathinfo = pathinfo($attArray['filepath']);
|
|
$pathinfo = pathinfo($attArray['filepath']);
|
|
if (isset($pathinfo['dirname']))
|
|
if (isset($pathinfo['dirname']))
|
|
- $newattArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . '/' . $pathinfo ['filename'] . '/ProjectFile.rmf', 'proName' => $proArray['pname'], 'stName' => $attfileArray['stname'], 'MD5_Jl' => $attArray['filehashcode']);
|
|
|
|
|
|
+ $newattArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . ' / ' . $pathinfo ['filename'] . ' / ProjectFile . rmf', 'proName' => $proArray['pname'], 'stName' => $attfileArray['stname'], 'MD5_Jl' => $attArray['filehashcode']);
|
|
}
|
|
}
|
|
echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $newattArray), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $newattArray), JSON_UNESCAPED_UNICODE);
|
|
die();
|
|
die();
|
|
@@ -895,7 +906,7 @@ class ClientController extends DooController
|
|
function setCheckno()
|
|
function setCheckno()
|
|
{
|
|
{
|
|
if (isset($this->params['userid']) && isset($this->params['tenderid']) && isset($this->params['phaseno']) && isset($_POST['MD5_JL']) && isset($_POST['MD5_Zip'])) {
|
|
if (isset($this->params['userid']) && isset($this->params['tenderid']) && isset($this->params['phaseno']) && isset($_POST['MD5_JL']) && isset($_POST['MD5_Zip'])) {
|
|
- $auditcontent = iconv('GBK', 'UTF-8', $_POST['CheckerMemo']);
|
|
|
|
|
|
+ $auditcontent = iconv('GBK', 'UTF - 8', $_POST['CheckerMemo']);
|
|
$auditArrayStatus = $this->measureauditact->getLastNewRowInfo($this->params['tenderid'], $this->params['phaseno'], $this->params['userid']);
|
|
$auditArrayStatus = $this->measureauditact->getLastNewRowInfo($this->params['tenderid'], $this->params['phaseno'], $this->params['userid']);
|
|
if (isset($auditArrayStatus ['mastatus']) && (($auditArrayStatus ['mastatus'] == 'checked') || ($auditArrayStatus ['mastatus'] == 'checkno'))) {
|
|
if (isset($auditArrayStatus ['mastatus']) && (($auditArrayStatus ['mastatus'] == 'checked') || ($auditArrayStatus ['mastatus'] == 'checkno'))) {
|
|
echo json_encode(array('status' => FALSE, 'msg' => '该标段已审批完毕。'), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => FALSE, 'msg' => '该标段已审批完毕。'), JSON_UNESCAPED_UNICODE);
|
|
@@ -921,7 +932,7 @@ class ClientController extends DooController
|
|
}
|
|
}
|
|
$res = $this->zip->open(Doo::conf()->SITE_PATH . $fp[0]['filepath']);
|
|
$res = $this->zip->open(Doo::conf()->SITE_PATH . $fp[0]['filepath']);
|
|
$extPath = pathinfo($fp[0]['filepath']);
|
|
$extPath = pathinfo($fp[0]['filepath']);
|
|
- $extPathdir = Doo::conf()->SITE_PATH . $extPath ['dirname'] . '/' . $extPath['filename'];
|
|
|
|
|
|
+ $extPathdir = Doo::conf()->SITE_PATH . $extPath ['dirname'] . ' / ' . $extPath['filename'];
|
|
if ($res === TRUE) {
|
|
if ($res === TRUE) {
|
|
if (!$this->dir_create($extPathdir)) {
|
|
if (!$this->dir_create($extPathdir)) {
|
|
return FALSE;
|
|
return FALSE;
|
|
@@ -958,7 +969,7 @@ class ClientController extends DooController
|
|
{
|
|
{
|
|
// 插入上次期数相关审批人员
|
|
// 插入上次期数相关审批人员
|
|
// TODO:
|
|
// TODO:
|
|
-// error_log(var_export($this->params, TRUE), 3, '/opt/html/jiliang_customedProduct/data/' . time());
|
|
|
|
|
|
+// error_log(var_export($this->params, TRUE), 3, ' / opt / html / jiliang_customedProduct / data / ' . time());
|
|
// die;
|
|
// die;
|
|
if (isset($this->params['tenderid']) && isset($this->params['phaseno'])) {
|
|
if (isset($this->params['tenderid']) && isset($this->params['phaseno'])) {
|
|
$auditArray = $this->numofperact->getChecknoRow($this->params['tenderid'], $this->params['phaseno']);
|
|
$auditArray = $this->numofperact->getChecknoRow($this->params['tenderid'], $this->params['phaseno']);
|
|
@@ -986,7 +997,7 @@ class ClientController extends DooController
|
|
// $downArray = NULL;
|
|
// $downArray = NULL;
|
|
// $pathinfo = pathinfo($urlinfoArray['filepath']);
|
|
// $pathinfo = pathinfo($urlinfoArray['filepath']);
|
|
// if (isset($pathinfo['dirname']))
|
|
// if (isset($pathinfo['dirname']))
|
|
-// $downArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '/ProjectFile.rmf', 'MD5_Jl' => $urlinfoArray['filehashcode'], 'proName' => $proArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $proArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
|
|
|
|
|
|
+// $downArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo['dirname'] . ' / ' . $pathinfo['filename'] . ' / ProjectFile . rmf', 'MD5_Jl' => $urlinfoArray['filehashcode'], 'proName' => $proArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $proArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
|
|
// echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downArray), JSON_UNESCAPED_UNICODE);
|
|
// echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downArray), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
die();
|
|
die();
|
|
@@ -1017,7 +1028,7 @@ class ClientController extends DooController
|
|
$downArray = NULL;
|
|
$downArray = NULL;
|
|
$pathinfo = pathinfo($urlinfoArray['filepath']);
|
|
$pathinfo = pathinfo($urlinfoArray['filepath']);
|
|
if (isset($pathinfo['dirname'])) {
|
|
if (isset($pathinfo['dirname'])) {
|
|
- $downArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '/ProjectFile.rmf', 'MD5_Jl' => $urlinfoArray['filehashcode'], 'proName' => $proArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $proArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
|
|
|
|
|
|
+ $downArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo['dirname'] . ' / ' . $pathinfo['filename'] . ' / ProjectFile . rmf', 'MD5_Jl' => $urlinfoArray['filehashcode'], 'proName' => $proArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $proArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
|
|
echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downArray), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downArray), JSON_UNESCAPED_UNICODE);
|
|
die();
|
|
die();
|
|
} else {
|
|
} else {
|
|
@@ -1056,7 +1067,7 @@ class ClientController extends DooController
|
|
public function updateTenderName()
|
|
public function updateTenderName()
|
|
{
|
|
{
|
|
if (isset($this->params['BidID']) && isset($this->params['BidNewName'])) {
|
|
if (isset($this->params['BidID']) && isset($this->params['BidNewName'])) {
|
|
- if ($this->actmeasure->updateName($this->params['BidID'], iconv('GBK', 'UTF-8', $this->params['BidNewName']))) {
|
|
|
|
|
|
+ if ($this->actmeasure->updateName($this->params['BidID'], iconv('GBK', 'UTF - 8', $this->params['BidNewName']))) {
|
|
echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
|
|
die();
|
|
die();
|
|
} else {
|
|
} else {
|
|
@@ -1231,6 +1242,18 @@ class ClientController extends DooController
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 。
|
|
|
|
+ * 标段ID,期号
|
|
|
|
+ */
|
|
|
|
+ private function __auditNotice($mobile, $text)
|
|
|
|
+ {
|
|
|
|
+ $smsSwitch = $this->aconfig->getOne(array('select' => 'smsSwitch', 'asArray' => TRUE))['smsSwitch'];
|
|
|
|
+ if ($smsSwitch > 0)
|
|
|
|
+ return $this->sms->sendSms($mobile, $text);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
function upfile($fildname, $param = 'doc, docx, xls, xlsx, png, zip')
|
|
function upfile($fildname, $param = 'doc, docx, xls, xlsx, png, zip')
|
|
{
|
|
{
|
|
return $this->att->uploadMut($fildname, $param);
|
|
return $this->att->uploadMut($fildname, $param);
|
|
@@ -1328,9 +1351,9 @@ class ClientController extends DooController
|
|
|
|
|
|
function dir_path($path)
|
|
function dir_path($path)
|
|
{
|
|
{
|
|
- $path = str_replace('\\', '/', $path);
|
|
|
|
- if (substr($path, -1) != '/')
|
|
|
|
- $path = $path . '/';
|
|
|
|
|
|
+ $path = str_replace('\\', ' / ', $path);
|
|
|
|
+ if (substr($path, -1) != ' / ')
|
|
|
|
+ $path = $path . ' / ';
|
|
return $path;
|
|
return $path;
|
|
}
|
|
}
|
|
|
|
|