添加外部对接标准法规信息/文本接口
This commit is contained in:
+9
-34
@@ -5,40 +5,15 @@
|
||||
<mapper namespace="com.jero.modules.docking.api.mapper.LawsSysApiInfoMapper">
|
||||
|
||||
<select id="pageList" resultType="com.jero.modules.docking.api.entity.LawsSysApiInfo">
|
||||
select
|
||||
l1.reg_part_name_en,
|
||||
l1.reg_part_name_cn,
|
||||
l1.form_type,
|
||||
l1.system_code,
|
||||
l1.decision_requirement,
|
||||
l1.classification,
|
||||
l1.applicable_market,
|
||||
l1.parts_certified_deliverables,
|
||||
l1.responsible_department,
|
||||
l1.responsible_module,
|
||||
l1.remark,
|
||||
l1.fnd_gpc,
|
||||
l1.id,
|
||||
l1.part_num,
|
||||
l1.part_relevance_id,
|
||||
l1.part_name,
|
||||
l1.production_factory,
|
||||
l1.applicable_vehicle_type,
|
||||
l1.technical_feature,
|
||||
l1.already_part_num_id,
|
||||
l1.already_part_num,
|
||||
l1.status,
|
||||
l1.success_time,
|
||||
l1.part_relevance_type,
|
||||
l1.replace_part_num,
|
||||
l1.create_by,
|
||||
l1.last_id,
|
||||
l1.create_time,
|
||||
s3.id as dep_id
|
||||
from laws_part_type l1
|
||||
left join sys_user s1 on s1.username = l1.create_by
|
||||
left join sys_user_depart s2 on s2.user_id = s1.id
|
||||
left join sys_depart s3 on s3.id = s2.dep_id
|
||||
select * from (
|
||||
select standard_number, standard_name, '1' as resource_type,GROUP_CONCAT(o.url) as url from laws_domestic_standard l
|
||||
left join oss_file o on o.standard_id = l.id
|
||||
where l.del_flag = 0 group by l.id
|
||||
union all
|
||||
select standard_number, standard_name, '2' as resource_type,GROUP_CONCAT(o1.url) from laws_enterprise_standard l1
|
||||
left join oss_file o1 on o1.standard_id = l1.id
|
||||
where l1.del_flag = 0 group by l1.id
|
||||
) a
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+1
-55
@@ -38,61 +38,7 @@ public class LawsSysApiInfoServiceImpl extends ServiceImpl<LawsSysApiInfoMapper,
|
||||
|
||||
@Override
|
||||
public Result<IPage<Map<String, Object>>> getStandardData(Map<String, Object> parameterMap) {
|
||||
// todo 未添加对接系统验证 未修改业务返回数据
|
||||
Map<String, Object> parameterMapByDomestic = new HashMap<>(parameterMap);
|
||||
Map<String, Object> parameterMapByEnterprise = new HashMap<>(parameterMap);
|
||||
|
||||
// 显示字段
|
||||
String selectFieldByDomestic = "standard_number, standard_name, resource_type";
|
||||
String selectFieldByEnterprise = "standard_number, standard_name, resource_type";
|
||||
|
||||
// 构建搜索条件
|
||||
String orderBy = "order by create_time desc";
|
||||
parameterMapByDomestic.put(FieldCommon.MODULE, TableNameEnum.DOMESTIC_REGULATIONS.getValue());
|
||||
parameterMapByEnterprise.put(FieldCommon.MODULE, TableNameEnum.ENTERPRISE_STANDARDS.getValue());
|
||||
// 关联部门字段不一致 特殊处理
|
||||
if (parameterMap.containsKey("associate_dept")){
|
||||
parameterMapByEnterprise.put("related_department", parameterMap.get("associate_dept"));
|
||||
}
|
||||
String queryConditionByDomestic =
|
||||
lawsCommonService.buildQueryCondition(parameterMapByDomestic).replace(orderBy, "");
|
||||
String queryConditionByEnterprise =
|
||||
lawsCommonService.buildQueryCondition(parameterMapByEnterprise).replace(orderBy, "");
|
||||
|
||||
// 分页参数
|
||||
long pageNo = Long.parseLong(String.valueOf(parameterMap.get("pageNo")));
|
||||
long pageSize = Long.parseLong(String.valueOf(parameterMap.get("pageSize")));
|
||||
IPage<Object> page = new Page<>(pageNo, pageSize);
|
||||
|
||||
// 查询数据
|
||||
IPage<Map<String, Object>> advancedSearchAll =
|
||||
lawsHomeSearchMapper.getAdvancedSearchAll(page, selectFieldByDomestic, selectFieldByEnterprise,
|
||||
queryConditionByDomestic, queryConditionByEnterprise);
|
||||
|
||||
// 标准状态翻译
|
||||
for (Map<String, Object> data : advancedSearchAll.getRecords()) {
|
||||
String resourceType = String.valueOf(data.get("resource_type"));
|
||||
String standardState = String.valueOf(data.get("standard_state"));
|
||||
String code = LawsHomeSearchCommon.LAWS_DOMESTIC_STANDARD.equals(resourceType)
|
||||
? "standard_state" : "enterprise_standard_state";
|
||||
String dictText = sysDictService.queryDictTextByKey(code, standardState);
|
||||
data.put("standard_state_dictText", dictText);
|
||||
|
||||
if (!Objects.isNull(data.get("release_date"))){
|
||||
Date releaseDate = (Date) data.get("release_date");
|
||||
data.put("release_date", new SimpleDateFormat("yyyy-MM-dd").format(releaseDate));
|
||||
}
|
||||
if (!Objects.isNull(data.get("implementation_date"))){
|
||||
try{
|
||||
Date implementationDate = (Date) data.get("implementation_date");
|
||||
data.put("implementation_date", new SimpleDateFormat("yyyy-MM-dd").format(implementationDate));
|
||||
}catch (Exception e){
|
||||
String implementationDate = data.get("implementation_date").toString();
|
||||
data.put("implementation_date", implementationDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.OK(advancedSearchAll);
|
||||
return Result.OK();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user