|
@@ -620,7 +620,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
AllowanceProjectEnum::PROJECT_SB_MEDICA,
|
|
|
//AllowanceProjectEnum::PROJECT_WORKDAY
|
|
|
]) ? 1 : 2;
|
|
|
- } else if ($info["checkState"] == 10) {
|
|
|
+ } else if ($info["checkState"] == 10 || $info["checkState"] == 8) {
|
|
|
$projects = explode(",", $info["projects"]);
|
|
|
if (in_array($project["id"], $projects)) {
|
|
|
$project["isEdit"] = 1;
|
|
@@ -769,7 +769,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
$response->msg = $batch["msg"];
|
|
|
return $response;
|
|
|
}
|
|
|
- if ($old["checkState"] != 1 && $old["checkState"] != 10) {
|
|
|
+ if ($old["checkState"] != 1 && $old["checkState"] != 10 && $old["checkState"] != 8) {
|
|
|
$response->msg = "不能重复提交审核";
|
|
|
return $response;
|
|
|
}
|
|
@@ -866,8 +866,10 @@ class TalentAllowance extends EnterpriseController {
|
|
|
$data["checkMsg"] = "";
|
|
|
$data["checkState"] = AllowanceStateEnum::NEED_CHECK;
|
|
|
$ep = \app\common\api\EnterpriseApi::getOne($this->user["uid"]);
|
|
|
+ $afterState = 7; //待初审
|
|
|
if ($ep->isGeneral == 2 && \app\common\api\Nhc::hasGeneralHospital($ep->medicalCommunityId)) {
|
|
|
$data["checkState"] = AllowanceStateEnum::NEED_GENERAL_CHECK; //分院并且有总院
|
|
|
+ $afterState = 3; //待审核
|
|
|
}
|
|
|
$data["files"] = "";
|
|
|
$data["projects"] = "";
|
|
@@ -889,7 +891,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
'active' => 1,
|
|
|
'state' => 1,
|
|
|
'step' => 0,
|
|
|
- 'stateChange' => sprintf("%s->%s", MainState::getStateDesc(1), MainState::getStateDesc(7)),
|
|
|
+ 'stateChange' => sprintf("%s->%s", MainState::getStateDesc(1), MainState::getStateDesc($afterState)),
|
|
|
'description' => "确认提交审核",
|
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
@@ -1255,29 +1257,29 @@ class TalentAllowance extends EnterpriseController {
|
|
|
if (!$oldObj) {
|
|
|
return new Response(Response::ERROR, "审核对象不存在");
|
|
|
}
|
|
|
+ $ep = \app\common\api\EnterpriseApi::getOne($oldObj["enterpriseId"]);
|
|
|
+ if (!$this->checkExaminePriv($ep->isGeneral, $ep->medicalCommunityId)) {
|
|
|
+ return new Response(Response::ERROR, "不在审核范围内");
|
|
|
+ }
|
|
|
+ if ($oldObj["checkState"] != AllowanceStateEnum::NEED_GENERAL_CHECK && $oldObj["checkState"] != AllowanceStateEnum::FIRST_REJECT) {
|
|
|
+ return new Response(Response::ERROR, "不在审核范围内");
|
|
|
+ }
|
|
|
|
|
|
$newObj = [];
|
|
|
$newObj["id"] = $obj["id"];
|
|
|
$projectList = [];
|
|
|
$fileList = [];
|
|
|
- if ($obj["process"] == 1) {
|
|
|
- if (\StrUtil::isNotEmpAndNull($obj["projects"])) {
|
|
|
- $projectList = array_filter(explode(",", $obj["projects"]));
|
|
|
- $newObj["projects"] = implode(",", $projectList);
|
|
|
- }
|
|
|
- if (\StrUtil::isNotEmpAndNull($obj["files"])) {
|
|
|
- $fileList = array_filter(explode(",", $obj["files"]));
|
|
|
- $newObj["files"] = implode(",", $fileList);
|
|
|
- }
|
|
|
- //if (Const.RSJ.equals(checkCompany.getCode())) {
|
|
|
- $newObj["concats"] = $obj["concats"];
|
|
|
- $newObj["fields"] = $obj["fields"];
|
|
|
- //}
|
|
|
+ if (\StrUtil::isNotEmpAndNull($obj["projects"])) {
|
|
|
+ $projectList = array_filter(explode(",", $obj["projects"]));
|
|
|
+ $newObj["projects"] = implode(",", $projectList);
|
|
|
}
|
|
|
- if ($obj["process"] == 3) {
|
|
|
- $newObj["toProcess"] = $obj["toProcess"];
|
|
|
- $newObj["toDep"] = $obj["toDep"];
|
|
|
+ if (\StrUtil::isNotEmpAndNull($obj["files"])) {
|
|
|
+ $fileList = array_filter(explode(",", $obj["files"]));
|
|
|
+ $newObj["files"] = implode(",", $fileList);
|
|
|
}
|
|
|
+ $newObj["concats"] = $obj["concats"];
|
|
|
+ $newObj["fields"] = $obj["fields"];
|
|
|
+ //}
|
|
|
TaModel::update($newObj);
|
|
|
//添加日志
|
|
|
TalentChecklog::create([
|
|
@@ -1287,7 +1289,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
'typeFileId' => null,
|
|
|
'active' => 2,
|
|
|
'state' => $obj["checkState"],
|
|
|
- 'step' => $obj["process"],
|
|
|
+ 'step' => -2,
|
|
|
'stateChange' => null,
|
|
|
'description' => $obj["checkMsg"],
|
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
@@ -1302,16 +1304,23 @@ class TalentAllowance extends EnterpriseController {
|
|
|
*/
|
|
|
public function submitCheck() {
|
|
|
$id = $this->request["id"];
|
|
|
- $process = $this->request["process"];
|
|
|
+ $process = -2;
|
|
|
$old = TalentAllowanceApi::getInfoById($id);
|
|
|
if (!$old) {
|
|
|
return new Response(Response::ERROR, "审核对象不存在");
|
|
|
}
|
|
|
+ $ep = \app\common\api\EnterpriseApi::getOne($old["enterpriseId"]);
|
|
|
+ if (!$this->checkExaminePriv($ep->isGeneral, $ep->medicalCommunityId)) {
|
|
|
+ return new Response(Response::ERROR, "不在审核范围内");
|
|
|
+ }
|
|
|
+ if ($old["checkState"] != AllowanceStateEnum::NEED_GENERAL_CHECK && $old["checkState"] != AllowanceStateEnum::FIRST_REJECT) {
|
|
|
+ return new Response(Response::ERROR, "不在审核范围内");
|
|
|
+ }
|
|
|
$updCheck = [];
|
|
|
$updCheck["id"] = $id;
|
|
|
$updCheck["type"] = $old["type"];
|
|
|
/* * 查询审核日志 */
|
|
|
- $log = TalentLogApi::getLastLogByStep($id, ProjectState::JBT, $process);
|
|
|
+ $log = \app\common\api\TalentLogApi::getLastLogByStep($id, ProjectState::JBT, $process);
|
|
|
if (!$log) {
|
|
|
return new Response(Response::ERROR, "请先审核后再提交");
|
|
|
}
|
|
@@ -1321,18 +1330,15 @@ class TalentAllowance extends EnterpriseController {
|
|
|
|
|
|
switch ($log["state"]) {
|
|
|
case 3:
|
|
|
- $updCheck["firstPassTime"] = $old["firstPassTime"];
|
|
|
- if (!$old["firstPassTime"]) {
|
|
|
- $updCheck["firstPassTime"] = date("Y-m-d H:i:s");
|
|
|
- }
|
|
|
- if (!$old["visitPassTime"]) {
|
|
|
- $updCheck["visitPassTime"] = date("Y-m-d H:i:s");
|
|
|
+ $updCheck["precheckPassTime"] = $old["precheckPassTime"];
|
|
|
+ if (!$old["precheckPassTime"]) {
|
|
|
+ $updCheck["precheckPassTime"] = date("Y-m-d H:i:s");
|
|
|
}
|
|
|
$updCheck["submitTime"] = date("Y-m-d H:i:s");
|
|
|
- $updCheck["checkState"] = AllowanceStateEnum::NEED_REVIEW;
|
|
|
+ $updCheck["checkState"] = AllowanceStateEnum::NEED_CHECK;
|
|
|
break;
|
|
|
case 2:
|
|
|
- $updCheck["checkState"] = AllowanceStateEnum::FIRST_REJECT;
|
|
|
+ $updCheck["checkState"] = AllowanceStateEnum::GENERAL_REJECT;
|
|
|
break;
|
|
|
case -1:
|
|
|
$updCheck["checkState"] = AllowanceStateEnum::NOTPASS;
|
|
@@ -1385,9 +1391,13 @@ class TalentAllowance extends EnterpriseController {
|
|
|
if (!$info) {
|
|
|
return new Response(Response::ERROR, "校验不通过,无法操作");
|
|
|
}
|
|
|
+ $ep = \app\common\api\EnterpriseApi::getOne($info["enterpriseId"]);
|
|
|
+ if (!$this->checkExaminePriv($ep->isGeneral, $ep->medicalCommunityId)) {
|
|
|
+ return new Response(Response::ERROR, "不在审核范围内");
|
|
|
+ }
|
|
|
$where = [];
|
|
|
$where[] = ["mainId", "=", $info["id"]];
|
|
|
- $where[] = ["step", "=", 1];
|
|
|
+ $where[] = ["step", "=", -2];
|
|
|
$where[] = ["active", "=", 2];
|
|
|
|
|
|
$log = null;
|
|
@@ -1448,8 +1458,8 @@ class TalentAllowance extends EnterpriseController {
|
|
|
if (!$info) {
|
|
|
return new Response(Response::ERROR, "系统错误,请联系管理员");
|
|
|
}
|
|
|
- if ($info["checkState"] != AllowanceStateEnum::FIRST_REJECT) {
|
|
|
- return new Response(Response::ERROR, "只能修改初审驳回的数据");
|
|
|
+ if ($info["checkState"] != AllowanceStateEnum::GENERAL_REJECT) {
|
|
|
+ return new Response(Response::ERROR, "只能修改总院驳回的数据");
|
|
|
}
|
|
|
$res = [];
|
|
|
$enterpriseMap = \app\common\model\Enterprise::where("type", $this->user["type"])->column("name", "id");
|
|
@@ -1488,10 +1498,28 @@ class TalentAllowance extends EnterpriseController {
|
|
|
if (!$data["id"]) {
|
|
|
return new Response(Response::ERROR, "系统错误,请联系管理员");
|
|
|
}
|
|
|
+ $old = TalentAllowanceApi::getInfoById($data["id"]);
|
|
|
+ if (!$old) {
|
|
|
+ return new Response(Response::ERROR, "审核对象不存在");
|
|
|
+ }
|
|
|
+ $ep = \app\common\api\EnterpriseApi::getOne($old["enterpriseId"]);
|
|
|
+ if (!$this->checkExaminePriv($ep->isGeneral, $ep->medicalCommunityId)) {
|
|
|
+ return new Response(Response::ERROR, "不在审核范围内");
|
|
|
+ }
|
|
|
+ if ($old["checkState"] != AllowanceStateEnum::GENERAL_REJECT) {
|
|
|
+ return new Response(Response::ERROR, "只能修改总院驳回的数据");
|
|
|
+ }
|
|
|
TaModel::update($data);
|
|
|
return new Response(Response::SUCCESS, "修改成功");
|
|
|
}
|
|
|
|
|
|
+ private function checkExaminePriv($isGeneral, $medicalCommunityId) {
|
|
|
+ if ($this->user["medicalCommunityId"] == $medicalCommunityId && $this->user["isGeneral"] == 1 && $isGeneral == 2) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
private function getCheckStateName($checkState, $publicState, $allowanceType) {
|
|
|
switch ($checkState) {
|
|
|
case 1:
|