| | |
| | | public void changeSex(AcceptData acceptData, Integer sex, PrintWriter out) {
|
| | | try {
|
| | | // 获取设备定义性别
|
| | | int deviceSex = deviceSexService.changeDeviceSex(sex, acceptData.getDevice());
|
| | | deviceSexService.save(acceptData.getDevice(), sex);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("sex", deviceSex);
|
| | | data.put("sex", sex);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("切换失败"));
|
| | |
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | |
|
| | | // 设置为通用
|
| | | deviceSexService.changeDeviceSex(0, acceptData.getDevice());
|
| | | deviceSexService.save(acceptData.getDevice(), 0);
|
| | |
|
| | | } catch (HomeNavbarUserException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | // 设置为通用
|
| | | deviceSexService.changeDeviceSex(0, acceptData.getDevice());
|
| | | deviceSexService.save(acceptData.getDevice(), 0);
|
| | |
|
| | | } catch (HomeNavbarUserException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|