Pu Zhibing
2025-06-06 b1f2f102034b4433201225b67a9fc78c08e532f0
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java
@@ -7,20 +7,18 @@
import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.common.constant.factory.PageFactory;
import com.stylefeng.guns.core.log.LogObjectHolder;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.core.util.SinataUtil;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.stylefeng.guns.core.log.LogObjectHolder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.Date;
@@ -299,6 +297,7 @@
        }
        tCompany.setType(2);  //2:分公司
        tCompany.setState(0); //0:正常
        tCompany.setSuperiorId(1);
        tCompany.setInsertTime(new Date());
        tCompanyService.insert(tCompany);
@@ -352,9 +351,6 @@
            return "error";
        }
        tCompany.setType(3);  //2:分公司
        if (ShiroKit.getUser().getRoleType() == 2){
            tCompany.setSuperiorId(ShiroKit.getUser().getObjectId());
        }
        tCompany.setState(0); //0:正常
        tCompany.setInsertTime(new Date());
        tCompanyService.insert(tCompany);
@@ -410,6 +406,7 @@
            user.setSalt(ShiroKit.getRandomSalt(5));
            user.setPassword(ShiroKit.md5(password, user.getSalt()));
        }
        tCompany.setSuperiorId(1);
        tCompanyService.updateById(tCompany);
        user.setName(tCompany.getName());
        userService.updateById(user);