| | |
| | | |
| | | List<Cstmr> listByPage(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId ,@Param("condition") String condition); |
| | | |
| | | int updateDeptIdByUserId(@Param("userId")Long userId, @Param("deptId")Long deptId); |
| | | |
| | | } |
| | |
| | | |
| | | Page<Cstmr> getPage(Page<Cstmr> page, Long hostId, String deptId, Long userId, String condition); |
| | | |
| | | int updateDeptIdByUserId(Long userId, Long deptId); |
| | | |
| | | } |
| | |
| | | return page.setRecords(baseMapper.listByPage(page, hostId, deptId, userId, condition)); |
| | | } |
| | | |
| | | @Override |
| | | public int updateDeptIdByUserId(Long userId, Long deptId) { |
| | | return this.baseMapper.updateDeptIdByUserId(userId, deptId); |
| | | } |
| | | |
| | | public static String zerofill(String msg, Integer count){ |
| | | if (msg.length() == count){ |
| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.result.KeyValueVo; |
| | | import com.zy.crm.manager.service.CstmrService; |
| | | import com.zy.crm.system.entity.Role; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.RoleService; |
| | |
| | | private UserService userService; |
| | | @Autowired |
| | | private RoleService roleService; |
| | | @Autowired |
| | | private CstmrService cstmrService; |
| | | |
| | | @RequestMapping(value = "/user/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | User one = userService.selectById(user.getId()); |
| | | if (!one.getDeptId().equals(user.getDeptId())) { |
| | | // todo: 修改关联数据的deptId字段 |
| | | cstmrService.updateDeptIdByUserId(user.getId(), user.getDeptId()); |
| | | } |
| | | if (!userService.updateById(user)) { |
| | | throw new CoolException("修改用户失败"); |
| | |
| | | ORDER BY mc.create_time DESC |
| | | </select> |
| | | |
| | | <update id="updateDeptIdByUserId"> |
| | | update man_cstmr set dept_id = #{deptId} where user_id = #{userId} |
| | | </update> |
| | | |
| | | </mapper> |