@Test public void testSaveDiagnoseTemplate() throws Exception { }
@Override public CommonResult saveDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam){ int count = 0; Integer roleId = diagnoseTemplateParam.getRoleId(); String name = diagnoseTemplateParam.getName(); List<DiagnoseParam> diagnoseParams = diagnoseTemplateParam.getDiagnoseList(); if(diagnoseTemplateMapper.getDiagnoseTemplateByName(name) != null) return CommonResult.fail(ResultCode.E_806); for(DiagnoseParam diagnoseParam: diagnoseParams){ String diseaseIcdCode = diagnoseParam.getIcdCode(); HashMap disease = diseaseMapper.getDiseaseByIcdCode(diseaseIcdCode); if(disease == null) return CommonResult.fail(ResultCode.E_800); Byte type; if(disease.get("type").equals("中医疾病")) type = 0; else type = 1; count = diagnoseTemplateMapper.insert(diseaseIcdCode, (String)disease.get("diseaseName"), type, roleId, name); if(count <= 0) return CommonResult.fail(ResultCode.E_802); } return CommonResult.success(count); }
DiagnoseTemplateServiceImpl implements DiagnoseTemplateService { @Override public CommonResult saveDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam){ int count = 0; Integer roleId = diagnoseTemplateParam.getRoleId(); String name = diagnoseTemplateParam.getName(); List<DiagnoseParam> diagnoseParams = diagnoseTemplateParam.getDiagnoseList(); if(diagnoseTemplateMapper.getDiagnoseTemplateByName(name) != null) return CommonResult.fail(ResultCode.E_806); for(DiagnoseParam diagnoseParam: diagnoseParams){ String diseaseIcdCode = diagnoseParam.getIcdCode(); HashMap disease = diseaseMapper.getDiseaseByIcdCode(diseaseIcdCode); if(disease == null) return CommonResult.fail(ResultCode.E_800); Byte type; if(disease.get("type").equals("中医疾病")) type = 0; else type = 1; count = diagnoseTemplateMapper.insert(diseaseIcdCode, (String)disease.get("diseaseName"), type, roleId, name); if(count <= 0) return CommonResult.fail(ResultCode.E_802); } return CommonResult.success(count); } }
DiagnoseTemplateServiceImpl implements DiagnoseTemplateService { @Override public CommonResult saveDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam){ int count = 0; Integer roleId = diagnoseTemplateParam.getRoleId(); String name = diagnoseTemplateParam.getName(); List<DiagnoseParam> diagnoseParams = diagnoseTemplateParam.getDiagnoseList(); if(diagnoseTemplateMapper.getDiagnoseTemplateByName(name) != null) return CommonResult.fail(ResultCode.E_806); for(DiagnoseParam diagnoseParam: diagnoseParams){ String diseaseIcdCode = diagnoseParam.getIcdCode(); HashMap disease = diseaseMapper.getDiseaseByIcdCode(diseaseIcdCode); if(disease == null) return CommonResult.fail(ResultCode.E_800); Byte type; if(disease.get("type").equals("中医疾病")) type = 0; else type = 1; count = diagnoseTemplateMapper.insert(diseaseIcdCode, (String)disease.get("diseaseName"), type, roleId, name); if(count <= 0) return CommonResult.fail(ResultCode.E_802); } return CommonResult.success(count); }  }
DiagnoseTemplateServiceImpl implements DiagnoseTemplateService { @Override public CommonResult saveDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam){ int count = 0; Integer roleId = diagnoseTemplateParam.getRoleId(); String name = diagnoseTemplateParam.getName(); List<DiagnoseParam> diagnoseParams = diagnoseTemplateParam.getDiagnoseList(); if(diagnoseTemplateMapper.getDiagnoseTemplateByName(name) != null) return CommonResult.fail(ResultCode.E_806); for(DiagnoseParam diagnoseParam: diagnoseParams){ String diseaseIcdCode = diagnoseParam.getIcdCode(); HashMap disease = diseaseMapper.getDiseaseByIcdCode(diseaseIcdCode); if(disease == null) return CommonResult.fail(ResultCode.E_800); Byte type; if(disease.get("type").equals("中医疾病")) type = 0; else type = 1; count = diagnoseTemplateMapper.insert(diseaseIcdCode, (String)disease.get("diseaseName"), type, roleId, name); if(count <= 0) return CommonResult.fail(ResultCode.E_802); } return CommonResult.success(count); }  @Override CommonResult saveDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam); @Override CommonResult modifyDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam); @Override CommonResult listMyDiagnoseTemplate(Integer roleId); CommonResult deleteMyDiagnoseTemplate(Integer roleId, String diagnoseTemplateName); }
DiagnoseTemplateServiceImpl implements DiagnoseTemplateService { @Override public CommonResult saveDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam){ int count = 0; Integer roleId = diagnoseTemplateParam.getRoleId(); String name = diagnoseTemplateParam.getName(); List<DiagnoseParam> diagnoseParams = diagnoseTemplateParam.getDiagnoseList(); if(diagnoseTemplateMapper.getDiagnoseTemplateByName(name) != null) return CommonResult.fail(ResultCode.E_806); for(DiagnoseParam diagnoseParam: diagnoseParams){ String diseaseIcdCode = diagnoseParam.getIcdCode(); HashMap disease = diseaseMapper.getDiseaseByIcdCode(diseaseIcdCode); if(disease == null) return CommonResult.fail(ResultCode.E_800); Byte type; if(disease.get("type").equals("中医疾病")) type = 0; else type = 1; count = diagnoseTemplateMapper.insert(diseaseIcdCode, (String)disease.get("diseaseName"), type, roleId, name); if(count <= 0) return CommonResult.fail(ResultCode.E_802); } return CommonResult.success(count); }  @Override CommonResult saveDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam); @Override CommonResult modifyDiagnoseTemplate(DiagnoseTemplateParam diagnoseTemplateParam); @Override CommonResult listMyDiagnoseTemplate(Integer roleId); CommonResult deleteMyDiagnoseTemplate(Integer roleId, String diagnoseTemplateName);  }