|
@@ -1,18 +1,24 @@
|
|
package org.springblade.archive.service.impl;
|
|
package org.springblade.archive.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
import org.springblade.archive.entity.ArchiveExpertConclusion;
|
|
import org.springblade.archive.entity.ArchiveExpertConclusion;
|
|
import org.springblade.archive.entity.ArchiveExpertScore;
|
|
import org.springblade.archive.entity.ArchiveExpertScore;
|
|
import org.springblade.archive.mapper.ArchiveExpertConclusionMapper;
|
|
import org.springblade.archive.mapper.ArchiveExpertConclusionMapper;
|
|
import org.springblade.archive.mapper.ArchiveExpertScoreMapper;
|
|
import org.springblade.archive.mapper.ArchiveExpertScoreMapper;
|
|
import org.springblade.archive.service.IArchiveExpertConclusionService;
|
|
import org.springblade.archive.service.IArchiveExpertConclusionService;
|
|
import org.springblade.archive.service.IArchiveExpertScoreService;
|
|
import org.springblade.archive.service.IArchiveExpertScoreService;
|
|
|
|
+import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
@Service
|
|
@Service
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveExpertConclusionMapper, ArchiveExpertConclusion> implements IArchiveExpertConclusionService {
|
|
public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveExpertConclusionMapper, ArchiveExpertConclusion> implements IArchiveExpertConclusionService {
|
|
@@ -25,14 +31,123 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
|
|
//保存表单基础信息
|
|
//保存表单基础信息
|
|
ArchiveExpertConclusion conclusion = new ArchiveExpertConclusion();
|
|
ArchiveExpertConclusion conclusion = new ArchiveExpertConclusion();
|
|
conclusion.setProjectId(projectId);
|
|
conclusion.setProjectId(projectId);
|
|
- conclusion.setApp_url(appUrl);
|
|
|
|
- conclusion.setIs_build_score(0);
|
|
|
|
|
|
+ conclusion.setAppUrl(appUrl);
|
|
|
|
+ conclusion.setIsBuildScore(0);
|
|
conclusion.setStatus(1);
|
|
conclusion.setStatus(1);
|
|
- conclusion.setApprove_status(0);
|
|
|
|
|
|
+ conclusion.setApproveStatus(0);
|
|
this.save(conclusion);
|
|
this.save(conclusion);
|
|
//保存评分基础信息
|
|
//保存评分基础信息
|
|
scoreService.saveBaseScoreInfo(projectId);
|
|
scoreService.saveBaseScoreInfo(projectId);
|
|
return R.data("保存成功");
|
|
return R.data("保存成功");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取申请状态
|
|
|
|
+ * @param projectId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean getAppStatus(Long projectId) {
|
|
|
|
+ //获取最新的最新的一期验收
|
|
|
|
+ ArchiveExpertConclusion one = this.getOne(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
|
|
|
|
+ .eq(ArchiveExpertConclusion::getProjectId, projectId)
|
|
|
|
+ .orderByDesc(ArchiveExpertConclusion::getCreateTime)
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ //如果为空代表没有申请过,返回true
|
|
|
|
+ if (one == null || one.getStatus() == 2){
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 验收申请-历史验收报告
|
|
|
|
+ * @param projectId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<ArchiveExpertConclusion> getHistoryTable(Long projectId) {
|
|
|
|
+ List<ArchiveExpertConclusion> list = this.list(new LambdaQueryWrapper<ArchiveExpertConclusion>()
|
|
|
|
+ .eq(ArchiveExpertConclusion::getProjectId, projectId)
|
|
|
|
+ .eq(ArchiveExpertConclusion::getStatus, 2)
|
|
|
|
+ .orderByDesc(ArchiveExpertConclusion::getApproveDate));
|
|
|
|
+ if (list.size() == 0){
|
|
|
|
+ throw new ServiceException("暂无历史验收报告");
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 在线验收-预览
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public String getAppPreview(Long projectId) {
|
|
|
|
+ //获取最新的最新的一期验收
|
|
|
|
+ ArchiveExpertConclusion one = this.getOne(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
|
|
|
|
+ .eq(ArchiveExpertConclusion::getProjectId, projectId)
|
|
|
|
+ .orderByDesc(ArchiveExpertConclusion::getCreateTime)
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ //如果为空代表没有申请过,返回true
|
|
|
|
+ if (one == null){
|
|
|
|
+ throw new ServiceException("暂无验收档案信息,请检查是否申请过验收");
|
|
|
|
+ }
|
|
|
|
+ return one.getAppUrl();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 在线验收-查看验收报告
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public String getTable(Long projectId) {
|
|
|
|
+ //获取最新的最新的一期验收
|
|
|
|
+ ArchiveExpertConclusion one = this.getOne(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
|
|
|
|
+ .eq(ArchiveExpertConclusion::getProjectId, projectId)
|
|
|
|
+ .orderByDesc(ArchiveExpertConclusion::getCreateTime)
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ //如果为空代表没有申请过,返回true
|
|
|
|
+ if (one == null){
|
|
|
|
+ throw new ServiceException("暂无验收档案信息,请检查是否申请过验收");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isBlank(one.getTableUrl())){
|
|
|
|
+ throw new ServiceException("当前在线验收还未生成报告");
|
|
|
|
+ }
|
|
|
|
+ return one.getTableUrl();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 编写结论-是否生成打分表
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Integer creatScore(Long projectId) {
|
|
|
|
+ //获取最新的最新的一期验收
|
|
|
|
+ ArchiveExpertConclusion one = this.getOne(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
|
|
|
|
+ .eq(ArchiveExpertConclusion::getProjectId, projectId)
|
|
|
|
+ .orderByDesc(ArchiveExpertConclusion::getCreateTime)
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ //如果为空代表没有申请过,返回true
|
|
|
|
+ if (one == null){
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ return one.getIsBuildScore();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 编写结论-修改是否生成打分表
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void updateScore(Long projectId, Integer isSelect) {
|
|
|
|
+ //获取最新的最新的一期验收
|
|
|
|
+ ArchiveExpertConclusion one = this.getOne(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
|
|
|
|
+ .eq(ArchiveExpertConclusion::getProjectId, projectId)
|
|
|
|
+ .orderByDesc(ArchiveExpertConclusion::getCreateTime)
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ //如果为空代表没有申请过,返回true
|
|
|
|
+ if (one == null){
|
|
|
|
+ throw new ServiceException("当前没有申请验收信息,无法修改");
|
|
|
|
+ }
|
|
|
|
+ one.setIsBuildScore(isSelect);
|
|
|
|
+ this.updateById(one);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|