Commit d73afb51 authored by 李松's avatar 李松

添加大屏使用登记证详情接口

parent b38d2184
...@@ -268,4 +268,18 @@ public class JgUseRegistrationManageController extends BaseController { ...@@ -268,4 +268,18 @@ public class JgUseRegistrationManageController extends BaseController {
} }
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort)); return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort));
} }
/**
* 根据sequenceNbr查询---大屏使用
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/detail/dp")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询---大屏使用", notes = "根据sequenceNbr查询---大屏使用")
public ResponseModel<Object> getDetail(@RequestParam(value = "sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.getDetail(sequenceNbr));
}
} }
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto; import com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto;
import com.yeejoin.amos.boot.module.jg.api.entity.*; import com.yeejoin.amos.boot.module.jg.api.entity.*;
...@@ -20,6 +21,7 @@ import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; ...@@ -20,6 +21,7 @@ import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil; import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import org.apache.commons.io.IOUtils;
import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
...@@ -31,19 +33,25 @@ import org.elasticsearch.index.query.TermsQueryBuilder; ...@@ -31,19 +33,25 @@ import org.elasticsearch.index.query.TermsQueryBuilder;
import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHit;
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.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.alibaba.fastjson.JSON.parseArray;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate; import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate;
/** /**
...@@ -95,6 +103,9 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -95,6 +103,9 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
@Autowired @Autowired
private IdxBizJgMaintenanceRecordInfoServiceImpl idxBizJgMaintenanceRecordInfoService; private IdxBizJgMaintenanceRecordInfoServiceImpl idxBizJgMaintenanceRecordInfoService;
@Value("classpath:/json/registrationBasic.json")
private Resource registrationBasicJson;
/** /**
* 将已经通过使用登记审批的证信息录入到 jg-use-registration-manage 表中 * 将已经通过使用登记审批的证信息录入到 jg-use-registration-manage 表中
*/ */
...@@ -548,4 +559,48 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -548,4 +559,48 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
return StringUtil.isNotEmpty(idxBizJgMaintenanceRecordInfo.getMeMasterPhone()) ? idxBizJgMaintenanceRecordInfo.getMeMasterPhone() : StringUtil.isNotEmpty(idxBizJgMaintenanceRecordInfo.getMeMaster1Phone()) ? idxBizJgMaintenanceRecordInfo.getMeMaster1Phone() : ""; return StringUtil.isNotEmpty(idxBizJgMaintenanceRecordInfo.getMeMasterPhone()) ? idxBizJgMaintenanceRecordInfo.getMeMasterPhone() : StringUtil.isNotEmpty(idxBizJgMaintenanceRecordInfo.getMeMaster1Phone()) ? idxBizJgMaintenanceRecordInfo.getMeMaster1Phone() : "";
} }
/**
* 根据sequenceNbr查询---大屏使用
*
* @param sequenceNbr 主键
* @return
*/
public Object getDetail(String sequenceNbr) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
List<FormValue> jsonData = getJsonData(registrationBasicJson);
HashMap<String, Object> result = new HashMap<>();
// 基本信息
JgUseRegistrationManage jgUseRegistrationManage = this.baseMapper.selectById(sequenceNbr);
Map<String, Object> objectMap = Bean.BeantoMap(jgUseRegistrationManage);
jsonData.forEach(f -> {
Object o = objectMap.get(f.getKey());
if (!ObjectUtils.isEmpty(o)) {
f.setValue(o.toString());
if ("auditPassDate".equals(f.getKey())){
f.setValue(simpleDateFormat.format(jgUseRegistrationManage.getAuditPassDate()));
}
}
});
// 流水信息
List<Map<String, String>> list = operationRecord(sequenceNbr);
HashMap<String, Object> map = new HashMap<>();
map.put("datas", list);
map.put("title", "使用登记证流水");
map.put("renderType", "timeline");
result.put("keyParams", jsonData);
result.put("deviceRecords", map);
return result;
}
private List<FormValue> getJsonData(Resource resource) {
String json;
try {
json = IOUtils.toString(resource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(e);
}
return parseArray(json, FormValue.class);
}
} }
\ No newline at end of file
[
{
"key": "useRegistrationCode",
"label": "使用登记证编号",
"type": "text"
},
{
"key": "useUnitName",
"label": "使用单位名称",
"type": "text"
},
{
"key": "useUnitAddress",
"label": "使用单位地址",
"type": "text"
},
{
"key": "receiveOrgName",
"label": "登记机关",
"type": "text"
},
{
"key": "equList",
"label": "设备种类",
"type": "text"
},
{
"key": "equCategory",
"label": "设备类别",
"type": "text"
},
{
"key": "equDefine",
"label": "设备品种",
"type": "text"
},
{
"key": "equUseAddress",
"label": "设备使用地址",
"type": "text"
},
{
"key": "certificateStatus",
"label": "使用登记证状态",
"type": "text"
},
{
"key": "auditPassDate",
"label": "办理日期",
"type": "text"
}
]
\ No newline at end of file
{
"tabs": [
{
"key": "keyinfo",
"displayName": "基本信息",
"renderType": "keyinfo",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-use-registration-manage/detail/dp",
"params": {
"sequenceNbr": "{sequenceNbr}"
}
}
}
},
{
"key": "deviceRecords",
"displayName": "设备信息",
"renderType": "table",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-use-registration-manage/detail/equList",
"params": {
"current": 1,
"size": 10,
"sequenceNbr": "{sequenceNbr}"
}
}
},
"visualParams": {
"rowKey": "record",
"showPage" : true,
"columns": [
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CATEGORY","width": 150,"align": "left","title": "设备类别","key": "AA6DE857-C788-494F-8F16-2ECFC7E34528"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_DEFINE","width": 160,"align": "left","title": "设备品种","key": "611DAF3D-5B79-466C-BEF2-CC91580091FA"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCT_NAME","width": 150,"align": "left","title": "产品名称","key": "D1CB84A4-E037-446A-9469-65B76E381585"},
{"dataRenderingMode": "defaultText","dataIndex": "FACTORY_NUM","width": 180,"align": "left","title": "产品编号","key": "0BB7318F-5134-42B6-A835-FC86D68066C2"},
{"dataRenderingMode": "defaultText","dataIndex": "USE_INNER_CODE","width": 180,"align": "left","title": "单位内编号","key": "0BB7318F-5134-42B6-A835-FC86D68066C3"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CODE","width": 180,"align": "left","title": "设备代码","key": "0BB7318F-5134-42B6-A835-FC86D68066C4"},
{"dataRenderingMode": "defaultText","dataIndex": "SUPERVISORY_CODE","width": 180,"align": "left","title": "监管码","key": "0BB7318F-5134-42B6-A835-FC86D68066C5"}
]
}
}
],
"content": {
}
}
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