| | |
| | | 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; |
| | |
| | | } |
| | | tCompany.setType(2); //2:分公司 |
| | | tCompany.setState(0); //0:正常 |
| | | tCompany.setSuperiorId(1); |
| | | tCompany.setInsertTime(new Date()); |
| | | tCompanyService.insert(tCompany); |
| | | |
| | |
| | | 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); |
| | |
| | | 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); |