Commit 36599306 authored by tianbo's avatar tianbo

查询监管设备改为data_source以jg开头

parent f3695c8d
......@@ -18,6 +18,6 @@ import java.util.Set;
public interface MidEquipRegistrationInfoMapper extends BaseMapper<MidEquipRegistrationInfo> {
@DS("tzs")
@Query("SELECT DISTINCT r.* FROM idx_biz_jg_use_info i, idx_biz_jg_register_info r WHERE i.data_source = 'jg' AND i.RECORD = r.RECORD AND r.EQU_CODE IN :values")
@Query("SELECT DISTINCT r.* FROM idx_biz_jg_use_info i, idx_biz_jg_register_info r WHERE i.data_source like 'jg%' AND i.RECORD = r.RECORD AND r.EQU_CODE IN :values")
List<MidEquipRegistrationInfo> getUseInfoByEquipCode(@Param("values") Set<String> sequenceCodes);
}
......@@ -402,7 +402,7 @@
<include refid="page-list-pipeline"/>
WHERE
ri."EQU_CATEGORY" = '8300'
and ui."DATA_SOURCE" = 'jg'
and ui."DATA_SOURCE" like 'jg%'
and NOT(ui."EQU_STATE" is not null )
and NOT(ri."USE_ORG_CODE" is not null )
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
......@@ -426,7 +426,7 @@
<select id="queryForUnitPipelineEquipment" resultType="java.util.Map">
<include refid="page-list-pipeline"/>
WHERE ui."DATA_SOURCE" = 'jg'
WHERE ui."DATA_SOURCE" like 'jg%'
and ui.record in
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
......@@ -470,7 +470,7 @@
<include refid="page-list-vessel"/>
WHERE
ri."EQU_CATEGORY" = '2300'
and ui."DATA_SOURCE" = 'jg'
and ui."DATA_SOURCE" like 'jg%'
and NOT(ui."EQU_STATE" is not null )
and NOT(ri."USE_ORG_CODE" is not null )
and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
......@@ -497,7 +497,7 @@
<include refid="page-list-vessel"/>
WHERE
ri."EQU_DEFINE" = '23T0'
and ui."DATA_SOURCE" = 'jg'
and ui."DATA_SOURCE" like 'jg%'
and ri.whether_vehicle_cylinder = 1
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
......@@ -511,7 +511,7 @@
<select id="queryForUnitVesselEquipment" resultType="java.util.Map">
<include refid="page-list-vessel"/>
WHERE ri."EQU_CATEGORY" = '2300' and ui."DATA_SOURCE" = 'jg' and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
WHERE ri."EQU_CATEGORY" = '2300' and ui."DATA_SOURCE" like 'jg%' and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
and ui.record in
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
......
......@@ -243,7 +243,7 @@
<select id="queryForUnitVesselEquipment" resultType="java.util.Map">
<include refid="page-list-vessel"/>
WHERE ri."EQU_CATEGORY" = '2300' and jui."DATA_SOURCE" = 'jg' and ri.whether_vehicle_cylinder = 1
WHERE ri."EQU_CATEGORY" = '2300' and jui."DATA_SOURCE" like 'jg%' and ri.whether_vehicle_cylinder = 1
and ui.sequence_nbr = #{sequenceNbr}
and jui.record in
<foreach collection="records" item="record" open="(" close=")" separator=",">
......
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Joiner;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
......@@ -1261,7 +1262,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
meBuilder.minimumShouldMatch(1);
boolMust.must(meBuilder);
// DATA_SOURCE 为“jg”的数据(从监管新加的设备)
// DATA_SOURCE 为“jg”开头的数据(从监管新加或复制的设备)
// 20240314 提出的监管业务不要让企业用户选到之前一码通认领或补录的设备,让从监管业务中去新增
BoolQueryBuilder dBuilder = QueryBuilders.boolQuery();
dBuilder.must(QueryBuilders.prefixQuery("DATA_SOURCE", "jg"));
......@@ -1444,9 +1445,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
JSONObject dto2 = jsonObject.getJSONObject("sourceAsMap");
if (!ValidationUtil.isEmpty(dto2.get(CONSTRUCTIONTYPE))) {
// 转化施工类型
Integer integer = Integer.valueOf(dto2.get(CONSTRUCTIONTYPE).toString());
String status = ConstructionEnum.getName.get(integer);
dto2.put(CONSTRUCTIONTYPE, status);
String constructionType = dto2.get(CONSTRUCTIONTYPE).toString();
if (!ValidationUtil.isEmpty(constructionType)) {
List<String> constructionTypeList = Arrays.asList(constructionType.split(","));
List<String> statusList = new ArrayList<>();
for (String cType : constructionTypeList) {
Integer integer = Integer.valueOf(cType);
String status = ConstructionEnum.getName.get(integer);
statusList.add(status);
}
dto2.put(CONSTRUCTIONTYPE, Joiner.on(",").join(statusList));
}
}
if (!ValidationUtil.isEmpty(dto2.get(EQUSTATE))) {
Integer integer = Integer.valueOf(dto2.get(EQUSTATE).toString());
......@@ -1574,13 +1583,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 业务场景
String businessScenarios = String.valueOf(equipmentClassForm.get("businessScenarios"));
// 操作类型
String operateType = ValidationUtil.isEmpty(equipmentInfoForm.get(SEQUENCE_NBR)) ? OPERATESAVE : OPERATEEDIT;
// 设备是否复制而来,复制来的设备走新增
boolean isCopy = !ValidationUtil.isEmpty(equipmentInfoForm.get(IS_COPY));
operateType = isCopy ? OPERATESAVE : operateType;
String dataSource = OPERATESAVE.equals(operateType) ? "jg" : equipmentInfoForm.get("DATA_SOURCE").toString();
if (isCopy) {
String sourceRecord = equipmentClassForm.get(RECORD).toString();
dataSource = "jg_" + sourceRecord;
}
record = OPERATESAVE.equals(operateType) ? UUID.randomUUID().toString() : equipmentInfoForm.get(RECORD).toString();
// 单位类型
......@@ -1607,7 +1620,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 使用信息
useInfo.setRecord(record);
useInfo.setRecDate(date);
useInfo.setDataSource("jg");
useInfo.setDataSource(dataSource);
useInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("USEINFO_SEQ")));
if (companyTypeStr.contains(CompanyTypeEnum.USE.getCode()) || companyTypeStr.contains(CompanyTypeEnum.INDIVIDUAL.getCode())) {
useInfo.setUseUnitCreditCode(companyInfoMap.get("creditCode").toString());
......
......@@ -435,7 +435,7 @@ public class ReportAnalysisServiceImpl implements IReportAnalysisService {
*/
private void jgEquipFilterQueryBuild(BoolQueryBuilder boolMust) {
// 监管类型数据
boolMust.must(QueryBuilders.termQuery("DATA_SOURCE", "jg"));
boolMust.must(QueryBuilders.prefixQuery("DATA_SOURCE", "jg"));
// 设备状态存在
boolMust.must(QueryBuilders.existsQuery("EQU_STATE"));
// 被监管状态: 1在用 2停用 3报废 4注销
......
......@@ -36,7 +36,7 @@
use."USE_UNIT_CREDIT_CODE" <![CDATA[<>]]> ''
and register.EQU_CODE <![CDATA[<>]]> ''
and supervision.ORG_BRANCH_CODE <![CDATA[<>]]> ''
and use."DATA_SOURCE" = 'jg'
and use."DATA_SOURCE" like 'jg%'
<if test="statusList.size() > 0">
and use.EQU_STATE in
<foreach collection="statusList" item="item" open="(" close=")" separator=",">
......
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