|
@@ -14,6 +14,7 @@ import lombok.SneakyThrows;
|
|
|
import org.springblade.business.dto.*;
|
|
|
import org.springblade.business.entity.EntrustInfo;
|
|
|
import org.springblade.business.entity.TrialDetectionData;
|
|
|
+import org.springblade.business.entity.TrialSampleInfo;
|
|
|
import org.springblade.business.entity.TrialSelfInspectionRecord;
|
|
|
import org.springblade.business.service.ITrialDetectionDataService;
|
|
|
import org.springblade.business.service.ITrialSampleInfoService;
|
|
@@ -26,14 +27,19 @@ import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.oss.model.BladeFile;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ResourceUtil;
|
|
|
+import org.springblade.manager.entity.ContractInfo;
|
|
|
+import org.springblade.manager.entity.ProjectInfo;
|
|
|
import org.springblade.manager.entity.TrialSelfDataRecord;
|
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.manager.feign.WbsTreePrivateClient;
|
|
|
import org.springblade.manager.vo.CheckRemoveBussTabInfoVo;
|
|
|
+import org.springblade.manager.vo.ContractInfoVO;
|
|
|
import org.springblade.manager.vo.TableFileVO;
|
|
|
import org.springblade.manager.vo.WbsTreePrivateVO;
|
|
|
+import org.springblade.meter.entity.MeterContractInfo;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@@ -530,4 +536,53 @@ public class TrialDetectionController extends BladeController {
|
|
|
jdbcTemplate.execute("delete from m_wbs_tree_private where p_key_id = " + pKeyId);
|
|
|
return R.success("删除成功");
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取试验自检基础信息
|
|
|
+ */
|
|
|
+ @GetMapping("/self/getBaseInfo")
|
|
|
+ @ApiOperationSupport(order = 30)
|
|
|
+ @ApiOperation(value = "获取试验自检基础信息", notes = "传入节点pKeyId")
|
|
|
+ public R<TrialSeleInspectionRecordBaseInfoVO> getBaseInfo(@RequestParam Long projectId, @RequestParam Long contractId, @RequestParam(required = false) Long id) {
|
|
|
+ ProjectInfo projectInfo = jdbcTemplate.query("select * from m_project_info where id = " + projectId, new BeanPropertyRowMapper<>(ProjectInfo.class)).stream().findAny().orElse(null);
|
|
|
+ if (projectInfo == null) {
|
|
|
+ return R.fail("未获取到项目信息");
|
|
|
+ }
|
|
|
+ ContractInfo contractInfo = jdbcTemplate.query("select * from m_contract_info where id = " + contractId, new BeanPropertyRowMapper<>(ContractInfo.class)).stream().findAny().orElse(null);
|
|
|
+ if (contractInfo == null) {
|
|
|
+ return R.fail("未获取到合同信息");
|
|
|
+ }
|
|
|
+ TrialSeleInspectionRecordBaseInfoVO vo = new TrialSeleInspectionRecordBaseInfoVO();
|
|
|
+ vo.setProjectName(projectInfo.getProjectName());
|
|
|
+ vo.setConstructionUnit(contractInfo.getConstructionUnitName());
|
|
|
+ if (contractInfo.getContractType().equals(2)) {
|
|
|
+ // todo 获取该监理下的所有施工单位
|
|
|
+ } else if (contractInfo.getContractType().equals(3)) {
|
|
|
+ // todo 获取该业主下的所有监理单位
|
|
|
+ }
|
|
|
+ vo.setSupervisionUnit(contractInfo.getSupervisionUnitName());
|
|
|
+ vo.setLabName(contractInfo.getLaboratoryName());
|
|
|
+ vo.setContractName(contractInfo.getContractNumber());
|
|
|
+ if (id != null) {
|
|
|
+ TrialSelfInspectionRecord record = jdbcTemplate.query("select * from u_trial_self_inspection_record where id = " + id, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class)).stream().findAny().orElse(null);
|
|
|
+ if (record != null) {
|
|
|
+ // 取样
|
|
|
+ Long entrustId = record.getEntrustId();
|
|
|
+ if (entrustId != null) {
|
|
|
+ EntrustInfo entrustInfo = jdbcTemplate.query("select * from u_entrust_info where id = " + entrustId, new BeanPropertyRowMapper<>(EntrustInfo.class)).stream().findAny().orElse(null);
|
|
|
+ if (entrustInfo != null) {
|
|
|
+ vo.setEntrustNo(entrustInfo.getEntrustNo());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<TrialSelfSample> selfSampleList = jdbcTemplate.query("select * from u_trial_self_sample where self_id = " + id, new BeanPropertyRowMapper<>(TrialSelfSample.class));
|
|
|
+ String samplingIds = selfSampleList.stream().map(TrialSelfSample::getSamplingId).map(String::valueOf).collect(Collectors.joining(","));
|
|
|
+ List<TrialSampleInfo> trialSampleInfoList = jdbcTemplate.query("select * from u_trial_sample_info where id in (" + samplingIds + ")", new BeanPropertyRowMapper<>(TrialSampleInfo.class));
|
|
|
+ vo.setTrialSampleInfoList(trialSampleInfoList);
|
|
|
+ if (vo.getProjectPosition() == null) {
|
|
|
+ vo.setProjectPosition(record.getProjectPosition());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.data(vo);
|
|
|
+ }
|
|
|
}
|