|
@ -486,6 +486,51 @@ public class PackageEndPoint extends EnvelopRestEndPoint {
|
|
|
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = ServiceApi.Packages.Status, method = RequestMethod.PUT)
|
|
|
@ApiOperation(value = "将接收时间为某段时间的结构化档案,状态更改为待解析", notes = "将接收时间为某段时间的结构化档案")
|
|
|
public long bulkUpdate(@ApiParam(name = "startDate", value = "开始时间(eg:2017-01-01 00:00:00)", required = false )
|
|
|
@RequestParam(value = "startDate",required = false) String startDate,
|
|
|
@ApiParam(name = "endDate", value = "结束时间(eg:2017-01-01 00:00:00)", required = false )
|
|
|
@RequestParam(value = "endDate",required = false) String endDate,
|
|
|
@ApiParam(name = "orgCode", value = "机构编码", required = false )
|
|
|
@RequestParam(value = "orgCode",required = false) String orgCode,
|
|
|
@ApiParam(name = "packType", value = "包类型", required = false )
|
|
|
@RequestParam(value = "packType",required = false) String packType){
|
|
|
String filters = "archive_status<>0;";
|
|
|
if(StringUtils.isNotBlank(startDate)){
|
|
|
filters+="receive_date>="+startDate+";";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(endDate)){
|
|
|
filters+="receive_date<="+endDate+";";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(orgCode)){
|
|
|
filters += "org_code="+orgCode+";";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(packType)){
|
|
|
filters += "pack_type="+packType+";";
|
|
|
}
|
|
|
long count = elasticSearchUtil.count(INDEX, TYPE, filters);
|
|
|
Page<Map<String, Object>> result = elasticSearchUtil.page(INDEX, TYPE, filters, 1, 10000);
|
|
|
while (CollectionUtils.isNotEmpty(result.getContent())) {
|
|
|
List<Map<String, Object>> updateSourceList = new ArrayList<>();
|
|
|
result.forEach(item -> {
|
|
|
Map<String, Object> updateSource = new HashMap<>();
|
|
|
updateSource.put("_id", item.get("_id"));
|
|
|
updateSource.put("analyze_status",0);
|
|
|
updateSource.put("fail_count",0);
|
|
|
updateSource.put("archive_status",0);
|
|
|
updateSource.put("analyze_fail_count",0);
|
|
|
updateSourceList.add(updateSource);
|
|
|
});
|
|
|
if (!updateSourceList.isEmpty()) {
|
|
|
elasticSearchUtil.bulkUpdate(INDEX, TYPE, updateSourceList);
|
|
|
}
|
|
|
result = elasticSearchUtil.page(INDEX, TYPE, filters, 1, 10000);
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
|
|
|
//-------------------------------------------------
|
|
|
|
|
|
/*@RequestMapping(value = ServiceApi.Packages.Migrate, method = RequestMethod.POST)
|