|
@@ -9,6 +9,7 @@ import com.diagbot.client.UserServiceClient;
|
|
import com.diagbot.dto.QuestionPageDTO;
|
|
import com.diagbot.dto.QuestionPageDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.ScaleContentDTO;
|
|
import com.diagbot.dto.ScaleContentDTO;
|
|
|
|
+import com.diagbot.entity.QuestionInfo;
|
|
import com.diagbot.entity.ScaleContent;
|
|
import com.diagbot.entity.ScaleContent;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -45,6 +46,8 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
|
|
ScaleContentService scaleContentService;
|
|
ScaleContentService scaleContentService;
|
|
@Autowired
|
|
@Autowired
|
|
UserServiceClient userServiceClient;
|
|
UserServiceClient userServiceClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ QuestionFacade questionFacade;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 量表内容新增或更新
|
|
* 量表内容新增或更新
|
|
@@ -55,7 +58,14 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
|
|
Long scaleId = scaleContentSaveVO.getScaleId();
|
|
Long scaleId = scaleContentSaveVO.getScaleId();
|
|
Date now = DateUtil.now();
|
|
Date now = DateUtil.now();
|
|
String userId = UserUtils.getCurrentPrincipleID();
|
|
String userId = UserUtils.getCurrentPrincipleID();
|
|
- //删除原关联内容
|
|
|
|
|
|
+
|
|
|
|
+ // 更新修改信息
|
|
|
|
+ questionFacade.update(new QuestionInfo(), new UpdateWrapper<QuestionInfo>()
|
|
|
|
+ .eq("id", scaleId)
|
|
|
|
+ .set("gmt_modified", now)
|
|
|
|
+ .set("modifier", userId)
|
|
|
|
+ );
|
|
|
|
+ // 删除原关联内容
|
|
if (scaleId != null) {
|
|
if (scaleId != null) {
|
|
this.update(new ScaleContent(), new UpdateWrapper<ScaleContent>()
|
|
this.update(new ScaleContent(), new UpdateWrapper<ScaleContent>()
|
|
.eq("scale_id", scaleId)
|
|
.eq("scale_id", scaleId)
|
|
@@ -64,7 +74,7 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
|
|
.set("modifier", userId)
|
|
.set("modifier", userId)
|
|
.set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
.set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
}
|
|
}
|
|
- //新增关联内容
|
|
|
|
|
|
+ // 新增关联内容
|
|
List<ScaleContent> list = new ArrayList<>();
|
|
List<ScaleContent> list = new ArrayList<>();
|
|
List<ScaleContentVO> scaleContentVOS = scaleContentSaveVO.getContent();
|
|
List<ScaleContentVO> scaleContentVOS = scaleContentSaveVO.getContent();
|
|
for (ScaleContentVO scaleContentVO : scaleContentVOS) {
|
|
for (ScaleContentVO scaleContentVO : scaleContentVOS) {
|