Commit fdbd5816 authored by 李松's avatar 李松

es实体添加工程装置字段

parent c432f32e
......@@ -158,4 +158,10 @@ public class ESEquipmentCategoryDto {
@Field(type = FieldType.Keyword)
private String USE_SITE_CODE;
/**
* 工程装置(工业管道使用)
*/
@Field(type = FieldType.Keyword)
private String PROJECT_CONTRAPTION;
}
......@@ -461,6 +461,7 @@
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
</sql>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
select * from (
<include refid="page-list-pipeline"/>
WHERE
ri."EQU_CATEGORY" = '8300'
......@@ -487,6 +488,7 @@
!='一级受理已驳回' and v.status !='使用单位已撤回' and v.status !='已作废' )
</if>
ORDER BY ui.REC_DATE DESC
) where uscUnitName is not null
</select>
<select id="queryForUnitPipelineEquipment" resultType="java.util.Map">
......
......@@ -2,7 +2,9 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import io.swagger.annotations.Api;
......@@ -215,4 +217,24 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
throw new Exception("系统异常");
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getProjectContraption")
@ApiOperation(httpMethod = "GET", value = "查询当前单位下工程装置信息", notes = "查询当前单位下工程装置信息")
public ResponseModel<Object> queryEquipCanUsedByVesselPageHistory() {
ReginParams info = getSelectedOrgInfo();
if (info.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.getProjectContraption(info.getCompany().getCompanyCode()));
} else {
return ResponseHelper.buildResponse(new ArrayList<String>());
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/esSynchronousProjectContraption")
@ApiOperation(httpMethod = "GET", value = "ES历史数据同步工程装置字段值", notes = "ES历史数据同步工程装置字段值")
public ResponseModel<Object> esSynchronousProjectContraption() {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.esSynchronousProjectContraption());
}
}
......@@ -44,4 +44,8 @@ public interface IIdxBizJgRegisterInfoService {
Object importPressureData(MultipartFile multipartFile) throws Exception;
Object savePressureVesselData(Map<String, Object> paramMap);
Object getProjectContraption(String uscUnitCreditCode);
Boolean esSynchronousProjectContraption();
}
......@@ -3043,4 +3043,25 @@ private SafetyProblemTracingMapper safetyProblemTracingMapper;
.findFirst();
return optional.map(map -> (String) map.get("useCode")).orElse(null);
}
@Override
public Object getProjectContraption(String uscUnitCreditCode) {
return this.baseMapper.getProjectContraption(uscUnitCreditCode);
}
@Override
public Boolean esSynchronousProjectContraption() {
List<Map<String, Object>> list = this.baseMapper.esSynchronousProjectContraption();
if (!ObjectUtils.isEmpty(list)) {
HashMap<String, Map<String, Object>> objMap = new HashMap<>();
list.forEach(item -> {
HashMap<String, Object> param = new HashMap<>();
param.put("PROJECT_CONTRAPTION", item.get("PROJECT_CONTRAPTION"));
objMap.put(item.get("SEQUENCE_NBR").toString(), param);
});
// 更新es
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
}
return Boolean.TRUE;
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* 注册登记信息表 Mapper 接口
......@@ -24,5 +25,10 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI
@Select("select code as dictDataKey,name as dictDataValue from tz_equipment_category where parent_id = ( SELECT sub.id from tz_equipment_category as sub where sub.code = #{equipCode})")
List<DictionarieValueModel> queryAllEquCategoriesUnderTheEquList(@Param("equipCode") String equipCode);
@Select("SELECT jui.PROJECT_CONTRAPTION as value FROM idx_biz_jg_construction_info jci LEFT JOIN idx_biz_jg_use_info jui on jci.RECORD = jui.RECORD where jci.USC_UNIT_CREDIT_CODE = #{uscUnitCreditCode} and jui.PROJECT_CONTRAPTION is not null GROUP BY jui.PROJECT_CONTRAPTION")
List<Map<String, Object>> getProjectContraption(@Param("uscUnitCreditCode")String uscUnitCreditCode);
@Select("SELECT SEQUENCE_NBR,REC_DATE,ORG_BRANCH_NAME,ORG_BRANCH_CODE,USE_UNIT_NAME,USE_UNIT_CREDIT_CODE,EQU_LIST_CODE,EQU_LIST,EQU_CATEGORY,EQU_CATEGORY_CODE,USE_ORG_CODE,CODE96333,EQU_CODE,SUPERVISORY_CODE,USE_PLACE,ADDRESS,EQU_STATE,STATUS,USE_INNER_CODE,FACTORY_NUM,PRODUCE_UNIT_NAME,INSPECT_REPORT,NEXT_INSPECT_DATE,CONSTRUCTION_TYPE,USC_UNIT_CREDIT_CODE,USC_UNIT_NAME,EQU_DEFINE,EQU_DEFINE_CODE,PRODUCT_NAME,BRAND_NAME,EQU_TYPE,DATA_SOURCE,IS_INTO_MANAGEMENT,WHETHER_VEHICLE_CYLINDER,WHETHER_SKID_MOUNTED_PRESSURE_VESSEL,DATE_FORMAT(PRODUCE_DATE,'%Y-%m-%d %H:%i:%s')as PRODUCE_DATE,PROJECT_CONTRAPTION from idx_biz_view_jg_all WHERE PROJECT_CONTRAPTION is not null")
List<Map<String, Object>> esSynchronousProjectContraption();
}
......@@ -104,7 +104,8 @@
IS_INTO_MANAGEMENT,
WHETHER_VEHICLE_CYLINDER,
WHETHER_SKID_MOUNTED_PRESSURE_VESSEL,
DATE_FORMAT(PRODUCE_DATE, '%Y-%m-%d %H:%i:%s') as PRODUCE_DATE
DATE_FORMAT(PRODUCE_DATE, '%Y-%m-%d %H:%i:%s') as PRODUCE_DATE,
PROJECT_CONTRAPTION
from idx_biz_view_jg_all
WHERE SEQUENCE_NBR = #{id}
</select>
......
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