|
@@ -702,6 +702,10 @@ class LivingAllowance extends AdminController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 公示再审核
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
public function afterCheck() {
|
|
|
$response = new \stdClass();
|
|
|
$response->code = 500;
|
|
@@ -764,18 +768,92 @@ class LivingAllowance extends AdminController {
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
Db::table("new_talent_checklog")->insert($newLog);
|
|
|
- Db::table("new_talent_checklog")->save($data);
|
|
|
+ Db::table("md_living_allowance_info")->save($data);
|
|
|
Db::commit();
|
|
|
$response->code = 200;
|
|
|
$response->msg = "审核成功";
|
|
|
return json($response);
|
|
|
} catch (\Exception $e) {
|
|
|
- Db::callback();
|
|
|
+ Db::rollback();
|
|
|
+ $response->msg = $e->getMessage();
|
|
|
+ return json($response);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 公示通过
|
|
|
+ */
|
|
|
+ public function publicPass() {
|
|
|
+ $response = new \stdClass();
|
|
|
+ $response->code = 500;
|
|
|
+
|
|
|
+ $ids = array_filter(explode(",", \StrUtil::getRequestDecodeParam($this->request, "ids")));
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["id", "in", $ids];
|
|
|
+ $upList = Db::table("md_living_allowance_info")->where($where)->select()->toArray();
|
|
|
+ //添加日志
|
|
|
+ $newLogs = [];
|
|
|
+ Db::startTrans();
|
|
|
+ try {
|
|
|
+ for ($i = 0; $i < count($upList); $i++) {
|
|
|
+ $obj = $upList[$i];
|
|
|
+
|
|
|
+ if ($obj["isPublic"] != 3) {
|
|
|
+ $response->msg = sprintf("第%d条记录不是公示中状态,不能公示通过");
|
|
|
+ return json($response);
|
|
|
+ }
|
|
|
+ $newLog["id"] = getStringId();
|
|
|
+ $newLog["type"] = ProjectState::LIVINGALLOWANCE;
|
|
|
+ $newLog["mainId"] = $obj["id"];
|
|
|
+ $newLog["active"] = 1;
|
|
|
+ $newLog["state"] = 3;
|
|
|
+ $newLog["step"] = 6;
|
|
|
+ $newLog["stateChange"] = "<span class='label label-success'>公示中</span>-><span class='label label-primary'>待兑现</span>";
|
|
|
+ $newLog["description"] = "";
|
|
|
+ $newLog["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ $newLog["createUser"] = sprintf("%s(%s)", $this->user["account"], $this->user["companyName"]);
|
|
|
+
|
|
|
+ $newLogs[] = $newLog;
|
|
|
+
|
|
|
+ $obj["isPublic"] = 4;
|
|
|
+ $obj["amount"] = $obj["recommendAmount"];
|
|
|
+ $obj["isPay"] = $obj["recommendIsPay"];
|
|
|
+ $obj["amountDesc"] = $obj["recommendAmountDesc"];
|
|
|
+ $obj["judgmentDetails"] = $obj["recommendJudgmentDetails"];
|
|
|
+ Db::table("md_living_allowance_info")->save($obj);
|
|
|
+ }
|
|
|
+ Db::table("new_talent_checklog")->insertAll($newLogs);
|
|
|
+ Db::commit();
|
|
|
+ $response->msg = "批量公示通过成功";
|
|
|
+ $response->code = 200;
|
|
|
+ return json($response);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ Db::rollback();
|
|
|
$response->msg = $e->getMessage();
|
|
|
return json($response);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 兑现
|
|
|
+ */
|
|
|
+ public function issue() {
|
|
|
+ /* Company company = (Company) this . getSession() . getAttribute("company");
|
|
|
+ List<LivingAllowanceInfo> tiList = this.livingAllowanceInfoService.selectList(new EntityWrapper<LivingAllowanceInfo>().in("id", ids.split(",")));
|
|
|
+ List<TalentChecklog> logList = new ArrayList<>();
|
|
|
+ for (LivingAllowanceInfo obj : tiList) {
|
|
|
+ obj . setIsPublic(5);
|
|
|
+ //添加日志
|
|
|
+ TalentChecklog log = new TalentChecklog(Integer . parseInt(ProjectConst . MASTERLIVINGALLOWANCE), obj . getId(), null,
|
|
|
+ StateConst . ACTIVE_YES, BasicStateEnum . RCRD_BASIC_PASS . getCode(), StepEnum . RCRD_STEP_CARD . getCode(), "<span class='label label-success'>待兑现</span>-><span class='label label-primary'>已兑现</span>", "",
|
|
|
+ DateUtil . getTime(), ShiroKit . getUser() . getAccount() + "(" + company . getName() + ")");
|
|
|
+ logList . add(log);
|
|
|
+ }
|
|
|
+ this . livingAllowanceInfoService . updateBatchById(tiList);
|
|
|
+ this . talentChecklogService . insertBatch(logList);
|
|
|
+ return new ResponseObj(ResponseObj . SUCCESS, "兑现成功"); */
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 计算兑现额度
|
|
|
* @param type $oldInfo
|