|
@@ -0,0 +1,42 @@
|
|
|
|
+package com.fdkankan.fusion.service.impl;
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.fdkankan.fusion.common.ResultCode;
|
|
|
|
+import com.fdkankan.fusion.entity.CaseExtractDetail;
|
|
|
|
+import com.fdkankan.fusion.entity.CaseScript;
|
|
|
|
+import com.fdkankan.fusion.exception.BusinessException;
|
|
|
|
+import com.fdkankan.fusion.mapper.ICaseScriptMapper;
|
|
|
|
+import com.fdkankan.fusion.service.ICaseScriptService;
|
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * <p>
|
|
|
|
+ * 服务实现类
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @author
|
|
|
|
+ * @since 2024-07-11
|
|
|
|
+ */
|
|
|
|
+@Service
|
|
|
|
+public class CaseScriptServiceImpl extends ServiceImpl<ICaseScriptMapper, CaseScript> implements ICaseScriptService {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public CaseScript getByCaseId(Integer caseId) {
|
|
|
|
+ LambdaQueryWrapper<CaseScript> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(CaseScript::getCaseId,caseId);
|
|
|
|
+ return this.getOne(wrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void saveByParam(CaseScript caseScript) {
|
|
|
|
+ if(caseScript.getCaseId() == null){
|
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
|
+ }
|
|
|
|
+ CaseScript dbCaseScript = this.getByCaseId(caseScript.getCaseId());
|
|
|
|
+ if(dbCaseScript != null){
|
|
|
|
+ caseScript.setId(dbCaseScript.getId());
|
|
|
|
+ }
|
|
|
|
+ this.saveOrUpdate(caseScript);
|
|
|
|
+ }
|
|
|
|
+}
|