|
@@ -12,6 +12,7 @@ use app\common\state\AllowanceProjectEnum;
|
|
|
use app\common\api\TalentAllowanceApi;
|
|
|
use app\common\model\TalentChecklog;
|
|
|
use app\common\state\ProjectState;
|
|
|
+use app\common\api\TalentLogApi;
|
|
|
|
|
|
/**
|
|
|
* Description of TalentAllowance
|
|
@@ -142,6 +143,93 @@ class TalentAllowance extends AdminController {
|
|
|
]);
|
|
|
return new Response(Response::SUCCESS, "审核成功");
|
|
|
}
|
|
|
+
|
|
|
+ public function submitCheck(){
|
|
|
+ $id = $this->request["id"];
|
|
|
+ $process = $this->request["process"];
|
|
|
+ $old = TalentAllowanceApi::getInfoById($param["id"]);
|
|
|
+ $updCheck["id"] = $id;
|
|
|
+ /**查询审核日志*/
|
|
|
+ $log = TalentLogApi::getLastLogByStep($id, ProjectState::JBT, $process);
|
|
|
+ if (!$log) {
|
|
|
+ return new Response(Response::ERROR, "请先审核后再提交");
|
|
|
+ }
|
|
|
+ $updCheck["checkMsg"] = $log["description"];
|
|
|
+ /**判断到达的最高流程*/
|
|
|
+ $updCheck["highProcess"] = !$old["highProcess"] || $old["highProcess"] < $process? $process : $old["process"];
|
|
|
+ $newLog = null;
|
|
|
+ switch ($process) {
|
|
|
+ case 1:
|
|
|
+ Company checkCompany = this.companyService.selectById(info.getCompanyId());
|
|
|
+ TalentDepcheckstate tds = this.talentDepcheckstateService.selectOne(new EntityWrapper<TalentDepcheckstate>().eq("mainId", info.getId()).eq("companyId", info.getCompanyId()));
|
|
|
+ tds.setState(log.getState());
|
|
|
+ if (log.getState() == BasicStateEnum.RCRD_BASIC_PASS.getCode()) {
|
|
|
+ tds.setSubmitTime(DateUtil.getTime());
|
|
|
+ }
|
|
|
+ this.talentDepcheckstateService.updateById(tds);
|
|
|
+ /**判断所有部门是否全部通过*/
|
|
|
+ info.setFirstPassTime(old.getFirstPassTime());
|
|
|
+ Boolean isSuccess = validFirstIsFinish(info);
|
|
|
+ newLog = new TalentChecklog(ProjectEnum.JBT.getCode(), info.getId(), null, StateConst.ACTIVE_YES, log.getState(),
|
|
|
+ info.getProcess(), AllowanceStateEnum.valueOf(old.getCheckState()) + "->" + AllowanceStateEnum.valueOf(info.getCheckState()), log.getDescription() + "(" + checkCompany.getName() + ")", DateUtil.getTime(),
|
|
|
+ ShiroKit.getUser().getAccount() + "(" + company.getName() + ")");
|
|
|
+ newLog.setCompanyId(info.getCompanyId());
|
|
|
+ this.talentChecklogService.delete(new EntityWrapper<TalentChecklog>().eq("mainId", info.getId()).eq("active", StateConst.ACTIVE_NO).eq("companyId", info.getCompanyId()));
|
|
|
+ this.talentChecklogService.insert(newLog);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ if (old.getCheckState() != AllowanceStateEnum.NEED_VISIT_CHECK.getCode() && old.getCheckState() != AllowanceStateEnum.REVIEW_REJECT.getCode()) {
|
|
|
+ return new ResponseObj(ResponseObj.FAILD, "不在审核范围内");
|
|
|
+ }
|
|
|
+ info.setCheckState(AllowanceStateEnum.NEED_REVIEW.getCode());
|
|
|
+ info.setVisitPassTime(DateUtil.getTime());
|
|
|
+ newLog = new TalentChecklog(ProjectEnum.JBT.getCode(), info.getId(), null,
|
|
|
+ StateConst.ACTIVE_YES, BasicStateEnum.RCRD_BASIC_PASS.getCode(), info.getProcess(),
|
|
|
+ AllowanceStateEnum.valueOf(old.getCheckState()) + "->" + AllowanceStateEnum.valueOf(info.getCheckState())
|
|
|
+ , "走访核查提交审核", DateUtil.getTime(), ShiroKit.getUser().getAccount() + "(" + company.getName() + ")");
|
|
|
+ this.talentChecklogService.insert(newLog);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ if (log.getState() == BasicStateEnum.RCRD_BASIC_NOTPASS.getCode()) {
|
|
|
+ info.setCheckState(AllowanceStateEnum.NOTPASS.getCode());
|
|
|
+ info.setRecommendAllowanceType(3);
|
|
|
+ info.setRecommendMoney(BigDecimal.ZERO);
|
|
|
+ info.setRecommendAllowanceMsg("审核不通过,不予兑现");
|
|
|
+ }
|
|
|
+ if (log.getState() == BasicStateEnum.RCRD_BASIC_REJECT.getCode()) {
|
|
|
+ /**设置驳回单位为上级驳回*/
|
|
|
+ if (old.getToProcess() == 1) {
|
|
|
+ info.setCheckState(AllowanceStateEnum.REJECT_TO_FIRST.getCode());
|
|
|
+ if (FengStringUtil.isEmpOrNull(old.getToDep())) {
|
|
|
+ return new ResponseObj(ResponseObj.FAILD, "请设置驳回单位后再提交 ");
|
|
|
+ }
|
|
|
+ List<Company> companies = this.companyService.selectList(new EntityWrapper<Company>().in("code", old.getToDep()));
|
|
|
+ String ids = companies.stream().map(Company::getId).collect(Collectors.joining(","));
|
|
|
+ this.talentDepcheckstateService.updateForSet("state=" + BasicStateEnum.RCRD_BASIC_UPREJECT.getCode(), new EntityWrapper<TalentDepcheckstate>().eq("mainId", old.getId()).in("companyId", ids));
|
|
|
+ } else if (old.getToProcess() == 2) {
|
|
|
+ info.setCheckState(AllowanceStateEnum.REVIEW_REJECT.getCode());
|
|
|
+ }
|
|
|
+ info.setToProcess(null);
|
|
|
+ info.setToDep("");
|
|
|
+ }
|
|
|
+ if (log.getState() == BasicStateEnum.RCRD_BASIC_PASS.getCode()) { //通过,计算金额
|
|
|
+ info.setCheckState(AllowanceStateEnum.REVIEW_PASS.getCode());
|
|
|
+ info.setReviewPassTime(DateUtil.getTime());
|
|
|
+ /*** 在此处需要判断津补贴类型*/
|
|
|
+ List<TalentAllowanceArrange> arrangeList = validateAllowanceType(info);
|
|
|
+ this.talentAllowanceArrangeService.updateBatchById(arrangeList);
|
|
|
+ }
|
|
|
+ newLog = new TalentChecklog(ProjectEnum.JBT.getCode(), info.getId(), null,
|
|
|
+ StateConst.ACTIVE_YES, log.getState(), info.getProcess(),
|
|
|
+ AllowanceStateEnum.valueOf(old.getCheckState()) + "->" + AllowanceStateEnum.valueOf(info.getCheckState())
|
|
|
+ , log.getDescription(), DateUtil.getTime(), ShiroKit.getUser().getAccount() + "(" + company.getName() + ")");
|
|
|
+ this.talentChecklogService.delete(new EntityWrapper<TalentChecklog>().eq("mainId", info.getId()).eq("active", StateConst.ACTIVE_NO));
|
|
|
+ this.talentChecklogService.insert(newLog);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.talentAllowanceInfoService.updateById(info);
|
|
|
+ return new ResponseObj(ResponseObj.SUCCESS, "提交审核成功");
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 校验是否在审核范围内
|