Pu Zhibing
3 天以前 5dacdee9b54c78372b68140e2b068d03a620eab9
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/RecruitController.java
@@ -1,8 +1,7 @@
package com.stylefeng.guns.modular.system.controller.general;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.beetl.ShiroExtUtil;
import com.stylefeng.guns.modular.system.model.Recruit;
import com.stylefeng.guns.modular.system.model.TRegion;
import com.stylefeng.guns.modular.system.service.IRecruitService;
@@ -11,12 +10,12 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.*;
/**
@@ -27,25 +26,28 @@
@Controller
@RequestMapping("/recruit")
public class RecruitController {
    private String PREFIX = "/system/recruit/";
    @Autowired
    private ITRegionService regionService;
    @Autowired
    private IRecruitService recruitService;
    @Resource
    private ShiroExtUtil shiroExtUtil;
    /**
     * 跳转到列表页
     *
     * @return
     */
    @GetMapping("/showRecruit")
    public String showRecruit(){
    public String showRecruit() {
        return PREFIX + "recruit.html";
    }
    /**
     * 跳转到添加页
     * @return
@@ -120,14 +122,14 @@
    @PostMapping("/addRecruit")
    public ResultUtil addRecruit(Recruit recruit){
        try {
            recruit.setCompanyType(ShiroKit.getUser().getRoleType());
            recruit.setCompanyId(ShiroKit.getUser().getObjectId());
            recruit.setCompanyType(shiroExtUtil.getUser().getRoleType());
            recruit.setCompanyId(shiroExtUtil.getUser().getObjectId());
            recruit.setProvinceName(regionService.selectOne(new EntityWrapper<TRegion>().eq("code", recruit.getProvinceCode())).getName());
            recruit.setCityName(regionService.selectOne(new EntityWrapper<TRegion>().eq("code", recruit.getCityCode())).getName());
            recruit.setFirstPageShow(2);
            recruit.setCreateTime(new Date());
            recruit.setInsertUser(ShiroKit.getUser().getId());
            if(recruit.getInterviewOrNot() == 1){
            recruit.setInsertUser(shiroExtUtil.getUser().getId());
            if (recruit.getInterviewOrNot() == 1) {
                recruit.setStartSalary(0D);
                recruit.setEndSalary(0D);
            }