| | |
| | | PageBean<OperateUser> operateUsers = operateUserService.getOperateUserList(parameters);
|
| | | return new ResultBean<PageBean<OperateUser>>(operateUsers);
|
| | | }
|
| | |
|
| | | @GetMapping("unique-mobile")
|
| | | public ResultBean<Boolean> uniqueMobile(String mobile){
|
| | | boolean result =operateUserService.isUniqueProperty("mobile",mobile);
|
| | | return new ResultBean<Boolean>(result);
|
| | | }
|
| | | @PostMapping("operateUser")
|
| | | public ResultBean<Integer> saveOrUpdateOperateUser(@RequestBody OperateUser operateUser) {
|
| | | Integer code= operateUserService.saveOrUpdateOperateUser(operateUser);
|
| | |
| | |
|
| | | public interface OperateUserService {
|
| | |
|
| | | OperateUser getOperateUserByMobile(String mobile);
|
| | | boolean isUniqueProperty(String propertyName, Object value);
|
| | |
|
| | | OperateUser getOperateUserByMobile(String mobile);
|
| | |
|
| | | OperateUser mobileLogin(String mobile, String password);
|
| | |
|
| | |
| | | }
|
| | | return device;
|
| | | }
|
| | |
|
| | | /*
|
| | | 刷新 redis 设备的信息
|
| | | */
|
| | | private void refreshDeviceInRedis(String mac){
|
| | | getDeviceWithOrgIdsByMac(mac);
|
| | | }
|
| | | @Override
|
| | | public PageBean queryByPageBean(PageBean pageBean) {
|
| | | Example example = ExampleUtil.generateExample(ENTITY_CLASS,pageBean);
|
| | |
| | | deviceMapper.insertSelective(device);
|
| | | }else{
|
| | | deviceMapper.updateByPrimaryKeySelective(device);
|
| | | //刷新redis里设备信息
|
| | | refreshDeviceInRedis(device.getMac());
|
| | | }
|
| | | }
|
| | | catch (Exception ex){
|
| | |
| | | monitorPoint.setIsDelete(Constants.IS_DELETE_FALSE);
|
| | | monitorPointMapper.insertSelective(monitorPoint);
|
| | | }else{
|
| | | // TODO 如果组织id改变需要刷新redis里设备信息
|
| | | monitorPointMapper.updateByPrimaryKeySelective(monitorPoint);
|
| | | }
|
| | | }
|
| | |
| | | private static Class ENTITY_CLASS = OperateUser.class;
|
| | | @Resource
|
| | | private OperateUserMapper operateUserMapper;
|
| | |
|
| | | @Override
|
| | | public boolean isUniqueProperty(String propertyName, Object value){
|
| | | Example example = new Example(ENTITY_CLASS);
|
| | | example.or().andEqualTo(propertyName,value);
|
| | | return operateUserMapper.selectCountByExample(example)==0;
|
| | | }
|
| | | @Override
|
| | | public OperateUser getOperateUserByMobile(String mobile) {
|
| | | OperateUser operateUser = new OperateUser();
|