// ajax 修改 public String updateKbDiseaseAjax() { log.info(logprefix + "updateKbDiseaseAjax,id=" + kbDisease.getId()); ReturnJson returnJson = new ReturnJson(); try { if (kbDisease.getId() != null && kbDisease.getId() > 0) { KbDisease tempKbDisease = kbDiseaseService.selectKbDiseaseById(kbDisease.getId()); // 选择能更改的属性,与界面一致 tempKbDisease.setName(kbDisease.getName()); tempKbDisease.setDescription(kbDisease.getDescription()); tempKbDisease.setKeshiid(kbDisease.getKeshiid()); kbDiseaseService.updateKbDisease(tempKbDisease); returnJson.setFlag(1); returnJson.setReason("修改成功"); JSONObject jo = JSONObject.fromObject(returnJson); this.returnStr = jo.toString(); // actionMsg = getText("viewKbDiseaseSuccess"); return SUCCESS; } else { actionMsg = getText("viewKbDiseaseFail"); log.info(logprefix + "updateKbDiseaseAjax fail"); } } catch (Exception e) { e.printStackTrace(); log.error("类KbDiseaseAction的方法:viewKbDisease错误" + e); } returnJson.setFlag(0); JSONObject jo = JSONObject.fromObject(returnJson); this.returnStr = jo.toString(); return SUCCESS; }