Commit d6e15b9d authored by xixinzhao's avatar xixinzhao

feat(jyjc):检验检测结果增加技术参数

parent c97e070a
package com.yeejoin.amos.boot.module.jyjc.api.service; package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import java.util.List;
/** /**
* 检验结果技术参数表接口类 * 检验结果技术参数表接口类
* *
* @author system_generator * @author system_generator
* @date 2023-12-14 * @date 2023-12-14
*/ */
public interface IJyjcInspectionResultParamService {} public interface IJyjcInspectionResultParamService {
/**
* 根据
* @param sequenceNbr
* @return
*/
List<JyjcInspectionResultParam> getParamByResultSeq(Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl; package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultParamMapper; import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultParamMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
...@@ -30,4 +31,11 @@ public class JyjcInspectionResultParamServiceImpl extends BaseService<JyjcInspec ...@@ -30,4 +31,11 @@ public class JyjcInspectionResultParamServiceImpl extends BaseService<JyjcInspec
public List<JyjcInspectionResultParamModel> queryForJyjcInspectionResultParamList() { public List<JyjcInspectionResultParamModel> queryForJyjcInspectionResultParamList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
@Override
public List<JyjcInspectionResultParam> getParamByResultSeq(Long sequenceNbr) {
LambdaQueryWrapper<JyjcInspectionResultParam> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(JyjcInspectionResultParam::getResultSeq, sequenceNbr);
return this.baseMapper.selectList(wrapper);
}
} }
\ No newline at end of file
...@@ -2,10 +2,14 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl; ...@@ -2,10 +2,14 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.json.JSONObject;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultAttachment; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultAttachment;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultMapper; import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -16,6 +20,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -16,6 +20,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -31,7 +36,10 @@ import java.util.stream.Collectors; ...@@ -31,7 +36,10 @@ import java.util.stream.Collectors;
public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionResultModel,JyjcInspectionResult,JyjcInspectionResultMapper> implements IJyjcInspectionResultService { public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionResultModel,JyjcInspectionResult,JyjcInspectionResultMapper> implements IJyjcInspectionResultService {
@Autowired @Autowired
private IJyjcInspectionResultAttachmentService jyjcInspectionResultAttachmentService; private IJyjcInspectionResultAttachmentService iJyjcInspectionResultAttachmentService;
@Autowired
private IJyjcInspectionResultParamService iJyjcInspectionResultParamService;
/** /**
...@@ -58,11 +66,23 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -58,11 +66,23 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
map = BeanUtil.beanToMap(jyjcInspectionResultModel); map = BeanUtil.beanToMap(jyjcInspectionResultModel);
// 获取附件 // 获取附件
List<JyjcInspectionResultAttachment> attachmentList = jyjcInspectionResultAttachmentService.getObjByResultSeq(sequenceNbr); List<JyjcInspectionResultAttachment> attachmentList = iJyjcInspectionResultAttachmentService.getObjByResultSeq(sequenceNbr);
if (!CollectionUtils.isEmpty(attachmentList)) { if (!CollectionUtils.isEmpty(attachmentList)) {
Map<String, Object> attachmentMap = attachmentList.stream().collect(Collectors.toMap(JyjcInspectionResultAttachment::getAttachmentType, JyjcInspectionResultAttachment::getAttachmentUrl)); Map<String, Object> attachmentMap = attachmentList.stream().collect(Collectors.toMap(JyjcInspectionResultAttachment::getAttachmentType, JyjcInspectionResultAttachment::getAttachmentUrl));
map.putAll(attachmentMap); map.putAll(attachmentMap);
} }
// 获取技术参数
List<JyjcInspectionResultParam> paramList = iJyjcInspectionResultParamService.getParamByResultSeq(sequenceNbr);
Map<String, Object> mapParam = new HashMap<>();
if (!CollectionUtils.isEmpty(paramList)) {
paramList.forEach(param -> {
if (!ObjectUtils.isEmpty(param.getParamJson())) {
mapParam.putAll(JSON.parseObject(param.getParamJson()));
}
});
map.put("paramJson", mapParam);
}
} }
return map; return map;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment