feat: There is no way the, 跑跑跑 跑数据 重置es
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
package com.adc.da.search;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.search.bean.SearchCenter;
|
||||
import com.adc.da.search.server.ResetSearchCenterService;
|
||||
import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@@ -25,28 +26,55 @@ public class ResetSearchCenterController extends BaseController<Map<String, Obje
|
||||
private ResetSearchCenterService resetSearchCenterService;
|
||||
@ApiOperation(value = "|SearchCenter|重新创建ALL标准数据索引")
|
||||
@PostMapping(value="/resetALLSearchCenter")
|
||||
public ResponseMessage resetALLSearchCenter() throws Exception{
|
||||
return resetSearchCenterService.resetALLSearchCenter();
|
||||
public ResponseMessage resetALLSearchCenter(@RequestBody SearchCenter searchCenter) throws Exception{
|
||||
ResponseMessage x = verifySearchCenter(searchCenter);
|
||||
if (x != null){
|
||||
return x;
|
||||
}
|
||||
return resetSearchCenterService.resetALLSearchCenter(searchCenter);
|
||||
}
|
||||
|
||||
private ResponseMessage verifySearchCenter(SearchCenter searchCenter) {
|
||||
if(searchCenter.getExecType() == null || "".equals(searchCenter.getExecType())){
|
||||
return Result.error("执行参数 ALL 存在更新 不存在新增 ,UPD 只 更新存在 es 里的标准 ,ADD 只新增不存在 es 的标准");
|
||||
}
|
||||
|
||||
if(searchCenter.getCountStand() == null || searchCenter.getCountStand() == 0){
|
||||
return Result.error("分页总数不可为空和0");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SearchCenter|重新创建国内外标准数据索引")
|
||||
@PostMapping(value="/resetAStandSearchCenter")
|
||||
public ResponseMessage resetStandSearchCenter() throws Exception{
|
||||
public ResponseMessage resetStandSearchCenter(@RequestBody SearchCenter searchCenter) throws Exception{
|
||||
ResponseMessage x = verifySearchCenter(searchCenter);
|
||||
if (x != null){
|
||||
return x;
|
||||
}
|
||||
SarStandardsInfoEOPage sarStandardsInfoEOPage = new SarStandardsInfoEOPage();
|
||||
return resetSearchCenterService.resetStandSearchCenter(sarStandardsInfoEOPage);
|
||||
return resetSearchCenterService.resetStandSearchCenter(sarStandardsInfoEOPage,searchCenter);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SearchCenter|重新创建国内外政策数据索引")
|
||||
@PostMapping(value="/resetBLawsSearchCenter")
|
||||
public ResponseMessage resetLawsSearchCenter() throws Exception{
|
||||
public ResponseMessage resetLawsSearchCenter(@RequestBody SearchCenter searchCenter) throws Exception{
|
||||
ResponseMessage x = verifySearchCenter(searchCenter);
|
||||
if (x != null){
|
||||
return x;
|
||||
}
|
||||
SarLawsStandInfoPage sarLawsInfoEOPage = new SarLawsStandInfoPage();
|
||||
return resetSearchCenterService.resetLawsSearchCenter(sarLawsInfoEOPage);
|
||||
return resetSearchCenterService.resetLawsSearchCenter(sarLawsInfoEOPage,searchCenter);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SearchCenter|重新创建企业标准数据索引")
|
||||
@PostMapping(value="/resetCBussStandSearchCenter")
|
||||
public ResponseMessage resetBussStandSearchCenter() throws Exception{
|
||||
public ResponseMessage resetBussStandSearchCenter(@RequestBody SearchCenter searchCenter) throws Exception{
|
||||
ResponseMessage x = verifySearchCenter(searchCenter);
|
||||
if (x != null){
|
||||
return x;
|
||||
}
|
||||
SarBussionessStandEOPage sarBussionessStandEOPage = new SarBussionessStandEOPage();
|
||||
return resetSearchCenterService.resetBussStandSearchCenter(sarBussionessStandEOPage);
|
||||
return resetSearchCenterService.resetBussStandSearchCenter(sarBussionessStandEOPage,searchCenter);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user