|
@@ -55,7 +55,23 @@ class Worker {
|
|
|
$whr[] = ["card_number", "=", $talent_info["idCard"]];
|
|
|
$whr[] = ["apply_year", "=", $talent_info["year"]];
|
|
|
$whr[] = ["checkState", ">=", 0];
|
|
|
- if (Db::table("new_talent_info")->where($whr)->find()) {
|
|
|
+ if ($ti = Db::table("new_talent_info")->where($whr)->find()) {
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["mainId", "=", $ti["id"]];
|
|
|
+ $where[] = ["type", "=", \app\common\state\ProjectState::TALENT];
|
|
|
+ $log = Db::table("new_talent_checklog")->where($where)->find();
|
|
|
+ if (!$log) {
|
|
|
+ $log["last_state"] = $log["new_state"] = $log["state"] = $ti["checkState"];
|
|
|
+ $log["id"] = getStringId();
|
|
|
+ $log["type"] = \app\common\state\ProjectState::TALENT;
|
|
|
+ $log["mainId"] = $ti["id"];
|
|
|
+ $log["active"] = 1;
|
|
|
+ $log["description"] = "旧系统导入新系统自动生成";
|
|
|
+ $log["createUser"] = "系统";
|
|
|
+ $log["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ \app\common\model\TalentLog::create($log);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -202,6 +218,15 @@ class Worker {
|
|
|
$updData["id"] = $newTalentInfoId;
|
|
|
Db::table("new_talent_info")->save($updData);
|
|
|
}
|
|
|
+ $log["last_state"] = $log["new_state"] = $log["state"] = $data["checkState"];
|
|
|
+ $log["id"] = getStringId();
|
|
|
+ $log["type"] = \app\common\state\ProjectState::TALENT;
|
|
|
+ $log["mainId"] = $newTalentInfoId;
|
|
|
+ $log["active"] = 1;
|
|
|
+ $log["description"] = "旧系统导入新系统自动生成";
|
|
|
+ $log["createUser"] = "系统";
|
|
|
+ $log["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ \app\common\model\TalentLog::create($log);
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -254,6 +279,23 @@ class Worker {
|
|
|
$where[] = ["name", "=", $oldCondition["name"]];
|
|
|
$where[] = ["type", "=", 2];
|
|
|
$newCondition = Db::table("new_talent_condition")->where($where)->find();
|
|
|
+ if (!$newCondition) {
|
|
|
+ $condition["source"] = $oldCondition["source"];
|
|
|
+ $condition["talentLevel"] = $oldCondition["talentLevel"];
|
|
|
+ $condition["type"] = $oldCondition["type"];
|
|
|
+ $condition["name"] = $oldCondition["name"];
|
|
|
+ $condition["activeYear"] = $oldCondition["activeYear"];
|
|
|
+ $condition["notWorkYear"] = $oldCondition["notWorkYear"];
|
|
|
+ $condition["active"] = $oldCondition["active"];
|
|
|
+ $condition["companyIds"] = $oldCondition["companyIds"];
|
|
|
+ $condition["description"] = $oldCondition["description"];
|
|
|
+ $condition["createTime"] = $oldCondition["createTime"];
|
|
|
+ $condition["createUser"] = $oldCondition["createUser"];
|
|
|
+ $condition["updateTime"] = $oldCondition["updateTime"];
|
|
|
+ $condition["updateUser"] = $oldCondition["updateUser"];
|
|
|
+ $newConditionId = Db::table("new_talent_condition")->insertGetId($condition);
|
|
|
+ return $newConditionId;
|
|
|
+ }
|
|
|
return $newCondition["id"];
|
|
|
}
|
|
|
|