Commit df989a35 authored by 刘凡's avatar 刘凡

*)报检增加附件

parent 569b33b2
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.dto.JyjcInspectionApplicationDto; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.dto.JyjcInspectionApplicationDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -52,4 +53,11 @@ public interface JYJCStatisticsMapper extends BaseMapper { ...@@ -52,4 +53,11 @@ public interface JYJCStatisticsMapper extends BaseMapper {
* @return 按照所选区域过滤报检信息 * @return 按照所选区域过滤报检信息
*/ */
Page<JyjcInspectionApplicationDto> queryForInspectAppPageList(@Param("page") Page<JyjcInspectionApplicationDto> page, @Param("dto") JyjcInspectionApplicationDto dto, @Param("orgCode") String orgCode); Page<JyjcInspectionApplicationDto> queryForInspectAppPageList(@Param("page") Page<JyjcInspectionApplicationDto> page, @Param("dto") JyjcInspectionApplicationDto dto, @Param("orgCode") String orgCode);
/**
* 查询资源附件
* @param applicationSeq
* @return
*/
List<Map<String,Object>> getDataByApplicationSeq(Long applicationSeq);
} }
...@@ -98,6 +98,12 @@ ...@@ -98,6 +98,12 @@
</where> </where>
order by tzjia.application_no desc order by tzjia.application_no desc
</select> </select>
<select id="getDataByApplicationSeq" resultType="map">
select *
from tz_jyjc_inspection_application_attachment
where application_seq = #{applicationSeq}
</select>
</mapper> </mapper>
...@@ -69,6 +69,7 @@ public class DPSubController { ...@@ -69,6 +69,7 @@ public class DPSubController {
} else if(template.equals("registration")) { // 登记证 } else if(template.equals("registration")) { // 登记证
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空"); Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("inspection")) { // 报检 } else if(template.equals("inspection")) { // 报检
template = template + "_" + param.get("equListCode");
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空"); Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else { } else {
throw new RuntimeException("暂无模板"); throw new RuntimeException("暂无模板");
......
package com.yeejoin.amos.boot.module.statistcs.biz.controller; package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dto.JyjcInspectionApplicationDto; import com.yeejoin.amos.boot.biz.common.dto.JyjcInspectionApplicationDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
...@@ -178,6 +180,12 @@ public class JYJCDPStatisticsController { ...@@ -178,6 +180,12 @@ public class JYJCDPStatisticsController {
return ResponseHelper.buildResponse(statisticsService.queryForInspectAppPageList(page, model)); return ResponseHelper.buildResponse(statisticsService.queryForInspectAppPageList(page, model));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/inspectApplication/matui/{sequenceNbr}")
@ApiOperation(httpMethod = "POST", value = "检验检测报检申请详情资源附件", notes = "检验检测报检申请详情资源附件")
public ResponseModel<JSONObject> queryDetailsMatui(@PathVariable Long sequenceNbr, @RequestBody JSONObject jsonObject) {
return ResponseHelper.buildResponse(statisticsService.queryDetailsMatui(sequenceNbr, JSONObject.parseObject(JSON.toJSONString(jsonObject))));
}
} }
......
...@@ -2,11 +2,14 @@ package com.yeejoin.amos.boot.module.statistcs.biz.service.impl; ...@@ -2,11 +2,14 @@ package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.CountDto; import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.biz.common.dto.JyjcInspectionApplicationDto; import com.yeejoin.amos.boot.biz.common.dto.JyjcInspectionApplicationDto;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectTimeCountDto; import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectTimeCountDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto; import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto;
...@@ -39,6 +42,7 @@ import org.elasticsearch.search.aggregations.AggregationBuilders; ...@@ -39,6 +42,7 @@ import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
...@@ -572,4 +576,23 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -572,4 +576,23 @@ public class JYJCDPStatisticsServiceImpl {
} }
return jyjcStatisticsMapper.queryForInspectAppPageList(page, model, orgCode); return jyjcStatisticsMapper.queryForInspectAppPageList(page, model, orgCode);
} }
public JSONObject queryDetailsMatui(Long sequenceNbr, JSONObject jsonObject) {
List<Map<String, Object>> dataByApplicationSeq = jyjcStatisticsMapper.getDataByApplicationSeq(sequenceNbr);
Map<String, Object> attMap = new HashMap<>();
for (Map<String, Object> maps : dataByApplicationSeq) {
List<AttachmentDto> data = JSONArray.parseArray(maps.get("attachment_url").toString(), AttachmentDto.class);
attMap.put(maps.get("attachment_type").toString(), data);
}
JSONArray subs = jsonObject.getJSONArray("subs");
subs.stream().forEach(x -> {
JSONObject xObj = (JSONObject) x;
JSONArray datas = xObj.getJSONArray("datas");
datas.stream().forEach(y -> {
JSONObject yObj = (JSONObject) y;
yObj.put("value", !ValidationUtil.isEmpty(attMap.get(yObj.getString("key"))) ? attMap.get(yObj.getString("key")) : new JSONArray());
});
});
return jsonObject;
}
} }
...@@ -41,9 +41,62 @@ ...@@ -41,9 +41,62 @@
{"dataRenderingMode": "actionDetailBtn","dataIndex": "action","width": 60,"align": "left","title": "操作","key": "9", "conf": { "title": "设备详情", "linkModelKey": "equip" }} {"dataRenderingMode": "actionDetailBtn","dataIndex": "action","width": 60,"align": "left","title": "操作","key": "9", "conf": { "title": "设备详情", "linkModelKey": "equip" }}
] ]
} }
},
{
"key": "basic",
"displayName": "附件",
"renderType": "basic",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"POST",
"apiPath":"/statistics/dp/jy/inspectApplication/matui/{sequenceNbr}",
"body": {
"subs": [
{
"key": "bjmatinfo",
"displayName": "报检附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "gzs", "label": "告知书(加盖受理单位公章)", "type": "file" },
{ "key": "cpzl", "label": "产品质量证明书", "type": "file" },
{ "key": "sgzxbg", "label": "施工自行检查报告", "type": "file" },
{ "key": "sght", "label": "施工合同或证明", "type": "file" },
{ "key": "sgfa", "label": "施工方案/施工设计文件", "type": "file" },
{ "key": "sgdwxk", "label": "施工单位许可证书", "type": "file" }
]
},
{
"key": "qzqxmatinfo",
"displayName": "起重机械专项要求(改造和重大修理后)",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "zlbz", "label": "质量保证手册和程序文件", "type": "file" },
{ "key": "sgzy", "label": "施工作业文件", "type": "file" },
{ "key": "sgry", "label": "施工人员、质量保证体系责任人、专业技术人员身份证、技术工人的身份证及资质证书", "type": "file" },
{ "key": "cpjs", "label": "产品技术文件", "type": "file" },
{ "key": "sgsj", "label": "施工设计文件", "type": "file" },
{ "key": "sgfb", "label": "施工分包方目录", "type": "file" },
{ "key": "fbspj", "label": "分包方评价资料", "type": "file" }
]
},
{
"key": "qtmatinfo",
"displayName": "其他附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "qtfj", "label": "附件", "type": "file" },
]
}
]
}
}
}
} }
], ],
"content": { "content": {
} }
} }
\ 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