| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | List<SvyLibTemplate> svyLibTemplates = svyLibTemplateMapper.selectSvyLibTemplateList(svyLibTemplateReq); |
| | | //添加题目 |
| | | for (int i = 0; i < svyLibTemplates.size(); i++) { |
| | | // SvyLibScript svyLibScript = new SvyLibScript(); |
| | | // svyLibScript.setSvyid(svyLibTemplates.get(i).getSvyid()); |
| | | // List<SvyLibScript> svyLibTopics = svyLibScriptMapper.selectSvyLibScriptList(svyLibScript); |
| | | SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript(); |
| | | svyLibTemplateScript.setSvyid(svyLibTemplates.get(i).getSvyid()); |
| | | List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript); |
| | |
| | | } |
| | | } |
| | | //将题目放到问卷列表中 |
| | | svyLibTemplates.get(i).setSvyLibScripts(svyLibTemplateScripts); |
| | | svyLibTemplates.get(i).setSvyTemplateLibScripts(svyLibTemplateScripts); |
| | | |
| | | //获取每个问卷对应的科室 |
| | | TempDetpRelevance tempDetpRelevance = new TempDetpRelevance(); |
| | |
| | | return libTemplates; |
| | | } |
| | | |
| | | // /** |
| | | // * 新增问卷 |
| | | // * |
| | | // * @param svyLibTemplate 问卷 |
| | | // * @return 结果 |
| | | // */ |
| | | // @Transactional |
| | | // @Override |
| | | // public int insertSvyLibTemplate(SvyLibTemplate svyLibTemplate) { |
| | | // svyLibTemplate.setCreateTime(DateUtils.getNowDate()); |
| | | // svyLibTemplateMapper.insertSvyLibTemplate(svyLibTemplate); |
| | | // //关联问卷疾病 |
| | | // for (String icdId : svyLibTemplate.getIcdID()) { |
| | | // Icd10Association icd10Association = new Icd10Association(); |
| | | // icd10Association.setIcd10code(icdId); |
| | | // icd10Association.setSvyid(svyLibTemplate.getSvyid()); |
| | | // icd10AssociationMapper.insertIcd10Association(icd10Association); |
| | | // } |
| | | // //新增问题题目 |
| | | // for (int i = 0; i < svyLibTemplate.getSvyLibScripts().size(); i++) { |
| | | // SvyLibScript svyLibScript = svyLibTemplate.getSvyLibScripts().get(i); |
| | | // svyLibScript.setSvyid(svyLibTemplate.getSvyid()); |
| | | // //题目的选项目,直接用svy_topicoption表,用svyTopicidf去关联 |
| | | // svyLibScriptMapper.insertSvyLibScript(svyLibScript); |
| | | // } |
| | | // return 1; |
| | | // } |
| | | |
| | | /** |
| | | * 新增或修改问卷模板信息 |
| | | * |
| | | * @param svyLibTemplate |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Integer saveOrUpdateTemplate(SvyLibTemplate svyLibTemplate) { |
| | | Integer i = null; |
| | |
| | | i = svyLibTemplate.getSvyid().intValue(); |
| | | |
| | | //处理题目 |
| | | if (CollectionUtils.isNotEmpty(svyLibTemplate.getSvyLibScripts())) { |
| | | for (SvyLibTemplateScript svyLibScript : svyLibTemplate.getSvyLibScripts()) { |
| | | if (CollectionUtils.isNotEmpty(svyLibTemplate.getSvyTemplateLibScripts())) { |
| | | for (SvyLibTemplateScript svyLibScript : svyLibTemplate.getSvyTemplateLibScripts()) { |
| | | //对题目进行处理 |
| | | if (svyLibScript.getIsoperation() != null) { |
| | | //问题的操作不为空 |