| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import com.dsh.course.feignClient.account.model.Coach; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.SinataUtil; |
| | |
| | | |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | private ICityService cityService; |
| | | @Autowired |
| | | private IOperatorAuthService operatorAuthService; |
| | | |
| | | |
| | | /** |
| | | * 根据运营商ID 获取运营商管理的省市 |
| | | */ |
| | | @RequestMapping(value = "/getCityByOperatorId") |
| | | @ResponseBody |
| | | public List<TOperatorCity> getCityByOperatorId(@RequestBody Integer operatorId) { |
| | | return operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId",operatorId)); |
| | | } |
| | | |
| | | /** |
| | | * 跳转运营商管理首页 |
| | | */ |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/updateOperator") |
| | | public ResultUtil updateOperator(Integer id,String name,String userName,String phone,Integer type ,@RequestParam String comArr) { |
| | | public ResultUtil updateOperator(Integer id,String name,String userName |
| | | ,String phone,Integer type ,@RequestParam String comArr) { |
| | | User one = userService.getOne(new QueryWrapper<User>().eq("name", name).eq("phone", phone)); |
| | | if (one!=null){ |
| | | return ResultUtil.error("当前管理员名称和电话已存在!"); |
| | | } |
| | | operatorCityService.remove(new QueryWrapper<TOperatorCity>().eq("operatorId",id)); |
| | | User user = new User(); |
| | | User user = userService.getOne(new QueryWrapper<User>().eq("objectId", id). |
| | | eq("objectType", 2)); |
| | | user.setName(userName); |
| | | user.setAccount(phone); |
| | | user.setPhone(phone); |
| | | user.setObjectType(2); |
| | | String a123456 = SecureUtil.md5("a123456"); |
| | | user.setPassword(a123456); |
| | | userService.save(user); |
| | | userService.updateById(user); |
| | | TOperator data = new TOperator(); |
| | | data.setId(id); |
| | | data.setUserId(user.getId()); |