Commit 03b7857a authored by 韩桐桐's avatar 韩桐桐

fix(ymt):删除冗余方法

parent fe6a4e27
...@@ -58,5 +58,4 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> { ...@@ -58,5 +58,4 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
*/ */
List<KV> selectSupervisorCodeMaxValue(); List<KV> selectSupervisorCodeMaxValue();
List<String> selectData();
} }
...@@ -188,79 +188,4 @@ ...@@ -188,79 +188,4 @@
LIMIT 1 LIMIT 1
</select> </select>
<select id="selectData" resultType="java.lang.String">
SELECT
distinct equ_id
FROM
(
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_change_registration_name_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_change_registration_reform_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_change_registration_transfer_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_change_registration_unit_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_enable_disable_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_equip_transfer_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_installation_notice_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_maintain_notice_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_maintenance_contract_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_reform_notice_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_scrap_cancel_eq" UNION ALL
SELECT
equ_id,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_transfer_notice_eq" UNION ALL
SELECT
equ_id ,
rec_date
FROM
"amos_tzs_biz"."tzs_jg_use_registration_eq" UNION ALL
( SELECT "RECORD" AS equ_id, rec_date FROM "amos_tzs_biz"."idx_biz_jg_other_info" WHERE ( "CLAIM_STATUS" IS NULL OR "CLAIM_STATUS" = '' ) AND "RECORD" LIKE'________-____-____-____-____________' )
)
WHERE
"REC_DATE" >= '2024-02-26 00:00:00'
</select>
</mapper> </mapper>
...@@ -422,14 +422,6 @@ public class EquipmentCategoryController extends BaseController { ...@@ -422,14 +422,6 @@ public class EquipmentCategoryController extends BaseController {
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "updateEquipmentCategoryToEs")
@ApiOperation(httpMethod = "GET", value = "jg数据更新至es", notes = "jg数据更新至es")
public ResponseModel<String> updateEquipmentCategoryToEs() {
equipmentCategoryServiceImpl.updateEs();
return ResponseHelper.buildResponse("success");
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.boot.module.ymt.biz.utils;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.ymt.biz.dao.EsEntity;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.xcontent.XContentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author LiuLin
* @date 2023年08月08日 16:30
*/
@Slf4j
@Component
public class ElasticSearchUtil {
private static final long SCROLL_TIMEOUT = 180000;
private static final int SIZE = 1000;
@Autowired
private RestHighLevelClient restHighLevelClient;
/**
* Description: 批量修改数据
*
* @param index index
* @param list 更新列表
* @author LiuLin
*/
public <T> void updateBatch(String index, List<EsEntity<T>> list) {
BulkRequest request = new BulkRequest();
list.forEach(item -> request.add(new UpdateRequest(index, item.getId())
.doc(JSON.toJSONString(item.getData()), XContentType.JSON)));
try {
restHighLevelClient.bulk(request, RequestOptions.DEFAULT);
list.forEach(s -> log.info("===========索引:【{}】,主键:【{}】修改成功", index, s.getId()));
} catch (Exception e) {
log.error("索引:[{}]", index, e);
}
}
}
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