From e7ac7e5702f6ac1f88403485de232e5494a1c76a Mon Sep 17 00:00:00 2001
From: zhaowenxuan <chacca165@163.com>
Date: 星期一, 11 八月 2025 13:55:57 +0800
Subject: [PATCH] 修改错误日志打印
---
ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSurveyQuestionServiceImpl.java | 63 +++++++++++++++++++++----------
1 files changed, 42 insertions(+), 21 deletions(-)
diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSurveyQuestionServiceImpl.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSurveyQuestionServiceImpl.java
index c00d7ff..85c696e 100644
--- a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSurveyQuestionServiceImpl.java
+++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSurveyQuestionServiceImpl.java
@@ -1,22 +1,20 @@
package com.ltkj.hosp.service.impl;
-import java.util.List;
-
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltkj.common.utils.DateUtils;
-import com.ltkj.hosp.domain.TjTeamSelectRecord;
-import com.ltkj.hosp.mapper.TjTeamSelectRecordMapper;
+import com.ltkj.common.utils.SecurityUtils;
+import com.ltkj.common.utils.StringUtils;
+import com.ltkj.hosp.domain.TjSurveyOptions;
+import com.ltkj.hosp.domain.TjSurveyQuestion;
+import com.ltkj.hosp.domain.TjSurveyTempQues;
+import com.ltkj.hosp.mapper.TjSurveyQuestionMapper;
+import com.ltkj.hosp.service.ITjSurveyQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
-
-import com.ltkj.common.utils.StringUtils;
-import org.springframework.transaction.annotation.Transactional;
-import com.ltkj.hosp.domain.TjSurveyOptions;
-import com.ltkj.hosp.mapper.TjSurveyQuestionMapper;
-import com.ltkj.hosp.domain.TjSurveyQuestion;
-import com.ltkj.hosp.service.ITjSurveyQuestionService;
+import java.util.List;
/**
* 闂嵎闂Service涓氬姟灞傚鐞�
@@ -29,6 +27,9 @@
@Autowired
private TjSurveyQuestionMapper tjSurveyQuestionMapper;
+ @Autowired
+ private ITjSurveyQuestionService tjSurveyQuestionService;
+
/**
* 鏌ヨ闂嵎闂
*
@@ -36,8 +37,13 @@
* @return 闂嵎闂
*/
@Override
- public TjSurveyQuestion selectTjSurveyQuestionByQid(Long qid) {
+ public TjSurveyQuestion selectTjSurveyQuestionByQid(String qid) {
return tjSurveyQuestionMapper.selectTjSurveyQuestionByQid(qid);
+ }
+
+ @Override
+ public List<TjSurveyOptions> selectOptionsByQid(String qid) {
+ return tjSurveyQuestionMapper.selectOptionsByQid(qid);
}
/**
@@ -57,13 +63,17 @@
* @param tjSurveyQuestion 闂嵎闂
* @return 缁撴灉
*/
- @Transactional
+// @Transactional
@Override
public int insertTjSurveyQuestion(TjSurveyQuestion tjSurveyQuestion) {
tjSurveyQuestion.setCreateTime(DateUtils.getNowDate());
- int rows = tjSurveyQuestionMapper.insertTjSurveyQuestion(tjSurveyQuestion);
- insertTjSurveyOptions(tjSurveyQuestion);
- return rows;
+ tjSurveyQuestion.setCreateBy(SecurityUtils.getLoginUser().getUsername());
+// int rows = tjSurveyQuestionMapper.insertTjSurveyQuestion(tjSurveyQuestion);
+ if (tjSurveyQuestionService.save(tjSurveyQuestion)) {
+ insertTjSurveyOptions(tjSurveyQuestion);
+ return 1;
+ }
+ return 0;
}
/**
@@ -76,8 +86,7 @@
@Override
public int updateTjSurveyQuestion(TjSurveyQuestion tjSurveyQuestion) {
tjSurveyQuestion.setUpdateTime(DateUtils.getNowDate());
- tjSurveyQuestionMapper.deleteTjSurveyOptionsByQid(tjSurveyQuestion.getQid())
- ;
+ tjSurveyQuestionMapper.deleteTjSurveyOptionsByQid(tjSurveyQuestion.getQid());
insertTjSurveyOptions(tjSurveyQuestion);
return tjSurveyQuestionMapper.updateTjSurveyQuestion(tjSurveyQuestion);
}
@@ -90,7 +99,7 @@
*/
@Transactional
@Override
- public int deleteTjSurveyQuestionByQids(Long[] qids) {
+ public int deleteTjSurveyQuestionByQids(String[] qids) {
tjSurveyQuestionMapper.deleteTjSurveyOptionsByQids(qids);
return tjSurveyQuestionMapper.deleteTjSurveyQuestionByQids(qids);
}
@@ -108,6 +117,16 @@
return tjSurveyQuestionMapper.deleteTjSurveyQuestionByQid(qid);
}
+ @Override
+ public List<TjSurveyTempQues> selectOptionsByMid(String mid) {
+ return tjSurveyQuestionMapper.selectOptionsByMid(mid);
+ }
+
+ @Override
+ public List<TjSurveyQuestion> getOptionsByMid(String mid) {
+ return tjSurveyQuestionMapper.getOptionsByMid(mid);
+ }
+
/**
* 鏂板闂嵎閫夐」淇℃伅
*
@@ -119,15 +138,17 @@
if (StringUtils.isNotNull(tjSurveyOptionsList)) {
List<TjSurveyOptions> list = new ArrayList<TjSurveyOptions>();
for (TjSurveyOptions tjSurveyOptions : tjSurveyOptionsList) {
- tjSurveyOptions.setQid(qid);
+ tjSurveyOptions.setQid(qid.toString());
tjSurveyOptions.setDeleted(0);
+ tjSurveyOptions.setCreateBy(SecurityUtils.getLoginUser().getUsername());
+ tjSurveyOptions.setCreateTime(DateUtils.getNowDate());
list.add(tjSurveyOptions);
}
if (list.size() > 0) {
for (TjSurveyOptions tjSurveyOptions : list) {
tjSurveyOptions.setDeleted(0);
+ tjSurveyQuestionMapper.insertTjSurveyOptions(tjSurveyOptions);
}
- tjSurveyQuestionMapper.batchTjSurveyOptions(list);
}
}
}
--
Gitblit v1.8.0