Commit ae8ab99c authored by xixinzhao's avatar xixinzhao

feat(jyjc):检验检测结果详情

parent e8a04473
package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultAttachment;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 接口类
*
* @author system_generator
* @date 2023-12-14
*/
public interface IJyjcInspectionResultAttachmentService {}
public interface IJyjcInspectionResultAttachmentService {
/**
* 根据结果表主键获取附件列表
*
* @param resultSeq
* @return
*/
List<JyjcInspectionResultAttachment> getObjByResultSeq(Long resultSeq);
}
package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import java.util.Map;
/**
* 业务开通申请表接口类
*
* @author system_generator
* @date 2023-12-14
*/
public interface IJyjcInspectionResultService {}
public interface IJyjcInspectionResultService {
/**
* 获取检验结果详情
* @param sequenceNbr 结果主键
* @return 检验结果实体
*/
Map<String, Object> queryDetailBySeq(Long sequenceNbr);
}
......@@ -6,6 +6,8 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -80,8 +82,8 @@ public class JyjcInspectionResultController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<JyjcInspectionResultModel> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryBySeq(sequenceNbr));
public ResponseModel<Map<String, Object>> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryDetailBySeq(sequenceNbr));
}
/**
......
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.JyjcInspectionResultAttachment;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultAttachmentMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService;
......@@ -30,4 +31,11 @@ public class JyjcInspectionResultAttachmentServiceImpl extends BaseService<JyjcI
public List<JyjcInspectionResultAttachmentModel> queryForJyjcInspectionResultAttachmentList() {
return this.queryForList("" , false);
}
@Override
public List<JyjcInspectionResultAttachment> getObjByResultSeq(Long resultSeq) {
LambdaQueryWrapper<JyjcInspectionResultAttachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(JyjcInspectionResultAttachment::getResultSeq, resultSeq);
return this.baseMapper.selectList(wrapper);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
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.mapper.JyjcInspectionResultMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 业务开通申请表服务实现类
......@@ -17,6 +29,11 @@ import java.util.List;
*/
@Service
public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionResultModel,JyjcInspectionResult,JyjcInspectionResultMapper> implements IJyjcInspectionResultService {
@Autowired
private IJyjcInspectionResultAttachmentService jyjcInspectionResultAttachmentService;
/**
* 分页查询
*/
......@@ -30,4 +47,23 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
public List<JyjcInspectionResultModel> queryForJyjcInspectionResultList() {
return this.queryForList("" , false);
}
@Override
public Map<String, Object> queryDetailBySeq(Long sequenceNbr) {
Map<String, Object> map = new HashMap<>();
JyjcInspectionResultModel jyjcInspectionResultModel = this.queryBySeq(sequenceNbr);
if (!ObjectUtils.isEmpty(jyjcInspectionResultModel)) {
// 对象转map
map = BeanUtil.beanToMap(jyjcInspectionResultModel);
// 获取附件
List<JyjcInspectionResultAttachment> attachmentList = jyjcInspectionResultAttachmentService.getObjByResultSeq(sequenceNbr);
if (!CollectionUtils.isEmpty(attachmentList)) {
Map<String, Object> attachmentMap = attachmentList.stream().collect(Collectors.toMap(JyjcInspectionResultAttachment::getAttachmentType, JyjcInspectionResultAttachment::getAttachmentUrl));
map.putAll(attachmentMap);
}
}
return map;
}
}
\ No newline at end of file
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